Showing that $\int_0^1 \log(\sin \pi x)dx=-\log2$

Consider $$f(z) = \log(1-e^{2 \pi zi }) = \log(e^{\pi zi}(e^{-\pi zi}-e^{\pi zi})) = \log(-2i) + \pi zi + \log(\sin(\pi z))$$ Then we have \begin{align} \int_0^1 f(z) dz & = \log(-2i) + \dfrac{i \pi}2 + \int_0^1 \log(\sin(\pi z))dz\\ & = \int_0^1 \log(\sin(\pi z))dz + \log(-2i) + \log(i)\\ & = \log(2) + \int_0^1 \log(\sin(\pi z))dz \end{align} Now it suffices to show that $\displaystyle \int_0^1 f(z) dz = 0$. Consider the contour $C(\epsilon,R)$ (which is the contour given in your question) given by the following.

$1$. $C_1(\epsilon,R)$: The vertical line along the imaginary axis from $iR$ to $i \epsilon$.

$2$. $C_2(\epsilon)$: The quarter turn of radius $\epsilon$ about $0$.

$3$. $C_3(\epsilon)$: Along the real axis from $(\epsilon,1-\epsilon)$.

$4$. $C_4(\epsilon)$: The quarter turn of radius $\epsilon$ about $1$.

$5$. $C_5(\epsilon,R)$: The vertical line from $1+i\epsilon$ to $1 + iR$.

$6$. $C_6(R)$: The horizontal line from $1+iR$ to $iR$.

$f(z)$ is analytic inside the contour $C$ and hence $\displaystyle \oint_C f(z) = 0$. This gives us $$\int_{C_1(\epsilon,R)} f dz + \int_{C_2(\epsilon)} f dz + \int_{C_3(\epsilon)} f dz + \int_{C_4(\epsilon)} f dz + \int_{C_5(\epsilon,R)} f dz + \int_{C_6(R)} f dz = 0$$

Now the integral along $1$ cancels with the integral along $5$ due to symmetry. Integrals along $2$ and $4$ scale as $\epsilon \log(\epsilon)$. Integral along $6$ goes to $0$ as $R \to \infty$. This gives us $$\lim_{\epsilon \to 0} \int_{C_3(\epsilon)} f dz = 0$$ which is what we need.


EDIT

@Did has given the standard way to evaluate this integral using real analysis techniques. Here is another way to prove it.

From integration by parts/ other techniques, we have that $$\int_0^{\pi/2} \sin^{2k}(x) dx = \frac{2k-1}{2k}\frac{2k-3}{2k-2} \cdots \frac{1}{2} \frac{\pi}{2} = \dfrac{(2k)!}{4^k (k!)^2} \dfrac{\pi}2 = \dfrac{\Gamma(2k+1)}{4^k \Gamma^2(k+1)} \dfrac{\pi}2$$

Hence, the analytic extension of $\displaystyle \int_0^{\pi/2} \sin^{2z}(x) dx $ is $\dfrac{\Gamma(2z+1)}{4^z \Gamma^2(z+1)} \dfrac{\pi}2$. (This needs to be justified)

Now differentiate both sides with respect to $z$, and set $z=0$, to get $$2 \int_0^{\pi/2} \log(\sin(x)) = -\dfrac{\pi}2 \log(4)$$ Hence, we get that $$\int_0^{\pi/2} \log(\sin(x)) dx = -\dfrac{\pi}2 \log(2)$$ This also provides you a way to evaluate $\displaystyle \int_0^{\pi/2} \sin^{n}(x) \log(\sin(x)) dx$.


The integral $I$ to be computed is $$ I=2\int_0^{1/2}\log(\sin\pi x)\mathrm dx\stackrel{x\to 1/2-x}{=}2\int_0^{1/2}\log(\cos\pi x)\mathrm dx. $$ Summing up yields $$ 2I=2\int_0^{1/2}\log(\cos\pi x\sin\pi x)\mathrm dx=2\int_0^{1/2}\log(\sin2\pi x)\mathrm dx-2\int_0^{1/2}\log(2)\mathrm dx. $$ The first integral on the RHS is $$ \int_0^{1/2}\log(\sin2\pi x)\mathrm dx\stackrel{x\to2x}{=}\int_0^{1}\log(\sin\pi x)\frac{\mathrm dx}2=\frac{I}2, $$ and the second integral on the RHS is easy, hence $2I=I-\log2$ and, finally, $$ I=-\log2. $$