How to evaluate $\int\frac{x^ndx}{\sqrt{ax^2+bx+c}}$ for natural $n$ How do we evaluate the following integral?
$$\int\frac{x^ndx}{\sqrt{ax^2+bx+c}}$$
I am strictly looking for a solution for natural $n$
I wanted to try a trig substitution
$$\int\frac{x^ndx}{\sqrt{ax^2+bx+c}}=\int\frac{x^ndx}{\sqrt{a\left(\left(x+\frac{b}{2a}\right)^2+\frac{c}{a}-\frac{b^2}{4a^2}\right)}}$$$$=\int\frac{(u-\frac{b}{2a})^ndx}{\sqrt{a\left(u^2+\frac{c}{a}-\frac{b^2}{4a^2}\right)}}$$
but I didn't know how to deal with the  $(\tan\theta+k)^n$
I can accept an answer with special functions.
 A: Here's how an electrician tries to solve this problem
First, we introduce the following notation
$$X(x)=X=ax^2+bx+c$$
Then we can present the integral in the form
$$I_n=\int\frac{x^ndx}{\sqrt{X}}$$
Now, let's differentiate $x^{n-1}\sqrt{X}$ with respect to $x$
$$\frac{\mathrm{d} }{\mathrm{d} x}(x^{n-1}\sqrt{X})=an\frac{x^n}{\sqrt{X}}+b(n-\frac{1}{2})\frac{x^{n-1}}{\sqrt{X}}+c(n-1)\frac{x^{n-2}}{\sqrt{X}}$$
Here we took into account that $X=ax^2+bx+c$
Integrating the resulting equation with respect to x we can write
$$x^{n-1}\sqrt{X}=anI_n+b(n-\frac{1}{2})I_{n-1}+c(n-1)I_{n-2}$$
Set here $n=1$
$$\sqrt{X}=aI_1+\frac{b}{2}I_0$$
We're almost done.
The only thing left is to calculate
$$I_0=\int\frac{dx}{\sqrt{ax^2+bx+c}}$$
After that we can calculate the integrals $I_1,I_2...$ successively using the recurrence equation.
Further development
Let's introduce a generating function
$$I(s)=I=\sum_{n=0}^{\infty}I_ns^n$$
Now, multiply both  sides of the recurrence relation above by $s^n$ and sum over $n\geqslant 1$.
(I'll skip the long but simple algebraic transformations)
We get the following differential equation
$$(cs^2+bs+a)\frac{\mathrm{d} I}{\mathrm{d} s}+(cs+\frac{b}{2})I=\frac{\sqrt{X}}{1-xs}$$
Let's remember that $X=ax^2+bx+c$
All the family of the given integral $I_n$ is hidden in this differential equation.
But how to drag them all out, that's the problem!
A: $$\int_0^xt^r(t-a)^{-\frac12}(t-b)^{-\frac12}dt\mathop=^{t=ux}\int_0^1 (ux)^r (ux-a)^{-\frac12}(ux-b)^{-\frac12}x du=\frac{x^r}{\sqrt{ab}}\int_0^1 u^{(r+1)-1} \left(-\left(\frac xbu-1\right)\right)^{-\frac12}\left(-\left(\frac xau-1\right)\right)^{-\frac12} x du=-\frac{x^{r+1}}{\sqrt{ab}}\int_0^1 u^{(r+1)-1} \left(1-\frac xbu\right) ^{-\frac12}\left(1-\frac xau\right)^{-\frac12} du$$
Using this  Appel F$_1$ integral representation:
$$\text F_1(a;b_1,b_2;c;x,y)=\frac{\Gamma(c)}{\Gamma(a)\Gamma(c-a)}\int_0^1\frac{t^{a-1}(1-t)^{c-a-1}}{(1-xt)^{b_1}(1-yt)^{b_2}}dt$$
Therefore:
$$\boxed{\int_0^x\frac{t^r}{\sqrt{(t-a)(t-b)}}dt=\frac{x^{r+1}}{\sqrt{ab}(r+1)}\text F_1\left(r+1;\frac12,\frac12;r+2;\frac xa,\frac xb\right)}$$
Shown here in the “alternate forms“ section. For $r\in\frac{\Bbb Z}2$, the Appel function reduces to a rational function including Elliptic F and Elliptic E. Also, for $r\in\Bbb Z$, inverse trigonometric functions appear with a rational function.
