<s>[INST] 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..
 [/INST] 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
</s>