---
title: Singularities and residues
heading: Classifying the points where a function breaks, and the one number that matters
eyebrow: A12 · Lesson 16 · Singularities and residues
xp: 40
---

::: hook
The places where a function stops being analytic aren't all alike. At some, the trouble is only apparent ($\sin z/z$ at 0 just needs the value 1); at **poles** the function blows up like $1/(z - a)^m$; at **essential singularities**, like $e^{1/z}$ at 0, it does something wilder, taking almost every value near the point. For each isolated singularity, one number, the **residue**, the coefficient of $1/(z - a)$ in the Laurent series, decides every contour integral around it. Engineers know residues already: they're the partial-fraction coefficients of a transfer function, the amplitudes of each pole's term in the impulse response.
:::

::: play
- $H(s) = \frac{s + c}{(s + a)(s + b)}$ has poles at −a and −b (×) and a zero at −c (○). The readouts give each pole's residue: the coefficient of its term in the partial fractions $\frac{r_1}{s + a} + \frac{r_2}{s + b}$.
- Move the zero onto a pole: that pole's residue becomes 0, because the zero cancels it and its term disappears.
- Move the poles toward each other: the residues grow huge with opposite signs. When they meet, the pole becomes double and needs a different formula.
:::
:::

```sim plot
view: splane
x: sigma = -6..1
y: omega = -3..3
slider: a = 0.2..5 step 0.1 = 1
slider: b = 0.2..5 step 0.1 = 3
slider: c = 0..5 step 0.1 = 2
pole: -a | label: −a
pole: -b | label: −b
zero: -c | label: −c
readout: residue at −a = (c - a)/(b - a + 1e-9)
readout: residue at −b = (c - b)/(a - b + 1e-9)
```

::: predict
## What's the residue of $\frac{e^z}{z - 2}$ at $z = 2$?

- [ ] 0
- [ ] 1
- [x] $e^2$
- [ ] $2\pi j e^2$

::: reveal
$e^2 \approx 7.39$: at a simple pole, the residue is $\lim_{z\to a}(z - a)f(z)$, which here is $e^2$. The integral around a loop enclosing it would be $2\pi j$ times that.
:::
:::

::: nameit
## Kinds of isolated singularity

At a point a where f is analytic nearby but not at a, look at the Laurent series in $0 < \lvert z - a\rvert < r$:

| Kind | Principal part | Example at 0 |
|---|---|---|
| removable | none | $\sin z/z$ |
| pole of order m | ends at $(z - a)^{-m}$ | $1/z^2$ (m = 2) |
| essential | infinitely many terms | $e^{1/z}$ |

A pole of order m is where $(z - a)^m f(z)$ becomes analytic and nonzero; f has a pole of order m wherever $1/f$ has a zero of order m.

## Residues

$\text{Res}(f, a) = c_{-1}$, and:

- **simple pole:** $\text{Res} = \lim_{z\to a}(z - a)f(z)$; for $f = g/h$ with $h(a) = 0$, $h'(a) \ne 0$: $\text{Res} = g(a)/h'(a)$;
- **pole of order m:** $\text{Res} = \frac{1}{(m - 1)!}\lim_{z\to a}\frac{d^{m-1}}{dz^{m-1}}\left[(z - a)^m f(z)\right]$;
- **essential:** read $c_{-1}$ off the Laurent series.

## In systems

For a rational $H(s)$ with simple poles $p_k$, the partial-fraction coefficients are the residues: $H(s) = \sum_k \frac{\text{Res}(H, p_k)}{s - p_k}$ (plus a polynomial if the degree allows). Each becomes a term $\text{Res}(H, p_k)e^{p_kt}$ in the impulse response (lesson 20).
:::

::: example
## Find the residues of $H(s) = \frac{s + 2}{(s + 1)(s + 3)}$.

::: solution
1. **Residue at −1.**
   $$\frac{-1 + 2}{-1 + 3} = \frac12$$
2. **Residue at −3.**
   $$\frac{-3 + 2}{-3 + 1} = \frac12$$
