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

2 Answers
Apr 12, 2015

#int_(x=-2)^1 abs(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)/2#

#= 2 1/2#

Apr 12, 2015

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

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

#int_-2^1 absx dx = int_-2^0 -x dx + int_0^1 x dx# .

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

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

Tlhe graph of #abs x#:

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

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

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

#int_-2^1 absx dx = 2+1/2=5/2#

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