
Ninad M. answered 01/15/20
UC Berkeley Grad - Experienced High School/College Tutor
Whenever we see an absolute value inside of an integral, we should check to see if the function inside the absolute value ever switches sign.
In this case x = 0 is between the limits of integration. So we can break the integral up at that point using the piecewise definition of absolute value
|x| = { x if x > 0
{ -x if x < 0
∫2|x|dx = ∫-2xdx + ∫2xdx = -x^2 (from -1 to 0) + x^2 (from 0 to 1) = 2