0
$\begingroup$

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.

$\endgroup$
1
  • $\begingroup$ Do you believe that a primitive of $x\mapsto|x-\pi|$ is $x\mapsto|1-\pi x|$? $\endgroup$
    – Did
    Commented Feb 23, 2015 at 19:11

3 Answers 3

2
$\begingroup$

See where $x-\pi$ is positive or negative. For example if $x\in (0,\pi)$, then $x-\pi<0$. Therefore $$|x-\pi|=\pi -x$$ integrating this gives $\pi x- x^2/2$

$\endgroup$
1
$\begingroup$

When $x \in [0,\pi]$, $x - \pi \le 0$, so $|x - \pi| = \pi - x$.

When $x \in [\pi, 2\pi]$, $x - \pi \ge 0$, so $|x - \pi| = x - \pi$. Now:

$$\int_0^{2\pi}|x - \pi|dx = \int_0^{\pi}|x - \pi|dx + \int_{\pi}^{2\pi}|x - \pi|dx = \int_0^{\pi}(\pi - x)dx + \int_{\pi}^{2\pi}(x - \pi)dx = \frac{\pi^2}{2} + (2\pi^2 - 2\pi^2 - \frac{\pi^2}{2} + \pi^2) = \pi^2 $$

$\endgroup$
1
$\begingroup$

Between $0$ and $\pi$ we have that $|x-\pi| = (\pi-x)$, while between $\pi$ and $2\pi$ we have that $|x-\pi| = (x-\pi)$. This allows us to remove the absolute signs and get normal polynomials.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .