How can I integrate $\int\sqrt{\frac{x^2+bx+c}{x^2+ex+f}}dx?$ How can I integrate
$$\int\sqrt{\dfrac{x^2+bx+c}{x^2+ex+f}}\,dx?$$ I was thinking a substitution $$t=\frac{x^2+bx+c}{x^2+ex+f},$$ which inverts as follows:
$$(x^2+ex+f)t=x^2+bx+c$$
$$(t-1)x^2+(et-b)x+ft-c=0$$
$$x=\dfrac{b-et+\sqrt{(b-et)^2-4(t-1)(ft-c)}}{2(t-1)},$$ but I've never really dealt with integrals of this complexity with the aim of finding a closed form in terms of fundamental integral functions. The best I could do is expand the integrand as a not-so-nice power series.
 A: Rewriting the integrand gives
$$\int \frac{x^2 + b x + c}{\sqrt{(x^2 + b x + c)(x^2 + e x + f)}} \,dx ,$$
and---except when the quartic under the radical has a repeated root---definite integrals of functions of this form are elliptic integrals, which usually cannot be expressed in terms of elementary functions. In general these integrals can be decomposed via reduction formula to combinations of $3$ normal forms of elliptic integrals, namely, incomplete elliptic integrals of the first ($F$), second ($E$), and third ($\Pi$) kinds. Maple produces a general expression in terms of these functions and the the arbitrary coefficients $b, c, e, f$, but the formula is too large to reproduce here, even if you first apply a suitable affine change of variables to put the integral in the form $$\int \sqrt{\frac{(x - h)^2 \pm k}{x^2 \pm' 1}}\,dx .$$ For the special case $h = 0$ (which occurs iff $b = e$), $\pm = -$, $\pm' = -$, at least, we have the compact elliptical integral expression
$$\int\sqrt\frac{x^2 - k^2}{x^2 - 1} \,dx = k E \left(x, \frac{1}{k}\right) + C .$$
The above considerations leaves just the special cases when the quartic has a repeated root, and all such cases can be managed with standard techniques. The $3$ essential cases are:

*

*The repeated roots are the roots of $x^2 + b x + c$, so that the integral is essentially $$\int \frac{x + p}{\sqrt{x^2 + e x + f}} \,dx .$$

*The repeated roots are the roots of $x^2 + d x + e$, so that the integral is essentially $$\int \frac{\sqrt{x^2 + b x + c}}{x + q} \,dx .$$

*The quadratics $x^2 + b x + c$ and $x^2 + e x + f$ have a common root, so that the integral is essentially $$\int \sqrt{\frac{x + r}{x + s}} \,dx .$$
The first two cases can be handled using either an appropriate (hyperbolic) trigonometric substitution, depending on the sign of the discriminant $e^2 - 4f$, resp. $b^2 - 4c$, of the remaining quadratic, or Euler substitution. (If the discriminant is zero, the integrand is just a ratio of linear functions.) In the third case the rationalizing substitution $u = \sqrt{\frac{x + r}{x + s}}$ transforms the integral into $$2 (s - r) \int \frac{u^2}{(u - 1)^2} \,du ,$$ which can be managed using the method of partial fractions.
A: Going off of Travis Willse's answer, I notice that
$$\int \frac{x^2+ax+b}{\sqrt{x^4+\alpha x^2+\beta x+\gamma}}dx$$ can be addressed as follows:
Since $$\frac{1}{\sqrt{x^4+\alpha x^2+\beta x+\gamma}}=\sum_{p,q,r\geqslant 0 }\binom{-\frac{1}{2}}{p,q,r,-\frac{1}{2}-p-q-r}\alpha^{q}\beta^r\gamma^{-\frac{1}{2}-p-q-r}x^{4p+2q+r},$$ we have
$$\int \frac{x^2+ax+b}{\sqrt{x^4+\alpha x^2+\beta x+\gamma}}dx=\int \sum_{p,q,r\geqslant 0 }\binom{-\frac{1}{2}}{p,q,r,-\frac{1}{2}-p-q-r}\alpha^{q}\beta^r\gamma^{-\frac{1}{2}-p-q-r}x^{4p+2q+r}(x^2+ax+b) dx\\=\boxed{\sum_{p,q,r\geqslant 0 }\binom{-\frac{1}{2}}{p,q,r,-\frac{1}{2}-p-q-r}\alpha^{q}\beta^r\gamma^{-\frac{1}{2}-p-q-r}\left(\frac{x^{4p+2q+r+3}}{4p+2q+r+3}+\frac{ax^{4p+2q+r+2}}{4p+2q+r+2}+\frac{bx^{4p+2q+r}}{4p+2q+r}\right) +C}$$ However, this is not the answer I'm looking for, but I put it here just so that it's out there to inspire someone.
