Computing the integral of $\log(\sin x)$
How to compute the following integral? $$\int\log(\sin x)\,dx$$
Motivation: Since $\log(\sin x)'=\cot x$, the antiderivative $\int\log(\sin x)\,dx$ has the nice property $F''(x)=\cot x$. Can we find $F$ explicitly? Failing that, can we find the definite integral over one of intervals where $\log (\sin x)$ is defined?
Solution 1:
You can calculate $$ \int_0^\pi\log(\sin x)\,dx = -\pi\log2 $$ and integrating up to $\pi/2$ would give half of this.
Note that integrating $\log(\sin x)$ from 0 to $\pi/2$ is the same as integrating $\log(\cos x)$ so that $$ \begin{align} \int_0^{\pi/2}\log(\sin x)\,dx &= \frac12\int_0^{\pi/2}\log(\sin x\cos x)\,dx\\ &= \frac12\int_0^{\pi/2}\log(\sin 2x)\,dx - \frac{\pi}{4}\log 2. \end{align} $$ After a change of variables, this can be rearranged to get the result.
Solution 2:
Series expansion can be used for this integral too.
We use the following identity;
$$\log(\sin x)=-\log 2-\sum_{k\geq 1}\frac{\cos(2kx)}{k} \phantom{a} (0<x<\pi)$$
This identity gives
$$\int_{a}^{b} \log(\sin x)dx=-(b-a)\log 2-\sum_{k\ge 1}\frac{\sin(2kb)-\sin(2ka)}{2k^2}$$
($a, b<\pi$)
For example,
$$\int_{0}^{\pi/4}\log(\sin x)dx=-\frac{\pi}{4}\log 2-\sum_{k\ge 1}\frac{\sin(\pi k/2)}{2k^2}=-\frac{\pi}{4}\log 2-\frac{1}{2}K$$
$$\int_{0}^{\pi/2} \log(\sin x)dx=-\frac{\pi}{2}\log 2$$
$$\int_{0}^{\pi}\log(\sin x)dx=-\pi \log 2$$
($K$; Catalan's constant ... $\displaystyle K=\sum_{k\ge 1}\frac{(-1)^{k-1}}{(2k-1)^2}$)