# How do I evaluateint_0^(pi/2) x sin^2(x)dx?

Jan 30, 2015

The answer is: $\frac{1}{16} \left({\pi}^{2} + 4\right)$

The first thing to do is to lower the degree of the function sinus with the Half-angle formula:

sinx=sqrt((1-cos2x)/2.

So the integral becomes:

${\int}_{0}^{\frac{\pi}{2}} x \frac{1 - \cos 2 x}{2} \mathrm{dx} = \frac{1}{2} {\int}_{0}^{\frac{\pi}{2}} \left(x - x \cos 2 x\right) \mathrm{dx} = \frac{1}{2} \left[{\int}_{0}^{\frac{\pi}{2}} x \mathrm{dx} - {\int}_{0}^{\frac{\pi}{2}} x \cos 2 x \mathrm{dx}\right]$.

To do the first integral it is sufficient to remember the law:

$\int {x}^{n} \mathrm{dx} = {x}^{n + 1} / \left(n + 1\right) + c$,

so:

${\int}_{0}^{\frac{\pi}{2}} x \mathrm{dx} = {\left[{x}^{2} / 2\right]}_{0}^{\frac{\pi}{2}} = \left[\frac{{\pi}^{2} / 4}{2} - \frac{0}{2}\right] = {\pi}^{2} / 8$

The second integral can be done using the theorem of the integration by parts, that says:

$\int f \left(x\right) g ' \left(x\right) \mathrm{dx} = f \left(x\right) g \left(x\right) - \int g \left(x\right) f ' \left(x\right) \mathrm{dx}$

We can assume that $f \left(x\right) = x$ and $g ' \left(x\right) \mathrm{dx} = \cos 2 x \mathrm{dx}$.

To find $g \left(x\right)$, it is sufficient to remember this law:

$g \left(x\right) = \int \cos \left(h \left(x\right)\right) h ' \left(x\right) \mathrm{dx} = \sin \left(h \left(x\right)\right) + c$,

where $h \left(x\right) = 2 x , \mathmr{and} h ' \left(x\right) = 2$,

So:

$g \left(x\right) = \int \cos 2 x \mathrm{dx} = \frac{1}{2} \int \cos 2 x .2 \mathrm{dx} = \frac{1}{2} \sin 2 x$.

and $f ' \left(x\right) = 1$

So:

${\int}_{0}^{\frac{\pi}{2}} x \cos 2 x \mathrm{dx} = {\left[x \cdot \frac{1}{2} \sin 2 x\right]}_{0}^{\frac{\pi}{2}} - {\int}_{0}^{\frac{\pi}{2}} 1 \cdot \frac{1}{2} \sin 2 x \mathrm{dx} =$

$\left[\frac{\pi}{2} \cdot \frac{1}{2} \sin 2 \left(\frac{\pi}{2}\right) - 0\right] - \frac{1}{2} {\left[- \frac{\cos 2 x}{2}\right]}_{0}^{\frac{\pi}{2}} = \left[\frac{\pi}{4} \sin \pi + \frac{1}{2} \frac{\cos 2 \left(\frac{\pi}{2}\right)}{2} - \frac{1}{2} \cos \frac{0}{2}\right] = \left[0 - \frac{1}{4} - \frac{1}{4}\right] = - \frac{1}{2.}$

I remember that $\int \sin 2 x \mathrm{dx} = - \frac{\cos 2 x}{2}$, done like before with $\int \cos 2 x \mathrm{dx} = \frac{\sin 2 x}{2}$

Final count:

$\frac{1}{2} \left({\pi}^{2} / 8 + \frac{1}{2}\right) = \frac{1}{16} \left({\pi}^{2} + 4\right)$