Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know how to find the integral of just one absolute value, but this problem presents the integral of the sum of two absolute values. Help!

I want to evaluate:


share|cite|improve this question
Do you know how to integrate the sum of two functions? – Erick Wong Feb 26 '13 at 2:35
use additivity of integrals and see where the two functions change signs. – Mathematician Feb 26 '13 at 2:37

You need to separate the integral into cases like $x\in[a, -1], x\in(-1,1), x\in[1,b]$, assuming $a<-1<1<b$. Then, for each case, you can get rid of the absolute value and calculate the integral as usual.

It will be clear if you try to draw the graph of the function.

share|cite|improve this answer

Absolute value represents a piecewise function.

$$ |x| = \left\{ \begin{array}{lcr} x & : & x \geq 0 \\ -x & : & x < 0\end{array}\right. $$

As with integrating any piecewise function, break the interval of integration up into the separate regions for which you have something easier to handle and integrate each part separately.

In this case, suppose $a = -3$ and $b = 4$. Then

$$ \int_{-3}^{4} |x-1| + |x+1| dx = \int_{-3}^{-1} -(x-1) -(x+1) dx + \int_{-1}^{1} -(x-1) + (x+1) dx + \int_{1}^{4} (x-1) + (x+1) dx $$

share|cite|improve this answer

Note that $f(x) = |x-1| + |x+1|$ can be broken down into multiple cases:

$$f(x) = \begin{cases}(x-1)+(x+1)& \text{if }x\ge1 \\ -(x-1)+(x+1) & \text{if } -1\le x\le1 \\ -(x-1)+-(x+1) & \text{if } x\le-1 \end{cases}$$

Simplifying: $$f(x) = \begin{cases} 2x& \text{if }x\ge1 \\ 2 & \text{if } -1\le x\le1 \\ -2x & \text{if } x\le-1 \end{cases}$$

This is easily visualized with a graph (see Wolfram|Alpha).

So, to integrate, break up the interval $[a, b]$ with $-1$ and $1$.

An example will probably help: $$\begin{align} \int_{-3}^3|x-1|+|x+1|\;dx &= \int_{-3}^{-1}-2x\;dx+\int_{-1}^{1}2\;dx+\int_1^32x\;dx\\ &=-x^2\bigg|^{-1}_{-3} + 2x\bigg|_{-1}^1+x^2\bigg|_1^3\\ &=8+4+8\\ &=20 \end{align} $$

This area can be seen shaded in this Wolfram|Alpha link.

share|cite|improve this answer






share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.