TITLE: Proof of this integration shortcut: $\int_a^b \frac{dx}{\sqrt{(x-a)(b-x)}}=\pi$
QUESTION [11 upvotes]: I came across this as one of the shortcuts in my textbook without any proof.
When  $b\gt a$, 

$$\int\limits_a^b \dfrac{dx}{\sqrt{(x-a)(b-x)}}=\pi$$


My attempt :
I notice that the the denominator is $0$ at both the bounds. I thought of substituting $x=a+(b-a)t$ so that the integral becomes
$$\int\limits_0^1 \dfrac{dt}{\sqrt{t(1-t)}}$$
This doesn't look simple, but I'm wondering if the answer can be seen using symmetry/geometry ?

REPLY [6 votes]: Let $m = \frac{b+a}{2}$ and $r = \frac{b-a}{2}$. Consider the circle
$$ (x - m)^2 + y^2 = r^2. $$
Part of this locus with $y \geq 0$ is given by $y = \sqrt{r^2 - (x-m)^2} = \sqrt{(x-a)(b-x)}$ for $a \leq x \leq b$. By the implicit differentiation, this function satisfies $ 2(x - m) dx + 2ydy = 0 $ and hence
$$ \frac{dy}{dx} = -\frac{x-m}{y}. $$
So the length of the upper-circular arc is
$$ \pi r = \int_{a}^{b} \sqrt{1+\left(\frac{dy}{dx}\right)^2} \, dx = \int_{a}^{b} \sqrt{\frac{(x-m)^2 + y^2}{y^2}} \, dx = \int_{a}^{b} \frac{r}{\sqrt{(x-a)(b-x)}} \, dx. $$
Dividing both sides by $r$ gives the desired answer.