Chapter 2 · Analytic Functions and Complex Integration

2.2 Contour Integrals, Cauchy’s Theorem and Integral Formula

Integration along curves in the plane: the ML-inequality, primitives and path independence, Cauchy's theorem and the deformation of contours, and Cauchy's integral formula — which makes every analytic function infinitely differentiable and gives Morera's theorem and Cauchy's estimates.

In real analysis the integral $\int_a^bf(x)\,dx$ runs along an interval, and there is only one way to get from $a$ to $b$. In the complex plane there are infinitely many paths from $z_1$ to $z_2$, and the first question about a complex integral is whether its value depends on the path. For a function such as $\bar z$ it does. For an analytic function, Cauchy discovered in the 1820s that it does not — as long as the path can be deformed into the other one without crossing a singularity. Equivalently, the integral of an analytic function round a closed curve is $0$. This is Cauchy's theorem, the central fact of complex analysis.

Its consequences are startling. The values of an analytic function inside a circle are determined by its values on the circle (Cauchy's integral formula); differentiating under the integral sign shows that an analytic function has derivatives of every order, a fact used in §2.1 to prove that real parts of analytic functions are harmonic; and the size of the derivatives is controlled by the size of the function (Cauchy's estimates), which leads directly to Liouville's theorem and the maximum modulus principle of §2.3. In CSIR NET this section supplies the bread-and-butter Part B question — "evaluate $\oint_{|z|=2}\frac{e^z}{(z-1)^2}dz$" — and Part C statements about path independence, primitives, Morera's theorem and limits of analytic functions.

Paths and Contour Integrals

📘 Definition 2.6 — Paths, contours and their length

A path is a continuous map $\gamma:[a,b]\to\mathbb{C}$; its image $\gamma^*=\gamma([a,b])$ is the trace. The path is smooth if $\gamma'$ exists, is continuous and is nonzero on $[a,b]$ (one-sided at the ends), and it is a contour (piecewise smooth path) if $[a,b]$ splits into finitely many intervals on each of which $\gamma$ is smooth. It is closed if $\gamma(a)=\gamma(b)$, and simple if $\gamma(s)\ne\gamma(t)$ for $s\ne t$ (except $s=a$, $t=b$ for a closed path). The length of a contour is $L(\gamma)=\int_a^b|\gamma'(t)|\,dt$.

The reverse path is $(-\gamma)(t)=\gamma(a+b-t)$. Standard examples: the segment $[z_1,z_2]$, $\ \gamma(t)=z_1+t(z_2-z_1)$, $t\in[0,1]$, of length $|z_2-z_1|$; the positively oriented circle $C(a,r)$, $\ \gamma(t)=a+re^{it}$, $t\in[0,2\pi]$, of length $2\pi r$.

By the Jordan curve theorem (which we use without proof), the trace of a simple closed path separates the plane into exactly two domains: a bounded interior and an unbounded exterior. A simple closed contour is positively oriented if its interior lies on the left as the contour is traced (anticlockwise). Unless said otherwise, closed contours $\oint_\gamma$ are positively oriented.

