# How do you integrate  x * cos^2 (x)?

Nov 5, 2016

The answer is $= {x}^{2} / 4 + \frac{x \sin 2 x}{4} + \frac{\cos 2 x}{8} + C$

#### Explanation:

First replace ${\cos}^{2} x$ by $\frac{1}{2} \left(1 + \cos 2 x\right)$
As $\cos 2 x = 2 {\cos}^{2} x - 1$
$\therefore \int x {\cos}^{2} x \mathrm{dx} = \frac{1}{2} \int \left(x + x \cos 2 x\right) \mathrm{dx}$

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

We integrate the last integral by parts
$u = x$$\implies$$u ' = 1$
$v ' = \cos 2 x$$\implies$$v = \frac{\sin 2 x}{2}$
So $\int x \cos 2 x \mathrm{dx} = \frac{x \sin 2 x}{2} - \frac{1}{2} \int \sin 2 x \mathrm{dx}$
$= \frac{x \sin 2 x}{2} + \frac{\cos 2 x}{4}$
Putting it all together

$\int x {\cos}^{2} x \mathrm{dx} = {x}^{2} / 4 + \frac{x \sin 2 x}{4} + \frac{\cos 2 x}{8} + C$