# Evaluate the integral `int_-1^2(x-2|x|)dx`The answer is -3.5 but I can only get -1.5. I don't know where I went wrong.

*print*Print*list*Cite

Expert Answers

tiburtius | Certified Educator

You must break this into two integrals because

`|x|={(x, if x geq 0),(-x, if x < 0):}`

So we get:

`int_-1^2(x-2|x|)dx=int_-1^0(x-2|x|)dx+int_0^2(x-2|x|)dx=`

`int_-1^0(x+2x)dx+int_0^2(x-2x)dx=3int_-1^0xdx-int_0^2xdx=`

`3 cdot x^2/2|_-1^0-x^2/2|_0^2=3(0-1/2)-(2-0)=-3/2-2=-7/2=-3.5`