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

Feb 3, 2017

$\frac{1}{27} \left(9 {x}^{2} - 2\right) \sin 3 x + \frac{2 x}{9} \cos 3 x + C$

#### Explanation:

Integration by parts formula

$I = \int u v ' \mathrm{dx} = u v - \int v u ' \mathrm{dx}$

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

$u = {x}^{2} \implies u ' = 2 x$

$v ' = \cos 3 x \implies v = \frac{1}{3} \sin 3 x$

$\therefore {I}_{1} = {x}^{2} / 3 \sin 3 x - \int \left[\frac{2 x}{3} \sin 3 x\right] \mathrm{dx}$

$\therefore {I}_{1} = {x}^{2} / 3 \sin 3 x - \frac{2}{3} \textcolor{b l u e}{\int \left[x \sin 3 x\right] \mathrm{dx}}$

we now have to use IBP on the integral highlighted in blue

${I}_{2} = \left(\int \left[x \sin 3 x\right] \mathrm{dx}\right)$

$u = x \implies u ' = 1$

$v ' = \sin 3 x \implies v = - \frac{1}{3} \cos 3 x$

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

${I}_{2} = - \frac{x}{3} \cos 3 x + \frac{1}{9} \sin 3 x$

substituting back into ${I}_{1}$

$\therefore {I}_{1} = {x}^{2} / 3 \sin 3 x - \frac{2}{3} \left(- \frac{x}{3} \cos 3 x + \frac{1}{9} \sin 3 x\right) + C$

$\therefore {I}_{1} = {x}^{2} / 3 \sin 3 x + \frac{2 x}{9} \cos 3 x - \frac{2}{27} \sin 3 x + C$

${I}_{1} = \left({x}^{2} / 3 - \frac{2}{27}\right) \sin 3 x + \frac{2 x}{9} \cos 3 x + C$

${I}_{1} = \frac{1}{27} \left(9 {x}^{2} - 2\right) \sin 3 x + \frac{2 x}{9} \cos 3 x + C$