Solution (source code)

= Solution

A <simple pole> at $z_0$ means that $f$ is <holomorphic> in a punctured neighbourhood and $(z-z_0)f(z)$ extends holomorphically to a nonzero value at $z_0$. Equivalently its <Laurent series> begins with $a_{-1}/(z-z_0)$ and has no higher negative powers. The <residue> is
$$
\boxed{\operatorname{Res}(f,z_0)=\lim_{z\to z_0}(z-z_0)f(z).}
$$
In particular, if $f=g/h$ with $g(z_0)\ne0$, $h(z_0)=0$ and $h'(z_0)\ne0$, this becomes $\operatorname{Res}(f,z_0)=g(z_0)/h'(z_0)$. The associated <residue theorem> is
$$
\boxed{\oint_C f(z)\,dz=2\pi i\sum_{z_j\text{ inside }C}\operatorname{Res}(f,z_j)}
$$
for a positively oriented simple <contour> with no poles on it.