TITLE: How to evaluate this improper integral?
QUESTION [6 upvotes]: I got stuck when evaluating these two improper integrals:$$
\int_a^b\frac{dx}{\sqrt{(b-x)(x-a)}}
$$
and$$
\int_0^1\frac{dx}{\sqrt{x-x^3}}
$$
How to evaluate them? Thank you!

REPLY [3 votes]: Use the substitution $x = a\sin^{2}t + b\cos^{2}t$ with assumption $a < b$ to get $$(b - x)(x - a) = (b - a)^{2}\sin^{2}t\cos^{2}t$$ and the limits of integration change to $\pi/2$ and $0$ corresponding to $x = a$ and $x = b$. And finally using $$\frac{dx}{dt} = -2(b - a)\sin t\cos t$$ we get the desired integral as $$\begin{aligned}I &= \int_{a}^{b}\frac{dx}{\sqrt{(b - x)(x - a)}}\\
&= \int_{0}^{\pi/2}\frac{2(b - a)\sin t\cos t}{(b - a)\sin t\cos t}\,dt\\
&= 2\int_{0}^{\pi/2}dt = \pi\end{aligned}$$