Calculation of $\int_{0}^{\frac{\pi}{4}}\tan^{-1}\sqrt{\frac{\cos 2x }{2 \cos^2 x}}dx$ Calculate 

$$ \int_{0}^{\frac{\pi}{4}}\tan^{-1}\sqrt{\frac{\cos 2x }{2 \cos^2 x}}dx$$

$\bf{My\; Try::}$ Let $\displaystyle I = \int_{0}^{\frac{\pi}{4}}\tan^{-1}\sqrt{\frac{\cos 2x }{2\cos^2 x}}dx = \int_{0}^{\frac{\pi}{4}}\frac{\pi}{2}-\int_{0}^{\frac{\pi}{4}}\cot^{-1}\sqrt{\frac{\cos 2x}{2\cos^2 x}}dx$
Using The formula $\displaystyle \tan^{-1}(x)+\cot^{-1}(x) = \frac{\pi}{2}\Rightarrow \tan^{-1}(x) = \frac{\pi}{2}-\cot^{-1}(x).$
Now Let $\displaystyle J = \int_{0}^{\frac{\pi}{4}}\cot^{-1}\sqrt{\frac{\cos 2x}{2\cos^2 x}}dx = \int_{0}^{\frac{\pi}{4}}\cot^{-1}\sqrt{\frac{\cos^2 x-\sin^2 x}{2\cos^2 x}}dx = \int_{0}^{\frac{\pi}{4}}\cot^{-1}\sqrt{\frac{1}{2}-\frac{\tan^2 x}{2}}dx$
Now How can I solve after that? Help required.
Thanks

Answer: $\displaystyle \int_{0}^{\pi/4}\tan^{-1}\sqrt{\frac{\cos 2x}{2\cos^2 x}}\,dx=\frac{\pi^2}{24}$
Proof:
We are making use of $3$ Lemmas which are (quite ) easy to prove:
1. $\displaystyle \int_{0}^{1}\frac{dx}{\sqrt{x^2+2}\left ( x^2+1 \right )}=\frac{\pi}{6} $
Proof: 
$$\begin{align*}
\int_{0}^{1}\frac{dx}{\sqrt{x^2+2}\left ( x^2+1 \right )} &\overset{x=\sqrt{2}\sinh t}{=\! =\! =\! =\! =\! =\! =\!}\int_{0}^{a}\frac{dt}{1+2\sinh^2 t} \\ 
 &= \int_{0}^{a}\frac{dt}{\cosh (2t)}=\int_{0}^{a}\frac{\cosh (2t)}{1+\sinh^2 (2t)}\,dt\\ 
 &=\frac{1}{2}\tanh^{-1}\left ( \sinh (2a) \right ) \\ 
 &=\frac{1}{2}\tanh^{-1}\left ( \sqrt{\left ( 1+2\sinh^2 a \right )^2-1} \right ) \\ 
 &= \frac{1}{2}\tanh^{-1}\sqrt{3}=\frac{\pi}{6}\\ 
\end{align*}$$
where $\displaystyle a=\sinh^{-1}\frac{1}{\sqrt{2}} $.
2. $\displaystyle \int_{0}^{\infty}\frac{dx}{\left ( x^2+a^2 \right )\left ( x^2+\beta^2 \right )}=\frac{\pi}{2a\beta\left ( a+\beta \right )}$
Proof:
$$\begin{align*}
\int_{0}^{\infty}\frac{dx}{\left ( x^2+a^2 \right )\left ( x^2+\beta^2 \right )} &=\int_{0}^{\infty}\frac{1}{\beta^2-a^2}\left ( \frac{1}{x^2+a^2}-\frac{1}{x^2+\beta^2} \right )\,dx \\ 
 &= \frac{1}{\beta^2-a^2}\left ( \frac{\pi}{2a}-\frac{\pi}{2\beta} \right )\\ 
 &= \frac{\pi}{2a\beta\left ( a+\beta \right )}\\ 
\end{align*}$$
3. It also holds by definition that: $\displaystyle \tan^{-1}a= \int_{0}^{1}\frac{a}{1+a^2x^2}\,dx$. 
And now we are ready to evaluate the integral. Successively we have:
$$\begin{align*}
\int_{0}^{\pi/4}\tan^{-1}\sqrt{\frac{\cos 2\theta}{2\cos^2 \theta}}\,d\theta &=\int_{0}^{\pi/4}\int_{0}^{1}\frac{\sqrt{\frac{\cos 2\theta}{2\cos^2 \theta}}}{1+\left ( \frac{\cos 2\theta}{2\cos^2 \theta} \right )x^2}\,dx \,d\theta\\ 
 &= \int_{0}^{1}\int_{0}^{\pi/4}\frac{\sqrt{1-2\sin^2 \theta}}{2-2\sin^2 \theta+\left ( 1-2\sin^2 \theta \right )x^2}\sqrt{2}\cos \theta \,\,d\theta \,dx\\ 
 &=\int_{0}^{1}\int_{0}^{\pi/2}\frac{\sqrt{1-\sin^2 \phi}}{2-\sin^2 \phi+\left ( 1-\sin^2 \phi \right )x^2}\cos \phi \,\,d\phi \,dx \\ 
 &=\int_{0}^{1}\int_{0}^{\pi/2}\frac{\cos^2 \phi}{\sin^2 \phi+\left ( x^2+2 \right )\cos^2 \phi}\,\,d\phi \,dx \\ 
 &=\int_{0}^{1}\int_{0}^{\pi/2}\frac{d\phi \,dx}{\tan^2 \phi+x^2+2}=\int_{0}^{1}\int_{0}^{\infty}\frac{dx\,dx}{\left ( y^2+x^2+2 \right )\left ( y^2+1 \right )} \\ 
 &=\frac{\pi}{2}\int_{0}^{1}\frac{dy}{\left ( 1+\sqrt{2+y^2} \right )\sqrt{2+y^2}} \\ 
 &=\frac{\pi}{2}\left ( \frac{\pi}{4}-\frac{\pi}{6} \right )=\frac{\pi^2}{24} 
\end{align*}$$
which checks numerically with the answer given above.
If I have any typos, because I typed it so quickly please let me know so that I correct them.
T:
