Primitive of x squared by Cosine of a x

Theorem

 * $\displaystyle \int x^2 \cos \left({a x}\right) \ \mathrm d x = \frac {2 x \cos a x} {a^2} + \left({\frac {x^2} a - \frac 2 {a^3} }\right) \sin a x + C$

where $C$ is an arbitrary constant.

Proof
With a view to expressing the primitive in the form:
 * $\displaystyle \int u \frac {\mathrm d v}{\mathrm d x} \ \mathrm d x = u v - \int v \frac {\mathrm d u}{\mathrm d x} \ \mathrm d x$

let:

and let:

Then:

Also see

 * Primitive of $x^2 \sin a x$