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?

An excellent discussion of this topic can be found in the book The Gamma Function by James Bonnar. Consider just two of the provably equivalent definitions of the Beta function:
$$
\begin{eqnarray}
B(x,y)&=& 2\int_0^{\pi/2}\sin(t)^{2x-1}\cos(t)^{2y-1}\,dt\\
      &=& \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)}.
\end{eqnarray}
$$
Directly from this definition we have 
$$
B(n+\frac{1}{2},\frac{1}{2}): \int_0^{\pi/2}\sin^{2n}(x)\,dx=\frac{\sqrt{\pi}  \cdot\Gamma(n+1/2)}{2(n!)}
$$
$$
B(n+1,\frac{1}{2}): \int_0^{\pi/2}\sin^{2n+1}(x)\,dx=\frac{\sqrt{\pi}  \cdot n!}{2 \Gamma(n+3/2)}
$$
Hence the quotient of these two integrals is
$$
\begin{eqnarray}
\frac{ \int_0^{\pi/2}\sin^{2n}(x)\,dx}{\int_0^{\pi/2}\sin^{2n+1}(x)\,dx}&=& \frac{\Gamma(n+1/2)}{n!}\frac{\Gamma(n+3/2)}{n!}\\
&=& \frac{2n+1}{2n}\frac{2n-1}{2n}\frac{2n-1}{2n-2}\cdots\frac{3}{4}\frac{3}{2}\frac{1}{2}\frac{\pi}{2}
\end{eqnarray}
$$
where the quantitiy $\pi/2$ results from the fact that
$$
\frac{\int_0^{\pi/2}\sin^{2\cdot 0}(x)\,dx}{\int_0^{\pi/2}\sin^{2\cdot 0+1}x\,dx}=\frac{\pi/2}{1}=\frac{\pi}{2}.
$$
So we have that
$$
\int_0^{\pi/2}\sin^{2n}(x)\,dx=\frac{2n-1}{2n}\frac{2n-3}{2n-2}\cdots\frac{1}{2}\frac{\pi}{2}=\frac{(2n)!}{4^n (n!)^2}\frac{\pi}{2}.
$$
Hence an analytic continuation of $\int_0^{\pi/2}\sin^{2n}(x)\,dx $ is
$$
\int_0^{\pi/2}\sin^{2z}(x)\,dx=\frac{\pi}{2}\frac{\Gamma(2z+1)}{4^z \Gamma^2(z+1)}=\frac{\pi}{2}\Gamma(2z+1)4^{-z}\Gamma^{-2}(z+1).
$$
Now differentiate both sides with respect to $z$ which yields
$$
\begin{eqnarray}
2\int_0^{\pi/2}\sin^{2z}(x)\log(\sin(x))\,dx =\frac{\pi}{2} \{2\Gamma'(2z+1)4^{-z}\Gamma^{-2}(z+1)\\
+2\Gamma(2z+1)4^{-z}\Gamma^{-3}(z+1)\Gamma'(z+1)\\
-\log(4)\Gamma(2z+1)4^{-z}\Gamma^{-2}(z+1)\}.
\end{eqnarray}
$$
Finally set $z=0$ and note that $\Gamma'(1)=-\gamma$ to complete the integration:
$$
\begin{eqnarray}
2\int_0^{\pi/2}\log(\sin(x))\,dx&=&\frac{\pi}{2}(-2\gamma+2\gamma-\log(4))\\
&=& -\frac{\pi}{2}\log(4)=-\pi\log(2).
\end{eqnarray}
$$
We conclude that
$$
\int_0^{\pi/2}\log(\sin(x))\,dx=-\frac{\pi}{2}\log(2).
$$
