How do you find the integral of abs(x) dx|x|dx on the interval [-2, 1]?

2 Answers
Apr 12, 2015

int_(x=-2)^1 abs(x) dx1x=2|x|dx

The easiest way to do this is to think about what this function looks like:
enter image source here

The integral is equal to the area shaded in blue
which is the sum of the areas of the two triangles

(2xx2)/2 + (1xx1)/22×22+1×12

= 2 1/2=212

Apr 12, 2015

absx = x|x|=x for x >=0x0 and absx = -x|x|=x for x<=0x0 so to integrate

int_-2^1 absx dx12|x|dx we need to split the integral into two integrals:

int_-2^1 absx dx = int_-2^0 -x dx + int_0^1 x dx12|x|dx=02xdx+10xdx .

Tlhis method is useful and important to know for more complicated integrals, like: int_0^8 abs (3x^2-17x+10)dx803x217x+10dx,

But for this particular problem there is a straightforward geometric method.

Tlhe graph of abs x|x|:

graph{abs x [-3.07, 1.796, -0.313, 2.12]}

From -22 to 00 we have a right triangle with base = height = 2, so its area is 1/2 2*2 = 21222=2

On the right, from 0 to 1, is a triangle of area 1/212, The integrhl is the area below the graph and above the axis, so

int_-2^1 absx dx = 2+1/2=5/212|x|dx=2+12=52

(These are the values of the two integrals above.)