If we start from the Fourier series of the sawtooth wave, giving that
$$ f(x)=\sum_{n\geq 1}\frac{\sin(nx)}{n}$$
is a $\pi$-periodic function that equals $\frac{\pi-x}{2}$ over $(0,\pi)$, by termwise integration we get that
$$ g(x) = \sum_{n\geq 1}\frac{1-\cos(nx)}{n^2} = \frac{\pi x}{2}-\frac{x^2}{4} $$
for any $x\in(0,\pi)$. By evaluating at $x=1$,
$$ \sum_{n\geq 1}\frac{\cos n}{n^2} = \color{red}{\zeta(2)-\frac{\pi}{2}+\frac{1}{4}} $$
follows.
An alternative approach is given by the Laplace transform (one of my all-time favourites).
Since
$$\mathcal{L}^{-1}\left(\frac{1}{x^2}\right)=s, $$
we have:
$$ \sum_{n\geq 1}\frac{\cos n}{n^2} = \int_{0}^{+\infty}\sum_{n\geq 0} s\cos(n) e^{-ns}\,ds=-\int_{0}^{+\infty}\frac{s}{2}\left(\frac{1}{e^{s+i}-1}+\frac{1}{e^{s-i}-1}\right)\,ds $$
or:
$$ \sum_{n\geq 1}\frac{\cos n}{n}=\int_{0}^{+\infty}\frac{e^s\cos(1)-1}{e^{2s}-2e^{s}\cos(1)+1}\,s\,ds\\ = \int_{0}^{+\infty}\left(s-\log\sqrt{e^{2s}-2e^s\cos(1)+1}\right)\,ds\\ = -\frac{1}{2}\int_{0}^{+\infty}\log\left(1+e^{-2s}-2e^{-s}\cos(1)\right)\,ds\\=-\int_{0}^{1}\frac{\log(1+t^2-2t\cos(1))}{2t}\,dt $$
that can be tackled through the residue theorem or Weierstrass products.
However, I think that the approach through Fourier series is way easier.
Thanks to all guys
– Joe Jul 11 '16 at 22:42