In complex analysis, the residue theorem, sometimes called Cauchy's residue theorem, is a powerful tool to evaluate line integrals of analytic functions over closed curves; it can often be used to compute real integrals and infinite series as well. It generalizes the Cauchy integral theorem and Cauchy's integral formula. From a geometrical perspective, it can be seen as a special case of the generalized Stokes' theorem. Statement The statement is as follows: Let be a simply connected open subset of the complex plane containing a finite list of points , , and a function defined and holomorphic on . Let be a closed rectifiable curve in , and denote the winding number of around by . The line integral of around is equal to times the sum of residues of at the points, each counted as many times as winds around the point: If is a positively oriented simple closed curve, if is in the interior of , and 0 if not, therefore with the sum over those inside . The relationship of the residue theorem to Stokes' theorem is given by the Jordan curve theorem. The general plane curve must first be reduced to a set of simple closed curves whose total is equivalent to for integration purposes; this reduces the problem to finding the integral of along a Jordan curve with interior . The requirement that be holomorphic on is equivalent to the statement that the exterior derivative on . Thus if two planar regions and of enclose the same subset of , the regions and lie entirely in , and hence is well-defined and equal to zero. Consequently, the contour integral of along is equal to the sum of a set of integrals along paths , each enclosing an arbitrarily small region around a single — the residues of (up to the conventional factor ) at . Summing over , we recover the final expression of the contour integral in terms of the winding numbers . In order to evaluate real integrals, the residue theorem is used in the following manner: the integrand is extended to the complex plane and its residues are computed (which is usually easy), and a part of the real axis is extended to a closed curve by attaching a half-circle in the upper or lower half-plane, forming a semicircle. The integral over this curve can then be computed using the residue theorem.