I found a complicated question in my textbook, I can't solve it? How to prove $$\sum_{n=1}^{\infty}{{(-1)}^{n-1}{\cos nx}\over {n}}=\ln(2\cos(x/2))$$ where $x\in(-\pi,\pi)$.
My tried method: I tried to take the derivative of $\ln(2\cos(x/2))$, and the derivative is $$\frac{-\sin(x/2)}{2\cos(x/2)}=\frac{-1}{2}\tan(x/2)$$. I tried to compute its Taylor series of ${-1\over 2}\tan(x/2)$. However, I don't think it does work using the method. I also tried to use Fourier series to solve it, but integrating $\ln(2\cos(x/2))\cos(nx)$ is so hard. I don't know how to solve it? Can someone tell me how to solve this question?
Put $\cos(nx)={\rm Re}\, e^{inx}$ and use $$\ln\left(\frac{1}{1-x}\right)=x+\frac{x^2}{2}+\frac{x^3}{3}+\frac{x^4}{4}+\frac{x^5}{5}+\dots$$