# Math Help - integration of an absolute value function??

1. ## integration of an absolute value function??

I'm very stuck on this problem because when I did it the way I thought it was supposed to be done I ended up with an answer of zero which definitely isn't possible... any tips on how to solve it would be greatly appreciated!!

integral of... (|x+1| - |x-1|)dx

Thanks

2. Originally Posted by khood
I'm very stuck on this problem because when I did it the way I thought it was supposed to be done I ended up with an answer of zero which definitely isn't possible... any tips on how to solve it would be greatly appreciated!!

integral of... (|x+1| - |x-1|)dx

Thanks
We know that $|x|= \left\{ \begin{array}{rcl}
-x & \mbox{if} & x<0 \\ 0 & \mbox{if} & x=0 \\
x & \mbox{if} & 0 \end{array}\right.$
. Now assuming integrability we integrate piecewise to get

$\int|x|dx=\left\{ \begin{array}{rcl}
\frac{-x^2}{2}& \mbox{if} & x<0 \\ 0 & \mbox{if} & x=0 \\
\frac{x^2}{2} & \mbox{if} & 0 \end{array}\right.$

And we can see this corresponds to $\frac{x|x|}{2}$

So we can conclude that $\int|x|dx=\frac{x|x|}{2}+C$

Now just make the proper substiutions in your integral and you should get

$\frac{(x+1)|x+1|}{2}+\frac{(x-1)|x-1|}{2}+C$