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

Jan 24, 2017

$\int {x}^{2} \cos 3 x \mathrm{dx} = \frac{{x}^{2} \sin 3 x}{3} + \frac{2 x \cos 3 x}{9} - \frac{2 \sin 3 x}{27} + C$

#### Explanation:

When integrating by parts a function in the form $f \left(x\right) = {x}^{k} g \left(x\right)$ we normally take ${x}^{k}$ as finite factor, so that at the next iteration the grade of $x$ is lower.

So, we can note that $\cos 3 x \mathrm{dx} = \frac{1}{3} d \left(\sin 3 x\right)$ and integrate by parts in this way:

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

The resulting integral can also be resolved by parts:

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

Putting it all together:

$\int {x}^{2} \cos 3 x \mathrm{dx} = \frac{{x}^{2} \sin 3 x}{3} + \frac{2 x \cos 3 x}{9} - \frac{2 \sin 3 x}{27} + C$