Primitive of x squared by Sine of a x

Theorem

 * $\ds \int x^2 \sin a x \rd x = \frac {2 x \sin a x} {a^2} + \paren {\frac 2 {a^3} - \frac {x^2} a} \cos 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 \cos a x$