the sum-of-all-residues identity
Here is a strikingly clean accounting law: for a nicely behaved function, if you add up all of its residues — every finite singularity plus the residue at infinity — the total is exactly zero. Nothing is left over. It is as though residues were a conserved quantity whose books must always balance across the whole sphere.
The statement: if f is holomorphic on the entire complex plane except for finitely many isolated singularities (so f is rational, or more generally meromorphic on the Riemann sphere), then the sum of Res(f, z_j) over all finite singularities z_j, plus Res(f, infinity), equals 0. The reason is short and elegant. Take a circle |z| = R large enough to enclose every finite singularity. By the residue theorem the integral over that circle equals 2 pi i times the sum of all finite residues. But by the very definition of the residue at infinity, that same integral also equals minus 2 pi i times Res(f, infinity). Setting the two expressions equal and dividing by 2 pi i gives: the sum of all finite residues plus Res(f, infinity) = 0. The point at infinity is not a special exception; it is the one extra entry that closes the ledger.
This identity is genuinely useful, not just pretty. When a rational function has many finite poles but a simple structure at infinity, it is often far less work to compute the single residue at infinity (via w = 1/z) and use the identity to get the sum of all the finite residues in one stroke — which by the residue theorem is the contour integral you wanted. It is the philosophical capstone of residue calculus: on the closed surface of the Riemann sphere there is no 'outside,' so all the local data must sum to nothing.
For f(z) = 1 / (z^2 - 1) = 1/((z-1)(z+1)), the finite residues are 1/2 at z = 1 and -1/2 at z = -1, summing to 0; consistently, the residue at infinity is 0 too, and the total is 0.
Finite residues plus the residue at infinity always sum to zero.
The identity needs f to have only finitely many singularities in the whole plane (meromorphic on the sphere); a function with infinitely many poles, like 1/sin z, does not qualify and the bare identity fails. The minus sign hidden in the definition of the residue at infinity is what makes the total vanish.