# Complex Analysis/Residue Theory/A More "Complex" Solution

There is a much more general, more lovely, all-pole encompassing formula for determining residues. We start off by examining the Laurent series of a function:

${\displaystyle f(z)=\sum _{n=-\infty }^{\infty }a_{n}(z-z_{0})^{n}}$

And when examining the expansion we note that if we want the residue of the simple pole of a function, we want the coefficient ${\displaystyle a_{-1}}$. The second order pole, ${\displaystyle a_{-2}}$, and so on. In order to really see what's going on in the formula, it's best to look at the expansion:

${\displaystyle f(z)=...+{\frac {a_{-2}}{(z-z_{0})^{2}}}+{\frac {a_{-1}}{(z-z_{0})}}+a_{0}+a_{1}(z-z_{0})+a_{2}(z-z_{0})^{2}+...}$

Say we want the residue of ${\displaystyle z_{0}}$ from a function with a 2nd-order pole about that point, we first multiply by ${\displaystyle (z-z_{0})^{2}}$:

${\displaystyle f(z)={\frac {a_{-2}}{(z-z_{0})^{2}}}+{\frac {a_{-1}}{(z-z_{0})}}+a_{0}+a_{1}(z-z_{0})+a_{2}(z-z_{0})^{2}+...}$

${\displaystyle (z-z_{0})^{2}f(z)=a_{-2}+a_{-1}(z-z_{0})+...\,}$

We now want to isolate the ${\displaystyle a_{-1}}$ term, so we take a derivative:

${\displaystyle g(z)={\frac {d}{dz}}((z-z_{0})^{2}f(z))=a_{-1}+...}$

Now if we evaluate ${\displaystyle g}$ at ${\displaystyle z_{0}}$, the remaining terms will be zero, thus:

${\displaystyle g(z_{0})={\frac {d}{dz}}((z-z_{0})^{2}f(z))=a_{-1}}$

gets us the residue, from repeating this same procedure the general formula can be obtained quite easily.

## The Residue Formula

${\displaystyle \mathrm {Res} (f,z_{0})=\lim _{z\rightarrow z_{0}}{\frac {1}{(m-1)!}}{\frac {d^{m-1}}{dz^{m-1}}}{\Big (}(z-z_{0})^{m}\cdot f(z){\Big )}}$

Where ${\displaystyle z_{0}}$ is the point about which the residue is to be found, ${\displaystyle f}$ is the function.

There are some extra terms placed into this formula that weren't discussed above. The factorial eliminates the extra multiplied terms from the derivatives, and the limit deals with issues caused by a removable singularity.