<s>[INST] Study the convergence of $\sum_{n=1}^\infty \frac{(-1)^n \cos^2(n)}{n}$ 
Study the convergence of $\sum_{n=1}^\infty \frac{(-1)^n \cos^2(n)}{n}$

Abel's/Dirichlet's tests cannot be applied here.
I guess it's something more tricky involving integration maybe (?)
 [/INST] First write
$$\sum_{n = 1}^\infty \frac{(-1)^n\cos^2 n}{n} = \sum_{n = 1}^\infty \left(\frac{(-1)^n}{2n} + \frac{(-e^{2i})^n}{4n} + \frac{(-e^{-2i})^n}{4n}\right)$$
using the identities $$\cos^2 x = \frac{(e^{ix} + e^{-ix})^2}{4} = \frac{1}{2} + \frac{e^{2ix}}{4} + \frac{e^{-2ix}}{4}.$$ The series $\sum_{n = 1}^\infty (-1)^n/(2n)$ converges by the alternating series test, and series $\sum_{n = 1}^\infty (-e^{2i})^n/(4n)$ and $\sum_{n = 1}^\infty (-e^{-2i})^n/(4n)$ converge by Dirichlet's test. This shows that $\sum_{n = 1}^\infty (-1)^n\cos^2(n)/n$ converges. It's value can be computed:
\begin{align}&\sum_{n = 1}^\infty \frac{(-1)^n}{2n} + \sum_{n = 1}^\infty \frac{(-e^{2i})^n}{4n} + \sum_{n = 1}^\infty \frac{(-e^{-2i})^n}{4n}\\
& = -\frac{\log 4 + \log(1 + e^{2i}) + \log(1 + e^{-2i})}{4}\\
&= -\frac{\log 4 + \log[(1 + \cos 2)^2 + \sin^2 2]}{4}\\
&= -\frac{\log 4 + \log|2 + 2\cos 2|}{4}\\
&= -\frac{\log 4 + \log 2 + \log(1 + \cos 2)}{4}\\
&= -\frac{\log[8(1 + \cos 2)]}{4}.
\end{align}

Note. In general, series of the form $$\sum_{n = 1}^\infty \frac{e^{in\theta}}{n},\quad \theta\in \Bbb R\setminus 2\pi \Bbb Z$$ are convergent, which I'll show by Dirichlet's test. Let $\theta \in \Bbb R\setminus 2\pi \Bbb Z$. The sequence $\left\langle \frac{1}{n}\right\rangle_{n = 1}^\infty$ decreases to $0$, and for every positive integer $N$,
$$\left\lvert \sum_{n = 1}^N e^{in\theta}\right\rvert = \left\lvert e^{i\theta}\frac{1 - e^{iN\theta}}{1 - e^{i\theta}}\right\rvert = \dfrac{\left\lvert\sin \frac{N\theta}{2}\right\rvert}{\left\lvert\sin \frac{\theta}{2}\right\rvert} \le \frac{1}{\left\lvert \sin \frac{\theta}{2}\right\rvert}.$$ Hence, by Dirichlet's test, the series $\sum_{n = 1}^\infty e^{in\theta}/n$ converges.
</s>