Series $\sum_{n=1}^\infty \frac{\cos n}{n^2}$ This is the series I want to find:
$$\sum_{n=1}^\infty \frac{\cos n}{n^2}$$
WolframAlpha gives the answer of $\frac14 + \frac16 (\pi - 3)\pi$.
I do not know anything about this problem other than to prove that it is convergent.
Thanks.
 A: Here's a solution using Fourier series.
For $a\in\mathbb C-\mathbb Z$, consider the $2\pi$-periodic function $f$ defined as $f_a(x)=\cos (ax)$ for $x\in [-\pi,\pi)$.
Let's expand it as a Fourier series (since it's periodic). The Fourier coefficients are
$$a_n = \int_{-\pi}^{\pi} \cos(ax)\cos(nx)dx = \frac{(-1)^{n+1}}{\pi}\frac{a \sin{\pi a}}{n^2-a^2}$$
So the Fourier expansion is $$f_a(x)=\cos(ax)=\frac{\sin{\pi a}}{\pi a} \left [1+2 a^2 \sum_{n=1}^{\infty} \frac{(-1)^{n+1} \cos{n x}}{n^2-a^2} \right ]$$
In other words
$$ \sum_{n=1}^{\infty} \frac{(-1)^{n+1} \cos{n x}}{n^2-a^2} = \frac 1 {2a^2}\left ( \frac{\pi a \cos(ax)}{\sin(\pi a)} - 1\right)$$
Evaluating at $x=1-\pi\in [-\pi, \pi)$ gives
$$\sum_{n=1}^{\infty} \frac{ \cos n}{n^2-a^2} = \frac 1 {2a^2}\left (1 - \frac{\pi a \cos(a(1 - \pi))}{\sin(\pi a)} \right)$$
Now letting $a\rightarrow 0$ gives
$$\begin{split}
\sum_{n=1}^{\infty} \frac{ \cos n}{n^2} &= \lim_{a\rightarrow 0}\frac 1 {2a^2}\left ( 1 - \frac{\pi a \cos(a (1-\pi))}{\sin(\pi a)} \right)\\
&=\lim_{a\rightarrow 0}\frac 1 {2a^2}\left (1 -  \frac{\pi a \left(1-\frac{a^2(1-\pi)^2}{2} + o(a^2)\right)}{\pi a -\frac{\pi^3 a^3}6 + o(a^2)} \right)\\
&= \lim_{a\rightarrow 0}\frac 1 {2a^2}\left (\frac{a^2}2 - a^2\pi + a^2\frac{\pi^2}3 +o(a^2)\right)\\
&=\frac 1 4 -\frac {\pi} 2 + \frac {\pi^2} 6
\end{split}$$
A: As @Matthew Pilling commented, write
$$\sum_{n=1}^\infty \frac{\cos (n)}{n^2}=\Re\Bigg[\sum_{n=1}^{\infty}\frac{(e^i)^n}{n^2}\Bigg]$$ Let $x=e^i$
$$\sum_{n=1}^{\infty}\frac{(e^i)^n}{n^2}=\sum_{n=1}^{\infty}\frac{x^n}{n^2}=\int \sum_{n=1}^{\infty}\frac{x^{n-1}}{n}\,dx=\frac 1x\int\sum_{n=1}^{\infty}\frac{x^{n}}{n}\,dx=-\int\frac{\log (1-x)}{x}\,dx$$
$$-\int\frac{\log (1-x)}{x}\,dx=\text{Li}_2(x)$$
$$\sum_{n=1}^\infty \frac{\cos (n)}{n^2}=\Re\Big[\text{Li}_2(e^i)\Big]=\frac{1}{2} \left(\text{Li}_2\left(e^{i}\right)+\text{Li}_2\left(e^{-i}\right)\right)$$ which is ... a number equal to
$$0.324137740053329817241093475006273747120365201519245527248\cdots$$ which I could not identify using inverse symbolic calculators but which is effectively equal to the nice expression from Wolfram Alpha.
