Which is the easiest way to evaluate $\int \limits_{0}^{\pi/2} (\sqrt{\tan x} +\sqrt{\cot x})$?

$${\int_0^{\frac{\pi}{2}} \sqrt{\tan x}dx + \sqrt{\cot x}dx}$$ $$={\int_0^{\frac{\pi}{2}}\frac{\sin x + \cos x}{\sqrt{\sin x \cos x}}dx = \int_0^{\frac{\pi}{2}} \frac{\sin x + \cos x}{\frac{\sqrt{2\sin{x}\cos{x}}}{\sqrt{2}}}dx = \sqrt{2}\int_0^{\frac{\pi}{2}} \frac{ \sin{x} + \cos{x}}{\sqrt{1 - (1 - 2 \sin{x} \cos{x})}}dx}$$ $${=\sqrt{2}\int_0^{\frac{\pi}{2}} \frac{ \sin{x} + \cos{x}}{\sqrt{1 - (\sin{x} - \cos{x})^2}}dx}$$

Let ${t = \sin{x} - \cos{x}}$, $\Large {{\small{dx}} = \frac{dt}{\sin{x} + \cos{x}}}$ $${x \to \frac{\pi}{2} \implies t = (\sin{x} - \cos{x}) \to 1}$$ $${x \to 0 \implies t = (\sin{x} - \cos{x}) \to -1}$$

$$\sqrt{2}\int_{-1}^{1} \frac{1}{\sqrt{1 - t^2}}dt = \sqrt{2}\left[\sin^{-1}{t}\right]_{-1}^{1} = \sqrt{2}\left[\frac{\pi}{2} - \left(- \frac{\pi}{2} \right) \right] = \sqrt{2} \pi $$


I think this might be the simplest approach.


I would argue the easiest way is to use the Gamma function. Notice that by making the change $x=\sin^2(u)$ we get that $$\int_0^1 x^{-\frac{1}{4}}(1-x)^{-\frac{3}{4}}dx=2\int_0^{\pi/2}\sqrt{\tan(x)}dx$$ Then this is $$B\left(\frac{1}{4},\frac{3}{4}\right)=\Gamma\left(\frac{1}{4}\right)\Gamma\left(\frac{3}{4}\right)=\frac{\pi}{\sin\left(\frac{\pi}{4}\right)}=\sqrt{2}\pi.$$


Let $u=\sqrt{\tan(x)}$. Then $u^2 = \tan(x)$ and $2 u \mathrm{d} u = (1+ \tan^2(x)) \mathrm{d} x$. Thus $$ \int_0^{\frac{\pi}{2}} \sqrt{\tan(x)} \mathrm{d} x = \int_0^\infty \frac{2u^2}{1+u^4} \mathrm{d} u $$ Since $1+u^4 = (1 + \sqrt{2} u + u^2)( 1- \sqrt{2} u + u^2)$, partial fraction decomposition applies: $$ \frac{2u^2}{1+u^4} = \frac{1}{\sqrt{2}} \left( \frac{u}{u^2-\sqrt{2} u+1}-\frac{u}{u^2+\sqrt{2} u+1} \right) $$ Hence $$ \begin{eqnarray} \int \frac{2u^2}{1+u^4} \mathrm{d} u &=& \frac{1}{2 \sqrt{2}} \log \left(\frac{u^2-\sqrt{2} u+1}{u^2+\sqrt{2} u+1}\right) + \\ &\phantom{=}& \frac{\tan ^{-1}\left(\sqrt{2} u+1\right) -\tan ^{-1}\left(1-\sqrt{2} u\right) }{\sqrt{2}} \end{eqnarray} $$ Applying the fundamental theorem of calculus: $$ \int_0^{\pi/2} \sqrt{\tan(x)} \mathrm{d} x = \frac{\pi}{\sqrt{2}} $$