Could someone help me solve this problem, I'm not sure where I'm going wrong $$ \int_{0}^{2\pi} |x-\pi| $$
We break the integral up since $[0,\pi] < 0$ and $[\pi-2\pi] > 0$. I then have
$$ \int_0^\pi |x-\pi| + \int_\pi^{2\pi}|x-\pi| $$
Integrating this I get $$ |1-\pi x||^{\pi}_0+|1-\pi x ||^{2 \pi}_{\pi} = \pi^2+3\pi^2=4\pi^2 $$
However, the correct answer is $\pi^2$. Could someone explain where I went wrong? Your help is appreciated.