<s>[INST] Evaluate $\int_0^{\pi/2}\ln^2(\sin\theta)\,\mathrm d\theta$ How can I evaluate  

$$\int_0^{\pi/2}\ln^2(\sin\theta)\,\mathrm d\theta$$

With Wolfram Alpha (see) I get to the next result 
$$ \int_0^{\pi/2}\ln^2(\sin\theta)\,\mathrm d\theta = \frac{1}{24} \left(\pi^3 + 3\pi \ln^2(4)\right)$$
How to prove these ?
 [/INST] Using the Fourier expansion, we have that
\begin{align}
\log(\sin x) = -\log 2-\sum^\infty_{k=1}\frac{\cos(2kx)}{k}
\end{align}
for $0 \leq x \leq \pi/2$. Then we see that
\begin{align}
\log^2(\sin x) = \left(\log 2 +\sum^\infty_{k=1}\frac{\cos(2kx)}{k} \right)^2
\end{align}
which means
\begin{align}
&\int^{\pi/2}_0\left( \log 2 +\sum^\infty_{k=1}\frac{\cos(2kx)}{k} \right)^2\ dx \\
&= \int^{\pi/2}_0\log^2 2+2\log 2\sum^\infty_{k=1}\frac{\cos(2kx)}{k}+\sum^\infty_{k=1}\sum^\infty_{n=1} \frac{\cos(2kx)\cos(2nx)}{kn}\ dx\\
&= \frac{\pi}{2} \log^2 2+2\log 2 \sum^\infty_{k=1}\int^{\pi/2}_0 \frac{\cos(2kx)}{k}\ dx+\sum^\infty_{k=1}\sum^\infty_{n=1}\int^{\pi/2}_0 \frac{\cos(2kx)\cos(2n x)}{kn}\ dx\\
&= \frac{\pi}{2}\log^2 2 + \sum^\infty_{n=1} \int^{\pi/2}_0 \frac{\cos^2(2nx)}{n^2}\ dx = \frac{\pi}{2}\log^2 2 +\frac{\pi}{4}\sum^\infty_{n=1}\frac{1}{n^2}\\
&= \frac{\pi}{2}\log^2 2 +\frac{\pi^3}{24} =\frac{1}{24}\left(\pi^3+3\pi\log^2 4 \right)
\end{align}
</s>