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

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:
{{begin-eqn}}
{{eqn | l = z
      | r = \paren {2 a x + b}^2
      | c = 
}}
{{eqn | ll= \leadsto
      | l = \frac {\d z} {\d x}
      | r = 4 a \paren {2 a x + b}
      | c = Derivative of Power and Chain Rule for Derivatives
}}
{{eqn | ll= \leadsto
      | l = \frac {\d z} {\d x}
      | r = 4 a \sqrt z
      | c = 
}}
{{end-eqn}}
Suppose $a > 0$.
Then we have:
{{begin-eqn}}
{{eqn | o = 
      | r = \int \sqrt {a x^2 + b x + c} \rd x
      | c = 
}}
{{eqn | r = \int \sqrt {\frac {\paren {2 a x + b}^2 + \paren {4 a c - b^2} } {4 a} } \rd x
      | c = Completing the Square
}}
{{eqn | r = \int \frac {\sqrt {z + \paren {4 a c - b^2} } \rd z} {\paren {2 \sqrt a} \paren {4 a \sqrt z} }
      | c = Integration by Substitution
}}
{{eqn | r = \frac 1 {8 a \sqrt a} \int \frac {\sqrt {z + \paren {4 a c - b^2} } \rd z} {\sqrt z}
      | c = Primitive of Constant Multiple of Function
}}
{{eqn | r = \frac 1 {8 a \sqrt a} \paren {\sqrt z \sqrt {z + \paren {4 a c - b^2} } + \frac {4 a c - b^2} 2 \int \frac {\d z} {\sqrt z \sqrt {z + \paren {4 a c - b^2} } } }
      | c = Primitive of $\dfrac {\sqrt{p x + q} } {\sqrt{a x + b} }$
}}
{{eqn | r = \frac {\sqrt z \sqrt {z + \paren {4 a c - b^2} } } {8 a \sqrt a} + \frac {4 a c - b^2} {16 a \sqrt a} \int \frac {\d z} {\sqrt z \sqrt {z + \paren {4 a c - b^2} } }
      | c = multiplying out
}}
{{eqn | r = \frac {\paren {2 a x + b} \sqrt {\paren {2 a x + b}^2 + \paren {4 a c - b^2} } } {8 a \sqrt a} + \frac {4 a c - b^2} {16 a \sqrt a} \int \frac {4 a \rd x} {\sqrt {\paren {2 a x + b}^2 + \paren {4 a c - b^2} } }
      | c = substituting back for $z$ and $\d z$
}}
{{eqn | r = \frac {\paren {2 a x + b} \paren {2 \sqrt a \sqrt {a x^2 + b x + c} } } {8 a \sqrt a} + \frac {4 a c - b^2} {16 a \sqrt a} \int \frac {4 a \rd x} {2 \sqrt a \sqrt {a x^2 + b x + c} }
      | c = substituting back for $\sqrt {a x^2 + b x + c}$
}}
{{eqn | r = \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} }
      | c = simplifying
}}
{{end-eqn}}
When $a < 0$, the above does not work, as we cannot take the square root of a negative number.
Hence in this case:
{{begin-eqn}}
{{eqn | o = 
      | r = \int \sqrt {a x^2 + b x + c} \rd x
      | c = 
}}
{{eqn | r = \int \sqrt {\frac {\paren {2 a x + b}^2 - \paren {b^2 - 4 a c} } {4 a} } \rd x
      | c = Completing the Square
}}
{{eqn | r = \int \sqrt {\frac {\paren {b^2 - 4 a c} - \paren {2 a x + b}^2} {-4 a} } \rd x
      | c = Completing the Square
}}
{{eqn | r = \int \frac {\sqrt {\paren {b^2 - 4 a c} - z} \rd z} {\paren {2 \sqrt {-a} } \paren {4 a \sqrt z} }
      | c = Integration by Substitution
}}
{{eqn | r = \frac 1 {8 a \sqrt {-a} } \int \frac {\sqrt {-z + \paren {b^2 - 4 a c} } \rd z} {\sqrt z}
      | c = Primitive of Constant Multiple of Function
}}
{{eqn | r = \frac 1 {8 a \sqrt {-a} } \paren {\sqrt z \sqrt {-z + \paren {b^2 - 4 a c} } + \frac {b^2 - 4 a c} 2 \int \frac {\d z} {\sqrt z \sqrt {-z + \paren {b^2 - 4 a c} } } }
      | c = Primitive of $\dfrac {\sqrt{p x + q} } {\sqrt{a x + b} }$
}}
{{eqn | r = \frac {\sqrt z \sqrt {\paren {b^2 - 4 a c} - z} } {8 a \sqrt {-a} } + \frac {b^2 - 4 a c} {16 a \sqrt {-a} } \int \frac {\d z} {\sqrt z \sqrt {\paren {b^2 - 4 a c} - z} }
      | c = multiplying out
}}
{{eqn | r = \frac {\paren {2 a x + b} \sqrt {\paren {b^2 - 4 a c} - \paren {2 a x + b}^2} } {8 a \sqrt {-a} } + \frac {b^2 - 4 a c} {16 a \sqrt {-a} } \int \frac {4 a \rd x} {\sqrt {\paren {b^2 - 4 a c} - \paren {2 a x + b}^2} }
      | c = substituting back for $z$ and $\d z$
}}
{{eqn | r = \frac {\paren {2 a x + b} \paren {2 \sqrt {-a} \sqrt {a x^2 + b x + c} } } {8 a \sqrt {-a} } + \frac {b^2 - 4 a c} {16 a \sqrt {-a} } \int \frac {4 a \rd x} {2 \sqrt {-a} \sqrt {a x^2 + b x + c} }
      | c = substituting back for $\sqrt {a x^2 + b x + c}$
}}
{{eqn | r = \frac {\paren {2 a x + b} \sqrt {a x^2 + b x + c} } {4 a} + \frac {b^2 - 4 a c} {-8 a} \int \frac {\d x} {\sqrt {a x^2 + b x + c} }
      | c = simplifying
}}
{{eqn | r = \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} }
      | c = arranging it into its final form
}}
{{end-eqn}}
{{qed}}