integration of $\int_0^6 |x^2 - 6x +8| dx$ $$\int_0^6 |x^2 - 6x +8| dx =$$
I know the answer to this problem is $\frac{44}3$. But, how do you get that? How does the solution change based on the absolute value? Without the absolute value I got an answer of 12 - I found the anti-derivative:$\frac{x^3}3-3x^2+8x$. I then solved it which got me 12. However, this is not the answer to the above problem. What should I be doing?
 A: The absolute value is a function that's very difficult to work with directly. But there's an easy way to deal with it:
$$
|y|=\begin{cases} y &\text{if }y\geq0\\ -y &\text{if }y\leq0\end{cases}
$$
So your first step is to find where the term inside the absolute value is positive and where negative. Then you break up the integral into pieces.
A: If the integrand were given without the absolute value then it would be negative in the interval $(2,4)$ hence the given integral is equal to
$$\int_0^2 f(x)\mathrm{d}x-\int_2^4f(x)\mathrm{d}x+\int_4^6f(x)\mathrm{d}x$$
where $f(x)=x^2-6x+8$.
A: Hint : $x^2-6x+8=(x-4)(x-2)$
Can you break domain $ [0,6]$ to get rid of absolute value notation?
A: If $f(x)>0$ on an interval, then $|f(x)|=f(x)$ on that interval. If $f(x)<0$ on an interval, then $|f(x)|=-f(x)$ on that interval. That's basically the actual definition of the absolute value function.
On the interval $[2,4]$, $x^2-6x+8<0$. Everywhere else it's positive. Thus, your original integral is equivalent to the sum of the following three integrals:
$$
\int_{0}^{2}(x^2-6x+8)\,dx+\int_{2}^{4}\left[-(x^2-6x+8)\right]\,dx+\int_{4}^{6}(x^2-6x+8)\,dx.
$$
A: Let $F(x):=\frac13 x^3-3x^2+8x$ so, because $F^\prime$ is negative on $(2,\,4)$ but positive on $(0,\,2)\cup(4,\,6)$, your integral is$$F(2)-F(0)-(F(4)-F(2))+F(6)-F(4)=F(0)+F(6)+2(F(2)-F(4))\\=0+12+2\left(\frac{20}{3}-\frac{16}{3}\right)=\frac{44}{3}.$$
