---
title: Cauchy's integral formula
heading: A function's values inside a loop, from its values on it
eyebrow: A12 · Lesson 13 · Cauchy's integral formula
xp: 40
---

::: hook
For an analytic function, the values on a closed curve decide every value inside it. **Cauchy's integral formula** says how: the value at any interior point is an integral of the boundary values, weighted by $1/(z - a)$. It's the complex-variable version of a fact every electrical engineer relies on, that the potential inside a charge-free region is fixed by its values on the boundary. Its consequences are startling: an analytic function has derivatives of every order, its value at a point is the average of its values on any circle around it, and a function analytic and bounded everywhere must be constant.
:::

::: play
- The circle has radius R; the dot is a point a. The arrows are the field whose flux and work give $\oint \frac{e^z}{z - a}\,dz$ around the circle, computed numerically.
- By Cauchy's formula, $f(a) = \frac{1}{2\pi j}\oint\frac{f(z)}{z - a}\,dz$. The readouts compare $f(a) = e^a$ found that way with $e^a$ computed directly: while a is inside the circle they agree.
- Move a outside the circle: the integral collapses to 0, by Cauchy's theorem, because $e^z/(z - a)$ is then analytic inside.
:::
:::

```sim plot
view: flow
x: x = -2.5..2.5
y: y = -2..2
slider: ax = -2..2 step 0.05 = 0.4
slider: ay = -1.5..1.5 step 0.05 = 0.3
slider: R = 0.5..1.8 step 0.05 = 1.2
dx: exp(x)*(cos(y)*(x - ax) + sin(y)*(y - ay))/((x - ax)^2 + (y - ay)^2 + 1e-9)
dy: exp(x)*(cos(y)*(y - ay) - sin(y)*(x - ax))/((x - ax)^2 + (y - ay)^2 + 1e-9)
arrows: none
path: R*cos(u), R*sin(u) | over: u = 0..2*pi | work: W | flux: P
dot: ax, ay | label: a
readout: Re f(a) from the integral = P/(2*pi)
readout: Re eᵃ computed directly = exp(ax)*cos(ay)
readout: Im f(a) from the integral = -W/(2*pi)
readout: Im eᵃ computed directly = exp(ax)*sin(ay)
```

::: predict
## f is analytic inside and on the circle $\lvert z\rvert = 3$. What's $\frac{1}{2\pi}\int_0^{2\pi}f(3e^{j\theta})\,d\theta$, its average around the circle?

- [ ] 0
- [x] f(0)
- [ ] f(3)
- [ ] $3f(0)$

::: reveal
f(0): Cauchy's formula with a = 0 on the circle $z = 3e^{j\theta}$ gives $f(0) = \frac{1}{2\pi j}\oint\frac{f(z)}{z}dz = \frac{1}{2\pi}\int_0^{2\pi}f(3e^{j\theta})\,d\theta$. The value at the center is the average over any circle around it, the **mean value property** shared by every harmonic function.
:::
:::

::: nameit
## The formula

If f is analytic on and inside a simple closed path C, traversed counterclockwise, and a is inside C:

$$f(a) = \frac{1}{2\pi j}\oint_C \frac{f(z)}{z - a}\,dz$$

and differentiating under the integral,

$$f^{(n)}(a) = \frac{n!}{2\pi j}\oint_C \frac{f(z)}{(z - a)^{n+1}}\,dz$$

So an analytic function has derivatives of every order, all analytic.

## Turned around: evaluating integrals

The formula also computes integrals: $\oint\frac{g(z)}{(z - a)^{n+1}}dz = \frac{2\pi j}{n!}g^{(n)}(a)$ when g is analytic inside.

## Consequences

