Integrating $\int_a^b\left[ \left(1 - \frac{a}{x} \right)\left(\frac{b}{x}-1 \right) \right]^\frac{1}{2}dx$ We are interested in the following integration:
$$ \int_a^b \left[ \left(1 - \frac{a}{x} \right)\left(\frac{b}{x}-1 \right) \right]^{1/2} dx. $$
I try to use substitution with:
$$u = \left(1-\tfrac{a}{x}\right)\left(\tfrac{b}{x} -1\right) = (a+b)x^{-1} - 1 - (ab)x^{-2}.$$
$$ du = \left( (-a-b)x^{-2} + (2ab)(x^{-3}) \right)dx $$ 
or
$$  dx = du \left( \left( (-a-b)x^{-2} + (2ab)(x^{-3}) \right)^{-1} \right)$$
Now the integration becomes something ugly. I try integration by parts on the ugly part, and it becomes even uglier. Obviously, I don't see some easier ways. I would appreciate some advices or the solution!
Edit: It may be easier to see the problem as
$$ \int_a^b \left[ (a-x)(x-b)x^{-2}  \right]^{1/2} dx .$$
 A: Let $0<a<b$.
By rewriting a bit we get
$$I(a,b)=\int_a^b\frac{\sqrt{(x-a)(b-x)}}x~\mathrm dx$$
Completing the square gives us
$$I(a,b)=\int_a^b\frac{\sqrt{\frac14(b-a)^2-\left(x-\frac{b+a}2\right)^2}}x~\mathrm dx$$
Substitute $\displaystyle\frac{b-a}2\sin(\theta)=x-\frac{b+a}2$ to get
$$I(a,b)=\frac{(b-a)^2}2\int_{-\pi/2}^{\pi/2}\frac{\cos^2(\theta)}{(b-a)\sin(\theta)+b+a}~\mathrm d\theta$$
By manipulating symmetry,
$$I(a,b)=\frac{(b-a)^2}4\int_0^{2\pi}\frac{\cos^2(\theta)}{(b-a)\sin(\theta)+b+a}~\mathrm d\theta$$
from which one may conclude
$$I(a,b)=\frac\pi2(\sqrt b-\sqrt a)^2$$
A: Rescale the integration range with the following variable change and the shorthand $q$
$$u = \frac{x-a}{b-a}, \>\>\>\>\>\>q=\frac{b}{a}-1$$
to simplify the original integral
$$ I = \int_a^b \left[ \left(1 - \frac{a}{x} \right)\left(\frac{b}{x}-1 \right) \right]^{1/2} dx=aq^2\int_0^1 \frac{\sqrt{u(1-u)}}{1+qu} du\tag{1}$$
Then, let $u=\sin^2 t$ to rewrite (1) as
$$ I = 2a\int_0^{\pi/2} \frac{q^2\sin^2 t\cos^2 t}{1+q\sin^2 t}dt$$
Decompose the integrand,
$$I = 2a\int_0^{\pi/2}\left( 1+q\cos^2 t-\frac{1+q}{1+q\sin^2 t}\right) dt$$
Carry out the two integrals,
$$I_1=\int_0^{\pi/2}\left( 1+q\cos^2 t\right) dt=\frac{\pi}{2}\left(1+\frac{q}{2}\right)$$
$$I_2=\int_0^{\pi/2} \frac{1+q}{1+q\sin^2 t}dt=\int_0^{\infty} \frac{(1+q)ds}{1+(1+q)s^2 }=\frac{\pi}{2}\sqrt{1+q}$$
where $s=\tan t$ is used in evaluating $I_2$. Thus,
$$I= 2a(I_1- I_2)= \frac{\pi}{2}(b+a-2\sqrt{ab})$$
