Analytic expression for the primitive of square root of a quadratic Can an analytic expression be given for 
$$\int \sqrt{ax^2 + bx +c} \, dx$$
I think substitution doesn't work in this case (I need to compute the integral $\int_0^t \ldots$).
 A: When you see
$$
ax^2 + \underbrace{{}\quad bx\quad{}}_\text{1st-degree term} + c,
$$
it may help to remember that there is a standard technique in algebra for reducing problems involving quadratic polynomials with a first-degree term to problems involving quadratic polynomials with no first-degree term.  It's called "completing the square".  You write
$$
ax^2+bx+c = a\left( x^2 + \frac b a x\right) + c.
$$
Then you need to work on $\displaystyle x^2 + \frac b a x$.
Half of the coefficient of the first-degree term is $\dfrac{b}{2a}$.  If you square that and add it to this expression you're working on, you get a perfect square—i.e. something squared:
$$
\underbrace{x^2 + \frac b a x} \quad +\quad \frac{b^2}{4a^2} = \left( x + \frac{b}{2a} \right)^2.
$$
So
\begin{align}
ax^2+bx+c = a\left( x^2 + \frac b a x\right) + c & = a\left( x^2 + \frac b a x + \frac{b^2}{4a^2} \right) - a\left( \frac{b^2}{4a^2} \right) + c \\[12pt]
& = a\left( x+ \frac{b}{2a} \right)^2 + \frac{4ac-b^2}{4a} \\[12pt]
& au^2 + \text{constant}.
\end{align}
Let's call that last constant capital $C$, and later we'll recall that it's $\dfrac{4ac-b^2}{4a}$.
Then since $u= x + \dfrac{b}{2a}$, we have $du = dx$, and the integral becomes
$$
\int \sqrt{au^2+C}\,du.
$$
Now we'd like a "$1$" where $C$ is, so that we can apply trigonometric identities.  So do a bit of algebra:
$$
\int \sqrt{au^2+C}\,du = \int \sqrt{\frac{a}{C} u^2 + 1} \, du.
$$
We also need $(\text{something})^2+1$, in order to apply the identity involving $\tan^2\theta+1$.  So we write:
$$
\int\sqrt{\left(u\sqrt{\frac{a}{C}}\right)^2+1}\  du.
$$
Then we have
$$
\int \sqrt{w^2 + 1}\  du.
$$
Since $w=u\sqrt{\dfrac{a}{C}}$, we have $dw = du\sqrt{\dfrac{a}{C}}$, so $du = dw\sqrt{\dfrac{C}{a}}$.
Now we have
$$
\sqrt{\dfrac{C}{a}} \int \sqrt{w^2+1}\  dw.
$$
This is
$$
\sqrt{\dfrac{C}{a}} \int \sqrt{\tan^2\theta+1}\  \sec^2\theta\,d\theta.
$$
$$
= \sqrt{\dfrac{C}{a}} \int \sec^3\theta\,d\theta.
$$
In April 2007, I wrote this Wikipedia article, which has since been edited by a number of others, and by me, explaining how to treat that integral and why it matters.
Later note: The above works if $a$ and (capital) $C$ are positive.  This implies (among other things) that $b^2-4ac<0$, so the quadratic polynomial cannot be factored using real numbers.
A: To deal with the integral, we first use method of completing square and then the well-know result
$$
\int \sqrt{x^2-a^2} d x=\frac{1}{2}\left[x \sqrt{x^2-a^2}-\ln \left|x+\sqrt{x^2-a^2}\right| \right ]+C
$$
Case 1: $a>0$ and $b^2>4ac$
$$
\begin{aligned}
I &=\int \sqrt{a x^2+b x+c} d x\\&=\int \sqrt{\left(\sqrt{a} x+\frac{b}{2 \sqrt{a}}\right)^2-\left(\frac{\sqrt{b^2-4 a c}}{2 \sqrt{a}} \right)^2}d x \\
&= \frac{1}{2 \sqrt{a}}\left[\left(\sqrt{a} x+\frac{b}{2 \sqrt{a}}\right) \sqrt{a x^2+b x+c}-\frac{b^2-4 a c}{4 a}\ln \left(\sqrt{a x^2+b x+c}+\sqrt{a} x+\frac{b}{2 \sqrt{a}}\right)\right]+C\\&=\frac{1}{4 a}(2 a x+b) \sqrt{a x^2+b x+c}-\frac{b^2-4 a c}{8 a^{\frac{3}{2}}} \ln \left(2 \sqrt{a} \sqrt{a x^2+b x+c}+2 a x+b\right)+C
\end{aligned}
$$
Case 2: $a>0$ and $b^2<4ac$
$$I=\int \sqrt{a x^2+b x+c} d x=\int \sqrt{\left(\sqrt{a} x+\frac{b}{2 \sqrt{a}}\right)^2-\left(\frac{i\sqrt{4 a c-b^2}}{2 \sqrt{a}} \right)^2}d x $$
Replacing $\frac{\sqrt{b^2-4 a c}}{2 \sqrt{a}} $ by $\frac{i\sqrt{4 a c -b^2}}{2 \sqrt{a}} $ in $(1)$ yields
$$I=\frac{1}{4 a}(2 a x+b) \sqrt{a x^2+b x+c}-\frac{b^2-4 a c}{8 a^{\frac{3}{2}}} \ln \left(2 \sqrt{a} \sqrt{a x^2+b x+c}+2 a x+b\right)+C$$
Conclusively, when $a>0$,
$$\boxed{I=\frac{1}{4 a}(2 a x+b) \sqrt{a x^2+b x+c}-\frac{b^2-4 a c}{8 a^{\frac{3}{2}}} \ln \left(2 \sqrt{a} \sqrt{a x^2+b x+c}+2 a x+b\right)+C}$$
