Primitive of x squared by Power of a x + b

Theorem

 * $\ds \int x^2 \paren {a x + b}^n \rd x = \frac {\paren {a x + b}^{n + 3} } {\paren {n + 3} a^3} - \frac {2 b \paren {a x + b}^{n + 2} } {\paren {n + 2} a^3} + \frac {b^2 \paren {a x + b}^{n + 1} } {\paren {n + 1} a^3} + C$

where $n \notin \set {-1, -2, -3}$.

Proof
Let $u = a x + b$.

Then:

Then:

Also see

 * Primitive of $x^2$ over $a x + b$ for the case when $n = -1$
 * Primitive of $x^2$ over $\paren {a x + b}^2$ for the case when $n = -2$
 * Primitive of $x^2$ over $\paren {a x + b}^3$ for the case when $n = -3$