Explore Integrals

# Integrals of absolute value functions

As we’ve seen, some integrals need to be divided into a few integrals if there are some discontinuities in the segment determined by the limits of integration. Sometimes, the functions are defined differently on different intervals, and the absolute value function is one of them.

Interesting, yes? Let’s take a closer look.

## What is integral of absolute value function?

The integral of an absolute value function is an integral where the integrand is an absolute value function.

But what is an absolute value function? It’s pretty simple: An absolute value function is a function in which the variable is inside the absolute value bars.

As always, to find the integral, properties of integrals need to be used, so be sure to keep our favorite table handy!

### Why is the integral of absolute value function so useful?

We can use integrals to calculate the distance that someone has traveled. For example, someone is walking to break a new world record, and his velocity is described by the function $$f(x)=|x|$$, where $$x$$ is the time in seconds. If his destination is placed at the origin, it would imply that he’s slowing down while approaching the place and speeding up while getting further away. If what we really want is the total distance that he’s traveled from place $$a$$ to $$b$$, we can use the integral of an absolute value function!

## How to solve integrals of absolute value functions?

Okay, let’s go through the solving method and walk through some example problems together!

### Example 1

Find the integral:

$$\int_{} |x|dx$$

Using the definition of an absolute value, let’s separate the integral into $$2$$ possible cases:

$$\int_{} xdx, x\geq0$$

$$\int_{} -xdx, x<0$$

Use $$\int a\times f(x)dx=a\times \int f(x)dx$$ for the second integral:

$$\int_{} xdx, x\geq0$$

$$-\int_{} xdx, x<0$$

Notice that we have same integral $$\int_{} xdx$$, so solve this integral first.

$$\int_{} xdx$$

Use $$\int x dx=\frac{x^2}2$$ to evaluate the integral:

$$\frac{x^2}2$$

Since the derivative of a constant is zero, we need to add the constant of integration $$C$$ to include all possible anti-derivative functions in the result:

$$\frac{x^2}2+C, C\in \mathbb{R}$$

Substitute this result for integrals:

$$\frac{x^2}2+C, C\in \mathbb{R}, x\geq0$$

$$-\frac{x^2}2+C, C\in \mathbb{R}, x<0$$

Awesome! The evaluated integral is equal to:

$$\frac{x^2}2+C, C\in \mathbb{R}, x\geq0$$
$$-\frac{x^2}2+C, C\in \mathbb{R}, x<0$$

### Example 2

Find the integral:

$$\int_{} |x|-|x+1|dx$$

This one has two absolute values in the integrand! We still need to separate each absolute value into 2 possible cases, so let’s use the definition of absolute value and separate this integral into $$4$$ possible cases:

$$\int x-(x+1)dx, x\geq0, x+1\geq0$$

$$\int -x-(x+1)dx, x<0, x+1\geq0$$

$$\int x-(-(x+1)) dx, x\geq0, x+1<0$$

$$\int -x-(-(x+1))dx, x<0, x+1<0$$

Simplify the integrands:

$$\int -1dx, x\geq0, x+1\geq0$$

$$\int -2x-1dx, x<0, x+1\geq0$$

$$\int 2x+1 dx, x\geq0, x+1<0$$

$$\int 1dx, x<0, x+1<0$$

Notice that there is a system of inequalities for every integral. Let’s start with the first:

$$x\geq0, x+1\geq0$$

Solve the second inequality for $$x$$:

$$x\geq0, x\geq-1$$

Find the intersection:

$$x\in [0, +\infty\rangle$$

Using the same procedure, find the other intervals and substitute them:

$$\int -1dx, x\in [0, +\infty\rangle$$

$$\int -2x-1dx, x\in[-1,0\rangle$$

$$\int 2x+1 dx, \emptyset$$

$$\int 1dx, x\in\langle-\infty,-1\rangle$$

In the third case, $$x$$ is in an empty set, so we can reject this case since there are no solutions.

$$\int -1dx, x\in [0, +\infty\rangle$$

$$\int -2x-1dx, x\in[-1,0\rangle$$

$$\int 1dx, x\in\langle-\infty,-1\rangle$$

Notice that in the first case, we can use $$\int a dx=a\times x$$ to get the same integral as in the third case:

$$-\int 1dx, x\in [0, +\infty\rangle$$

$$\int -2x-1dx, x\in[-1,0\rangle$$

$$\int 1dx, x\in\langle-\infty,-1\rangle$$

Now let’s find the integral $$\int 1dx$$:

$$\int 1dx$$

Use $$\int a dx=a\times x$$ to evaluate the integral:

$$x$$

Since the derivative of a constant is zero, we need to add the constant of integration $$C$$ to include all possible anti-derivative functions in the result:

$$x+C, C\in \mathbb{R}$$

Substitute $$x+C, C\in \mathbb{R}$$ for $$\int 1dx$$ into the first and third cases:

$$-x+C, C\in \mathbb{R}, x\in [0, +\infty\rangle$$

$$\int -2x-1dx, x\in[-1,0\rangle$$

$$x+C, C\in \mathbb{R}, x\in\langle-\infty,-1\rangle$$

Now let’s focus on our last one — the second case:

$$\int -2x-1dx, x\in[-1,0\rangle$$

Use the property of integral $$\int f(x)\pm g(x)dx=\int f(x)dx \pm \int g(x)dx$$:

$$-\int2xdx-\int1dx$$

Use $$\int a\times f(x)dx=a\times\int f(x)dx$$:

$$-2\int xdx-\int1dx$$

Now, use $$\int xdx=\frac{x^2}2$$ for the first integral and $$\int adx=a\times x$$ for the second integral:

$$-2\times\frac{x^2}2-1\times x$$

Simplify the expression:

$$-x^2-x$$

Since the derivative of a constant is zero, we need to add the constant of integration $$C$$ to include all possible anti-derivative functions in the result:

$$-x^2-x+C, C\in \mathbb{R}$$

Substitute $$-x^2-x+C, C\in \mathbb{R}$$ for $$\int -2x-1dx$$ into the second case:

$$-x+C, C\in \mathbb{R}, x\in [0, +\infty\rangle$$

$$-x^2-x+C, C\in \mathbb{R}, x\in[-1,0\rangle$$

$$x+C, C\in \mathbb{R}, x\in\langle-\infty,-1\rangle$$

So, the evaluated integral is equal to:

$$-x+C, C\in \mathbb{R}, x\in [0, +\infty\rangle$$
$$-x^2-x+C, C\in \mathbb{R}, x\in[-1,0\rangle$$
$$x+C, C\in \mathbb{R}, x\in\langle-\infty,-1\rangle$$

Phew! Nice work.

## Study summary

1. Use the absolute value definition to separate the integral into 2 possible cases.
2. Evaluate each indefinite integral separately.

## Do it yourself!

Try these practice problems to really get the hang of the method. If you get stuck, we can help!

Evaluate the integral:

1. $$\int |x^3-5x^2+6x|dx$$
2. $$\int |\cos(x)|dx$$
3. $$\int |1-e^{x-1}|dx$$
4. $$\int |\log_3(x-1)|dx$$

Solutions:

1. $$\frac{x^4}4-\frac{5x^3}{3}+3x^2+C, C\in\mathbb{R}, \text{for}~x^3-5x^2+6x\geq0 ~~ \text{and} ~~ -\frac{x^4}4+\frac{5x^3}{3}-3x^2+C, C\in\mathbb{R}, \text{for}~x^3-5x^2+6x<0$$
2. $$\sin{(x)}+C, C\in \mathbb{R}, \text{for}\cos{(x)}\geq0 ~~\text{and} ~~ -\sin{(x)}+C, C\in \mathbb{R}, \text{for}\cos{(x)}<0$$
3. $$x-e^{x-1}+C, C\in \mathbb{R}, \text{for}~1-e^{x-1}\geq0 ~~\text{and} ~-x+e^{x-1}+C, C\in \mathbb{R}, \text{for}~1-e^{x-1}<0$$
4. $$\log_3{(x-1)\times(x-1)}-\frac{x-1}{\ln{3}}+C, C\in \mathbb{R}, \text{for}~\log_3(x-1)\geq0 ~~\text{and} ~~~-\log_3{(x-1)\times(x-1)}+\frac{x-1}{\ln{3}}+C, C\in \mathbb{R}, \text{for}~\log_3(x-1)<0$$

How’s it going? Do you need some help? Just scan the problem with your Photomath app and we’ll walk you through it!

Here’s a sneak peek of what you’ll see:

/

## Got calculus homework?

Head over to the Photomath app for instant, step-by-step solutions to all of your calculus problems.