(Lecture 23 of Mathematical Methods II.)
Residue theory is the culmination of complex integration, bringing together Cauchy's integral formula and Laurent Series. Integrating both sides of the Laurent expansion around $z_0$:
\begin{equation} \tag{1} \oint f(z)\,dz=\sum_{n=-\infty}^\infty c_n\oint (z-z_0)^n\,dz\,, \end{equation}
and remembering that $\oint(z-z_0)^n\,dz=2i\pi\delta_{n,-1}$, we find:
\begin{equation} \tag{2} \oint f(z)\,dz=2i\pi c_{-1} \end{equation}
The coefficient of the negative power of order one in the Laurent expansion is called the Residue. We write: $\mathrm{Res}_{z=z_0}f(z)=c_{-1}$. To calculate a residue at a pole, we need not produce a whole Laurent series, but, more economically, we can derive formulas to compute residues:
Simple poles:
\begin{align} \tag{3} \mathrm{Res}_{z=z_0}f(z)&=\lim_{z\rightarrow z_0}(z-z_0)f(z)\,,\\ \mathrm{Res}_{z=z_0}\frac{p(z)}{q(z)}&=\frac{p(z_0)}{q'(z_0)}\,, \end{align}
where, in the latter case, $f(z_0)\neq0$ and $z_0$ is a simple zero of $q$.
The generalization to higher poles provides the formula:
\begin{equation} \tag{4} \mathrm{Res}_{z=z_0}f(z)=\frac{1}{(m-1)!}\lim_{z\rightarrow z_0}\left\{\frac{d^{m-1}}{dz^{m-1}}\left[(z-z_0)^m f(z)\right]\right\}\,. \end{equation}
In particular, for a pole of order 2:
\begin{equation} \mathrm{Res}_{z=z_0}f(z)=\lim_{z\rightarrow z_0}\{[(z-z_0)^2f(z)']\tag{5}\,. \end{equation}
The so-called Residue Theorem extends this technique to the case of several singularities: if $f$ is holomorphic inside a simple closed path $\mathcal{C}$ and on $\mathcal{C}$, except for finitely many points $z_1$, \dots, $z_n$, inside $\mathcal{C}$, then the integral of $\mathcal{C}$ in the trigonometric sense is $2i\pi$ times the sum of the residues at the poles:
\begin{equation} \tag{6} \oint_\mathcal{C}f(z)\,dz=2i\pi\sum_{k=1}^n\mathrm{Res}_{z=z_k}f(z)\,, \end{equation}
The method of Residue is useful to compute integrals not only in the complex planes but also of the real variable. For instance, rational functions of $\cos(\theta)$ and $\sin(\theta)$ in polar coordinates are easily obtained through the substitution:
\begin{align} \tag{7} \cos(\theta)&=\frac{1}{2}\left(z+\frac{1}{z}\right)\,,\\ \sin(\theta)&=\frac{1}{2i}\left(z-\frac{1}{z}\right)\,, \end{align}
that turns them into rational functions of $z$ on a complex circle; indeed, $d\theta=dz/(iz)$ and:
\begin{equation} \tag{8} \int_0^{2\pi} F(\cos(\theta),\sin(\theta))\,d\theta=\oint_\mathcal{C}\frac{f(z)}{iz}\,dz\,, \end{equation}
that can thus be integrated by the method of Residues. We will see in next lectures how other types of integrals can be similarly easily calculated thanks to residues.