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

Jan 13, 2017

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

#### Explanation:

When we integrate by parts a function of the form:

${x}^{n} f \left(x\right)$

we normally choose ${x}^{n}$ as the integral part and $f \left(x\right)$ as the differential part, so that in the resulting integral we have ${x}^{n - 1}$

In this case however

${\cos}^{2} x \mathrm{dx}$

is not the differential of an «easy» function, so we first reduce the degree of the trigonometric function using the identity:

${\cos}^{2} x = \frac{1 + \cos \left(2 x\right)}{2}$

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

Now we can solve the first integral directly:

$\int {x}^{2} / 2 \mathrm{dx} = {x}^{3} / 6$

and the second by parts:

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

and again:

$\frac{1}{2} \int x \sin \left(2 x\right) \mathrm{dx} = - \frac{1}{4} \int x d \left(\cos 2 x\right) = - \frac{x \cos \left(2 x\right)}{4} + \frac{1}{4} \int \cos 2 x \mathrm{dx} = - \frac{x \cos \left(2 x\right)}{4} + \frac{1}{8} \sin 2 x + C$

Putting it together:

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