This integral equals $\pi$ because it secretly measures an angle tracing out a semicircle:
$$ \int_\alpha^\beta \frac{dx}{\sqrt{(\beta - x)(x - \alpha)}} = \pi . $$
A while back, I wrote a short post about the above integral, which is one of my favorite integrals. In that post, I showed how to solve it by completing the square under the square root, and then using a variable substitution. This transforms the integral into a common trigonometric integral. However, I noted that this approach doesn’t offer geometric intuition for why the result is $\pi$.
It turns out that this integral is exactly equivalent to an angular integral over a semicircle! Here is one way to see it. Start by drawing a circle with the diameter going from $\alpha$ to $\beta$, as in the diagram below.
Circle with diameter $[\alpha, \beta]$; $m$ is the midpoint, $r$ the radius, $P(x, y)$ a point on the upper semicircle, and $\theta$ the central angle.
Using the standard trigonometric parametrization of a circle with the angle $\theta$ as labeled in the diagram, we have
$$ \begin{aligned} r \cos{\theta} &= x - m \newline r \sin{\theta} &= y, \end{aligned} $$
where the radius $r = (\beta - \alpha)/2$, and $m$ is the midpoint of the diameter ($m = (\alpha + \beta)/2$). Since $\sin^2{\theta} + \cos^2{\theta} = 1$,
$$ \frac{y^2}{r^2} + \frac{(x - m)^2}{r^2} = 1. $$
Solving this equation for $y^2$ gives
$$ y^2 = r^2 - (x - m)^2. $$
Plugging in for $m$ and $r$ in terms of $\alpha$ and $\beta$, this becomes
$$ y^2 = -x^2 + x(\alpha + \beta) - \alpha \beta = (\beta - x)(x - \alpha). $$
On the upper semicircle, we can take the positive root for $y$, giving
$$ y = \sqrt{(\beta - x)(x - \alpha)}. $$
This looks very promising! We can now say the following:
$$ \int_\alpha^\beta \frac{dx}{\sqrt{(\beta - x)(x - \alpha)}} = \int_\alpha^\beta \frac{dx}{y(x)}, $$
where $y(x)$ is defined as the height of the point $P$ corresponding to $x$ on the upper semicircle in the diagram. Using the angular parametrization of the circle again, we have
$$ x = m + r \cos{\theta}, $$
so that
$$ dx = -r \sin{\theta}\; d\theta = -r \left(\frac{y}{r}\right) d\theta = -y\; d\theta . $$
This is the key differential for the change to an angular integration: $dx/y = -d\theta$. Looking at the limits of the integral, when $x = \alpha$, $\theta = \pi$, and when $x = \beta$, $\theta = 0$. Putting this all together, we have
$$ \int_\alpha^\beta \frac{dx}{\sqrt{(\beta - x)(x - \alpha)}} = \int_\alpha^\beta \frac{dx}{y(x)} = \int_\pi^0 -d\theta = \int_0^\pi d\theta. $$
So the original integral is equivalent to integrating over the angle as it sweeps out a semicircle, which is obviously $\pi$! I think this is a very neat result: there is a “hidden” circle in the original integral, which when uncovered makes it obvious that the answer is $\pi$.