- **Mean value:** f at the center of a circle is the average of f on the circle.
- **Maximum modulus:** a non-constant analytic function's $\lvert f\rvert$ has no maximum inside a region; its largest values are on the boundary. (For potentials: no maxima or minima in charge-free space, Earnshaw's theorem.)
- **Liouville:** a function analytic in the whole plane and bounded is constant. So a polynomial with no roots would make $1/p(z)$ bounded and analytic everywhere, hence constant: every non-constant polynomial has a root, the **fundamental theorem of algebra**.
:::

::: example
## Evaluate $\oint\frac{e^z}{z - 1}\,dz$ around $\lvert z\rvert = 2$.

::: solution
1. **Match the formula.** Take $f = e^z$ and a = 1, which is inside the circle.
2. **Apply it.**
   $$\begin{aligned} I &= 2\pi j f(1) \\ &= 2\pi e j \\ &\approx 17.08j \end{aligned}$$

**Answer:** $2\pi e j \approx 17.08j$.
:::
:::

::: example
## Evaluate $\oint\frac{\sin z}{z^3}\,dz$ around $\lvert z\rvert = 1$.

::: solution
1. **Match the formula.** This is the n = 2 form with $f = \sin z$ and a = 0.
2. **Apply it.**
   $$\begin{aligned} I &= \frac{2\pi j}{2!}f''(0) \\ &= \pi j(-\sin 0) \\ &= 0 \end{aligned}$$

**Answer:** 0.
:::
:::

::: example
## In a charge-free region, the potential on a circle of radius 1 cm around a point P is $V(\theta) = 3 + 2\cos\theta + \sin 2\theta$ volts. What is the potential at P?

::: solution
1. **The potential is harmonic.** So it's the real part of an analytic function.
2. **Average around the circle.** The Cauchy integral formula with $z = z_0 + re^{j\theta}$ says the value at the center is the average around the circle:
   $$V(P) = \frac{1}{2\pi}\int_0^{2\pi}V(\theta)\,d\theta$$
3. **Average each term.** The cosine and sine terms average to zero over a full turn, so $V(P) = 3$ V.
4. **No peaks or dips.** The same property explains why a charge-free region has no potential peaks or dips inside it: an interior maximum would have to exceed its own average.

**Answer:** the potential at P is 3 V.
:::
:::

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

## What's the imaginary part of $\oint\frac{e^z}{z - \given{a}}\,dz$ around $\lvert z\rvert = 3$?

::: right
Right. $2\pi j\,e^a$: imaginary part {answer}.
:::

::: misses
- [exp(a)] Multiply by $2\pi j$.
- [any] Not yet. $2\pi j f(a)$ with $f = e^z$.
:::
:::

::: check
given: a = 0.5 | 1; n = 2 | 3 | 4
answer: 2*pi*exp(a)/n!
tolerance: 0.5%

## What's the imaginary part of $\oint\frac{e^z}{(z - \given{a})^{\given{n} + 1}}\,dz$ around $\lvert z\rvert = 3$?

::: right
Right. $\frac{2\pi j}{n!}e^a$: imaginary part {answer}.
:::

::: misses
- [2*pi*exp(a)] Divide by $n!$.
- [any] Not yet. $\frac{2\pi j}{n!}f^{(n)}(a)$, and every derivative of $e^z$ is $e^z$.
:::
:::

::: check
given: b = 1 | 2 | 3; a = 0 | 0.5
answer: 2*pi*cos(b*a)
tolerance: 0.5%

## What's the imaginary part of $\oint\frac{\cos(\given{b}z)}{z - \given{a}}\,dz$ around $\lvert z\rvert = 2$?

::: right
Right. $2\pi j\cos(ba)$: imaginary part {answer}.
:::

::: misses
- [any] Not yet. $2\pi j f(a)$ with $f = \cos bz$.
:::
:::

::: check
given: c = 1 | 2 | 5; r = 1 | 2
answer: c^2
tolerance: 0.5%

## $f(z) = (z + \given{c})^2$. What's its average value around the circle $\lvert z\rvert = \given{r}$?

::: right
Right. f(0) = {answer}, whatever the radius.
:::

::: misses
- [any] Not yet. The mean value property: the value at the center.
:::
:::

::: check
given: a = 2 | 3 | 5
answer: a + 1
tolerance: 0.5%

## $f(z) = z + \given{a}$ on the closed disk $\lvert z\rvert \le 1$. What's the largest value of $\lvert f\rvert$?

::: right
Right. {answer}, reached on the boundary at z = 1, as the maximum modulus principle says it must be.
:::

::: misses
- [a] That's $\lvert f\rvert$ at the center; the largest value is on the boundary.
- [any] Not yet. Look along the edge, $\lvert z\rvert = 1$.
:::
:::

::: check
kind: choice

## Which follows from Liouville's theorem?

- [ ] Every analytic function is a polynomial
- [x] $\sin z$ can't be bounded on the whole complex plane
- [ ] $e^z$ is never zero
- [ ] Every integral of an analytic function is zero

::: misses
- [1] $e^z$ is analytic everywhere and isn't a polynomial.
- [3] True, but it comes from $e^z e^{-z} = 1$, not Liouville.
- [4] Only closed integrals, by Cauchy's theorem.
:::
:::

::: check
kind: parts
given: M = 2 | 5; R = 0.5 | 2

## f is analytic on the disk $\lvert z\rvert \le \given{R}$, and $\lvert f\rvert \le \given{M}$ on its edge.

::: part
answer: M/R
tolerance: 0.5%

### What bound do Cauchy's estimates give on $\lvert f'(0)\rvert$?

::: misses
- [M*R] Divide by R: a function confined to a small disk can still change fast.
- [any] $\lvert f^{(n)}(0)\rvert \le \frac{n!M}{R^n}$.
:::
:::

::: part
answer: 2*M/R^2
tolerance: 0.5%

### And on $\lvert f''(0)\rvert$?

::: misses
- [M/R^2] Include $n! = 2$.
- [any] $\frac{2M}{R^2}$.
:::
:::
:::

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

## Evaluate $\oint\frac{e^{bz}}{(z - a)^2}\,dz$ around a circle enclosing a, using $\oint\frac{f(z)}{(z - a)^2}dz = 2\pi jf'(a)$.

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

### What is $f'(a)$ for $f = e^{bz}$?
:::

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

### What is the imaginary part of the integral?
:::

::: right
Right. The integral is $2\pi jbe^{ab}$, purely imaginary.
:::
:::

::: explain
## Why does Cauchy's integral formula imply that an analytic function has derivatives of every order?

::: model
The formula writes f(a) as an integral in which a appears only in the smooth factor $1/(z - a)$, while z stays on the boundary, away from a. That factor can be differentiated with respect to a as often as we like, giving $n!/(z - a)^{n+1}$, and the differentiation can be moved inside the integral. So every derivative of f at a exists and is itself given by a similar integral, which is again differentiable. Nothing like this holds for real functions, where differentiable once says nothing about twice.
:::
:::

::: practice

::: check
given: a = -2 | -1 | 0.2 | 0.5 | 1.5 | 2.5
answer: 2*pi*exp(a)
tolerance: 0.5%

## Im $\oint e^z/(z - \given{a})\,dz$ on $\lvert z\rvert = 3$?

::: misses
- [any] $2\pi e^a$.
:::
:::

::: check
given: a = 0.3 | 1; n = 2 | 4
answer: 2*pi*exp(a)/n!
tolerance: 0.5%

## Im $\oint e^z/(z - \given{a})^{\given{n}+1}\,dz$ on $\lvert z\rvert = 3$?

::: misses
- [any] $2\pi e^a/n!$.
:::
:::

::: check
given: c = 3 | 4; r = 2 | 5
answer: c^2
tolerance: 0.5%

## Average of $(z + \given{c})^2$ on $\lvert z\rvert = \given{r}$?

::: misses
- [any] f(0).
:::
:::
:::
