<s>[INST] 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?
 [/INST] There was a duplicate posted a while ago. Since I think my answer might be of some interest, here it goes:
By substituting $\sin{x}=t$, we can write it as:
\begin{align*}
  \int_{0}^{\pi/2} \, \log\sin{x}\, dx &= \int_{0}^{1} \, \frac{\log{t}}{\sqrt{1-t^2}}\, dt \tag{1}
\end{align*}
Now, consider:
\begin{align*}
  I(a) &= \int_{0}^{1} \, \frac{t^a}{(1-t^2)^{1/2}}\, dt \\
  &= \mathrm{B}\left(\frac{a+1}{2},\; \frac{1}{2}\right) \\
  \frac{\partial }{\partial a}I(a) &= \frac{1}{4}\left(\psi\left(\frac{a+1}{2}\right)-\psi\left(\frac{a+2}{2}\right)\right)\mathrm{B}\left(\frac{a+1}{2},\; \frac{1}{2}\right) \\
  \implies I'(0) &= \frac{1}{4}\left(\psi\left(\frac{1}{2}\right)-\psi\left(1\right)\right)\mathrm{B}\left(\frac{1}{2},\; \frac{1}{2}\right) \tag{2}
\end{align*}
Putting the values of digamma and beta functions.
\begin{align*}
  \psi\left(\frac{1}{2}\right) &= -2\log{2}-\gamma \\
  \psi\left(1\right) &= -\gamma \\
  \mathrm{B}\left(\frac{1}{2}, \frac{1}{2}\right) &= \pi
\end{align*}
Hence, from $(1)$ and $(2)$,
\begin{align*}
\boxed{\displaystyle \int_{0}^{\pi/2} \, \log\sin{x}\, dx = -\frac{\pi}{2}\log{2}}
\end{align*}
Using a CAS, we can derive for higher powers of $\ln\sin{x}$, e.g.
\begin{align*}
  \int_{0}^{\pi/2} \, \left(\log\sin{x}\right)^2\, dx &= \frac{1}{24} \, \pi^{3} + \frac{1}{2} \, \pi \log\left(2\right)^{2} \\
  \int_{0}^{\pi/2} \, \left(\log\sin{x}\right)^3\, dx &= -\frac{1}{8} \, \pi^{3} \log\left(2\right) - \frac{1}{2} \, \pi \log\left(2\right)^{3} - \frac{3}{4} \, \pi \zeta(3)\\
  \int_{0}^{\pi/2} \, \left(\log\sin{x}\right)^4\, dx &= \frac{19}{480} \, \pi^{5} + \frac{1}{4} \, \pi^{3} \log\left(2\right)^{2} + \frac{1}{2} \, \pi \log\left(2\right)^{4} + 3 \, \pi \log\left(2\right) \zeta(3)
\end{align*}
We can also observe another interesting thing, for small values of $n$
\begin{align*}
\displaystyle \int_{0}^{\pi/2} \, \left(\log\sin{x}\right)^n\, dx \approx \displaystyle (-1)^n\, n!
\end{align*}
</s>