Primitive of Root of a x squared plus b x plus c

Theorem
Let $a \in \R_{\ne 0}$.

Then:
 * $\ds \int \sqrt {a x^2 + b x + c} \rd x = \frac {\paren {2 a x + b} \sqrt {a x^2 + b x + c} } {4 a} + \frac {4 a c - b^2} {8 a} \int \frac {\d x} {\sqrt {a x^2 + b x + c} }$

Proof
Let:

Suppose $a > 0$.

Then we have:

When $a < 0$, the above does not work, as we cannot take the square root of a negative number.

Hence in this case: