# Integral of an absolute value function

How do I find the definite integral of an absolute value function?

For instance: $f(x) = |-2x^3 + 24x|$ from $x=1$ to $x=4$

-
Find the roots (thereby splitting the function into intervals on which it doesn't change sign), and in each interval evaluate the relevant function ($+f$ or $-f$). –  davin Mar 16 '12 at 15:04
To expand on @davin's comment: Use the definition of the absolute value! The absolute value equals "the inside" when "the inside" is non-negative, and equals " (-) the inside" when "the inside is negative. So you need to find where "the inside" is zero (i.e. find the roots of $-2x^3 + 24x = 0$ and possibly split the integral into two or more... –  The Chaz 2.0 Mar 16 '12 at 15:09

In your example, we'll take $f(x) = -2x^3+24x$, so
$$f(x) = 2x(-x^2+12) = -2x(x-\sqrt{12})(x+\sqrt{12})$$
$$\int_1^4 |f| = \int_1^{\sqrt{12}}|f| + \int_{\sqrt{12}}^4 |f| = \int_1^{\sqrt{12}} f + \int_{\sqrt{12}}^4 -f$$