The last identity is a consequence of the following formula which can be found for instance in [1]}.
\(\tfrac{1}{2\pi }\int _{0}^{2\pi }\log \big (\sin ^2\left(\tfrac{\theta }{2}\right)\big )\cos (n\theta )d\theta =-\frac{1}{n}.\) 
