How should one approach questions of this kind:
What is the sum of $$\sum_{n=0}^\infty\frac{\cos^{2n+1}x}{2n+1}$$
For $x=0$ this reduces to $1+1/3+1/5+...$ which diverges by the integral test. In fact, the answer is supposed to be $\log\cot (x/2)$. How do we arrive at it?
$$\sum_{n=1}^\infty\frac{t^{2n+1}}{2n+1}=\tanh^{-1}t=\frac12\log\frac{1+t}{1-t}.$$ for $|t|<1$. Substitute $t=\cos x$. $$\sum_{n=1}^\infty\frac{\cos^{2n+1}x}{2n+1}=\frac12\log\frac{1+\cos x} {1-\cos x}.$$ This can be simplified further using half-angle formulae.