proof of $-\ln\left(2\sin\left(\frac x2\right)\right)=\sum_{k=1}^\infty \frac {\cos(kx)}{k}$? There is an identity that I have seen pop up in a few questions on this stackexchange, and I was wondering what proof there is for it. It goes something like this:
$$-\ln\left(2\sin\left(\frac x2\right)\right)=\sum_{k=1}^\infty \frac {\cos(kx)}{k}$$
Again, my question is:
How do you prove this identity?

$-\dfrac{\cos(kx)}k=$ real of $-\dfrac{e^{ikx}}k$
As $\ln(1-h)=-\sum_{r=1}^\infty\dfrac{h^r}r,$
$\sum-\dfrac{e^{ikx}}k=\ln\left[1-e^{ix}\right]$
$=\ln(e^{ix/2})+\ln(e^{ix/2}-e^{-ix/2})$
$=ix/2+\ln(i\cdot2\sin x/2)$
$=ix/2+\ln i+\ln(2\sin x/2)$
$i=e^{i\pi/2}\implies\ln(i)=i\pi/2$
