TITLE: How to derive this interesting identity for $\log(\sin(x))$
QUESTION [10 upvotes]: I saw on SE that:
$$\log(\sin x)=-\log(2)-\sum_{n=1}^{\infty}\frac{\cos(2nx)}{n} \phantom{a} (0<x<\pi)$$
This is an extremely useful identity, as it helps solve: 
$$\int_{0}^{\pi} \log(\sin(x)) dx$$
But how is it derived? From Taylor series, power series? How do I get this?
Even if someone can start me off that would be great.

REPLY [2 votes]: Hint: Use $~\ln(1-t)~=~-\displaystyle\sum_{n=1}^\infty\frac{t^n}n~$ in conjunction with Euler's formula.