TITLE: Computing $ \int_a^b \frac{x^p}{\sqrt{(x-a)(b-x)}} \mathrm dx$
QUESTION [12 upvotes]: I would like to compute the integral:
$$ \int_a^b \frac{x^p}{\sqrt{(x-a)(b-x)}} \mathrm dx$$
where $$ a<b$$ and $$ p\in\mathbb{N}$$
$$ \int_a^b \frac{x^p}{\sqrt{(x-a)(b-x)}} \mathrm dx=\frac{2}{b-a} \int_a^b \frac{x^p \mathrm dx}{\sqrt{1-\left(\frac{2x-(a+b)}{b-a}\right)^2}} $$
The substitution $x\rightarrow \frac{2x-(a+b)}{b-a}$ gives:
$$ \frac{1}{2^p} \int_{-1}^{1} \frac{((b-a)x+a+b)^p}{\sqrt{1-x^2}} \mathrm dx$$
I tried to make an integration by parts:
$$ \frac{1}{2^p}\left(2^{p-1}\pi(a^p+b^p)-p(b-a) \int_{-1}^1 \arcsin(x)((b-a)x+a+b)^{p-1} \mathrm dx \right)$$
What about the integral $$ \int_{-1}^1 \arcsin(x)((b-a)x+a+b)^{p-1} \mathrm dx $$?

REPLY [4 votes]: I would probably find it easiest to reduce the given integral to Euler's integral for Gauss's hypergeometric function:
$$
  \int_a^b \frac{ x^p \mathrm{d} x}{\sqrt{(b-x)(x-a)}} \stackrel{x = a+(b-a) u}{=} \int_0^1 \frac{(a+(b-a)u)^p }{\sqrt{u(1-u)}} \mathrm{d} u = \\ a^p \int_0^1 u^{-\frac{1}{2}} \left(1-u\right)^{-\frac{1}{2}} \left( 1- \left(1-\frac{b}{a}\right) u \right)^p \mathrm{d} u 
$$
This is the case of the Euler integral representation of the Gauss's hypergeometric function with parameters $\alpha = \frac{1}{2}$, $\gamma=1$ and $\beta = -p$  and $z=1-\frac{b}{a}$, hence
$$
  \int_a^b \frac{ x^p \mathrm{d} x}{\sqrt{(b-x)(x-a)}} = a^p \cdot \underbrace{\mathrm{B}\left(\frac{1}{2}, \frac{1}{2}\right)}_{\pi} \cdot {}_2 F_1\left(\frac{1}{2}, -p ; 1; 1 - \frac{b}{a}\right)
$$
The hypergeometric series terminates for $p\in \mathbb{N}$, and the result coincides with that of @Marvis, but the above result extends to all the complex values of $p$:
In[29]:= With[{a = 2.4, b = 3.6, p = 3.4}, 
 a^p \[Pi] Hypergeometric2F1[1/2, -p, 1, 1 - b/a]]

Out[29]= 142.388

In[30]:= With[{a = 2.4, b = 3.6, p = 3.4}, 
 NIntegrate[x^p/Sqrt[(b - x) (x - a)], {x, a, b}]]

Out[30]= 142.388