📘 Definition 2.7 — The contour integral
Let $\gamma:[a,b]\to\mathbb{C}$ be a contour and $f$ a function continuous on $\gamma^*$. The contour integral of $f$ along $\gamma$ is $$\int_\gamma f(z)\,dz=\int_a^bf(\gamma(t))\,\gamma'(t)\,dt,$$ where the integral of a complex-valued function of $t$ is $\int(\operatorname{Re}g)\,dt+i\int(\operatorname{Im}g)\,dt$, and for a contour the integrals over the smooth pieces are added. We also write $\displaystyle\int_\gamma f(z)\,|dz|=\int_a^bf(\gamma(t))\,|\gamma'(t)|\,dt$ (the integral with respect to arc length).
📐 Theorem 2.10 — Properties of contour integrals; the ML-inequality
Let $\gamma$ be a contour and $f,g$ continuous on $\gamma^*$.
  1. $\int_\gamma(\alpha f+\beta g)\,dz=\alpha\int_\gamma f\,dz+\beta\int_\gamma g\,dz$ for $\alpha,\beta\in\mathbb{C}$; $\ \int_{-\gamma}f\,dz=-\int_\gamma f\,dz$; and the integral over a path made by joining $\gamma_1$ and $\gamma_2$ end to end is $\int_{\gamma_1}+\int_{\gamma_2}$.
  2. The integral does not change under an orientation-preserving reparametrisation $\gamma\circ\varphi$ ($\varphi:[c,d]\to[a,b]$ a $C^1$ bijection with $\varphi'\gt0$).
  3. For a continuous $g:[a,b]\to\mathbb{C}$, $\ \left|\int_a^bg(t)\,dt\right|\le\int_a^b|g(t)|\,dt$.
  4. ML-inequality. If $|f(z)|\le M$ on $\gamma^*$, then $$\left|\int_\gamma f(z)\,dz\right|\le\int_\gamma|f(z)|\,|dz|\le M\,L(\gamma).$$
  5. If $f_n\to f$ uniformly on $\gamma^*$, then $\int_\gamma f_n\,dz\to\int_\gamma f\,dz$.

Proof. (1) Linearity holds for real and imaginary parts separately. For the reverse path, substitute $s=a+b-t$: $$\int_a^bf(\gamma(a+b-t))\,\big(-\gamma'(a+b-t)\big)\,dt=-\int_a^bf(\gamma(s))\gamma'(s)\,ds.$$ Additivity is the additivity of real integrals over adjacent intervals. (2) By the chain rule, $(\gamma\circ\varphi)'(s)=\gamma'(\varphi(s))\varphi'(s)$, and the substitution $t=\varphi(s)$ in the real integrals gives the same value.

(3) Let $I=\int_a^bg\,dt$; if $I=0$ there is nothing to prove. Otherwise write $I=|I|e^{i\alpha}$. Then $$|I|=e^{-i\alpha}I=\int_a^be^{-i\alpha}g(t)\,dt=\int_a^b\operatorname{Re}\big(e^{-i\alpha}g(t)\big)\,dt\le\int_a^b|g(t)|\,dt,$$ where the third equality holds because $|I|$ is real, so the imaginary part of the integral vanishes. (4) Apply (3) to $g(t)=f(\gamma(t))\gamma'(t)$: $|g|\le M|\gamma'|$, and $\int|\gamma'|=L(\gamma)$. (5) By (4), $\left|\int_\gamma f_n-\int_\gamma f\right|\le L(\gamma)\sup_{\gamma^*}|f_n-f|\to0$. ∎

✏️ Example 1 — The most important integral in complex analysis
Let $a\in\mathbb{C}$, $r\gt0$ and $n\in\mathbb{Z}$. Show that $$\oint_{C(a,r)}(z-a)^n\,dz=\begin{cases}2\pi i,&n=-1,\\0,&n\ne-1.\end{cases}$$
Parametrise $z=a+re^{it}$, $dz=ire^{it}\,dt$, $t\in[0,2\pi]$. Then $(z-a)^n\,dz=r^ne^{int}\cdot ire^{it}\,dt=ir^{n+1}e^{i(n+1)t}\,dt$.
$n=-1$ The integrand is $i\,dt$: the integral is $2\pi i$, independent of $r$.
$n\ne-1$ $\displaystyle\int_0^{2\pi}e^{i(n+1)t}\,dt=\left[\frac{e^{i(n+1)t}}{i(n+1)}\right]_0^{2\pi}=0$, since $e^{2\pi i(n+1)}=1$.
Meaning Every power $(z-a)^n$ except $n=-1$ has a primitive $\frac{(z-a)^{n+1}}{n+1}$ on $\mathbb{C}\setminus\{a\}$, so its integral round a closed path vanishes (Theorem 2.11 below). The function $\frac1{z-a}$ has no primitive on $\mathbb{C}\setminus\{a\}$ — this one integral is the seed of the residue theorem (Chapter 3).
✏️ Example 2 — The path matters for $\bar z$ but not for $z^2$
Compute $\int_\gamma\bar z\,dz$ and $\int_\gamma z^2\,dz$ from $0$ to $1+i$ along (i) the segment $[0,1+i]$; (ii) the path $\gamma_2$ from $0$ to $1$ and then from $1$ to $1+i$.
(i) $\bar z$ $z=t(1+i)$, $\bar z=t(1-i)$, $dz=(1+i)\,dt$: $\displaystyle\int_0^1t(1-i)(1+i)\,dt=\int_0^12t\,dt=1$.
(ii) $\bar z$ On $[0,1]$: $z=t$, $\int_0^1t\,dt=\frac12$. On $[1,1+i]$: $z=1+it$, $\bar z=1-it$, $dz=i\,dt$: $\int_0^1(1-it)\,i\,dt=i+\frac12$. Total $1+i$.
$z^2$ Along (i): $\int_0^1t^2(1+i)^3\,dt=\frac{(1+i)^3}3=\frac{-2+2i}3$. Along (ii): $\int_0^1t^2\,dt+\int_0^1(1+it)^2i\,dt=\frac13+\left[\frac{(1+it)^3}{3}\right]_0^1=\frac13+\frac{(1+i)^3-1}{3}=\frac{-2+2i}{3}$. The same.
Why $z^2$ has the primitive $z^3/3$, so the integral is $\frac{(1+i)^3}{3}-0$ along every contour. $\bar z$ is not analytic and has no primitive. The difference of the two $\bar z$ integrals is the integral round the closed triangle $0\to1\to1+i\to0$, namely $i$; in general $\oint_\gamma\bar z\,dz=2i\cdot\text{(area enclosed)}$ for a positively oriented simple closed contour (Green's theorem), here $2i\cdot\frac12=i$.
✏️ Example 3 — Estimating with the ML-inequality
(a) Show that $\displaystyle\left|\oint_{|z|=2}\frac{e^z}{z^2+1}\,dz\right|\le\frac{4\pi e^2}{3}$.
(b) Let $\Gamma_R$ be the upper half of the circle $|z|=R$ ($R\gt1$). Show that $\displaystyle\int_{\Gamma_R}\frac{dz}{z^2+1}\to0$ as $R\to\infty$.
(a) Numerator On $|z|=2$, $|e^z|=e^{\operatorname{Re}z}\le e^2$.
(a) Denominator Reverse triangle inequality: $|z^2+1|\ge|z|^2-1=3$. So $|f|\le e^2/3=M$, and $L=4\pi$: the integral is at most $4\pi e^2/3\approx30.95$. (The true modulus is about $5.29$; ML gives a bound, not the value.)
(b) On $\Gamma_R$, $|z^2+1|\ge R^2-1$ and $L=\pi R$, so the integral is at most $\dfrac{\pi R}{R^2-1}\to0$. This estimate is the key step in evaluating $\int_{-\infty}^\infty\frac{dx}{1+x^2}$ by residues (Chapter 3).

Primitives and Path Independence

📘 Definition 2.8 — Primitive
Let $f$ be continuous on a domain $D$. A primitive (antiderivative) of $f$ on $D$ is an analytic function $F$ on $D$ with $F'=f$ on $D$. By Theorem 2.6, two primitives on a domain differ by a constant.
📐 Theorem 2.11 — Fundamental theorem for contour integrals
If $f$ is continuous on a domain $D$ and has a primitive $F$ there, then for every contour $\gamma$ in $D$ from $z_1$ to $z_2$, $$\int_\gamma f(z)\,dz=F(z_2)-F(z_1).$$ In particular $\oint_\gamma f(z)\,dz=0$ for every closed contour $\gamma$ in $D$.

Proof. On a smooth piece $\gamma:[a,b]\to D$, the function $t\mapsto F(\gamma(t))$ has derivative $F'(\gamma(t))\gamma'(t)=f(\gamma(t))\gamma'(t)$. Indeed, write $F(w)-F(w_0)=\chi(w)(w-w_0)$ with $w_0=\gamma(t)$ as in Theorem 2.2(1); then $$\frac{F(\gamma(t+s))-F(\gamma(t))}{s}=\chi(\gamma(t+s))\,\frac{\gamma(t+s)-\gamma(t)}{s}\to F'(\gamma(t))\gamma'(t).$$ Applying the real fundamental theorem of calculus to the real and imaginary parts, $\int_a^bf(\gamma(t))\gamma'(t)\,dt=F(\gamma(b))-F(\gamma(a))$. For a contour, add over the pieces: the sum telescopes to $F(z_2)-F(z_1)$. ∎

📐 Theorem 2.12 — When does a primitive exist?
Let $f$ be continuous on a domain $D$. The following are equivalent:
  1. $f$ has a primitive on $D$;
  2. $\oint_\gamma f\,dz=0$ for every closed contour $\gamma$ in $D$;
  3. $\int_\gamma f\,dz$ depends only on the endpoints of $\gamma$, for contours $\gamma$ in $D$.

Proof. (1)⇒(2) is Theorem 2.11. (2)⇔(3): if $\gamma_1,\gamma_2$ run from $z_1$ to $z_2$, then $\gamma_1$ followed by $-\gamma_2$ is a closed contour, whose integral is $\int_{\gamma_1}-\int_{\gamma_2}$; and every closed contour arises this way (split it at a point).

(3)⇒(1). Fix $z_0\in D$ and define $F(z)=\int_{\gamma_z}f(\zeta)\,d\zeta$, where $\gamma_z$ is any contour in $D$ from $z_0$ to $z$ (one exists — a polygonal path — because $D$ is a domain; by (3) the choice does not matter). Let $z\in D$ and $D(z,r)\subseteq D$. For $|h|\lt r$, the path $\gamma_z$ followed by the segment $[z,z+h]$ runs from $z_0$ to $z+h$, so $F(z+h)-F(z)=\int_{[z,z+h]}f(\zeta)\,d\zeta$. Since $\int_{[z,z+h]}d\zeta=h$, $$\frac{F(z+h)-F(z)}{h}-f(z)=\frac1h\int_{[z,z+h]}\big(f(\zeta)-f(z)\big)\,d\zeta.$$ By the ML-inequality (length $|h|$), the modulus of the right side is at most $\sup_{|\zeta-z|\le|h|}|f(\zeta)-f(z)|$, which tends to $0$ as $h\to0$ by continuity of $f$. So $F'(z)=f(z)$. ∎

Consequences. For $n\ne-1$, $z^n$ has the primitive $z^{n+1}/(n+1)$; polynomials, $e^z$, $\sin z$, $\cos z$ have primitives on $\mathbb{C}$; so their integrals depend only on the endpoints. But $\frac1z$ has no primitive on $\mathbb{C}\setminus\{0\}$, because $\oint_{|z|=1}\frac{dz}z=2\pi i\ne0$ — this is the integral version of the fact that $\mathbb{C}\setminus\{0\}$ carries no branch of the logarithm (Theorem 1.27(4)). On the cut plane $\mathbb{C}\setminus(-\infty,0]$, $\frac1z$ does have the primitive $\operatorname{Log}z$.

✏️ Example 4 — Integrals by primitives
Evaluate (a) $\int_\gamma ze^{z^2}\,dz$ along any contour from $0$ to $i\sqrt\pi$; (b) $\int_\gamma\cos z\,dz$ along any contour from $0$ to $i$; (c) $\int_\gamma\frac{dz}z$ along the upper half of the unit circle from $1$ to $-1$, and along the lower half.
(a) $\frac12e^{z^2}$ is an entire primitive: $\frac12\left(e^{(i\sqrt\pi)^2}-e^0\right)=\frac{e^{-\pi}-1}{2}\approx-0.4784$.
(b) $\sin z$ is a primitive: $\sin i-\sin0=i\sinh1\approx1.1752\,i$.
(c) Upper half The upper semicircle ends on the cut of $\operatorname{Log}$, so use another branch: $L_1(z)=\ln|z|+i\theta$ with $\theta\in\left(-\tfrac\pi2,\tfrac{3\pi}2\right)$, analytic on the plane cut along the negative imaginary axis, which contains the upper semicircle. Then $\int=L_1(-1)-L_1(1)=i\pi-0=i\pi$.
(c) Lower half With $L_2(z)=\ln|z|+i\theta$, $\theta\in\left(-\tfrac{3\pi}2,\tfrac\pi2\right)$ (cut along the positive imaginary axis): $\int=L_2(-1)-L_2(1)=-i\pi$. The two paths give different answers; their difference $i\pi-(-i\pi)=2\pi i$ is the integral round the whole circle. Path independence fails because $\frac1z$ has no primitive on any domain containing both paths.

Cauchy's Theorem

When does an analytic function have a primitive? The key is a beautiful argument of Goursat (1900): the integral round any triangle vanishes, and no continuity of $f'$ is needed.

📐 Theorem 2.13 — The Cauchy–Goursat theorem for triangles
Let $f$ be analytic on an open set $U$, and let $T\subseteq U$ be a closed triangle (the triangle together with its inside). Then $$\oint_{\partial T}f(z)\,dz=0.$$ The conclusion still holds if $f$ is only continuous on $U$ and analytic on $U\setminus\{p\}$ for a single point $p$.

Proof. Let $I=\left|\oint_{\partial T}f\right|$, and let $d$ and $\ell$ be the diameter and perimeter of $T$. Joining the midpoints of the sides divides $T$ into four congruent triangles $T^{(1)},\dots,T^{(4)}$, each with diameter $d/2$ and perimeter $\ell/2$. With all boundaries positively oriented, $\oint_{\partial T}f=\sum_{k=1}^4\oint_{\partial T^{(k)}}f$, because each interior side is traversed twice in opposite directions and cancels. So at least one of them, call it $T_1$, has $\left|\oint_{\partial T_1}f\right|\ge I/4$. Repeating, we get nested triangles $T\supset T_1\supset T_2\supset\cdots$ with $$\left|\oint_{\partial T_n}f\right|\ge\frac{I}{4^n},\qquad\operatorname{diam}T_n=\frac{d}{2^n},\qquad L(\partial T_n)=\frac{\ell}{2^n}.$$

The $T_n$ are nonempty, closed, bounded and nested, with diameters tending to $0$, so they have exactly one common point $z_0\in T\subseteq U$ (Cantor's intersection theorem). Since $f$ is differentiable at $z_0$, $f(z)=f(z_0)+f'(z_0)(z-z_0)+\varepsilon(z)(z-z_0)$ with $\varepsilon(z)\to0$ as $z\to z_0$. The linear function $f(z_0)+f'(z_0)(z-z_0)$ has a primitive, so its integral round $\partial T_n$ is $0$ (Theorem 2.11). Hence, for $z\in\partial T_n$ (where $|z-z_0|\le d/2^n$), the ML-inequality gives $$\frac{I}{4^n}\le\left|\oint_{\partial T_n}\varepsilon(z)(z-z_0)\,dz\right|\le\sup_{T_n}|\varepsilon|\cdot\frac{d}{2^n}\cdot\frac{\ell}{2^n}.$$ Thus $I\le d\,\ell\,\sup_{T_n}|\varepsilon|\to0$ as $n\to\infty$, and $I=0$.

For the extension, suppose $p\in T$. If $p$ is a vertex, choose points $q,s$ on the two sides of $T$ at $p$, at distance $\delta$ from $p$; the segment $[q,s]$ cuts off a small triangle $T'=[p,q,s]$ of perimeter at most $4\delta$, and the rest of $T$ splits into two triangles not containing $p$, on which the integrals vanish. Then $\left|\oint_{\partial T}f\right|=\left|\oint_{\partial T'}f\right|\le4\delta\max_T|f|$, which tends to $0$ with $\delta$. If $p$ lies elsewhere in $T$, split $T$ into triangles having $p$ as a vertex. ∎

Historical remark. The first proofs assumed that $f'$ is continuous and used Green's theorem: with $f=u+iv$ and $dz=dx+i\,dy$, $$\oint_{\partial\Omega}f\,dz=\oint(u\,dx-v\,dy)+i\oint(v\,dx+u\,dy)=\iint_\Omega(-v_x-u_y)\,dA+i\iint_\Omega(u_x-v_y)\,dA=0$$ by the Cauchy–Riemann equations. Goursat's proof shows that complex differentiability alone suffices — which is exactly what allows us to deduce continuity of $f'$ later.

📐 Theorem 2.14 — Cauchy's theorem for convex domains
Let $D$ be a convex open set (more generally, a star-shaped domain: there is $z_0\in D$ with $[z_0,z]\subseteq D$ for every $z\in D$). If $f$ is analytic on $D$, or continuous on $D$ and analytic on $D\setminus\{p\}$, then $f$ has a primitive on $D$, and therefore $$\oint_\gamma f(z)\,dz=0\quad\text{for every closed contour }\gamma\text{ in }D.$$

Proof. Let $z_0$ be a star centre and define $F(z)=\int_{[z_0,z]}f(\zeta)\,d\zeta$. Let $z\in D$, $D(z,r)\subseteq D$ and $|h|\lt r$. The closed triangle with vertices $z_0,z,z+h$ is the union of the segments $[z_0,w]$ for $w\in[z,z+h]$; each such $w$ lies in $D(z,r)\subseteq D$, so each segment lies in $D$, and the triangle lies in $D$. By Theorem 2.13, $\oint$ round this triangle is $0$, i.e. $F(z+h)-F(z)=\int_{[z,z+h]}f$. The estimate in the proof of Theorem 2.12 now gives $F'(z)=f(z)$. The second statement follows from Theorem 2.11. ∎

Discs, half-planes, rectangles and the cut plane $\mathbb{C}\setminus(-\infty,0]$ (star-shaped about $1$) are the cases used most often.

Convexity is far more than needed. What matters is that the domain has no holes.

📘 Definition 2.9 — Simply connected domain
A domain $D$ is simply connected if for every simple closed contour $\gamma$ in $D$, the interior of $\gamma$ is contained in $D$. Equivalent conditions (stated without proof): every closed path in $D$ can be continuously shrunk to a point within $D$; the complement of $D$ in the extended plane $\mathbb{C}_\infty$ is connected. Discs, half-planes, convex and star-shaped domains, the cut plane and the plane minus a ray are simply connected; the punctured disc $0\lt|z|\lt1$, annuli and $\mathbb{C}\setminus\{0\}$ are not.
📐 Theorem 2.15 — Cauchy's theorem
If $f$ is analytic on a simply connected domain $D$, then $$\oint_\gamma f(z)\,dz=0$$ for every closed contour $\gamma$ in $D$, and $f$ has a primitive on $D$.

Proof sketch. (i) Reduction to polygons. Cover $\gamma^*$ by finitely many discs inside $D$ (compactness). On each disc $f$ has a primitive (Theorem 2.14), so a short arc of $\gamma$ inside one disc may be replaced by the chord joining its ends without changing the integral. Hence it suffices to treat closed polygons. (ii) Polygons. A closed polygon with self-intersections splits into finitely many simple closed polygons, plus segments traversed back and forth (which contribute nothing). (iii) Simple polygons. A simple closed polygon can be triangulated: its inside is a finite union of triangles meeting along edges (every simple polygon with more than three sides has a diagonal lying inside it, and induction on the number of sides finishes). Since $D$ is simply connected, the inside, and so every triangle, lies in $D$. By Goursat's theorem each triangle contributes $0$; interior edges cancel in pairs, so the integral round the polygon is $0$. (iv) The primitive then exists by Theorem 2.12. ∎

Corollaries. (a) Harmonic conjugates (completing Theorem 2.8): if $u$ is harmonic on a simply connected domain $D$, then $g=u_x-iu_y$ is analytic on $D$ (Exercise III.7 of §2.1), so it has a primitive $G$. Since $G'=g$ gives $(\operatorname{Re}G)_x=u_x$ and $(\operatorname{Re}G)_y=u_y$, $\operatorname{Re}G=u+c$, and $\operatorname{Im}G$ is a harmonic conjugate of $u$. (b) Logarithms: if $f$ is analytic and nowhere zero on a simply connected domain $D$, then $f'/f$ has a primitive $L$, and adjusting the constant one gets $e^{L}=f$ — an analytic branch of $\log f$ (the derivative of $fe^{-L}$ is $0$).

On a domain with holes we can still compare integrals over contours that surround the same holes.

📐 Theorem 2.16 — Deformation of contours
  1. Let $\gamma_0$ and $\gamma_1$ be positively oriented simple closed contours with $\gamma_1$ inside $\gamma_0$, and let $f$ be analytic on an open set containing the closed region between them (both curves and the points inside $\gamma_0$ but outside $\gamma_1$). Then $$\oint_{\gamma_0}f(z)\,dz=\oint_{\gamma_1}f(z)\,dz.$$
  2. More generally, if $\gamma_1,\dots,\gamma_n$ are positively oriented simple closed contours inside $\gamma_0$ whose closed interiors are disjoint, and $f$ is analytic on an open set containing the region inside $\gamma_0$ and outside every $\gamma_k$, together with all the curves, then $$\oint_{\gamma_0}f(z)\,dz=\sum_{k=1}^n\oint_{\gamma_k}f(z)\,dz.$$

Proof sketch. For (1), join $\gamma_0$ to $\gamma_1$ by two disjoint segments (cross-cuts). They cut the region between the curves into two pieces, each bounded by a simple closed contour made of an arc of $\gamma_0$, a cross-cut, an arc of $\gamma_1$ traversed clockwise, and the other cross-cut. Each piece lies in a simply connected open subset of the region where $f$ is analytic, so by Cauchy's theorem each of the two boundary integrals is $0$. Adding them, the cross-cuts are traversed once in each direction and cancel, leaving $\oint_{\gamma_0}f-\oint_{\gamma_1}f=0$. For (2) use cross-cuts to each $\gamma_k$ in the same way. ∎

✏️ Example 5 — Deforming contours into small circles
(a) Let $\gamma$ be a positively oriented simple closed contour and $a\notin\gamma^*$. Show that $\oint_\gamma\frac{dz}{z-a}$ is $2\pi i$ if $a$ is inside $\gamma$ and $0$ if $a$ is outside.
(b) Evaluate $\displaystyle\oint_{|z|=2}\frac{dz}{z^2-1}$. (c) Evaluate $\displaystyle\oint_\gamma\frac{3z-1}{z(z-1)}\,dz$ for $\gamma:|z|=2$ and for $\gamma:|z-2|=\tfrac32$.
(a) If $a$ is outside, $\frac1{z-a}$ is analytic on a simply connected domain containing $\gamma$ and its inside (e.g. a slightly larger region avoiding $a$), so the integral is $0$. If $a$ is inside, choose $r$ so small that $C(a,r)$ lies inside $\gamma$; by Theorem 2.16(1) the integral equals $\oint_{C(a,r)}\frac{dz}{z-a}=2\pi i$ (Example 1).
(b) Partial fractions $\frac1{z^2-1}=\frac12\left(\frac1{z-1}-\frac1{z+1}\right)$; both $\pm1$ lie inside $|z|=2$, so the integral is $\frac12(2\pi i-2\pi i)=0$. (The integrand is not analytic inside the circle — the answer $0$ is a cancellation, not Cauchy's theorem.)
(c) Partial fractions $\frac{3z-1}{z(z-1)}=\frac Az+\frac B{z-1}$ with $A=\frac{-1}{-1}=1$ (cover up $z$, put $z=0$) and $B=\frac{3-1}{1}=2$ (put $z=1$).
(c) Which points are inside? $|z|=2$ encloses $0$ and $1$: the integral is $2\pi i(1+2)=6\pi i$. The circle $|z-2|=\frac32$ encloses $1$ (distance $1$ from the centre) but not $0$ (distance $2$): the integral is $2\pi i\cdot2=4\pi i$.
Interactive 1 — Deform the Contour, Keep the Integral

The blue closed contour morphs from a large wobbly curve (morph $0$) into a small circle (morph $1$) about its centre; singular points of $f$ are marked red with the coefficient $c$ of $\frac{c}{z-a}$ beside them. The integral $\oint f\,dz$ is computed numerically at every frame. For an analytic $f$ it stays exactly constant while the contour moves — and jumps by $2\pi i c$ at the instant the contour sweeps across a singular point. Move the centre to change which points are inside. The last option, $\bar z$, is not analytic: its integral changes continuously with the enclosed area.

∮ f dz (numerical)—
singular points inside—
2πi × Σ c (inside)—

Cauchy's Integral Formula and Its Consequences

📐 Theorem 2.17 — Cauchy's integral formula
Let $f$ be analytic on a simply connected domain $D$ (for instance a disc), and let $\gamma$ be a positively oriented simple closed contour in $D$. Then for every $a$ inside $\gamma$, $$f(a)=\frac1{2\pi i}\oint_\gamma\frac{f(z)}{z-a}\,dz,$$ while the integral is $0$ for every $a\in D$ outside $\gamma$. In particular (mean value property), if $\overline{D(a,r)}\subseteq D$ then $f(a)=\dfrac1{2\pi}\displaystyle\int_0^{2\pi}f(a+re^{it})\,dt$, and the same holds for $u=\operatorname{Re}f$.

Proof. If $a$ is outside $\gamma$, then $\frac{f(z)}{z-a}$ is analytic on a simply connected domain containing $\gamma$ and its inside, and Cauchy's theorem gives $0$. Let $a$ be inside $\gamma$. The function $\frac{f(z)}{z-a}$ is analytic on the region between $\gamma$ and any small circle $C(a,\varepsilon)$ inside $\gamma$, so by Theorem 2.16, $$\oint_\gamma\frac{f(z)}{z-a}\,dz=\oint_{C(a,\varepsilon)}\frac{f(z)}{z-a}\,dz=f(a)\oint_{C(a,\varepsilon)}\frac{dz}{z-a}+\oint_{C(a,\varepsilon)}\frac{f(z)-f(a)}{z-a}\,dz.$$ The first term is $2\pi i\,f(a)$ (Example 1). By the ML-inequality the second has modulus at most $$2\pi\varepsilon\cdot\max_{|z-a|=\varepsilon}\frac{|f(z)-f(a)|}{\varepsilon}=2\pi\max_{|z-a|=\varepsilon}|f(z)-f(a)|,$$ which tends to $0$ as $\varepsilon\to0$ by continuity of $f$. The left side does not depend on $\varepsilon$, so it equals $2\pi i\,f(a)$. For the mean value property take $\gamma=C(a,r)$, $z=a+re^{it}$, $dz=ire^{it}dt$: $$\frac{1}{2\pi i}\int_0^{2\pi}\frac{f(a+re^{it})}{re^{it}}\,ire^{it}\,dt=\frac1{2\pi}\int_0^{2\pi}f(a+re^{it})\,dt;$$ take real parts for $u$. ∎

The formula says that an analytic function inside a disc is completely determined by its values on the boundary circle. Its real power appears when we differentiate under the integral sign.

📐 Theorem 2.18 — Cauchy's integral formula for derivatives
Under the hypotheses of Theorem 2.17, $f$ has derivatives of all orders on $D$, each of them analytic, and for $a$ inside $\gamma$ and $n=0,1,2,\dots$ $$f^{(n)}(a)=\frac{n!}{2\pi i}\oint_\gamma\frac{f(z)}{(z-a)^{n+1}}\,dz.$$ Consequently, if $f=u+iv$ is analytic on any open set $U$, then $f'$ is analytic on $U$, and $u$ and $v$ have continuous partial derivatives of all orders.

Proof. Lemma. Let $\varphi$ be continuous on $\gamma^*$ and, for $m\ge1$, $F_m(w)=\oint_\gamma\frac{\varphi(z)}{(z-w)^m}\,dz$ for $w\notin\gamma^*$. Then $F_m$ is differentiable on $\mathbb{C}\setminus\gamma^*$ with $F_m'=mF_{m+1}$.

Proof of the lemma for $m=1$. Fix $w_0\notin\gamma^*$, let $\delta=\operatorname{dist}(w_0,\gamma^*)\gt0$ and take $|w-w_0|\lt\delta/2$, so that $|z-w|\ge\delta/2$ and $|z-w_0|\ge\delta$ on $\gamma^*$. Then $$\frac{F_1(w)-F_1(w_0)}{w-w_0}=\oint_\gamma\frac{\varphi(z)\,dz}{(z-w)(z-w_0)},$$ and $$\left|\oint_\gamma\frac{\varphi(z)\,dz}{(z-w)(z-w_0)}-\oint_\gamma\frac{\varphi(z)\,dz}{(z-w_0)^2}\right|=|w-w_0|\left|\oint_\gamma\frac{\varphi(z)\,dz}{(z-w)(z-w_0)^2}\right|\le|w-w_0|\frac{\max|\varphi|\,L(\gamma)}{(\delta/2)\,\delta^2}\to0.$$ So $F_1'(w_0)=F_2(w_0)$. For general $m$ the same computation works with the identity (difference of $m$-th powers) $$\frac1{(z-w)^m}-\frac1{(z-w_0)^m}=(w-w_0)\sum_{k=1}^{m}\frac{1}{(z-w)^{k}(z-w_0)^{m+1-k}}:$$ as $w\to w_0$, each of the $m$ terms of the sum tends to $\frac{1}{(z-w_0)^{m+1}}$, uniformly on $\gamma^*$, giving $F_m'=mF_{m+1}$.

Proof of the theorem. Let $\Omega$ be the inside of $\gamma$. By Theorem 2.17, $f=\frac{1}{2\pi i}F_1$ on $\Omega$ with $\varphi=f|_{\gamma^*}$. By the lemma, $f'=\frac{1}{2\pi i}F_2$, $f''=\frac{2}{2\pi i}F_3$, and inductively $f^{(n)}=\frac{n!}{2\pi i}F_{n+1}$ on $\Omega$; each is differentiable. For the last statement, every point of an open set $U$ has a disc around it in $U$; apply the theorem on that disc with $\gamma$ a slightly smaller circle. Then $f'=u_x+iv_x$, $f''=u_{xx}+iv_{xx}$, … are continuous, and by the CR equations every partial derivative of $u,v$ of order $k$ is $\pm$ the real or imaginary part of $f^{(k)}$. ∎

This is the result promised in §2.1: complex differentiability once on an open set implies differentiability infinitely often. Nothing remotely like it holds for real functions ($x|x|$ is differentiable once but not twice).

🧭 Problem-solving strategy — evaluating $\oint_\gamma f(z)\,dz$
  1. Is the integrand analytic? If it involves $\bar z$, $|z|$, $\operatorname{Re}z$, … it is not. On a circle $|z-a|=r$ substitute $\bar z=\bar a+\frac{r^2}{z-a}$ to make it analytic; otherwise parametrise.
  2. Locate the singular points (zeros of denominators, the cut of a logarithm) and decide which lie inside $\gamma$. Points on $\gamma$ make the integral undefined (or improper).
  3. No singular point inside (and the function analytic on a simply connected domain containing $\gamma$ and its inside): the answer is $0$ by Cauchy's theorem.
  4. One singular point $a$ inside, integrand $\frac{g(z)}{(z-a)^{n+1}}$ with $g$ analytic inside: the answer is $\frac{2\pi i}{n!}g^{(n)}(a)$ (Theorem 2.18).
  5. Several singular points inside: use partial fractions, or deform $\gamma$ into small circles round each point (Theorem 2.16(2)) and apply step 4 to each, with $g$ = the rest of the integrand.
  6. Open path: look for a primitive (Theorem 2.11), choosing a branch of $\log$ that is analytic along the whole path.
  7. Check with the ML-inequality that the size of the answer is plausible.
✏️ Example 6 — The integral formulas at work
Evaluate (a) $\displaystyle\oint_{|z|=2}\frac{e^z}{z-1}\,dz$; (b) $\displaystyle\oint_{|z|=1}\frac{\sin z}{z^4}\,dz$; (c) $\displaystyle\oint_{|z-i|=1}\frac{dz}{z^2+1}$; (d) $\displaystyle\oint_{|z|=3}\frac{e^{2z}}{(z+1)^3}\,dz$; (e) $\displaystyle\oint_{|z|=2}\frac{\bar z}{z-1}\,dz$.
(a) $g=e^z$ is entire and $1$ is inside: $2\pi i\,g(1)=2\pi ie$.
(b) $\frac{\sin z}{z^{3+1}}$: $n=3$, $g=\sin z$, $g'''(0)=-\cos0=-1$. The integral is $\frac{2\pi i}{3!}(-1)=-\frac{\pi i}{3}$. (Check with the series: $\frac{\sin z}{z^4}=\frac1{z^3}-\frac{1}{6z}+\cdots$, and only the $\frac1z$ term contributes, $2\pi i\cdot\left(-\frac16\right)$.)
(c) $z^2+1=(z-i)(z+i)$; on and inside $|z-i|=1$ only $i$ is singular ($-i$ is at distance $2$). With $g=\frac1{z+i}$: $2\pi i\,g(i)=2\pi i\cdot\frac1{2i}=\pi$.
(d) $n=2$, $g=e^{2z}$, $g''=4e^{2z}$, $a=-1$ inside: $\frac{2\pi i}{2!}\cdot4e^{-2}=4\pi ie^{-2}\approx1.7007\,i$.
(e) Not analytic Do not write $2\pi i\,\bar z|_{z=1}=2\pi i$. On $|z|=2$, $\bar z=\frac4z$, so the integral equals $\oint_{|z|=2}\frac{4\,dz}{z(z-1)}=4\oint\left(\frac1{z-1}-\frac1z\right)dz=4(2\pi i-2\pi i)=0$. A numerical check confirms $0$.
Interactive 2 — Cauchy's Integral Formula and Cauchy's Estimates

Left: the circle $|z|=r$ and the singular points of $f$ (red). The readout computes $\dfrac{n!}{2\pi i}\oint_{|z|=r}\dfrac{f(z)}{z^{n+1}}dz$ numerically and compares it with the true $f^{(n)}(0)$: they agree for every radius until the circle reaches a singular point. Right: the Cauchy bound $\dfrac{n!\,M(r)}{r^n}$ (blue, logarithmic scale, $M(r)=\max_{|z|=r}|f|$) against the true value $|f^{(n)}(0)|$ (green line). Every radius gives a valid bound; the best one is at the bottom of the blue curve. Press Play to sweep $r$.

—
(n!/2πi)∮ f/zⁿ⁺¹ dz—
true f⁽ⁿ⁾(0)—
M(r)—
bound n!M(r)/rⁿ—
📐 Theorem 2.19 — Morera's theorem
Let $f$ be continuous on an open set $U$, and suppose $\oint_{\partial T}f(z)\,dz=0$ for every closed triangle $T\subseteq U$. Then $f$ is analytic on $U$.

Proof. Analyticity is local, so let $D=D(a,r)\subseteq U$ be a disc. Define $F(z)=\int_{[a,z]}f$ on $D$. Exactly as in the proof of Theorem 2.14 — the hypothesis on triangles replacing Goursat's theorem — $F'=f$ on $D$. So $F$ is analytic on $D$, and by Theorem 2.18 its derivative $f$ is analytic on $D$. ∎

Morera's theorem is the converse of Goursat's theorem, and it is the standard tool for proving that a function defined by a limit or an integral is analytic:

  1. Uniform limits (Weierstrass). If $f_n$ are analytic on $U$ and $f_n\to f$ uniformly on every compact subset of $U$, then $f$ is analytic on $U$, and $f_n^{(k)}\to f^{(k)}$ uniformly on compact subsets for every $k$. Proof: $f$ is continuous; for a triangle $T$, $\oint_{\partial T}f=\lim\oint_{\partial T}f_n=0$ (Theorem 2.10(5) and Goursat), so Morera applies. For derivatives, on a closed disc $\overline{D(a,\rho)}$ with $\overline{D(a,2\rho)}\subseteq U$, Theorem 2.18 on the circle $|z-a|=2\rho$ gives $|f_n^{(k)}(w)-f^{(k)}(w)|\le\frac{2\,k!}{\rho^{k}}\max_{|z-a|=2\rho}|f_n-f|$ for $|w-a|\le\rho$ (since $|z-w|\ge\rho$ there); cover a compact set by finitely many such discs. Compare real analysis, where a uniform limit of polynomials can be nowhere differentiable.
  2. Removing a line. If $f$ is continuous on $U$ and analytic on $U\setminus L$ for a line $L$, then $f$ is analytic on $U$. (Triangles meeting $L$ are cut by $L$ into triangles with a side on $L$; approximate those by triangles off $L$ and use continuity.)
📐 Theorem 2.20 — Cauchy's estimates
Let $f$ be analytic on an open set containing the closed disc $\overline{D(a,r)}$, and let $M(r)=\max_{|z-a|=r}|f(z)|$. Then for every $n\ge0$ $$\left|f^{(n)}(a)\right|\le\frac{n!\,M(r)}{r^n}.$$ If $f$ is analytic on $D(a,R)$ and $|f|\le M$ there, then $|f^{(n)}(a)|\le n!M/R^n$.

Proof. The open set contains a slightly larger disc, which is simply connected; apply Theorem 2.18 with $\gamma=C(a,r)$ and the ML-inequality: $$\left|f^{(n)}(a)\right|=\frac{n!}{2\pi}\left|\oint_{C(a,r)}\frac{f(z)}{(z-a)^{n+1}}\,dz\right|\le\frac{n!}{2\pi}\cdot\frac{M(r)}{r^{n+1}}\cdot2\pi r=\frac{n!\,M(r)}{r^n}.$$ For the second statement apply the first with every $r\lt R$ (where $M(r)\le M$) and let $r\to R$. ∎

Cauchy's estimates say that an analytic function cannot oscillate wildly while staying small: bounding $|f|$ on a circle bounds all its derivatives at the centre. Letting $r\to\infty$ for a bounded entire function gives $f'(a)=0$ for every $a$ — Liouville's theorem, the starting point of §2.3.

✏️ Example 7 — Prove or disprove: estimates, Morera and limits
(a) There is a function $f$, analytic on a neighbourhood of $|z|\le1$, with $|f(z)|\le1$ for $|z|=1$ and $f'(0)=2$.
(b) If $f$ is analytic on a neighbourhood of $|z|\le3$ and $|f(z)|\le5$ on $|z|=3$, then $|f'''(0)|\le\frac{10}{9}$.
(c) If $f$ is continuous on $\mathbb{C}$ and $\oint_{|z|=1}f(z)\,dz=0$, then $f$ is analytic on $|z|\lt1$.
(d) If $f_n$ are analytic on the unit disc $\mathbb{D}$ and $f_n\to f$ uniformly on $\mathbb{D}$, then $f$ is analytic on $\mathbb{D}$.
(a) False Cauchy's estimate with $n=1$, $r=1$, $M(1)\le1$: $|f'(0)|\le1$.
(b) True $|f'''(0)|\le\frac{3!\cdot5}{3^3}=\frac{30}{27}=\frac{10}{9}$. (Equality for $f(z)=\frac{5}{27}z^3$, which has $|f|=5$ on $|z|=3$ and $f'''=\frac{30}{27}$.)
(c) False $f(z)=\bar z^{\,2}$: on $|z|=1$, $\bar z=1/z$, so $\oint\bar z^{\,2}dz=\oint z^{-2}dz=0$; but $\bar z^{\,2}$ is differentiable only at $0$ and analytic nowhere (Exercise I.4 of §2.1). One closed curve is not enough: Morera needs all triangles.
(d) True By the Weierstrass theorem above (consequence 1 of Morera). Contrast: $f_n(x)=\sqrt{x^2+\frac1n}$ are smooth real functions converging uniformly on $\mathbb{R}$ to $|x|$, which is not differentiable at $0$.
⚠️ Counterexamples and pitfalls
  1. Analytic on the curve is not enough. $\frac1z$ is analytic on $|z|=1$, but $\oint_{|z|=1}\frac{dz}{z}=2\pi i\ne0$: Cauchy's theorem needs analyticity on a simply connected domain containing the curve and its inside.
  2. Analytic on a domain is not enough either. $\frac1z$ is analytic on the annulus $1\lt|z|\lt3$, which contains the circle $|z|=2$, yet the integral round it is $2\pi i$. The annulus is not simply connected.
  3. A zero integral does not mean analytic. $\oint_{|z|=1}\bar z^{\,2}\,dz=0$ and $\oint_{|z|=2}\frac{dz}{z^2-1}=0$ — the first integrand is not analytic anywhere near the curve, the second has two singular points inside. Morera needs zero integrals over all triangles, not one curve.
  4. Path dependence for non-analytic integrands. $\int\bar z\,dz$ from $0$ to $1+i$ is $1$ along the segment and $1+i$ along the axes (Example 2). $\oint_\gamma\bar z\,dz=2i\times$ area, never $0$ for a simple closed curve.
  5. Local primitives need not be global. $\frac1z$ has a primitive on every disc not containing $0$ (a branch of $\log$) but none on $\mathbb{C}\setminus\{0\}$. $\operatorname{Log}$ is a primitive only on the cut plane, so it cannot be used along a path crossing $(-\infty,0]$.
  6. Do not apply the integral formula to non-analytic numerators: $\oint_{|z|=2}\frac{\bar z}{z-1}dz=0$, not $2\pi i$ (Example 6(e)).
  7. Orientation matters: a clockwise circle gives $-2\pi i$ for $\oint\frac{dz}{z}$. "$\oint$" means positively oriented.
  8. A point outside the contour contributes nothing to $\oint\frac{f(z)}{z-a}dz$ — the formula gives $0$, not $2\pi if(a)$. Points on the contour make the integral undefined.
  9. The ML-inequality is an upper bound, often a crude one ($30.95$ versus $5.29$ in Example 3).
  10. Real intuition about limits fails — in the good direction. Uniform limits of analytic functions are analytic and can be differentiated term by term; uniform limits of smooth real functions can be nowhere differentiable. But uniform convergence on the open disc does not give uniform convergence of the derivatives on the open disc: $f_n=z^n/n\to0$ uniformly on $\mathbb{D}$, while $\sup_{\mathbb{D}}|f_n'|=1$.
  11. Cauchy's estimates need $f$ analytic on the closed disc (or on the open disc with $|f|\le M$ throughout). For $f=\frac1{1-z}$ there is no estimate with $r\ge1$.

Exercises

I
Contour integrals and the ML-inequality.
  • 1 Compute $\int_\gamma\operatorname{Re}z\,dz$ along the segment from $0$ to $1+i$.
  • 2 Compute $\int_\gamma|z|^2\,dz$ along the path from $0$ to $1$ and then from $1$ to $1+i$.
  • 3 Show that $\oint_{|z|=r}\bar z\,dz=2\pi ir^2$.
  • 4 Compute $\oint_{|z|=1}\operatorname{Re}z\,dz$.
  • 5 Compute $\int_\gamma\frac{dz}{z^2}$ along any contour from $1$ to $i$ that avoids $0$.
  • 6 Let $\Gamma_R$ be the upper half of $|z|=R$, $R\gt1$. Show that $\left|\int_{\Gamma_R}\frac{e^{iz}}{z^2+1}\,dz\right|\le\frac{\pi R}{R^2-1}$.
  • 7 Show that $\left|\int_{[i,\,2+i]}\frac{dz}{z^4}\right|\le2$.
  • 8 Let $\gamma$ be the boundary of the square with vertices $\pm1\pm i$, positively oriented. Compute $\oint_\gamma\bar z\,dz$.
1 $z=t(1+i)$, $\operatorname{Re}z=t$, $dz=(1+i)dt$: $\int_0^1t(1+i)\,dt=\frac{1+i}{2}$.
2 On $[0,1]$: $\int_0^1t^2dt=\frac13$. On $[1,1+i]$: $z=1+it$, $|z|^2=1+t^2$, $dz=i\,dt$: $i\int_0^1(1+t^2)dt=\frac{4i}{3}$. Total $\frac13+\frac{4}{3}i$.
3 $z=re^{it}$: $\int_0^{2\pi}re^{-it}\cdot ire^{it}dt=2\pi ir^2$. (Also: $\bar z=r^2/z$ on the circle.)
4 $\int_0^{2\pi}\cos t\cdot ie^{it}\,dt=i\int_0^{2\pi}(\cos^2t+i\cos t\sin t)\,dt=i\pi$. (Green: $\oint x\,dz=i\cdot$area.)
5 Primitive $-\frac1z$ on $\mathbb{C}\setminus\{0\}$: $-\frac1i+\frac11=1+i$, along every such contour.
6 For $z=x+iy$ with $y\ge0$, $|e^{iz}|=e^{-y}\le1$; $|z^2+1|\ge R^2-1$; $L=\pi R$. ML gives the bound, which tends to $0$ as $R\to\infty$. (For $R=3$ the bound is $1.178$, the true modulus $0.093$.)
7 On the segment $z=t+i$, $|z|\ge1$, so $|z^{-4}|\le1$, and $L=2$. (True value about $0.363$.)
8 $\oint\bar z\,dz=2i\cdot\text{area}=2i\cdot4=8i$. Directly: each side contributes $2i$, e.g. on $z=1+it$, $t\in[-1,1]$: $\int(1-it)\,i\,dt=2i$.
II
Primitives, Cauchy's theorem and deformation.
  • 1 Evaluate $\int_\gamma(z^2+3z)\,dz$ along any contour from $1$ to $i$.
  • 2 Evaluate $\int_\gamma e^{\pi z}\,dz$ along any contour from $i$ to $\frac i2$.
  • 3 Which of these integrals over $|z|=1$ vanish, and why? (a) $\oint\frac{e^z}{z^2-4}dz$; (b) $\oint\tan z\,dz$; (c) $\oint\frac{dz}{2z-1}$; (d) $\oint\operatorname{Log}(z+2)\,dz$.
  • 4 Compute $\oint_{|z|=2}\frac{dz}{z(z-1)}$ and explain why the answer does not follow from Cauchy's theorem.
  • 5 Compute $\oint_\gamma\frac{z+2}{z(z-2)}dz$ for $\gamma:|z|=3$ and for $\gamma:|z|=1$.
  • 6 Show that $\int_\gamma\frac{d\zeta}{\zeta}=\operatorname{Log}z$ for every contour $\gamma$ in $\mathbb{C}\setminus(-\infty,0]$ from $1$ to $z$.
  • 7 Let $\gamma$ be the ellipse $\frac{x^2}{9}+\frac{y^2}{4}=1$, positively oriented. Compute $\oint_\gamma\frac{dz}{z-1}$, $\oint_\gamma\frac{dz}{z-3i}$ and $\oint_\gamma\frac{dz}{z^2}$.
  • 8 On the annulus $A=\{1\lt|z|\lt2\}$, show that $\frac1z$ has no primitive but $\frac1{z^2}$ does. Which closed contours $\gamma$ in $A$ satisfy $\oint_\gamma\frac{dz}z=0$?
1 $F=\frac{z^3}3+\frac{3z^2}2$: $F(i)-F(1)=\left(-\frac i3-\frac32\right)-\frac{11}{6}=-\frac{10}3-\frac i3$.
2 $\frac{e^{\pi z}}{\pi}\Big|_i^{i/2}=\frac{e^{i\pi/2}-e^{i\pi}}{\pi}=\frac{1+i}{\pi}$.
3 (a) $0$: singular points $\pm2$ lie outside; analytic on $|z|\lt2$. (b) $0$: $\tan z$ is analytic on $|z|\lt\frac\pi2$, which contains the circle. (c) Not $0$: $z=\frac12$ is inside; $\frac{1}{2z-1}=\frac12\cdot\frac{1}{z-\frac12}$ gives $\pi i$. (d) $0$: for $|z|\lt2$, $\operatorname{Re}(z+2)\gt0$, so $z+2$ avoids the cut and $\operatorname{Log}(z+2)$ is analytic on the disc $|z|\lt2$.
4 $\frac1{z(z-1)}=\frac1{z-1}-\frac1z$: $2\pi i-2\pi i=0$. Both singular points lie inside, so Cauchy's theorem does not apply; the $0$ comes from cancellation. (Compare pitfall 3.)
5 $\frac{z+2}{z(z-2)}=-\frac1z+\frac{2}{z-2}$. On $|z|=3$: $2\pi i(-1+2)=2\pi i$. On $|z|=1$: only $0$ inside: $-2\pi i$.
6 $\operatorname{Log}$ is a primitive of $\frac1\zeta$ on the cut plane (Theorem 1.27(2)), so by Theorem 2.11 the integral is $\operatorname{Log}z-\operatorname{Log}1=\operatorname{Log}z$.
7 $1$ is inside ($\frac19\lt1$): $2\pi i$. $3i$ is outside ($\frac94\gt1$): $0$. $\frac1{z^2}$ has the primitive $-\frac1z$ on $\mathbb{C}\setminus\{0\}$: $0$.
8 $\oint_{|z|=1.5}\frac{dz}z=2\pi i\ne0$, so no primitive (Theorem 2.12); $-\frac1z$ is a primitive of $\frac1{z^2}$. For a closed contour $\gamma$ in $A$, $\frac1{2\pi i}\oint_\gamma\frac{dz}z$ is the number of times $\gamma$ winds round $0$ (an integer); it vanishes exactly for contours that do not wind round the hole — for instance every contour lying in a disc inside $A$.
III
Cauchy's integral formula.
  • 1 $\displaystyle\oint_{|z|=2}\frac{z^2}{z-1}\,dz$
  • 2 $\displaystyle\oint_{|z|=1}\frac{\cos z}{z}\,dz$
  • 3 $\displaystyle\oint_{|z|=1}\frac{e^{3z}}{z^3}\,dz$
  • 4 $\displaystyle\oint_{|z-1|=1}\frac{dz}{z^2-1}$
  • 5 $\displaystyle\oint_{|z|=3}\frac{e^{z}}{z^2+4}\,dz$
  • 6 $\displaystyle\oint_{|z|=2}\frac{ze^z}{(z-1)^3}\,dz$
  • 7 $\displaystyle\oint_{|z|=1}\frac{\operatorname{Log}(z+3)}{z^2}\,dz$
  • 8 $\displaystyle\oint_{|z|=2}\frac{\sin z}{(z-\pi/2)^3}\,dz$
  • 9 $\displaystyle\oint_{|z|=1}\frac{\bar z}{z-2}\,dz$
  • 10 Use the mean value property to evaluate $\displaystyle\frac1{2\pi}\int_0^{2\pi}e^{\cos t}\cos(\sin t)\,dt$.
Check: compute the integrals of III.1–9 numerically
numerical value (trapezoid rule)—
value from the formula—
1 $g=z^2$, $a=1$ inside: $2\pi i$.
2 $2\pi i\cos0=2\pi i$.
3 $n=2$: $\frac{2\pi i}{2!}\cdot\left(e^{3z}\right)''\big|_0=\pi i\cdot9=9\pi i$.
4 Only $z=1$ is inside ($-1$ is at distance $2$ from the centre): $g=\frac1{z+1}$, $2\pi i\cdot\frac12=\pi i$.
5 Both $\pm2i$ are inside. $\frac1{z^2+4}=\frac1{4i}\left(\frac1{z-2i}-\frac1{z+2i}\right)$, so the integral is $\frac{2\pi i}{4i}\left(e^{2i}-e^{-2i}\right)=\frac\pi2\cdot2i\sin2=i\pi\sin2\approx2.8566\,i$.
6 $g=ze^z$, $g''=(z+2)e^z$, $g''(1)=3e$: $\frac{2\pi i}{2}\cdot3e=3\pi ie$.
7 $g=\operatorname{Log}(z+3)$ is analytic on $|z|\lt3$; $g'(0)=\frac13$: $\frac{2\pi i}{3}$.
8 $\frac\pi2\approx1.571$ is inside. $g=\sin z$, $g''=-\sin z$, $g''(\frac\pi2)=-1$: $\frac{2\pi i}{2}(-1)=-\pi i$.
9 On $|z|=1$, $\bar z=\frac1z$: $\oint\frac{dz}{z(z-2)}$; only $0$ is inside, with $g=\frac1{z-2}$: $2\pi i\cdot\left(-\frac12\right)=-\pi i$.
10 $e^{\cos t}\cos(\sin t)=\operatorname{Re}e^{e^{it}}$, and by the mean value property for $f=e^z$ on $|z|=1$ the average of $f(e^{it})$ is $f(0)=1$. Answer: $1$.
IV
Morera, estimates and proofs.
  • 1 Let $f$ be analytic on $|z|\lt2$ with $|f(z)|\le3$ there. Prove that $|f^{(n)}(0)|\le\dfrac{3\cdot n!}{2^n}$ for all $n$.
  • 2 Let $f$ be analytic on the unit disc with $|f(z)|\le\dfrac1{1-|z|}$. Choosing the best radius, show that $|f^{(n)}(0)|\le\dfrac{n!\,(n+1)^{n+1}}{n^n}$ for $n\ge1$; for $n=1$ this is $4$.
  • 3 Prove that if $f$ is continuous on $\mathbb{C}$ and analytic on $\mathbb{C}\setminus\mathbb{R}$, then $f$ is entire.
  • 4 Prove that $\zeta(z)=\sum_{n\ge1}n^{-z}$ (with $n^{-z}=e^{-z\ln n}$) is analytic on the half-plane $\operatorname{Re}z\gt1$, and that it may be differentiated term by term there.
  • 5 Let $f$ be analytic on a neighbourhood of $\overline{D(a,r)}$. Prove that $|f(a)|\le\frac1{2\pi}\int_0^{2\pi}|f(a+re^{it})|\,dt$ and that $\pi r^2f(a)=\iint_{D(a,r)}f\,dA$ (area mean value).
  • 6 Let $f$ be analytic on an open set containing a closed contour $\gamma$. Prove that $\oint_\gamma\overline{f(z)}\,f'(z)\,dz$ is purely imaginary.
  • 7 Show that $f(z)=\bar z^{\,2}$ satisfies $\oint_{|z|=r}f\,dz=0$ for every $r\gt0$, and explain why this does not contradict Morera's theorem.
1 For each $r\lt2$, Theorem 2.20 gives $|f^{(n)}(0)|\le\frac{n!\cdot3}{r^n}$. Let $r\to2^-$.
2 For $0\lt r\lt1$, $M(r)\le\frac1{1-r}$, so $|f^{(n)}(0)|\le\frac{n!}{r^n(1-r)}$. The function $r^n(1-r)$ is largest at $r=\frac n{n+1}$, where it equals $\frac{n^n}{(n+1)^{n+1}}$. This gives the bound; for $n=1$, $\frac{1\cdot4}{1}=4$.
3 Morera on $\mathbb{C}$: a triangle $T$ not meeting $\mathbb{R}$ lies in the upper or lower half-plane, where $f$ is analytic; Goursat gives $0$. If $T$ meets $\mathbb{R}$, the real axis cuts $T$ into at most three triangles, each with an edge (or vertex) on $\mathbb{R}$ and otherwise in one half-plane. For such a triangle $T'$, shift the edge on $\mathbb{R}$ by $i\varepsilon$ into the open half-plane to get $T'_\varepsilon$ with $\oint_{\partial T'_\varepsilon}f=0$; by uniform continuity of $f$ on a compact neighbourhood, $\oint_{\partial T'_\varepsilon}f\to\oint_{\partial T'}f$ as $\varepsilon\to0$. So all triangle integrals vanish and $f$ is entire.
4 On $\operatorname{Re}z\ge\sigma\gt1$, $|n^{-z}|=n^{-\operatorname{Re}z}\le n^{-\sigma}$ and $\sum n^{-\sigma}\lt\infty$, so the partial sums (entire functions) converge uniformly there (M-test). Every compact subset of $\operatorname{Re}z\gt1$ lies in such a half-plane, so the Weierstrass consequence of Morera gives analyticity, and the derivatives of the partial sums, $-\sum_{n\le N}(\ln n)n^{-z}$, converge to $\zeta'$.
5 Mean value property and Theorem 2.10(3): $|f(a)|=\frac1{2\pi}\left|\int_0^{2\pi}f(a+re^{it})dt\right|\le\frac1{2\pi}\int_0^{2\pi}|f(a+re^{it})|dt$. For the area version, multiply $2\pi\rho\,f(a)=\int_0^{2\pi}f(a+\rho e^{it})\rho\,dt$ by $d\rho$ and integrate over $0\le\rho\le r$: $\pi r^2f(a)=\iint_{D(a,r)}f\,dA$ (polar coordinates).
6 Let $I=\oint_\gamma\bar f f'\,dz=\int_a^b\overline{f(\gamma)}\,(f\circ\gamma)'\,dt$. Then $\bar I=\int_a^bf(\gamma)\,\overline{(f\circ\gamma)'}\,dt$, and $I+\bar I=\int_a^b\frac{d}{dt}|f(\gamma(t))|^2\,dt=0$ because $\gamma$ is closed. So $\operatorname{Re}I=0$. (Geometrically, $I=\oint\bar w\,dw$ along the image curve $w=f\circ\gamma$, which is $2i$ times a signed area.)
7 On $|z|=r$, $\bar z=\frac{r^2}z$: $\oint\frac{r^4}{z^2}dz=0$. Morera requires zero integrals over all triangles (equivalently all closed contours) in the region; circles centred at one point are a small subfamily. For instance $\oint_{|z-1|=1}\bar z^{\,2}dz=\oint\left(1+\frac{1}{z-1}\right)^2dz=2\cdot2\pi i=4\pi i\ne0$.
🎯 Exam corner CSIR Part BCSIR Part CGATE MA

E1. CSIR Part B GATE MA The value of $\displaystyle\oint_{|z|=3}\frac{e^z}{(z-1)^2}\,dz$ is (A) $0$; (B) $2\pi i$; (C) $2\pi ie$; (D) $\pi ie$.

Idea Theorem 2.18 with $n=1$, $g=e^z$, $a=1$ inside the circle.
Compute $\frac{2\pi i}{1!}g'(1)=2\pi ie$. (B) is the value for $\frac{e^{z-1}}{z-1}$; (D) has a spurious factor $\frac12$; (A) would need the integrand to be analytic inside the circle.
Answer (C).

E2. CSIR Part B Let $\gamma$ be the boundary of the square with vertices $0,1,1+i,i$, positively oriented. Then $\oint_\gamma\bar z\,dz$ equals (A) $0$; (B) $i$; (C) $2i$; (D) $2\pi i$.

Idea $\bar z$ is not analytic; $\oint\bar z\,dz=\oint(x-iy)(dx+i\,dy)$, whose value by Green's theorem is $2i\times$ area.
Direct check The four sides give $\frac12$, $\frac12+i$, $-\frac12+i$ and $-\frac12$ (e.g. on $z=1+it$: $\int_0^1(1-it)i\,dt=i+\frac12$); the sum is $2i$.
Answer (C).

E3. CSIR Part B Let $f$ be analytic on a neighbourhood of $|z|\le2$ with $|f(z)|\le8$ for $|z|=2$. The largest possible value of $|f''(0)|$ is (A) $2$; (B) $4$; (C) $8$; (D) $16$.

Bound Cauchy: $|f''(0)|\le\frac{2!\cdot8}{2^2}=4$.
Attained $f(z)=2z^2$ has $|f|=8$ on $|z|=2$ and $f''(0)=4$. So the maximum is exactly $4$.
Answer (B).

E4. CSIR Part C Let $\gamma$ be the circle $|z|=2$, positively oriented. Which of the following are true? (A) $\oint_\gamma\frac{dz}{z^2+1}=0$. (B) $\oint_\gamma\bar z\,dz=0$. (C) $\oint_\gamma\frac{e^z}{z}\,dz=2\pi i$. (D) $\oint_\gamma\frac{dz}{z-3}=2\pi i$.

(A) True $\frac1{z^2+1}=\frac1{2i}\left(\frac1{z-i}-\frac1{z+i}\right)$, both points inside: $\frac{2\pi i-2\pi i}{2i}=0$ — by cancellation, not by Cauchy's theorem.
(B) False $\oint_{|z|=2}\bar z\,dz=2\pi i\cdot4=8\pi i$ (Exercise I.3).
(C) True Cauchy's integral formula: $2\pi ie^0$.
(D) False $3$ is outside, the integrand is analytic on $|z|\lt3$: the value is $0$.
Answer (A) and (C).

E5. CSIR Part C Let $f$ be continuous on a domain $D$. Which of the following are true? (A) If $f$ has a primitive on $D$, then $\oint_\gamma f\,dz=0$ for every closed contour $\gamma$ in $D$. (B) If $f$ is analytic on $D$, then $f$ has a primitive on $D$. (C) If $\oint_{\partial T}f\,dz=0$ for every closed triangle $T\subseteq D$, then $f$ is analytic on $D$. (D) If $f$ is analytic on $D$, then $f'$ is analytic on $D$.

(A) True Theorem 2.11.
(B) False $\frac1z$ on $\mathbb{C}\setminus\{0\}$: $\oint_{|z|=1}\frac{dz}z\ne0$. True only on simply connected domains (Theorem 2.15).
(C) True Morera's theorem (Theorem 2.19).
(D) True Theorem 2.18.
Answer (A), (C) and (D).

E6. CSIR Part C GATE MA Let $f_n$ be analytic on the unit disc $\mathbb{D}$ and suppose $f_n\to f$ uniformly on $\mathbb{D}$. Which of the following are necessarily true? (A) $f$ is analytic on $\mathbb{D}$. (B) $f_n'(z)\to f'(z)$ for every $z\in\mathbb{D}$. (C) $f_n'\to f'$ uniformly on $\mathbb{D}$. (D) If every $f_n$ is a polynomial, then $f$ is a polynomial.

(A) True Morera: triangle integrals of $f$ are limits of those of $f_n$, which vanish.
(B) True Derivatives converge uniformly on compact subsets (Cauchy's integral formula for $f_n'-f'$ on a circle inside $\mathbb{D}$), in particular pointwise.
(C) False $f_n(z)=\frac{z^n}{n}$: $|f_n|\le\frac1n$ on $\mathbb{D}$, so $f_n\to0$ uniformly, but $f_n'=z^{n-1}$ has $\sup_{\mathbb{D}}|f_n'|=1$ for every $n$.
(D) False The partial sums $\sum_{k\le n}\frac{z^k}{k!}$ converge uniformly on $\mathbb{D}$ to $e^z$, which is not a polynomial (its derivatives never vanish identically).
Answer (A) and (B).
🧑‍🏫 For the teacher

Suggested plan — 3 lectures × 60 min.

  1. Contour integrals and primitives. Definitions 2.6–2.7 with the two standard parametrisations; Theorem 2.10 with the proof of (3) (the rotation trick). Example 1 in full — everything later rests on it. Example 2 on the board: let students compute both paths before revealing. Definition 2.8, Theorems 2.11–2.12; Example 4(c) shows why a branch must be chosen along the path.
  2. Cauchy's theorem. Goursat's proof (Theorem 2.13) in full — draw the subdivided triangles; mention the Green's-theorem proof as motivation. Theorem 2.14, Definition 2.9 with examples and non-examples, Theorem 2.15 as a sketch, Theorem 2.16 with a picture of the cross-cuts. Project Interactive 1: with $\frac1{z^2+1}$, move the centre so that the morph passes across $i$ and watch the jump of $\pi$; then switch to $\bar z$. Example 5.
  3. The integral formula and consequences. Theorem 2.17 with proof, the strategy box, Example 6 (spend time on (e)). Theorem 2.18 — prove the lemma for $m=1$, state the rest. Interactive 2: show that the CIF value is independent of $r$ and that the Cauchy bound has a best radius. Theorems 2.19–2.20, Example 7, Exam corner E5–E6.

Discussion questions. (1) Why does the integral of $\frac1z$ round a circle not depend on the radius, while the integral of $\bar z$ does? Give two explanations — one from primitives, one from Cauchy's theorem. (2) Cauchy's integral formula expresses $f(a)$ through boundary values. What does it say about an analytic function that vanishes on a circle? On a small arc? (3) In real analysis a uniform limit of differentiable functions need not be differentiable; why is the complex case different, and where exactly does the proof use complex analyticity?

Misconceptions to watch for. Applying Cauchy's theorem when a singular point is inside, or on a domain with a hole; applying the integral formula to $\bar z$-type numerators; forgetting the factor $\frac{1}{n!}$ (or using $n$ instead of $n+1$ as the power) in the derivative formula; counting points on the circle as inside; ignoring orientation; treating the ML bound as the value; using $\operatorname{Log}$ as a primitive along a path that crosses the negative real axis.

Suggested homework. I(2, 3, 6, 8), II(3, 5, 7, 8), III(3, 5, 6, 9, 10), IV(1, 3, 6); Exam corner E1, E3, E6.

🔬 Research–Teaching NexusResearch-tutored · optional, about 60 minutes

Research question. Numerical differentiation by finite differences is notoriously unstable: halving the step size can make the answer worse. Cauchy's integral formula offers an alternative — compute $f^{(n)}(a)$ as an integral over a circle, approximated by averaging $M$ sampled values. How accurate is this, and how should the radius be chosen?

Why it matters. Contour-integral methods are used to compute high derivatives and Taylor coefficients in combinatorics and physics, to invert Laplace and $z$-transforms in control engineering and signal processing, to price financial options from characteristic functions, and to find all eigenvalues of a matrix inside a region (contour-integral eigensolvers in computational physics). The trapezoidal rule on a circle converges geometrically fast for analytic integrands — a phenomenon with deep connections to Fourier series.

What to do.

  1. With $M$ equally spaced points $z_k=re^{2\pi ik/M}$ on $|z|=r$, the trapezoidal rule turns Theorem 2.18 (with $a=0$) into $$f^{(n)}(0)\approx\frac{n!}{M}\sum_{k=0}^{M-1}\frac{f(z_k)}{z_k^{\,n}}.$$ Derive this from the parametrisation $z=re^{it}$.
  2. For $f=e^z$ and $n=10$ (true value $1$), tabulate the relative error for $r=0.5,1,2,4,10,16$ and $M=32,64$.
  3. Explain the two sources of error: rounding (the sum has size about $M(r)/r^n$ while the answer is $1/n!$ times it — compare with Cauchy's estimate) and aliasing (the rule integrates exactly all $z^j$ except those with $j\equiv0\pmod M$, so Taylor terms of degree $n\pm M,\ n\pm2M,\dots$ leak in). Which dominates for small $r$, and which for large $r$?
  4. Compare with the central difference formula for $f''(0)$ with steps $h=10^{-2},10^{-4},10^{-6}$.

Tools: Python with NumPy (or any language with complex arithmetic); numpy.fft computes all the sums $\frac1M\sum f(z_k)z_k^{-n}$, $n=0,\dots,M-1$, at once.

Hand in: The error table, a log-scale plot of error against $r$, and a paragraph explaining the optimal radius in terms of the minimiser of the Cauchy bound $n!\,e^r/r^n$ (which is $r=n$).

Going further. Read about the Lyness–Moler method for numerical differentiation, Bornemann's analysis of accurate Taylor coefficients via Cauchy integrals, and the Sakurai–Sugiura and FEAST eigensolvers, which apply the same idea to the resolvent $(zI-A)^{-1}$ of a matrix.

Instructor note: for $f=e^z$, $n=10$, $M=32$ the relative errors are about $1.5\times10^{-6}$ ($r=0.5$), $2.3\times10^{-9}$ ($r=1$), $5.9\times10^{-12}$ ($r=2$), $2.7\times10^{-14}$ ($r=4$), $2.6\times10^{-13}$ ($r=10$) and $8.8\times10^{-7}$ ($r=16$); with $M=64$ the last two drop to about $3\times10^{-16}$ and $1.3\times10^{-15}$. Small $r$ loses to rounding (the terms are amplified by $n!/r^n$), large $r$ with small $M$ to aliasing (the leaked coefficient $r^{M}/(n+M)!$ grows with $r$). Radii near $r=n=10$ with enough points give full double precision.

🧪 Self-check quiz

0/5 correct

Q1. $\displaystyle\oint_{|z|=1}\frac{dz}{z^2}$ equals

Q2. $\displaystyle\oint_{|z|=2}\frac{e^z}{z-1}\,dz$ equals

Q3. The ML-inequality gives which upper bound for $\left|\oint_{|z|=3}\frac{dz}{z^2-4}\right|$?

Q4. Let $f$ be analytic on a domain $D$. Then $\oint_\gamma f\,dz=0$ for every closed contour $\gamma$ in $D$

Q5. If $f$ is entire and $|f(z)|\le10$ on $|z|=5$, then Cauchy's estimate gives $|f''(0)|\le$