<s>[INST] How evaluate the following hard integrals? Prove:

$$\displaystyle\int_0^{\frac{\pi}{4}}{\,x}{\,\arctan\sqrt{\frac{\cos2x}{2\sin^2x}}}dx=\frac{\pi}{96}[{\pi^2}-6\ln^22]$$
   And  $$\displaystyle\int_0^{\frac{\pi}{4}}{\,x}{\,\arctan\sqrt{\frac{2\sin^2x}{\cos2x}}}dx=\frac{\pi}{192}[{\pi^2}+12\ln^22]$$
   These integrals have been proposed by my friend,but I do not know how to proceed.
   How do you evaluate these integral?

 [/INST] Denote the first integral by $I$ and the second by $J$. Then,
$$\begin{aligned}
J=&\int_0^{\pi/4} x\left(\frac{\pi}{2}-\arctan\sqrt{\frac{\cos 2x}{2\sin^2 x}}\right)\,dx \\ 
=&\frac{\pi^3}{64}-I \,\,\,\,\,\,\,(1)
\end{aligned}$$
$I$ can be simiplified to:
$$I=\int_0^{\pi/4} x\arccos(\sqrt{2}\sin x)\,dx=\left(\frac{x^2\arccos(\sqrt{2}\sin x)}{2}\right|_0^{\pi/4}+\frac{1}{2}\int_0^{\pi/4} \frac{x^2\left(\sqrt{2}\cos x\right)}{\sqrt{1-2\sin^2x}}\,dx$$
The first term is zero and with the substitution $2\sin^2x=\sin^2\theta$,
$$I=\frac{1}{2}\int_0^{\pi/2} \left(\arcsin\left(\frac{\sin \theta}{\sqrt{2}}\right)\right)^2\,d\theta$$
From here, 
$$\frac{\arcsin x}{\sqrt{1-x^2}}=\sum_{n=0}^{\infty} \frac{(2n)!!}{(2n+1)!!}x^{2n+1}$$
Integrate both sides within the limit $0$ to $\sin\theta/\sqrt{2}$, i.e:
$$\begin{aligned}
I &=\frac{1}{2}\sum_{n=0}^{\infty} \frac{1}{2^{n+1}(n+1)}\frac{(2n)!!}{(2n+1)!!}\int_0^{\pi/2} \sin^{2n+2}\theta\,d\theta \\
&=\frac{1}{2}\sum_{n=0}^{\infty} \frac{1}{2^{n+1}(n+1)}\frac{(2n)!!}{(2n+1)!!}\frac{(2n+1)!! \pi}{2^{n+2}(n+1)!}\\
&=\frac{\pi}{8}\sum_{n=0}^{\infty}\frac{1}{2^{n+1}(n+1)^2} \,\,\,\,\,\,\,\,\,\left((2n)!!=2^nn!\right) \\
&=\frac{\pi}{8}\text{Li}_2\left(\frac{1}{2}\right) \\
\end{aligned}$$
Hence,
$$\boxed{I=\dfrac{\pi}{96}\left(\pi^2-6\ln^22\right)}$$
and from $(1)$,
$$\boxed{J=\dfrac{\pi}{192}\left(\pi^2+12\ln^2 2\right)}$$
</s>