# How do you integrate int (2+sin(x/2))^2 cos(x/2)dx using integration by parts?

Jan 9, 2016

$I = 10 \sin \left(\frac{x}{2}\right) - 2 \cos \left(x\right) - 2 \sin \left(\frac{x}{2}\right) + \frac{2}{3} {\sin}^{3} \left(\frac{x}{2}\right) + c$

#### Explanation:

For a non-parts approach

$I = \int {\left(2 + \sin \left(\frac{x}{2}\right)\right)}^{2} \cos \left(\frac{x}{2}\right) \mathrm{dx}$

Expanding that

$I = \int \left(4 + 4 \sin \left(\frac{x}{2}\right) + {\sin}^{2} \left(\frac{x}{2}\right)\right) \cos \left(\frac{x}{2}\right) \mathrm{dx}$

And that

$I = \int 4 \cos \left(\frac{x}{2}\right) \mathrm{dx} + \int 4 \sin \left(\frac{x}{2}\right) \cos \left(\frac{x}{2}\right) \mathrm{dx} + \int {\sin}^{2} \left(\frac{x}{2}\right) \cos \left(\frac{x}{2}\right) \mathrm{dx}$

The first integral is easy

$I = 8 \sin \left(\frac{x}{2}\right) + \int 4 \sin \left(\frac{x}{2}\right) \cos \left(\frac{x}{2}\right) \mathrm{dx} + \int {\sin}^{2} \left(\frac{x}{2}\right) \cos \left(\frac{x}{2}\right) \mathrm{dx}$

The second is easy if you remember that

$\sin \left(\alpha x\right) \cos \left(\alpha x\right) = \sin \frac{2 \alpha x}{2}$, so

$I = 8 \sin \left(\frac{x}{2}\right) + \int 2 \sin \left(x\right) \mathrm{dx} + \int {\sin}^{2} \left(\frac{x}{2}\right) \cos \left(\frac{x}{2}\right) \mathrm{dx}$
$I = 8 \sin \left(\frac{x}{2}\right) - 2 \cos \left(x\right) + \int {\sin}^{2} \left(\frac{x}{2}\right) \cos \left(\frac{x}{2}\right) \mathrm{dx}$

If you remember ${\sin}^{2} \left(\theta\right) = 1 - {\cos}^{2} \left(\theta\right)$

$I = 8 \sin \left(\frac{x}{2}\right) - 2 \cos \left(x\right) + \int \left(1 - {\cos}^{2} \left(\frac{x}{2}\right)\right) \cos \left(\frac{x}{2}\right) \mathrm{dx}$
$I = 8 \sin \left(\frac{x}{2}\right) - 2 \cos \left(x\right) + \int \cos \left(\frac{x}{2}\right) \mathrm{dx} - \int {\cos}^{3} \left(\frac{x}{2}\right) \mathrm{dx}$
$I = 8 \sin \left(\frac{x}{2}\right) - 2 \cos \left(x\right) + 2 \sin \left(\frac{x}{2}\right) - \int {\cos}^{3} \left(\frac{x}{2}\right) \mathrm{dx}$

And now, use ${\cos}^{2} \left(\frac{x}{2}\right) = 1 - {\sin}^{2} \left(\frac{x}{2}\right)$

$I = 10 \sin \left(\frac{x}{2}\right) - 2 \cos \left(x\right) - \int \left(1 - {\sin}^{2} \left(\frac{x}{2}\right)\right) \cos \left(\frac{x}{2}\right) \mathrm{dx}$

Say $u = \sin \left(\frac{x}{2}\right)$ so $\mathrm{du} = \cos \frac{\frac{x}{2}}{2}$

$I = 10 \sin \left(\frac{x}{2}\right) - 2 \cos \left(x\right) - 2 \int \left(1 - {\sin}^{2} \left(\frac{x}{2}\right)\right) \cos \frac{\frac{x}{2}}{2} \mathrm{dx}$
$I = 10 \sin \left(\frac{x}{2}\right) - 2 \cos \left(x\right) - 2 \int \left(1 - {u}^{2}\right) \mathrm{du}$
$I = 10 \sin \left(\frac{x}{2}\right) - 2 \cos \left(x\right) - 2 u + \frac{2 {u}^{3}}{3} + c$

Switching it back to $x$

$I = 10 \sin \left(\frac{x}{2}\right) - 2 \cos \left(x\right) - 2 \sin \left(\frac{x}{2}\right) + \frac{2}{3} {\sin}^{3} \left(\frac{x}{2}\right) + c$