# How to integrate a function with a nested absolute value: $|x^2 - 2|x||$? [closed]

I need help with this problem,

$$\int_0^4|x^2 - 2|x||dx$$

what should I do with $2|x|$ ?

• Why this "picture" ? Anyway, $|x|=x$ if $0\leq x\leq4$ and $|x^2-2x|=x^2-2x$ when $x\leq 2$ and vice-versa. May 28, 2015 at 19:22
• Hint: the absolute value function is piecewise linear. Can you integrate piecewise integrable functions? May 28, 2015 at 19:22
• You have $x \in [0,4]$, so $|x|=x$. So you only need to determine for which $x$ you have $x^2 \leq 2x$ and subdivide the area of integration accordingly. May 28, 2015 at 19:23

Conveniently, your integration limits are $(0,4)$ so the inside absolute value can be ignored. You are left with the following: $$\int_0^4 |x^2 - 2x| \ dx = \int_0^4x\cdot|x-2|\ dx$$ $$= \int_0^2 x\cdot(2-x)\ dx + \int_2^4x\cdot(x-2) \ dx$$ I leave the rest to you.