<s>[INST] Calculate $\sum \limits_{n = 1}^{\infty} \frac{\cos 2n}{n^2}$ I need to calculate the following sum:
$$
\sum \limits_{n = 1}^{\infty} \frac{\cos 2n}{n^2}
$$
I've tried adding an imaginary part and differentiating:
$$
f(x) = \sum \limits_{k = 1}^{\infty} \frac{\cos 2xk + i \sin 2xk}{k^2} \\
f(x) = \sum \limits_{k = 1}^{\infty} \frac{e^{2ixk}}{k^2} \\
f'(x) = \sum \limits_{k = 1}^{\infty} \frac{2i e^{2ixk}}{k} \\
f''(x) = - 4\sum \limits_{k = 1}^{\infty} e^{2ixk} \\ 
f''(x) = -4\frac{e^{2ix}}{1 - e^{2ix}}
$$
Where $f(x)$ if a function of which I need to find the value at $x = 1$.
After differentiating once I get 
$$
f'(x) = \frac{\log \left( 1 - e^{kx} \right)}{k} + C
$$
(k is just some constant), and I can't integrate once more as I'll get an integral logarithm which I don't want to work with.
Is there any more pleasant way to calculate the aforementioned sum?
 [/INST] Subtract $\sum_n\frac1{n^2}=\frac{\pi^2}6$ to obtain
\begin{eqnarray}
\sum_{n=1}^\infty\frac{\cos2n}{n^2}-\frac{\pi^2}6
&=&
\sum_{n=1}^\infty\frac{1-\cos2n}{n^2}
\\
&=&
-2\sum_{n=1}^\infty\left(\frac{\sin n}n\right)^2\;.
\end{eqnarray}
Now note that $\frac1\pi\frac{\sin n}n$ is the $n$-th coefficient in the Fourier series of a rectangular pulse with period $2\pi$ and length $2$:
$$
\frac1{2\pi}\int_{-1}^1\mathrm e^{-\mathrm inx}\mathrm dx=\frac1\pi\frac{\sin nx}n\;.
$$
By Parseval’s theorem we have
$$
\sum_{n=-\infty}^\infty\left(\frac1\pi\frac{\sin nx}n\right)^2=\frac1{2\pi}\int_{-1}^1\mathrm dx=\frac1\pi\;,
$$
and thus
\begin{eqnarray}
\sum_{n=1}^\infty\left(\frac{\sin n}n\right)^2
&=&
\frac12\left(\sum_{n=-\infty}^\infty\left(\frac{\sin nx}n\right)^2-1\right)
\\
&=&
\frac{\pi-1}2\;.
\end{eqnarray}
Substituting above yields
\begin{eqnarray}
\sum_{n=1}^\infty\frac{\cos2n}{n^2}
&=&
\frac{\pi^2}6-2\cdot\frac{\pi-1}2
\\
&=&\frac{\pi^2}6-\pi+1\;.
\end{eqnarray}
</s>