<aside> 🍖 A residue is the first non zero term in the principle part of the Laurent series evaluated about a point $z=a$
</aside>
The Laurent series for some function $f(z)$ expanded about $z=a$ valid within $0<|z-a|<R$
$$ f(z)=\sum_{n=1} \frac{b_n}{(z-a)^n}+\sum_{n=0} a_n (z-a)^n $$
Then for some curve $C$ lying within $0<|z-a|<R$
$$ \oint f(z)\,\text dz =2\pi i b_1 $$
the coefficient b$_1$ is the residue of $f(z)$ at $z=0$
🧔♀️ Theorem: Residue theorem states that for a curve $C$ that encloses a number of poles of $f(z)$, the closed contour integral around $C$ is
$$ \oint _C f(z)\,\text dz=2\pi i $$
💼 Case: lets evaluate $\oint_C \frac{1}{z(z-2)}\,\text dz$ where $C$ encloses both $z=0$ and $z=2$
$$ \begin{aligned} \oint_C \frac{1}{z(z-2)} \,\text dz =\oint _{C_1} \frac{1}{z(z-2)} \,\text dz \\+\oint _{C_2}\frac{1}{z(z-2)}\,\text dz \end{aligned} $$
Evaluating using Cauchy’s integral
For $C_1$
$$ \frac{1}{z(z-2)}=\frac{f(z)}{z} \qquad \oint_{C_1} \frac{1}{z(z-2)}\,\text dz=2\pi i f(0) =2\pi i\left ( \frac{1}{z-2} \right )_{z=0} = -\pi i $$
For $C_2$
$$ \frac{1}{z(z-2)}=\frac{f(z)}{z-2} \qquad \oint_{C_2} \frac{1}{z(z-2)}\,\text dz=2\pi i f(2) =2\pi i\left ( \frac{1}{z} \right )_{z=2} = \pi i $$
Combining
$$ \oint_C \frac{1}{z(z-2)} \,\text dz=-\pi i + \pi i=0 $$
Using the residue theorem we expand around each pole in each contour
Around $C_1$, there is a pole at $z=0$
$$ \begin{aligned} \frac{1}{z(z-2)}&=\frac{-1}{2z}\left ( 1- \frac{z}{2} \right ) ^{-1} \\ &=\frac{-1}{2z}\left ( 1 + \frac{z}{2} + \ldots \right ) = \frac{-1}{2z} -\frac{1}{4} +\ldots \end{aligned} $$
Thus the residue from $C_1$ is $b_1=-\frac 12$
Around $C_2$ there is a pole at $z=2$ and substituting $w=z-2$
$$ \begin{aligned} \frac{1}{z(z-2)}&=\frac{1}{w(w+2)}=\frac{1}{2w}\left ( 1+ \frac{w}{2} \right ) ^{-1} \\ &=\frac{1}{2w}\left ( 1 + \frac{w}{2} + \ldots \right ) = \frac{1}{2w} -\frac{1}{4} +\ldots \end{aligned} $$
So the residue from $C_2$ is $b_1=\frac{1}{2}$. The integral around $C$ is therefore
$$ \oint_C\frac{1}{z(z-2)}\,\text dz=2\pi i \left ( - \frac{1}{2} + \frac{1}{2} \right ) =0 $$
as before
💃 Example: $f(z)=\frac{z-1}{z(z-2)}$
It has poles at $z=0$ and $z=2$
The residue at $z=0$ is given by
$$ \text{res} (0)=\lim _{z\to 0 } \left [ z\frac{(z-1)}{z(z-2)} \right ]=\frac{0-1}{0-2}=\frac{1}{2} $$
At $z=2$ the residue is
$$ \text{res}(2)=\lim_{z\to 2} \left [ (z-2)\frac{(z-1)}{z(z-2)} \right ]=\frac{2-1}{2}=\frac{1}{2} $$