Skip to content

Summing a Series by Residues

The problem

Evaluate

\[\sum_{n=1}^{\infty}\frac{1}{n^2}\]

Euler solved this in 1735 by a brilliant and, at the time, entirely unjustified manipulation of \(\sin x\) as an infinite product. The contour method gets it in half a page, generalises immediately, and needs nothing you have not already met.

The trick

\(\pi\cot(\pi z)\) has a simple pole at every integer, each with residue exactly 1:

\[\cot(\pi z) = \frac{\cos\pi z}{\sin\pi z}, \qquad \operatorname{Res}_{z=n}\pi\cot(\pi z) = \frac{\pi\cos\pi n}{\pi\cos\pi n} = 1\]

So for any \(f\), the function \(\pi\cot(\pi z)f(z)\) has residue \(f(n)\) at each integer. A sum has been converted into a set of residues — and residues are what contour integration handles.

The argument

Take a large square contour \(C_N\) with corners at \(\pm(N+\tfrac12)(1\pm i)\) — deliberately passing between integers, where \(\cot(\pi z)\) is well behaved. By the residue theorem:

\[\frac{1}{2\pi i}\oint_{C_N}\pi\cot(\pi z)f(z)\,dz = \sum_{n=-N}^{N}f(n) \;+\; \sum_{\text{poles of }f}\operatorname{Res}\left[\pi\cot(\pi z)f(z)\right]\]

The key fact — and the only analytic work — is that \(|\cot(\pi z)|\) is bounded on these contours, uniformly in \(N\). So if \(f\) decays faster than \(1/|z|\), the integral \(\to 0\) as \(N\to\infty\), leaving

\[\boxed{\;\sum_{n=-\infty}^{\infty}f(n) = -\sum_{\text{poles of }f}\operatorname{Res}\left[\pi\cot(\pi z)f(z)\right]\;}\]

An infinite sum equals a finite set of residues. That is the whole method.

Applying it to \(1/n^2\)

Take \(f(z) = 1/z^2\). Its only pole is at the origin — which is also a pole of \(\cot\), so the two combine into a third-order pole, and we need the Laurent expansion.

\[\cot w = \frac{1}{w} - \frac{w}{3} - \frac{w^3}{45} - \cdots\]

so with \(w = \pi z\):

\[\pi\cot(\pi z) = \frac{1}{z} - \frac{\pi^2z}{3} - \frac{\pi^4z^3}{45} - \cdots\]
\[\pi\cot(\pi z)\cdot\frac{1}{z^2} = \frac{1}{z^3} - \frac{\pi^2}{3z} - \frac{\pi^4z}{45} - \cdots\]

Read off the coefficient of \(1/z\):

\[\operatorname{Res}_{z=0} = -\frac{\pi^2}{3}\]

The theorem then gives \(\sum_{n\neq0}1/n^2 = \pi^2/3\). Since the sum is symmetric in \(\pm n\):

\[\sum_{n=1}^{\infty}\frac{1}{n^2} = \frac{\pi^2}{6} = 1.6449340668\ldots\]

Numerical check: summing two million terms directly gives 1.644933567, differing from \(\pi^2/6\) by \(5\times10^{-7}\) — consistent with the tail \(\sim1/N\), and confirming the closed form.

Why it generalises so cheaply

The same contour, a different \(f\), and nothing else changes:

\(f(z)\) Residue at 0 Result
\(1/z^2\) \(-\pi^2/3\) \(\sum 1/n^2 = \pi^2/6\)
\(1/z^4\) \(-\pi^4/45\) \(\sum 1/n^4 = \pi^4/90\)
\(1/z^6\) \(-2\pi^6/945\) \(\sum 1/n^6 = \pi^6/945\)

(Checked numerically: \(\sum1/n^4\) to \(2\times10^5\) terms gives 1.082323234, and \(\pi^4/90 = 1.082323234\).)

Each requires one more term of the \(\cot\) expansion and nothing else. Euler's method needed a fresh insight for each case; this needs a fresh Taylor coefficient.

And when \(f\) has poles away from the integers, they contribute too. For \(f = 1/(z^2+a^2)\) the poles at \(\pm ia\) give

\[\sum_{n=-\infty}^{\infty}\frac{1}{n^2+a^2} = \frac{\pi}{a}\coth(\pi a)\]

a result that is essentially unobtainable by elementary means, and which appears directly in lattice Green's functions and in the Casimir calculation.

Why \(\zeta(3)\) resists

The method gives every even power effortlessly and no odd power at all. For \(f = 1/z^3\) the sum \(\sum_{n=-\infty}^{\infty}1/n^3\) vanishes by antisymmetry, and the residue theorem returns \(0 = 0\) — true, and useless.

That asymmetry is not an accident of technique. \(\zeta(3)\) was proved irrational only in 1978 (Apéry), and no closed form in terms of \(\pi\) is known. The contour method's silence here is a genuine reflection of the mathematics, not a failure of cleverness.

Common mistakes

  • Letting the contour pass through an integer. \(\cot(\pi z)\) blows up there; the corners at half-integers are chosen precisely to avoid it.
  • Forgetting that a pole of \(f\) at an integer merges with \(\cot\)'s pole. Then the order goes up and you need more Laurent terms — as at \(z=0\) above.
  • Dropping the poles of \(f\) elsewhere. They contribute residues too.
  • Using it on a slowly decaying \(f\). The contour integral must vanish, which needs decay faster than \(1/|z|\). For \(f\sim1/z\) use \(\pi\csc(\pi z)\) and the alternating-sum variant instead.

Residue theorem · Laurent series · Contour integration · Singularities & branch points · Contour integrator — residues evaluated numerically