TITLE: Compute the fourier coefficients, and series for $\log(\sin(x))$
QUESTION [10 upvotes]: I posted a similar question with a bad response, so I am retrying with hopes of better knowledge. The fourier series is in the form:
$$f(x) = \frac{a_0}{2} + \sum_{n=1}^{\infty} a_n\cos(nx) + \sum_{n=1}^{\infty} b_n\sin(nx)$$
Where:
$$a_n = \frac{1}{\pi} \int_{-\pi}^{\pi} f(x)\cos(nx) dx$$
$$b_n = \frac{1}{\pi} \int_{-\pi}^{\pi} f(x)\sin(nx) dx$$
The problem is computing the coefficients. The goal of trying to derive the series is to solve:
$$\int_{0}^{\pi} \log(\sin(x)) dx$$
$\displaystyle a_n = \frac{1}{\pi} \int_{-\pi}^{\pi} \log(\sin(x))\cos(nx) dx$
Which is very difficult to compute. 
What can be done?
The series representation is:
$$\log(\sin(x)) = -\log(2) - \sum_{n=1}^{\infty} \frac{\cos(2kx)}{k}$$

REPLY [7 votes]: Use equation $\text{(1d)}$ below and the fact that
$$
\int_0^\pi\cos(2kx)\,\mathrm{d}x=0
$$
to get
$$
\int_0^\pi\log(\sin(x))\,\mathrm{d}x=-\pi\log(2)
$$

$$
\begin{align}
\log(\sin(x))
&=\log\left(\frac{e^{ix}-e^{-ix}}{2i}\right)\tag{1a}\\
&=+ix-\log(2)-i\pi/2+\log(1-e^{-2ix})\tag{1b}\\
&=-ix-\log(2)+i\pi/2+\log(1-e^{+2ix})\tag{1c}\\
&=-\log(2)-\sum_{k=1}^\infty\frac{\cos(2kx)}{k}\tag{1d}
\end{align}
$$
Explanation:
$\text{(1a)}$: $\sin(x)=\frac{e^{ix}-e^{-ix}}{2i}$
$\text{(1b)}$: bring $e^{+ix}$ and $+\frac1{2i}$ out of the log
$\text{(1c)}$: bring $e^{-ix}$ and $-\frac1{2i}$ out of the log
$\text{(1d)}$: use $\log(1-x)=-\sum\limits_{k=1}^\infty\frac{x^k}k$ while averaging $\text{(1b)}$ and $\text{(1c)}$  

$$
\begin{align}
\log(\cos(x))
&=\log\left(\frac{e^{ix}+e^{-ix}}2\right)\tag{2a}\\
&=+ix-\log(2)+\log(1+e^{-2ix})\tag{2b}\\
&=-ix-\log(2)+\log(1+e^{+2ix})\tag{2c}\\
&=-\log(2)+\sum_{k=1}^\infty(-1)^{k-1}\frac{\cos(2kx)}{k}\tag{2d}
\end{align}
$$
Explanation:
$\text{(2a)}$: $\cos(x)=\frac{e^{ix}+e^{-ix}}2$
$\text{(2b)}$: bring $e^{+ix}$ and $\frac12$ out of the log
$\text{(2c)}$: bring $e^{-ix}$ and $\frac12$ out of the log
$\text{(2d)}$: use $\log(1+x)=\sum\limits_{k=1}^\infty(-1)^{k-1}\frac{x^k}k$ while averaging $\text{(2b)}$ and $\text{(2c)}$