# Calculate an integral using complex integration

came across this one $$\int_0^{\pi / 2} \ln (\sin x)\;dx$$

I wanted to find it using the residues, but, I don't thing they are isolated ones

Let us write $I$ this integral. Changing the variable $x$ into $y=\frac\pi2-x$, we get $$I=\int_0^{\pi/2}\ln(\cos y)\,\mathrm dy$$ so we can add up the two integrals $$\begin{split}2I&=\int_0^{\pi/2}\left[\ln(\sin x)+\ln(\cos x)\right]\mathrm dx=\int_0^{\pi/2}\ln\left(\frac12\sin 2x\right)\,\mathrm dx\\&=-\frac\pi2\ln 2+\int_0^{\pi/2}\ln(\sin 2x)\,\mathrm dx\end{split}\tag{1}$$ Let us change the variable in the last integral into $z=2x$ : $$\begin{split}\int_0^{\pi/2}\ln(\sin 2x)\,\mathrm dx&=\frac12\int_0^\pi\ln(\sin z)\,\mathrm dz\\&=\frac12\int_0^{\pi/2}\ln(\sin x)\,\mathrm dx+\frac12\int_{\pi/2}^\pi\ln(\sin x)\,\mathrm dx\\&=\frac12I+\frac12J.\end{split}\tag{2}$$ Then we use the change of variable $t=\pi-x$ to compute $J$ : $$J=\int_{\pi/2}^\pi\ln(\sin x)\,\mathrm dx=\int_0^{\pi/2}\ln(\sin t)\,\mathrm dt=I.$$ As a conclusion, we obtain that $2I=-\frac\pi2\ln2+I$, hence the result $I=-\frac\pi2\ln2$.

• Hooray for no complex analysis! – BCLC Dec 4 '15 at 15:00

Strange but true, it is enough to use the definition of the Riemann integral through Riemann sums.

$$I = \int_{0}^{\pi}\log\sin x\,dx = \lim_{n\to +\infty}\frac{\pi}{ n}\sum_{k=1}^{n-1}\log\sin\frac{\pi k}{n}=\lim_{n\to +\infty}\frac{\pi}{n}\log\prod_{k=1}^{n-1}\sin\frac{\pi k}{n}\tag{1}$$ but $$\prod_{k=1}^{n-1}\sin\frac{\pi k}{n} = \frac{2n}{2^n}\tag{2}$$ is a well-known identity, giving:

$$\int_{0}^{\pi}\log\sin(x)\,dx = \color{red}{-\pi\log 2}.\tag{3}$$

I think there's an easier way: try differentiation by parts, set $\int_{0}^{\frac{\pi}{2}} 1 \cdot \ln (\sin x)dx = x \log \sin x |_{0}^{\frac{\pi}{2}} -\int_{0}^{\frac{\pi}{2}} \frac{x \cos x dx}{\sin x}$

• How does this lead to the result ? – Tom-Tom Jan 31 '14 at 12:53