# How do you integrate int_0^(pi/2) x^2*sin(2x) dx using integration by parts?

Dec 24, 2015

${\int}_{0}^{\frac{\pi}{2}} {x}^{2} \cdot \sin \left(2 x\right) \mathrm{dx} = \frac{{\pi}^{2}}{8} - \frac{1}{2}$

#### Explanation:

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

To integrate by parts, you need to identify what is $f \left(x\right)$ and $g ' \left(x\right)$, i.e. which side to integrate and which side to differentiate.

Now, polynomials, differentiated a finite number of times, will eventually become zero. Sinusoidal functions, on the other hand, can be integrated or differentiated repeated with ease.

In this problem, you need to integrate by parts twice, because you need to differentiate ${x}^{2}$ twice before it goes away. First, let $f \left(x\right) = {x}^{2}$ and $g ' \left(x\right) = \sin \left(2 x\right)$, i.e. differentiate ${x}^{2}$ and integrate $\sin \left(2 x\right)$.

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

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

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

$= \frac{{\pi}^{2}}{8} + {\int}_{0}^{\frac{\pi}{2}} x \cdot \cos \left(2 x\right) \mathrm{dx}$

Now for the second integration by parts.

$\frac{{\pi}^{2}}{8} + {\int}_{0}^{\frac{\pi}{2}} x \cdot \cos \left(2 x\right) \mathrm{dx} = \frac{{\pi}^{2}}{8} + \frac{1}{2} {\int}_{0}^{\frac{\pi}{2}} x \cdot \frac{d}{\mathrm{dx}} \left(\sin \left(2 x\right)\right) \mathrm{dx}$

$= \frac{{\pi}^{2}}{8} + \frac{1}{2} \left({\left[x \cdot \sin \left(2 x\right)\right]}_{0}^{\frac{\pi}{2}} - {\int}_{0}^{\frac{\pi}{2}} \frac{d}{\mathrm{dx}} \left(x\right) \cdot \sin \left(2 x\right) \mathrm{dx}\right)$

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

$= \frac{{\pi}^{2}}{8} - \frac{1}{2} {\int}_{0}^{\frac{\pi}{2}} \sin \left(2 x\right) \mathrm{dx}$

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

$= \frac{{\pi}^{2}}{8} + \frac{1}{4} \left[\cos \left(\pi\right) - \cos \left(0\right)\right]$

$= \frac{{\pi}^{2}}{8} - \frac{1}{2}$