Let be a piecewise smooth contour forming a simple closed curve, positively oriented: travel counterclockwise, with the interior on the left. Suppose is holomorphic on an open set containing and its interior, except at finitely many isolated singularities strictly inside. ThenNo isolated singularity may lie on : the ordinary contour integral must be defined there. Reversing the direction of the contour reverses the sign of the answer. The theorem applies to essential singularities as well as poles. [ref]
Return to . A counterclockwise circle encloses both simple poles, soYet is nonzero everywhere it is defined. A zero contour integral does not imply a zero function, or even absence of poles: the enclosed residues can cancel. By contrast, the counterclockwise circle encloses only , givingThe picture compares these two selections. Changing the shape of a contour while keeping the same enclosed poles leaves the contour integral unchanged, provided the contour deformation stays where is holomorphic.
This is the practical appeal of the residue theorem: local Laurent coefficients determine a global contour integral. For a rational function, a few simple pole computations can replace a long parametrized calculation. It also makes real improper integrals accessible by treating the real line as part of a closed contour in the complex plane.
To compute , take and travel along the real line from to , then return along the upper semicircle , parametrized by for . This contour is positively oriented and encloses the simple pole only; is outside. HenceThe added arc must be controlled before taking a limit. On , the reverse triangle inequality gives , and the arc length is . The estimation lemma therefore yieldsThe denominator grows quadratically while the arc length grows only linearly. This quantitative comparison, rather than a sketch alone, explains why closing the contour does not alter the limiting real improper integral. It even supplies an error bound: the difference between and the finite real integral is at most .
For a numerical check, gives the finite real integral , leaving about to reach . The arc bound is , comfortably larger than that error. The graph shows both quantities approaching zero. The exact tail here can be checked with the antiderivative ; the residue theorem method remains useful for improper integrals where a convenient real antiderivative is unavailable.
Finally, both one-sided improper integrals converge absolutely: for , , whose tails are integrable. Thus the symmetric limit computes the ordinary improper integral, not merely a Cauchy principal value, andClosing below instead would enclose the simple pole . With the same left-to-right traversal of the real line, that contour is clockwise, so its contour integral is again. This provides a useful sign check: the opposite residue is accompanied by the opposite direction around the enclosed region.
The same strategy extends to many other rational functions: choose a contour, identify its enclosed isolated singularities, compute their residues, and bound the added pieces. The choice of contour and the bound are as much part of the calculation as the residues. [ref]
New to topics? Read the docs here!

