Prove $\int_a^b \frac{1}{x}\sqrt{-(x-a)(x-b)}dx = (\frac{a+b}{2}-\sqrt{ab})\pi$ Does anyone know how to solve $$\int_a^b \frac{1}{x}\sqrt{-(x-a)(x-b)}dx$$
After trying Wolfram Alpha, I conclude that it possibly equals $(\frac{a+b}{2}-\sqrt{ab})\pi = \frac{(\sqrt{a}-\sqrt{b})^2}{2}\pi$.
The book I am reading says one can use residue theorem to quickly obtain the result, but the details are not written and I cannot figure out the solution.
P.S. One can prove from this integral that arithmetic mean $\geq$ geometric mean.

Let $x=a\cos^2 t+b \sin^2 t  \implies dx=(b-a) \sin 2t dt$
Then $$I=2\int_{0}^{\pi/2} \frac{(b-a)^2 \sin^2 t \cos^2 tdt}{a \cos^2 t+b \sin^2t}= 2 (b-a)^2 \int_{0}^{\pi/2}\frac{ \sin^2 t ~dt}{a+b\tan^2 t}$$
Let $\tan t=u$, then
$$I=2\int_{0}^{\infty} \frac{u^2 du}{(1+u^2)^2(a+bu^2)}=2\int_{0}^{\infty} du \left(\frac{b-a}{(1+u^2)^2}+\frac{a}{1+u^2}-\frac{ab}{a+bu^2}\right)$$
$$\implies I=\left. (b-a)\left(\frac{u}{1+u^2}+\tan^{-1}u\right)+2a \tan^{-1}u -2\sqrt{ab} ~\tan^{-1}\frac{u\sqrt{b}}{\sqrt{a}} \right|_{0}^{\infty}=\left(\frac{a+b}{2}-\sqrt{ab} \right) \pi $$
I will get back.
