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

I need help with a textbook exercise (Stein's Complex Analysis, Chapter 3, Exercises 9). This exercise requires me to show that $$\int_0^1 \log(\sin \pi x)dx=-\log2$$ A hint is given as "Use the contour shown in Figure 9."

Since this is an exercise from Chapter 3, I think I should use the residue formula or something like that. But the function $f(x)=\log(\sin \pi x)$ becomes singular on $x=0$ and $x=1$, which makes the contour illegal for the residue theorem. Can anyone give me a further hint on this problem? Many thanks in advance!

P.S. This is my first time on Math Stack Exchange. If you find my post ambiguous, let me know.

-
I bet the contour is ever so slightly bigger than the box you've indicated, so that you can use the residue theorem. But if not, then you'll just have to use the definition and treat it as improper. – mixedmath Mar 26 '13 at 11:53
Note that, $z=0$ and $z=1$ are branch points. – Mhenni Benghorbal Mar 26 '13 at 12:28
The singularities at $x=0$ and $x=1$ are integrable. – Ron Gordon Mar 26 '13 at 12:49
@MhenniBenghorbal: If they are branch points, then how will it help to solve this problem? – York Tsang Mar 26 '13 at 13:54
For example, $$\int_0^1 dx \: \log{x} = [x \log{x} - x]_0^1 = -1$$ Note that the integral is finite despite log having a singularity at $x=0$. – Ron Gordon Mar 26 '13 at 13:55

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.$$

-
Sorry, no complex analysis, simply the identities $\sin(\pi-u)=\sin u$, $\sin(\pi/2-u)=\cos u$ and $\sin(2u)=2\sin u\cos u$. – Did Mar 30 '13 at 23:37
I assume the OP wants a complex analysis proof, which makes use of the specific contour he has in the question. – user17762 Mar 30 '13 at 23:38
and I didn't downvote. – user17762 Mar 30 '13 at 23:45
@Marvis Obviously, I am well aware that "the OP wants a complex analysis proof" and that the proof in my post does not use complex analysis since I signaled it myself in a comment. – Did Mar 31 '13 at 0:07
(+1) a simple answer is a better answer. BTW, there is a typo in $2^{nd}$ line. – achille hui Mar 31 '13 at 0:23

It is not a complex analytic technique but I think it is worth mentioning. We can compute the integral by taking Riemann sums and exploiting the identity: $$\prod_{k=1}^{n-1}\sin\frac{\pi k}{n}=\frac{2n}{2^n}\tag{1}$$ from which it follows that: $$\begin{eqnarray*}\int_{0}^{1}\log(\sin(\pi x))\,dx &=& \frac{1}{\pi}\int_{0}^{\pi}\log\sin x\,dx = \frac{1}{\pi}\lim_{n\to +\infty}\frac{\pi}{n}\sum_{k=1}^{n-1}\log\sin\frac{\pi k}{n}\\&=&\lim_{n\to +\infty}\frac{1}{n}\,\log\frac{2n}{2^n}=\color{red}{-\log 2}.\tag{2}\end{eqnarray*}$$

-