3. **Partial fractions and impulse response.**
   $$H = \frac{1/2}{s + 1} + \frac{1/2}{s + 3}$$
   and its impulse response is $\frac12(e^{-t} + e^{-3t})$.

**Answer:** both residues are $\frac12$, so the impulse response is $\frac12(e^{-t} + e^{-3t})$.
:::
:::

::: example
## Find the residue of $\frac{1}{z^2(z - 1)}$ at its double pole, z = 0.

::: solution
1. **Use the rule for m = 2.**
   $$\begin{aligned} \frac{d}{dz}\left[z^2\cdot\frac{1}{z^2(z - 1)}\right] &= \frac{d}{dz}\frac{1}{z - 1} \\ &= -\frac{1}{(z - 1)^2} \end{aligned}$$
   which is −1 at 0.
2. **Check with the other pole.** The simple pole at 1 has residue $1/1^2 = 1$; the two sum to 0, as they must for a function that falls off like $1/z^3$.

**Answer:** the residue at z = 0 is −1.
:::
:::

::: example
## Find the residues of $\frac{1}{\sin z}$ at 0 and at π, and of $\pi\cot\pi z$ at every integer.

::: solution
1. **Use g/h.** Each is $g/h$ with h having a simple zero, so the residue is $g(a)/h'(a)$.
2. **The function $1/\sin z$.** At 0 the residue is $1/\cos 0 = 1$, and at π it's $1/\cos\pi = -1$.
3. **The function $\pi\cot\pi z$.** Write it as $\frac{\pi\cos\pi z}{\sin\pi z}$, so $h' = \pi\cos\pi z$, and at an integer n the residue is
   $$\frac{\pi\cos\pi n}{\pi\cos\pi n} = 1$$
4. **Why it's useful.** A function with residue 1 at every integer can sum series: integrating $\pi\cot(\pi z)f(z)$ around a large square adds up $f(n)$ over all the integers it encloses.

**Answer:** $1/\sin z$ has residue 1 at 0 and −1 at π, and $\pi\cot\pi z$ has residue 1 at every integer.
:::
:::

::: check
given: a = 1 | 2 | 0.5; b = 3 | 4; c = 0 | 3 | 5
answer: (c - a)/(b - a)
tolerance: 0.5%

## What's the residue of $\frac{s + \given{c}}{(s + \given{a})(s + \given{b})}$ at $s = -\given{a}$?

::: right
Right. $(c - a)/(b - a)$ = {answer}.
:::

::: misses
- [(c - a)/(a - b)] Evaluate the other factor at $s = -a$: $-a + b$.
- [any] Not yet. Cover up $(s + a)$ and evaluate the rest at $s = -a$.
:::
:::

::: check
given: a = 1 | 2 | 0.5
answer: exp(a)
tolerance: 0.5%

## What's the residue of $\frac{e^z}{z - \given{a}}$ at $z = \given{a}$?

::: right
Right. $e^a$ = {answer}.
:::

::: misses
- [any] Not yet. $\lim (z - a)f(z)$.
:::
:::

::: check
given: a = 1 | 2 | 3
answer: 1/(2*a)
tolerance: 0.5%

## What's the residue of $\frac{1}{z^2 - \given{a}^2}$ at $z = \given{a}$? (Use $g(a)/h'(a)$.)

::: right
Right. $1/(2a)$ = {answer}.
:::

::: misses
- [1/a] $h'(z) = 2z$, so $h'(a) = 2a$.
- [any] Not yet. $g(a)/h'(a)$ with $h = z^2 - a^2$.
:::
:::

::: check
given: a = 1 | 2 | -1
answer: -1/a^2
tolerance: 0.5%

## What's the residue of $\frac{1}{z^2(z - \given{a})}$ at its double pole $z = 0$?

::: right
Right. $\frac{d}{dz}\frac{1}{z - a}$ at 0 is $-1/a^2$ = {answer}.
:::

::: misses
- [1/a^2] Mind the sign of the derivative.
- [any] Not yet. Differentiate $(z^2)f = \frac{1}{z - a}$ once, at 0.
:::
:::

