Different ways to tackle the integral $\int_0^1\sqrt\frac x{1-x}\,dx$

Here it is an entirely different approach, through Fourier-Legendre series expansions.
By the generating function for shifted Legendre polynomials, for any $x\in(0,1)$ we have:

$$ \sqrt{x}=\sum_{n\geq 0}\frac{2(-1)^n}{(1-2n)(2n+3)}\,P_n(2x-1), $$ $$ \frac{1}{\sqrt{1-x}}=\sum_{n\geq 0} 2\,P_n(2x-1), $$ hence by the orthogonality relations it follows that

$$\begin{eqnarray*} \int_{0}^{1}\sqrt{\frac{x}{1-x}}\,dx &=& \sum_{n\geq 0}\frac{4(-1)^{n+1}}{(2n-1)(2n+1)(2n+3)}\\&=&\frac{1}{2}\sum_{n\geq 0}(-1)^{n+1}\left[\frac{1}{2n-1}-\frac{2}{2n+1}+\frac{1}{2n+3}\right]\\ &\stackrel{\text{SBP}}{=}& 2\sum_{n\geq 0}\left[\frac{1}{4n+1}-\frac{1}{4n+3}\right]=2\arctan 1=\color{blue}{\frac{\pi}{2}}. \end{eqnarray*}$$ This technique has a large number of interesting applications, especially about integrals involving $K(k)$ or $E(k)$, which are naturally associated with (shifted) Legendre polynomials.


Yet another approach. By enforcing the substitution $\frac{x}{1-x}\mapsto u^2$ we are left with

$$ 2\int_{0}^{+\infty}\frac{du}{(1+u^2)^2}=-2\left.\frac{d}{da}\int_{0}^{+\infty}\frac{du}{a+u^2}\right|_{a=1}=-\left.\frac{d}{da}\frac{\pi}{\sqrt{a}}\right|_{a=1}=\frac{\pi}{2}.$$


Here is another way that involves rationalising the numerator first.

For $0 \leqslant x < 1$ we can write \begin{align*} \int_0^1 \sqrt{\frac{x}{1 - x}} \, dx &= \int_0^1 \sqrt{\frac{x}{1 - x}} \cdot \frac{\sqrt{x}}{\sqrt{x}} \, dx\\ &= \int^1_0 \frac{x}{\sqrt{x - x^2}} \, dx \end{align*} Now rewriting the numerator as the derivative of the denominator we have \begin{align*} \int_0^1 \sqrt{\frac{x}{1 - x}} \, dx &= -\frac{1}{2} \int^1_0 \frac{(1 - 2x) - 1}{\sqrt{x - x^2}} \, dx\\ &= -\frac{1}{2} \int^1_0 \frac{1 - 2x}{\sqrt{x - x^2}} \, dx + \frac{1}{2} \int^1_0 \frac{dx}{\sqrt{x - x^2}} \, dx\\ &= I_1 + I_2 \end{align*} The first of these integrals can be found using a substitution of $x = u + 1/2$. The result is $$I_1 = \int^{1/2}_{-1/2} \frac{u}{\sqrt{1/4 - u^2}} \, du = 0,$$ as the integrand is odd between symmetric limits.

The second integral can be found by first completing the square. As $$x - x^2 = \frac{1}{4} - \left (x - \frac{1}{2} \right )^2,$$ we have $$I_2 = \frac{1}{2} \int^1_0 \frac{dx}{\sqrt{\frac{1}{2^2} - \left (x - \frac{1}{2} \right )^2}} \, dx = \frac{1}{2} \sin^{-1} (2x - 1) \Big{|}^1_0 = \frac{\pi}{2}.$$ Thus $$\int_0^1 \sqrt{\frac{x}{1 - x}} \, dx = \frac{\pi}{2}.$$


The standard way for rational functions $f\biggl(x,\sqrt{\dfrac{ax+b}{cx+d}}\biggr)$ consists in setting $t=\sqrt{\dfrac{ax+b}{cx+d}}$. So we'll set $$t=\sqrt{\frac{x}{1-x}}\iff x=\frac{t^2}{1+t^2},\qquad \mathrm dx=\frac{2t}{(1+t^2)^2}\,\mathrm dt.$$ The integral becomes $$\int_0^1\sqrt{\frac{x}{1-x}}\,\mathrm dx=2\int_0^{+\infty}\frac{t^2\,\mathrm dt}{(1+t^2)^2}=2\biggl(\int_0^{+\infty}\frac{\mathrm dt}{1+t^2}-\int_0^{+\infty}\frac{\mathrm dt}{(1+t^2)^2}\biggr).$$ Now it is well-known the standard integrals $\;I_n=\displaystyle\int\frac{\mathrm dt}{(1+t^2)^n}$ can be computed recursively: in the present case, integrating by parts $I_1=\arctan x$, we'll obtain the following relation between $I_1$ and $I_2$: $$I_2=\frac{t}{2(1+t^2)}+\frac12I_1,\enspace\text{so }\quad I_1-I_2=\frac12\Bigl(\arctan t-\frac{t}{1+t^2}\Bigr)$$ and finally $$\int_0^1\sqrt{\frac{x}{1-x}}\,\mathrm dx=\arctan t -\frac{t}{1+t^2}\Biggm\vert_0^{\infty}=\frac\pi2.$$