This question number 11.15(a) Tom M Apostol's MAthematical Analysis From Chapter Fourier analysis.
Prove that $ \log |\sin(x/2)| = -\log 2 -\sum_{n=1}^{\infty} \frac{\cos nx} {n} $ ( if $ x\neq 2 k\pi)$.
So, I tried by using $a_0 = 2/\pi \int_{0}^{\pi} \log|\sin(x/2)| dx$ and I used $\sin(2x) =2\sin x\cos x$.
So Using it I get $a_0 /2 =\log 2 + 2/\pi [\int_{0}^{\pi}\log|\sin(x/4)|dx +\int_{0}^{\pi}\log|\cos (x/4) |dx]$.
But the problem is how to compute $\int_{0}^{\pi}\log|\cos (x/4) |dx$. The limit of integral can be taken from $0$ to $2 \pi $
Similar problem will also arise when I will compute $a_n = \int_{0}^{\pi} \log|\sin(x/2)| \times\cos(nx) dx$.
Can you please tell how to compute this integral OR If there is alternate way of computing the fourier series.
Thank you.
Note that$$\ln|2\sin(x/2)|=\ln|1-e^{ix}|=\tfrac12(\ln(1-e^{ix})+\text{c.c.})=-\tfrac12\sum_{n\ge1}\tfrac{e^{inx}+\text{c.c.}}{n}=-\sum_n\tfrac{\cos nx}{n},$$where $z+\text{c.c.}$ is short for $z+\bar{z}$.