Primitive of x squared by Cosine of a x

Theorem

 * $\ds \int x^2 \cos a x \rd x = \frac {2 x \cos a x} {a^2} + \paren {\frac {x^2} a - \frac 2 {a^3} } \sin a x + C$

where $C$ is an arbitrary constant.

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

let:

and let:

Then:

Also see

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