This is a variant of Exercise 64 in Chapter 9 of concrete mathematics.
Prove the following identity \begin{equation} \sum_{n = -\infty}^{\infty}' \frac{1 - \cos( 2\pi n k )}{n^2 } = 2 \pi^2 ( k - k^2 ) \qquad k \in [0,1] \end{equation} I came across it in a different context and was surprised that it is exact.
Let's use Euler-Maclaurin expansion to convert the sum into an integral.
Take $f(x) = \frac{1 - \cos( 2\pi x k )}{x^2 } $ \begin{equation} \sum_{n = -N+1}^{N}' f(n) = \int_{-N}^{N} f(x) dx - f(0) + \sum_{k=1}^{p} \frac{B_k}{k!}f^{(k-1)}(x)\Big|^N_{-N} + R_p \end{equation} The first two terms are already the exact result, \begin{equation} \int_{-\infty}^{\infty} f(x) dx = 2\pi k \int_{-\infty}^{\infty} \frac{1- \cos x}{x^2}dx = 2\pi^2 k \qquad f(0) = 2\pi^2 k^2 \end{equation} so one needs to prove the end point corrections(terms with $B_k$ in it) as well as the reminder terms are zero.
At any order $p$, there are only finite number of end point correction terms which goes at most like $\mathcal{O}(\frac{1}{N^2})$, so they vanish when taking the $N\rightarrow \infty$ limit. But I don't know how to show the reminder term is zero(as $N\rightarrow \infty$), \begin{equation} R_p(N) = (-1)^p \int_{-N}^{N} \frac{1}{p!} B_p( x - \lfloor x \rfloor ) f^{(p)}(x) dx \end{equation} Maybe there are other methods to prove the identity, but I personally would appreciate the proof using Euler Maclaurin, since I'm going to use it for another series, and the reminder term has \begin{equation} f(x) = \frac{g(x) - g(0) }{ x^2} - \frac{g'(0)}{x} \end{equation} where $g(x ) = g(x + N)$ is a periodic function. So you can also go ahead and prove the general $g(x)$ case.
Thanks.
Edit: The general case can also be worked out by robjohn 's method by summing over each individual the Fourier components. Though a direct proof of the vanishing Euler-Maclaurin reminder term is still absent, robjohn's method solved my problem.