TITLE: Computing the integral of $\log(\sin x)$
QUESTION [42 upvotes]: 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?

REPLY [2 votes]: Probably this question indeed aims on a definite integral from $0$ to $\pi/2$ (or $\pi$). But it can be of interest to give a rather simple form of the antiderivative in the range $0<x<\pi$ as well.
Lemma:
$$
\int_0^x\log(2\sin t) dt=-\frac12\sum_{k=1}^\infty\frac{\sin(2kx)}{k^2}
=-\frac12\Im[\operatorname{Li}_2(e^{2ix})],\tag1
$$
Proof:
Observe that $\log(2\sin t)$ in the range $0< t<\pi$ is a real number. Therefore:
$$\begin{align}
\log(2\sin t)&=\log(e^{it}-e^{-it})-\log i\\
&=i\left(t-\frac\pi2\right)+\log(1-e^{-2it})\\
&=i\left(t-\frac\pi2\right)-\sum_{k=1}^\infty\frac{e^{-2ikt}}k\\
&=i\underbrace{\left(t-\frac\pi2+\sum_{k=1}^\infty\frac{\sin(2kt)}k\right)}_{=0}-\sum_{k=1}^\infty\frac{\cos(2kt)}k\\
&=-\sum_{k=1}^\infty\frac{\cos(2kt)}k.\tag2
\end{align}
$$
Substituting $(2)$ into the left hand side of $(1)$ one obtains its right hand side. $\blacksquare$
Thus for the integral in question we have:
$$
\int_0^x\log(\sin t) dt=\int_0^x\left[\log(2\sin t)-\log2\right] dt
=-\frac12\Im[\operatorname{Li}_2(e^{2ix})]
-x\log2.
$$