How do you evaluate the integral of #int absx dx# from -2 to 1?

2 Answers
Dec 15, 2015

Split the interval into two.

Explanation:

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

For #x<0#, #absx=-x#.
For #x>=0#, #absx=x#.

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

#= [-x^2/2]_-2^0 + [x^2/2]_0^1#

#= 2 + 1/2 #

#= 5/2#

Dec 15, 2015

#int_(-2)^1|x|dx = 5/2#

Explanation:

The absolute value function #|*|# can be written as the piecewise function
#|x| = {(-x" if "x<=0), (x" if "x>=0):}#

Thus, using the property that for #a < b < c#
#int_a^cf(x)dx = int_a^bf(x)dx + int_b^cf(x)dx#

we obtain

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

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

#=-int_-2^0xdx + int_0^1xdx#

#= -[x^2/2]_-2^0 + [x^2/2]_0^1#

#=-(0^2/2 - (-2)^2/2) + (1^2/2 - 0^2/2)#

#= -(-2)+1/2#

#=5/2#

Thus #int_(-2)^1|x|dx = 5/2#