Integrating $\int_a^b\left[ \left(1 – \frac{a}{x} \right)\left(\frac{b}{x}-1 \right) \right]^\frac{1}{2}dx$

calculusdefinite integralsintegration

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 .$$

Best Answer

Rescale the integration range with the following variable $u = \frac{x-a}{b-a}$ and the shorthand $q=\frac{b}{a}-1$ to simplify the 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$$

Then, let $u=\sin^2 t$

\begin{align} I &= 2a\int_0^{\pi/2} \frac{q^2\sin^2 t\cos^2 t}{1+q\sin^2 t}dt\\ &= 2a\int_0^{\pi/2}\left( 1+q\cos^2 t-\frac{1+q}{1+q\sin^2 t}\right) dt \end{align}

where

$$\int_0^{\pi/2}\left( 1+q\cos^2 t\right) dt=\frac{\pi}{2}\left(1+\frac{q}{2}\right)$$

$$\int_0^{\pi/2} \frac{1+q}{1+q\sin^2 t}dt=\int_0^{\infty} \frac{(1+q) d(\tan t)}{1+(1+q)\tan^2 t}=\frac{\pi}{2}\sqrt{1+q}$$

Thus

$$I= \frac{\pi}{2}(b+a-2\sqrt{ab})$$