Definite integral of an absolute function

107 Views Asked by At

What is the value of $$\int_{-2}^2 \left|x+1\right|\;dx ?$$

I know the answer is 5 but I don't know how to work it out..

(Original scan)

2

There are 2 best solutions below

1
On

HINT:

For real $y,$

$$|y|= \begin{cases} +y &\mbox{if } y\ge0 \\ -y & \mbox{if } y<0 \end{cases}$$

0
On

Consider $$\int_{-2}^{2}|x+1|dx=\int_{-2}^{-1}|x+1|dx+\int_{-1}^{2}|x+1|dx.$$ Using the definition of absolute value the right-hand side becomes $$\int_{-2}^{-1}-(x+1)dx+\int_{-1}^2(x+1)dx.$$ Integrating with respect to $x$ we obtain $$\left.\left({-1\over 2}x^2-x\right)\right|_{-2}^{-1} +\left.\left({1\over 2}x^2+x\right)\right|_{-1}^2.$$ Thus $$\left({-1\over 2}+1\right)+(-2+2)+(2+2)+\left({-1\over 2}+1\right)=5.$$