How to compute $\int_a^b (b-x)^{\frac{n-1}{2}}(x-a)^{-1/2}dx$? I wonder how to compute the following integral (for any natural number $n\geq 0$):
$$\int_a^b (b-x)^{\frac{n-1}{2}}(x-a)^{-1/2}dx.$$
Does anyone know the final answer and how to get there? Is there a trick?
Thank you very much!
 A: Hint:
$$\int_0^1 dt\: t^{m-1} (1-t)^{n-1} = \frac{\Gamma(m) \Gamma(n)}{\Gamma(m+n)}$$
A: $$I=\int_a^b\frac{\sqrt{b-x}^{\,n}}{\sqrt{(b-x)(x-a)}}\,dx$$
$$x=a\cos^2 t+b\sin^2 t:$$
$$\begin{align*}I&=\int_0^{\pi/2}\frac{2(b-a)\cos t\sin t\cdot\sqrt{(b-a)\cos^{2}t}^{\,n}}{\sqrt{(b-a)^2\cos^2 t\sin^2 t}}\,dt\\[7pt]&=2\sqrt{b-a}^{\,n}\int_0^{\pi/2}\cos^{n}t\,dt\\[7pt]&= \left\{ 
  \begin{array}{l l}
    \pi\sqrt{b-a}^{\,n}\frac{1\cdot 3\cdots (n-1)}{2\cdot 4\cdots n}\quad(n\;\text{even})\\[7pt]
    2\sqrt{b-a}^{\,n}\frac{2\cdot 4\cdots (n-1)}{1\cdot 3\cdots n}\quad(n\;\text{odd})
  \end{array} \right.\end{align*}$$
$$\star$$
The latter integral is well known, and can easily be evaluated by parts:
$$\begin{align*}I_n=\int_0^{\pi/2}\cos^nt\,dt\Rightarrow I_n&=(n-1)\int_0^{\pi/2}\sin^2 t\cos^{n-2}t\,dt\\[7pt]&=(n-1)I_{n-2}-(n-1)I_{n}\\[7pt]&\qquad\Rightarrow I_n=\frac{n-1}{n}I_{n-2}\\[7pt]&\qquad\qquad\Rightarrow\left\{ 
  \begin{array}{l l}
    I_n=\frac{1\cdot 3\cdots (n-1)}{2\cdot 4\cdots n}I_0\;(n\;\text{even})\\[7pt]
    I_n=\frac{2\cdot 4\cdots (n-1)}{1\cdot 3\cdots n}I_1\;(n\;\text{odd})\end{array}\right. \\[7pt]&\qquad\qquad\qquad\big(I_0=\dfrac{\pi}{2}\,\;\;I_1=1\big)\end{align*}$$
A: Let $x=(b-a)t+a$, then $b-x=(b-a)(1-t)$, $x-a=(b-a)t$, and $\mathrm{d}x=(b-a)\mathrm{d}t$.
Then let $t=\sin^2(\theta)$.
$$
\begin{align}
\int_a^b(b-x)^{(n-1)/2}\,(x-a)^{-1/2}\,\mathrm{d}x
&=(b-a)^{n/2}\int_0^1(1-t)^{(n-1)/2}\,t^{-1/2}\,\mathrm{d}t\\
&=2(b-a)^{n/2}\int_0^{\pi/2}\cos^{n}(\theta)\,\mathrm{d}\theta\tag{1}
\end{align}
$$
Integration by parts yields
$$
\int_0^{\pi/2}\cos^n(\theta)\,\mathrm{d}\theta=\frac{n-1}{n}\int_0^{\pi/2}\cos^{n-2}(\theta)\,\mathrm{d}\theta\tag{2}
$$
For even $n$, we get
$$
\begin{align}
\int_0^{\pi/2}\cos^n(\theta)\,\mathrm{d}\theta&=\frac{\pi}{2^{n+1}}\binom{n}{n/2}\\
\int_a^b(b-x)^{(n-1)/2}\,(x-a)^{-1/2}\,\mathrm{d}x&=(b-a)^{n/2}\frac{\pi}{2^n}\binom{n}{n/2}\tag{3}
\end{align}
$$
For odd $n$, we get
$$
\begin{align}
\int_0^{\pi/2}\cos^n(\theta)\,\mathrm{d}\theta&=\frac{2^{n-1}}{n\binom{n-1}{(n-1)/2}}\\
\int_a^b(b-x)^{(n-1)/2}\,(x-a)^{-1/2}\,\mathrm{d}x&=(b-a)^{n/2}\frac{2^n}{n\binom{n-1}{(n-1)/2}}\tag{4}
\end{align}
$$
