Primitive of x squared by Sine of a x

Theorem

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

where $C$ is an arbitrary constant.

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

let:

and let:

Then:

Also see

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