TITLE: Is there a direct method for evaluating this integral: $\int_{0}^{2\pi}\ln^2(2\sin(\frac{x}{2}))dx$?
QUESTION [8 upvotes]: I stumbled upon this integral while attempting to evaluate $\sum_{n=1}^{\infty}\frac{\cos(n\theta)}{n}$. 
I started with the series $-\ln(1-z)=\sum_{n=1}^{\infty}\frac{z^n}{n}$, replaced z with $e^{i\theta}$ and extracted the real part to get $-\ln(2\sin(\frac{\theta}{2}))= \sum_{n=1}^{\infty}\frac{\cos(n\theta)}{n}$.
Using Parseval's identity it follows that $\frac{1}{\pi}\int_{0}^{2\pi}\ln^2(2\sin(\frac{\theta}{2}))d\theta=\sum_{n=1}^{\infty}\frac{1}{n^2}=\frac{\pi^2}{6}$.
This gives me the result: $\int_{0}^{2\pi}\ln^2(2\sin(\frac{\theta}{2}))d\theta=\frac{\pi^3}{6}$.
Now this is the most roundabout way I have ever evaluated an integral, and I have attempted to find a more direct way to do it without any success. Does anyone know of other methods for evaluating this?

REPLY [2 votes]: With a small change of variables, this answer shows that
$$
\log(\sin(x))=-\log(2)-\sum_{k=1}^\infty\frac{\cos(2kx)}k\tag{1}
$$
Therefore,
$$
\begin{align}
&\int_0^{2\pi}\log\left(2\sin\left(\frac x2\right)\right)^2\,\mathrm{d}x\\
&=2\int_0^\pi\log(2\sin(x))^2\,\mathrm{d}x\tag{2}\\
&=\color{#C00000}{2\log(2)^2\int_0^\pi\,\mathrm{d}x}\color{#00A000}{+4\log(2)\int_0^\pi\log(\sin(x))\,\mathrm{d}x}\color{#0000F0}{+2\int_0^\pi\log(\sin(x))^2\,\mathrm{d}x}\tag{3}\\
&=\color{#C00000}{2\pi\log(2)^2}\color{#00A000}{-4\pi\log(2)^2}\color{#0000F0}{+2\left(\pi\log(2)^2+\frac\pi2\zeta(2)\right)}\tag{4}\\
&=\frac{\pi^3}6\tag{5}
\end{align}
$$
Explanation:
$(2)$: substitute $x\mapsto2x$
$(3)$: expand $[\log(2)+\log(\sin(x))]^2=\log(2)^2+2\log(2)\log(\sin(x))+\log(\sin(x))^2$
$(4)$: apply $(1)$ using $\int_0^\pi\cos(2kx)\,\mathrm{d}x=0$ and $\int_0^\pi\cos(2jx)\cos(2kx)\,\mathrm{d}x=\frac\pi2[j=k]$
$(5)$: arithmetic and $\zeta(2)=\frac{\pi^2}6$