# What is int_-pi^pixsinxdx ?

Nov 11, 2015

2.

#### Explanation:

Write $f : x \mapsto x \sin \left(x\right)$.

Because $f \left(- x\right) = f \left(x\right)$ for all $x \in \left[- \pi , \pi\right]$, you can say that
${\int}_{- \pi}^{\pi} f \left(x\right) \mathrm{dx} = 2 {\int}_{0}^{\pi} f \left(x\right) d x$.

Now, use integration by parts with
$u \left(x\right) = x$ and $v \left(x\right) = - \cos \left(x\right)$.
The functions $u , v$ are ${C}^{1}$ on $\left[0 , \pi\right]$ and
$u ' \left(x\right) = 1$ and $v ' \left(x\right) = \sin \left(x\right)$.

The integration by parts says that
${\int}_{0}^{\pi} u \left(x\right) v ' \left(x\right) \mathrm{dx} = {\left[u \left(x\right) v \left(x\right)\right]}_{0}^{\pi} - {\int}_{0}^{\pi} u ' \left(x\right) v \left(x\right) \mathrm{dx}$,
therefore,
${\int}_{0}^{\pi} x \sin \left(x\right) \mathrm{dx} = {\left[- x \cos \left(x\right)\right]}_{0}^{\pi} + {\int}_{0}^{\pi} \cos \left(x\right) \mathrm{dx}$
${\int}_{0}^{\pi} x \sin \left(x\right) \mathrm{dx} = 1 + {\left[\sin \left(x\right)\right]}_{0}^{\pi} = 1$.

Finally, ${\int}_{- \pi}^{\pi} x \sin \left(x\right) \mathrm{dx} = 2 {\int}_{0}^{\pi} x \sin \left(x\right) \mathrm{dx} = 2$.