::: check
given: n = 1 | 2 | 3
answer: 1/n!
tolerance: 0.5%

## $e^{1/z} = \sum_{k\ge 0}\frac{1}{k!\,z^k}$ has an essential singularity at 0. What's the coefficient of $z^{-\given{n}}$?

::: right
Right. $1/n!$ = {answer}. Its residue, the $z^{-1}$ coefficient, is 1.
:::

::: misses
- [any] Not yet. The term with $k = n$.
:::
:::

::: check
kind: choice

## What kind of singularity does $\frac{1 - \cos z}{z^2}$ have at 0?

- [x] Removable
- [ ] A simple pole
- [ ] A double pole
- [ ] Essential

::: misses
- [2] $1 - \cos z = z^2/2 - \cdots$, so the quotient tends to 1/2.
- [3] The $z^2$ in the numerator's series cancels the denominator.
- [4] Its Laurent series has no negative powers at all.
:::
:::

::: check
kind: parts
given: a = 1 | 2; b = 1 | 3

## $f = \frac{e^{\given{a}z}}{z^2 + \given{b}^2}$ has a simple pole at $z = \given{b}j$.

::: part
answer: sin(a*b)/(2*b)
tolerance: 0.5%

### What is the real part of the residue there?

::: misses
- [cos(a*b)/(2*b)] Dividing by $2jb$ turns $j\sin$ into the real part.
- [any] The residue is $\frac{e^{jab}}{2jb}$.
:::
:::

::: part
answer: -cos(a*b)/(2*b)
tolerance: 0.5%

### What is its imaginary part?

::: misses
- [cos(a*b)/(2*b)] $\frac1j = -j$.
- [any] $\frac{\cos ab + j\sin ab}{2jb}$.
:::
:::
:::

::: check
kind: derivation
vars: a = 0.5..2, b = 0.5..2

## $f = \frac{e^{bz}}{z^2 - a^2}$ has simple poles at $\pm a$.

::: step
answer: exp(a*b)/(2*a)

### What is the residue at a?
:::

::: step
answer: -exp(-a*b)/(2*a)

### At −a?
:::

::: step
answer: sinh(a*b)/a

### What is $\frac{1}{2\pi j}\oint f\,dz$ around a circle enclosing both?
:::

::: right
Right. That's $\frac{\sinh ab}{a}$, the inverse Laplace transform of $\frac{1}{s^2 - a^2}$ at $t = b$.
:::
:::

::: explain
## Why are a transfer function's partial-fraction coefficients the same as its residues?

::: model
Near a simple pole $p_k$, the partial-fraction expansion $H(s) = \sum_k \frac{A_k}{s - p_k}$ has exactly one term that blows up, $\frac{A_k}{s - p_k}$, and every other term is analytic there. So the Laurent series of H around $p_k$ starts with $A_k(s - p_k)^{-1}$, and the coefficient of $(s - p_k)^{-1}$ is by definition the residue. The cover-up rule for finding $A_k$, multiplying by $(s - p_k)$ and setting $s = p_k$, is the residue formula for a simple pole.
:::
:::

::: practice

::: check
given: a = 1 | 4; b = 2 | 6; c = 3
answer: (c - a)/(b - a)
tolerance: 0.5%

## Residue of $\frac{s + \given{c}}{(s + \given{a})(s + \given{b})}$ at $-\given{a}$?

::: misses
- [any] Cover-up.
:::
:::

::: check
given: a = 0.5 | 1 | 2 | 3 | 4 | 5
answer: 1/(2*a)
tolerance: 0.5%

## Residue of $1/(z^2 - \given{a}^2)$ at {a}?

::: misses
- [any] $1/(2a)$.
:::
:::

::: check
given: a = -4 | -3 | -2 | 1 | 2 | 3 | 5
answer: -1/a^2
tolerance: 0.5%

## Residue of $\frac{1}{z^2(z - \given{a})}$ at 0?

::: misses
- [any] $-1/a^2$.
:::
:::
:::
