Verify integral using Residue Theorem Verify the following equation:
$$
 \int_{0}^{2\pi}{\log{\left(\sin^{2}{2\theta}\right)}\,\mathrm{d}\theta}  =  4\int_{0}^{\pi}{\log{\left(\sin{\theta}\right)}\,\mathrm{d}\theta} = -4\pi \log{2}$$
I am unable to think of a closed rectifiable curve so that I can apply the residue theorem to prove the above equation. At first I thought we can put $z=e^{i\theta}$ and take $0\leq \theta \leq 2\pi $ but then I could not understand the singularities and analyticity of the log in that.
 A: I did not find a way to perform the integration by evaluating a residue at a singularity of a function. However I will present below a hint how to calculate the integral using contour integration of an analytic function.
$$\begin{align}
\int_0^{\pi} \log(\sin x)\,dx
&=\int_0^{\pi} \log\left(\frac{e^{ix}-e^{-ix}}{2i}\right)\,dx\\
&=\int_0^{\pi} \left[\log\left(1-e^{-2ix}\right)+ix-\log(2i)\right]dx\\
&=\int_0^{\pi}\log\left(1-e^{-2ix}\right)\,dx+\frac{i\pi^2}2-\pi\log2-\frac{i\pi^2}2\\
&=\int_0^{\pi}\log\left(1-e^{-2ix}\right)\,dx-\pi\log2,
\end{align}$$
where we used $\log(i)=\frac{i\pi}2$.
So we have to prove $\int_0^{\pi}\log\left(1-e^{-2ix}\right)\,dx=0$. This can be done by the integration over the following path:
$$\begin{array}{lllll}
(1):&\quad \epsilon&\to&\pi-\epsilon\\
(2):&\quad \pi-\epsilon&\to& \pi+i \epsilon\\
(3):&\quad \pi+i\epsilon&\to& \pi+iR\\
(4):&\quad \pi+iR &\to& iR\\
(5):&\quad iR&\to& i\epsilon\\
(6):&\quad i\epsilon&\to&\epsilon\\
\end{array}$$
Observe that the integrals along $(3)$ and $(5)$ cancel each other, hence it remains to show that the integrals along $(2),(4),(6)$ tend to $0$ as $\epsilon\to0,\; R\to\infty$, which is left as an exercise.
