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

Jan 9, 2016

$I = \frac{9 {x}^{2} \sin \left(3 x\right) + 18 x \cos \left(3 x\right) - 2 \sin \left(3 x\right)}{9} + c$

Explanation:

$I = \int {x}^{2} \cos \left(3 x\right) \mathrm{dx}$

Say $u = {x}^{2}$ so $\mathrm{du} = 2 x$ and $\mathrm{dv} = \cos \left(3 x\right)$ so $v = \sin \frac{3 x}{3}$

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

Say $u = x$ so $\mathrm{du} = 1$ and $\mathrm{dv} = \sin \left(3 x\right)$ so $v = - \cos \frac{3 x}{3}$

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

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

$I = \frac{9 {x}^{2} \sin \left(3 x\right) + 18 x \cos \left(3 x\right) - 2 \sin \left(3 x\right)}{9} + c$