How to integrate : $\sqrt{\frac{a-x}{x-b}}$ Problem : 
How to integrate : $\sqrt{\frac{a-x}{x-b}}$
Unable to find the substitution for this : 
$\sqrt{\frac{a-x}{x-b}}$
Please help how to proceed ...........thanks..
 A: Just to note some useful related points, regarding @Ron's answer:
Let the integrand is as 

$$R\left(x,x^{p_1/q_1},x^{p_2/q_q},\cdots,x^{p_k/q_k}\right)$$ 

then we can use the substitution $x=t^m$ in which 

$$m=\gcd(q_1,q_2,\cdots,q_k)$$ 

and if the integrand is as the powers of $\frac{ax+b}{cx+d}$, so you can use the substitution $\frac{ax+b}{cx+d}=t^m$ in which $m$ is selected as above.
A: Why so much regress maths in simple Solutions.
I think it's a good solution.
$$\begin{align}&\int\sqrt{\frac{a-x}{x-b}}dx\\ & =\int \frac{a-x}{\sqrt{(a-x)(x-b)}} dx \\ &= \int \frac{\frac12(a+b-2x)}{\sqrt{(a-x)(x-b)}} dx+\int \frac{(\frac a2-\frac b2)}{\sqrt{(a-x)(x-b)} } dx \\ &=\sqrt{(a-x)(x-b)}+\frac{(a-b)}{2}\int\frac{dx}{\sqrt{(\frac{a+b}2)^2-(x-\frac{a+b}2)^2-ab}}\\ &=\sqrt{(a-x)(x-b)}+\frac{(a-b)}{2}\int\frac{dx}{\sqrt{{{(\frac{a-b}2)^2}}-(x-\frac{a+b}2)^2}}\\ &=\sqrt{(a-x)(x-b)}+\left(\frac{a-b}2\right)\arcsin\left(\frac{x-\frac{a+b}2}{\frac{a-b}{2}}\right)+C\end{align}$$
A: Let
$$t = \frac{a-x}{x-b}$$
Then
$$x=\frac{a+b t}{1+t}$$
and
$$dx = \frac{b-a}{(1+t)^2} dt$$
Then the integral is
$$(b-a) \int dt \frac{\sqrt{t}}{(1+t)^2}$$
Now sub $t=\tan^2{u}$ and the integral becomes
$$2 (b-a) \int du \sin^2{u} = (b-a) (u-\sin{u} \cos{u}) + C$$
Now back substitute to get the integral in terms of $x$.  I get
$$\int dx\, \sqrt{\frac{a-x}{x-b}} = \sqrt{(a-x)(x-b)} - (a-b) \arctan{\sqrt{\frac{a-x}{x-b}}}+C$$
A: First you have to define the domain of the function 
$$\frac{a-x}{x-b}\geq 0$$ 
Assume that $x>b$
$$a-x\geq x-b $$
$$x\leq \frac{a+b}{2}$$
more precisely we have 
$$2x-b\leq a$$
so $a$ has to be a positive number .
On the other hand for $x<b$
$$a-x\leq x-b $$
$$x\geq \frac{a+b}{2}$$
Once the restrictive domains are applied , apply the solution Ron provided .
A: If $a=b,$  $$\frac{a-x}{x-b}=\frac{b-x}{x-b}=-1$$
But for real calculus $$\frac{a-x}{x-b}\text{ must be }>0$$
So, $a\ne b$
Putting $x=a\cos^2y+b\sin^2y$ so that $dx=2(b-a)\sin y\cos ydy$
and  $$\frac{a-x}{x-b}=\frac{a-(a\cos^2y+b\sin^2y)}{(a\cos^2y+b\sin^2y)-b}=\frac{(a-b)\sin^2y}{(a-b)\cos^2y}=\tan^2y$$
$$\implies y=\arctan \sqrt{\frac{a-x}{x-b}}$$
$$\int\sqrt{\frac{a-x}{x-b}}dx=\int \tan y\cdot 2(b-a)\sin y\cos ydy$$
$$=(b-a)\int2\sin^2ydy=(b-a)\int(1-\cos2y)dy=(b-a)\left(y-\frac{\sin2y}2\right)+C$$
Now, $x=a\cos^2y+b\sin^2y\implies 2x=a(1+\cos2y)+b(1-\cos2y)$
$\implies \cos2y=\frac{2x-a-b}{a-b}$
$\implies \sin^22y=1-\left(\frac{2x-a-b}{a-b}\right)^2=\frac{(a-b)^2-(a+b-2x)^2}{(a-b)^2}=\frac{(a-b)^2-(a+b)^2-(2x)^2+4x(a+b)}{(a-b)^2}=\frac{4(a-x)(x-b)}{(a-b)^2}$
$\implies \sin2y=\frac{2\sqrt{(a-x)(x-b)}}{a-b} $
$x=a\cos^2y+b\sin^2y$ can be employed for $$\int\sqrt{(a-x)(x-b)}dx$$ and $$\int\frac1{\sqrt{(a-x)(x-b)}}dx$$ as well
