Is there a direct method for evaluating this integral: $\int_{0}^{2\pi}\ln^2(2\sin(\frac{x}{2}))dx$? 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?
 A: It is well-known that:
$$ \int_{0}^{\pi}(2\sin\theta)^{\alpha}\,d\theta = 2^\alpha\, \frac{\Gamma\left(\frac{1}{2}\right)\Gamma\left(\frac{1}{2}+\frac{\alpha}{2}\right)}{\Gamma\left(1+\frac{\alpha}{2}\right)}$$
hence by differentiating both sides with respect to $\alpha$ we get:
$$ \int_{0}^{\pi}(2\sin\theta)^{\alpha}\log(2\sin\theta)\,d\theta= 2^\alpha\, \frac{\Gamma\left(\frac{1}{2}\right)\Gamma\left(\frac{1}{2}+\frac{\alpha}{2}\right)}{\Gamma\left(1+\frac{\alpha}{2}\right)}\cdot\frac{\psi\left(\frac{\alpha+1}{2}\right)-\psi\left(\frac{\alpha+2}{2}\right)+\log 4}{2}$$
and we just need to differentiate both sides with respect to $\alpha$ again, then evaluate in $\alpha=0$ by exploiting:
$$\frac{\Gamma\left(\frac{1}{2}\right)^2}{\Gamma(1)}=\pi, \qquad \psi\left(\frac{1}{2}\right)-\psi(1)=-\log 4,\qquad \psi'\left(\frac{1}{2}\right)-\psi'(1)=2\,\zeta(2).$$
A: 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$
A: Are you familiar with a dog bone contour in the complex plane? You take the branch of log that is analytic on $\mathbb{C}\text{\ }[-\infty,2]$ and the branch that is analytic on $\mathbb{C}\text{\ }([0,+\infty]$ and combine them to a function that is analytic on $\mathbb{C}\text{\ }[0,2]$. The you integrate around the line $[0,2]$ with two epsilon circle around the singularities at $0,2$.
