Find the sum of the series: $ \sum_{n=1}^\infty (-1)^{n-1}\frac{\cos nx}{n(n+1)} $ 
Find the sum of the series:
  $$
\sum_{n=1}^\infty (-1)^{n-1}\frac{\cos nx}{n(n+1)}
$$

My attempt:
$$
\begin{aligned}
&\sum_{n=1}^\infty (-1)^{n-1}\frac{\cos nx +i\sin nx}{n(n+1)}=\\
&=\sum_{n=1}^\infty (-1)^{n-1}\left(\frac{(\cos x +i\sin x)^n}{n}-\frac{(\cos x +i\sin x)^n}{n+1}\right)=\\
&=[\cos x + i\sin x = t]=\sum_{n=1}^\infty (-1)^{n-1}\left(\frac{t^n}{n}-\frac{t^n}{n+1}\right)=\dots=\\
&=\ln(1+t)+\frac{1}{t}\left(-\ln|1+t|+t\right)
\end{aligned}
$$
But I don't know how to end the solution. How to ged rid of $i$ inside the logarithms?
P.S. The answer my textbook gives me is
$
(1+\cos x)\ln\left(2\cos\frac{x}{2}\right)+\frac{1}{2}x\sin x - 1
$.

We have that 
$$\cos((n+1)x)+\cos(nx)=2\cos(x/2)\cos((n+1/2)x)$$
Therefore, we split the given series into a telescopic sum and another convergent series,
$$S(x):=\sum_{n=1}^\infty (-1)^{n-1}\frac{\cos(nx)}{n(n+1)}=
\sum_{n=1}^\infty \left((-1)^{n-1}\frac{\cos(nx)}{n}-(-1)^{n}\frac{\cos(n+1)x}{n+1}\right)\\
+2\cos(x/2)\text{Re}\left(\sum_{n=1}^\infty\frac{(-1)^{n} (e^{ix})^{n+1/2}}{n+1}\right).$$
Finally, after recalling that $\ln(1+z)=\sum_{n=1}^\infty (-1)^{n-1}\frac{z^n}{n}$ for $|z|\leq 1$ and $z\not=-1$, we find
$$\begin{align}
S(x)&=\cos(x)+2\cos(x/2)\text{Re}\left(e^{-ix/2}(\ln(1+e^{ix})-e^{ix})\right)\\
&=\cos(x)+\cos(x/2)(\cos(x/2)\ln(2+2\cos(x))+x\sin(x/2))
-2\cos^2(x/2)\\
&=(1+\cos(x))\ln\left(2\cos(x/2)\right)+\frac{x\sin(x)}{2} - 1.
\end{align}$$
where
$$\ln(1+e^{ix})=\ln(|1+e^{ix}|)+i\text{Arg}(1+e^{ix})
=\frac{1}{2}\ln(2+2\cos(x))+\frac{ix}{2}.$$
P.S. Your textbook answer is valid for $x\in (-\pi,\pi)$.
