Why does the Residue Theorem still hold, when I let my contour get infinitely large? The theorem (as I know it) only allows for a finite set of isolated singularities.
I integrated, along a square box, a function that has simple poles at all the non-zero integers -- and a triple pole at zero.  Then I let the box get infinitely large to help prove that the sum of $1/n^2$ is $\pi^2 / 6$.
But why can the Residue Theorem still be applied, even though the box is getting infinitely large, and the poles will eventually become an infinite set?
...I know that a box is compact, and poles at the integers means this set of poles is a discrete set, hence the set of poles in this compact box ...is finite.  But something about taking the limit is bugging me.
Thanks,
 A: To reiterate and amplify the comments: You are not actually making a contour infinitely large. Instead, you're considering a sequence of contours $(\gamma_{N})$, each enclosing finitely many poles. For each $N$, you use the residue theorem to deduce an equation of the form
$$
a_{N} = \frac{1}{2\pi i} \oint_{\gamma_{N}} f(z)\, dz = b_{N} + c_{N} + \cdots,
$$
in which $a_{N}$ is the sum of the residues of the enclosed poles, and the terms on the right are contributions to the integral from smooth portions of the contour.
Next you focus on the termwise equality of sequences
$$
a_{N} = b_{N} + c_{N} + \cdots,
$$
taking the limit as $N \to \infty$. Chances are you've arranged that $a_{N}$ converges to the sum of some series (such as $\zeta(2)$) or can be evaluated explicitly (e.g., because there are only finitely many poles), and that the limits of the expressions on the right can be evaluated (or are themselves integrals of interst).
In the end, you have a useful evaluation of some quantity, often an improper integral or the sum of an infinite series.
For brevity, one often speaks of the process as if there's a "limiting contour" enclosing all the poles, but technically that's not the underlying reasoning.
