Primitive of x squared by Exponential of a x

Theorem

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

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: