How to compute $\int_0^{\frac{\pi}{2}}\frac{\arctan(\sqrt{\tan(x)})}{\tan(x)}dx$

$$\begin{align} \int_{0}^{\frac{\pi}{2}}\frac{\arctan\left(\sqrt{\tan\left(x\right)}\right)}{\tan\left(x\right)}dx &= \frac{1}{2}\int_{0}^{\pi}\frac{\arctan\left(\sqrt{\tan\left(\frac{x}{2}\right)}\right)}{\tan\left(\frac{x}{2}\right)}dx \\&\stackrel{(1)}{=}\int_{0}^{\infty}\frac{\arctan\left(\sqrt{t}\right)}{t\left(1+t^{2}\right)}dt \\&=2\int_{0}^{\infty}\frac{\arctan u}{u\left(1+u^{4}\right)}du \\&\stackrel{(2)}{=}2\int_{0}^{\infty}\int_{0}^{1}\frac{1}{1+u^{2}t^{2}}\frac{1}{1+u^{4}}dtdu \\&\stackrel{(3)}{=}2\int_{0}^{1}\int_{0}^{\infty}\frac{1}{1+u^{2}t^{2}}\frac{1}{1+u^{4}}dudt \\&\stackrel{(4)}{=}2\int_{0}^{1}\frac{1}{1+t^{4}}\int_{0}^{\infty}\left(\frac{1}{1+u^{4}}+\frac{t^{4}}{t^{2}u^{2}+1}-\frac{t^{2}u^{2}}{1+u^{4}}\right)dudt \\&=2\int_{0}^{1}\frac{1}{1+t^{4}}\left(\frac{\pi}{2\sqrt{2}}+\frac{\pi t^{3}}{2}-\frac{\pi t^{2}}{2\sqrt{2}}\right)dt \\&= \frac{\pi}{\sqrt{2}}\int_{0}^{1}\left(\frac{1-t^{2}}{1+t^{4}}\right)dt+\pi\int_{0}^{1}\frac{t^{3}}{1+t^{4}}dt \\&=\frac{\pi}{\sqrt{2}}\frac{\operatorname{arccoth}\left(\sqrt{2}\right)}{\sqrt{2}}+\frac{\pi\log\left(2\right)}{4} \\&=\frac{\pi}{4}\log\left(6+4\sqrt{2}\right) = \frac{\pi}{2}\log\left(2+\sqrt{2}\right) \end{align}$$ Where:

$(1)$ is the Weirstrass Subsitution

$(2)$ is using the fact $\frac{\arctan{x}}{x} = \int_0^1 \frac{du}{1+x^2 u^2} $

$(3)$ is interchanging integrals via Fubini's Theorem (our integrand is positive and decays rapidly)

$(4)$ is a partial fraction decomposition


Here is an alternative solution to the proposed integral


We first introduce the following parameter:$$I(k)=\int_{0}^{\pi/2}\frac{\arctan(k\sqrt{\tan t})}{\tan t}dt$$ Clearly the desired integral is $I(1)$. We now differentiate under the integral sign: $$I'(k) = \int_{0}^{\pi /2}\frac{dt}{\sqrt{\tan t}\left(k^2\tan t+1\right)}$$ Letting $\tan(t) \mapsto t$ we have $$I'(k)=\int_{0}^{\infty}\frac{dt}{\sqrt{t}\left(k^2t+1\right)\left(1+t^2\right)}$$ Via an easy partial fraction decomposition followed by some basic integration, we conclude $$I'(k)=\frac{2\pi k^3-\sqrt{2}\pi\left(k^2-1\right)}{2\left(k^4+1\right)}$$ Note the resemblance to the integrand on the third-from-last line in my other answer—this is not accidental. The same (not very difficult) integrations show $$I(k)=\frac{\pi}{2}\log\left(k^2+k\sqrt{2}+1\right)$$ So we find $$I(1) = \frac{\pi}{2}\log\left(2+\sqrt{2}\right)$$