$\int_0^{\pi/2}\log^2(\cos^2x)\mathrm{d}x=\frac{\pi^3}6+2\pi\log^2(2)$??? I saw in a paper by @Jack D'aurizio the following integral
$$I=\int_0^{\pi/2}\log^2(\cos^2x)\mathrm{d}x=\frac{\pi^3}6+2\pi\log^2(2)$$
Below is my attempt.
$$I=4\int_0^{\pi/2}\log^2(\cos x)\mathrm{d}x$$
Then we define
$$F(a)=\int_0^{\pi/2}\log^2(a\cos x)\mathrm{d}x$$
So we have
$$F'(a)=\frac2a\int_0^{\pi/2}\log(a\cos x)\mathrm{d}x$$
Which I do not know how to compute. How do I proceed? Thanks.

\begin{align}J=\int_0^{\frac{\pi}{2}} \ln^2\left(\cos x\right)\,dx\end{align}
Observe that,
\begin{align}I&=4J\\
J&=\int_0^{\frac{\pi}{2}} \ln^2\left(\sin x\right)\,dx\\
\int_0^{\frac{\pi}{2}} \ln\left(\sin x\right)\,dx&=\int_0^{\frac{\pi}{2}} \ln\left(\cos x\right)\,dx
\end{align}
(change of variable $y=\dfrac{\pi}{2}-x$  )
\begin{align}
K&=\int_0^{\frac{\pi}{2}} \ln^2 \left(2\sin x\cos x\right)\,dx\\
&=\int_0^{\frac{\pi}{2}} \ln^2 \left(\sin\left(2x\right)\right)\,dx\\
\end{align}
Perform the change of variable $y=2x$,
\begin{align}
K&=\frac{1}{2}\int_0^{\pi} \ln^2 \left(\sin x\right)\,dx\\
&=\frac{1}{2}\int_0^{\frac{\pi}{2}} \ln^2 \left(\sin x\right)\,dx+\frac{1}{2}\int_{\frac{\pi}{2}}^\pi \ln^2 \left(\sin x\right)\,dx\\
\end{align}
In the latter integral perform the change of variable $y=\dfrac{\pi}{2}-x$ and recall $\sin\left(\pi-x\right)=\sin x$ for $x$ real,
\begin{align}
K&=\int_0^{\frac{\pi}{2}} \ln^2 \left(\sin x\right)\,dx\\
&=\int_0^{\frac{\pi}{2}} \ln^2 \left(\cos x\right)\,dx\\
&=J
\end{align}
On the other hand,
\begin{align}
K&=\int_0^{\frac{\pi}{2}}\left(\ln 2+\ln(\sin x)+\ln(\cos x)\right)^2 \,dx\\
&=\frac{\pi}{2}\ln^2 2+\int_0^{\frac{\pi}{2}}\ln^2(\sin x)\,dx+\int_0^{\frac{\pi}{2}}\ln^2(\cos x)\,dx+2\ln 2\int_0^{\frac{\pi}{2}}\ln(\cos x)\,dx+\\
&2\ln 2\int_0^{\frac{\pi}{2}}\ln(\sin x)\,dx+2\int_0^{\frac{\pi}{2}}\ln(\sin x)\ln(\cos x)\,dx\\
&=\frac{\pi}{2}\ln^2 2+2J+4\ln 2\int_0^{\frac{\pi}{2}}\ln(\cos x)\,dx+2\int_0^{\frac{\pi}{2}}\ln(\sin x)\ln(\cos x)\,dx\\
\end{align}
\begin{align}L&=\int_0^\infty \frac{\ln^2 x}{1+x^2}\,dx\end{align}
Perform the change of variable $x=\tan y$,
\begin{align}L&=\int_0^{\frac{\pi}{2}} \ln^2\left(\tan x\right)\,dx\\
&=\int_0^{\frac{\pi}{2}}\left(\ln\left(\sin x\right)-\ln\left(\cos x\right)\right)^2\,dx\\
&=2J-2\int_0^{\frac{\pi}{2}}\ln(\sin x)\ln(\cos x)\,dx\\
\end{align}
Therefore,
\begin{align}K+L&=\frac{\pi}{2}\ln^2 2+4J+4\ln 2\int_0^{\frac{\pi}{2}}\ln(\cos x)\,dx
\end{align}
Therefore (recall $K=J$), 
\begin{align}J&=\frac{1}{3}L-\frac{\pi}{6}\ln^2 2-\frac{4}{3}\ln 2\int_0^{\frac{\pi}{2}}\ln(\cos x)\,dx\end{align}
On the other hand,
\begin{align}L&=\int_0^1 \frac{\ln^2 x}{1+x}\,dx+\int_1^\infty \frac{\ln^2 x}{1+x}\,dx\end{align}
In the latter integral perform the change of variable $y=\dfrac{1}{x}$,
\begin{align}L&=2\int_0^1 \frac{\ln^2 x}{1+x}\,dx\end{align}
But it is well known that,
\begin{align}\int_0^1 \frac{\ln^2 x}{1+x^2}\,dx&=\frac{\pi^3}{16}\\
\int_0^{\frac{\pi}{2}}\ln(\cos x)\,dx&=-\frac{1}{2}\pi\ln 2
\end{align}
Therefore,
\begin{align}J&=\frac{\pi^3}{24}-\frac{\pi}{6}\ln^2 2-\frac{4}{3}\ln 2\times -\frac{1}{2}\pi\ln 2\\
&=\boxed{\frac{\pi^3}{24}+\frac{1}{2}\pi\ln^2 2}\\
\end{align}
PS:
See: https://math.stackexchange.com/a/2942594/186817
(in this post i assume only the value of $\zeta(4)$ )
