# How do you integrate int cos^2x by integration by parts method?

Jan 23, 2017

$\frac{x}{2} + \frac{1}{2} \sin x \cos x + c$

#### Explanation:

If you really want to integrate by parts, choose $u = \cos x$, $\mathrm{dv} = \cos x \mathrm{dv}$, $\mathrm{du} = - \sin x \mathrm{dx}$, $v = \sin x$.

$\int u \mathrm{dv} = u v - \int v \mathrm{du}$

$\int \cos x \cos x \mathrm{dx} = \cos x \sin x - \int \sin x \left(- \sin x\right) \mathrm{dx}$

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

$\int {\cos}^{2} x \mathrm{dx} = \cos x \sin x + \int 1 \mathrm{dx} - \int {\cos}^{2} x \mathrm{dx}$

Now for the sneaky part: take the integral on the right over to the left:

$2 \int {\cos}^{2} x \mathrm{dx} = \cos x \sin x + x$

Hence
$\int {\cos}^{2} x \mathrm{dx} = \frac{1}{2} x + \frac{1}{2} \sin x \cos x$

However, a shorter way is to use the identities $\cos 2 x = {\cos}^{2} x - {\sin}^{2} x = 2 {\cos}^{2} x - 1 = 1 - 2 {\sin}^{2} x$ and $\sin 2 x = 2 \sin x \cos x$.

$\int {\cos}^{2} x = \int \frac{1 + \cos 2 x}{2} \mathrm{dx}$

$= \int \frac{1}{2} \mathrm{dx} + \frac{1}{2} \int \cos 2 x \mathrm{dx}$

$= \frac{1}{2} x + \frac{1}{2} \sin 2 x + c$

$= \frac{1}{2} x + \sin x \cos x + c$