I'm a physicist with no clue how to calculate $S = \sum_{k=1}^{\infty} \frac{\cos(kx)}{k^2}$.
One handbook says the answer is $\frac{1}{12}(3x^2 - 6 \pi x + 2 \pi^2)$ on the interval $0 \leq x \leq 2\pi$, which would give the value everywhere since the sum is periodic in $2\pi$.
Altland's Condensed Matter Field Theory gives the value as
$\frac{\pi^2}{6} - \frac{\pi |x|}{2} + \frac{x^2}{4} + \dots$, giving no domain and with a weird absolute value, implying the series is valid everywhere and has higher powers. But how can this be correct? The series is periodic and those first three terms give the complete answer on $0 \leq x \leq 2\pi$, so trying to define the result everywhere with an infinite power series seems senseless to me.
Anyway, can anybody shed light on how to perform the summation? I've tried writing $S$ as a contour integration, like so:
$\frac{1}{2\pi i} \oint dz g(z) \frac{\cos(i z x)}{-z^2} $, where $g(z) = \frac{\beta}{exp(\beta z) - 1}$, a counting function with simple poles at $z = i k$, $k = ..., -2, -1, 0, 1, 2, \dots$, and the contour contains all the poles of $g(z)$ for $k = 1, 2, 3, ...$.
Now, this is not my expertise, but I want to learn. The trick now is to pick a different contour (possibly going off to infinity), such that the integral can be performed. I see that the product $g(z) \frac{\cos(i z x)}{-z^2}$ goes to zero at infinity, but I cannot see how to deform the contour such that the integral becomes tractable.
$$S=\frac{\text{Li}_2\left(e^{i x}\right)+\text{Li}_2\left(e^{-i x}\right)}{2}$$
which isn't really enlightening given what generated it.
– GPhys Jan 25 '16 at 10:33