How to integrate $\int_{0}^{1}\text{log}(\text{sin}(\pi x))\text{d}x$ using complex analysis Here is exercise 9, chapter 3 from Stein & Shakarchi's Complex Analysis II:
Show that:
$$\int_{0}^{1}\text{log}(\text{sin}(\pi x))\text{d}x=-\text{log(2)}$$ 
[Hint: use a contour through the set $\{ri\,|\,\,r\geq0\} \cup\{r\,\,|\,\, r\in[0, 1]\}\cup\{1+ri\,\,|\,\,r\geq0\}$] 
That contour doesn't seem to make sense to me for this integral in particular. I really have no clue for this one. Any ideas?
 A: Let $I$ be the integral given by
$$I=\int_0^1 \log(\sin(\pi x))\,dx \tag 1$$
Enforcing the substitution $ x \to x/\pi$ in $(1)$ reveals
$$\begin{align}
I&=\frac{1}{\pi}\int_0^\pi \log(\sin(x))\,dx \\\\
&=\frac{1}{2\pi}\int_0^\pi \log(\sin^2(x))\,dx\\\\
&=\frac{1}{2\pi}\int_0^\pi \log\left(\frac{1+\cos(2x)}{2}\right)\,dx \tag 2
\end{align}$$
Next, enforcing the substitution $x\to x/2$ in $(2)$ yields
$$\begin{align}
I&=\frac{1}{4\pi}\int_0^{2\pi} \log\left(\frac{1+\cos(x)}{2}\right)\,dx \\\\
&=-\frac{\pi}{2}\log(2)+\frac{1}{4\pi}\int_0^{2\pi}\log(1+\cos(x))\,dx\tag 3
\end{align}$$
We now move to the complex plane by making the classical substitution $z=e^{ix}$.  Proceeding, $(3)$ becomes
$$\begin{align}
I&=-\frac{\pi}{2}\log(2)+\frac{1}{4\pi}\oint_{|z|=1}\log\left(1+\frac{z+z^{-1}}{2}\right)\,\frac{1}{iz}\,dz \\\\
&=-\frac{\pi}{2}\log(2)+\frac{1}{4\pi i}\oint_{|z|=1}\frac{2\log(z+1)-\log(z)}{z}\,dz  \tag 4
\end{align}$$
Note that the integrand in $(4)$ has branch points at $z=0$ and $z=-1$, and a first-order pole at $z=0$.  We choose to cut the plane with branch cuts from $z=0$ to $z=-\infty$, and from $z=-1$ to $z=-\infty$, along the non-positive real axis.
We can deform the contour $|z|=1$ around the branch cuts and the pole and write
$$\begin{align}
\oint_{|z|=1}\frac{2\log(z+1)-\log(z)}{z}\,dz  &=\lim_{\epsilon \to 0^+}\left(\int_{-\epsilon}^{-1} \frac{2\log(x+1)-\log|x|
-i\pi}{x}\,dx \right.\\\\
&-\int_{-\epsilon}^{-1} \frac{2\log(x+1)-\log|x|+i\pi}{x}\,dx\\\\
&\left. +\int_{-\pi}^{\pi}\frac{2\log(1+\epsilon e^{i\phi})-\log(\epsilon e^{i\phi})}{\epsilon e^{i\phi}}\,i\epsilon e^{i\phi}\,d\phi\right)\\\\
&=0 \tag 5
\end{align}$$
Finally, using $(5)$ in $(4)$, we obtain the coveted equality
$$I=-\frac{\pi}{2}\log(2)$$
as was to be shown!
