JustToThePoint English Website Version
JustToThePoint en español

A Guide to Contour Integrals in Complex Analysis

If the only tool you have is a hammer, you tend to see every problem as a nail, Abraham Maslow.

image info

Introduction

A complex function $f(z)$ maps $z = x + iy \in \mathbb{C}$ to another complex number. For example: $f(z) = z^2 = (x + iy)^2 = x^2 - y^2 + 2ixy, f(z) = \frac{1}{z}, f(z) = \sqrt{z^2 + 7}$.

A contour is a continuous, piecewise-smooth curve defined parametrically as: $z(t) = x(t) + iy(t), \quad a \leq t \leq b$. Examples of contours:

Complex contour integrals are both a generalization of real integrals to the complex plane and a cornerstone of complex analysis. Instead of integrating over an interval on the real line, we integrate a complex-valued function along a curve or contour (a piecewise-smooth curve in the complex plane) in the complex plane.

Mathematical Formulation of Contour Integrals

Definition (Smooth Contour Integral). Let ᵞ be a smooth contour (a continuously differentiable path in the complex plane), $\gamma: [a, b] \to \mathbb{C}$. Let $f: \gamma^* \to \mathbb{C}$ be a continuous complex-valued function defined on the trace $\gamma^*$ of the contour (i.e. along the image of $\gamma$). Then, the contour integral of f along $\gamma$ is defined as $\int_{\gamma} f(z)dz := \int_{a}^{b} f(\gamma(t)) \gamma^{'}(t)dt$.

In this definition, we integrate the function f along the path traced out by $\gamma(t)$. The term $\gamma^{'}(t)$ (the derivative of $\gamma$) accounts for the direction and speed of traversal along the path. This definition essentially transforms or converts the complex line integral into a regular real integral over the interval [a, b] via the parametrization $\gamma(t)$. The factor $\gamma'(t)dt = d\gamma$ represents an infinitesimal step along the curve, so $f(\gamma(t))\gamma'(t)dt$ is the infinitesimal contribution to the integral from that step.

In a standard real integral, like $\int_{a}^{b} g(x)dx$, we’re essentially summing up areas of infinitely many tiny (infinitesimal) rectangles. Each rectangle has height g(xi​) and infinitesimal width dx.

A contour integral is quite similar, but instead of moving along a straight line interval (the x-axis), we’re moving along a curve γ in the complex plane and instead of summing up simple (real) areas, we’re summing up tiny complex quantities.

Another way to understand the contour integral is as a limit of Riemann sums of weighted steps along the path:

  1. Chop Up the Path. First, imagine the smooth curve γ is approximated by a sequence of short, straight line segments. We create these segments by picking or choosing partition points $z_0, z_1​,z_2​, \cdots ,z_n​$ along the curve (with $z_0 = \gamma(a)$ at the start and $z_n = \gamma(b)$ at the end).
  2. Define the “Small Steps” (Δzi​). Each consecutive pair of points or tiny segment is a “step” or small displacement from one point to the next. The step from zi to zi+1​ is the complex difference Δzi​ = zi+1​ −zi​. This Δzi​ isn’t just a length; it’s a tiny vector (a small complex number) having both a magnitude (the length of the segment) and a direction (the angle of the segment).
  3. Find the “Weight” at Each Step (f(i)) (Sample the function). At the beginning of each step or segment (at point zi​), we evaluate our function f(z). This gives us another complex number, f(zi​), which we can think of as a “weight” or a “scaling factor” for that specific step. This weight also has its own magnitude and direction.
  4. Calculate the “Weighted Step” (f(zi​)⋅Δzi​). This is the key part. For each segment, we multiply the function’s value (the weight) by the step itself: f(zi​)⋅Δzi​.
  5. Sum everything up. The contour integral is what you get when you add all these “weighted steps or contributions” together: $\int_{\gamma} f(z)dz ≈ \sum_{i=0}^{n-1}f(z_i)\Delta z_i$ where $\Delta z_i = \gamma(t_{i+1})-\gamma(t_i), f(z_i) = f(\gamma(t_i))$.

$\sum_{i=0}^{n-1}f(\gamma(t_i))·(\gamma(t_{i+1})-\gamma(t_i)) = \sum_{i=0}^{n-1}f(\gamma(t_i))·\frac{\gamma(t_{i+1})-\gamma(t_i)}{t_{i+1}-t_{i}}(t_{i+1}-t_{i})$

As we make our segments infinitesimally small, the time interval $\Delta t_i \to 0$ becomes the infinitesimal dt and the fraction $\frac{\gamma(t_{i+1})-\gamma(t_i)}{t_{i+1}-t_{i}}$ becomes the very definition of the derivative $\gamma^{'}(t_i)$.

The sum becomes $\sum_{i=0}^{n-1}f(\gamma(t_i))·\gamma^{'}(t_i)\Delta t_i$ which is a Riemann sum. As we refine the partition (making the segments infinitesimally small, $\Delta t_i \to 0$), this sum approaches the integral we were given: $\int_{a}^{b} f(\gamma(t)) \gamma^{'}(t)dt = \int_{\gamma} f(z)dz$.

In short, we accumulate the contributions $f(z)dz$ along each tiny step of the path and take the limit to get the exact integral.

Now, if the path $\gamma$ isn’t smooth over the entire interval but is composed of multiple smooth segments or pieces joined end-to-end.

Definition (Piecewise Smooth Contour). Let ᵞ be a piecewise smooth contour, $\gamma: [a, b] \to \mathbb{C}$, meaning there is a partition $a = t_0 < t_1 < \cdots < t_n < t_{n+1} = b$ such that $\gamma$ is smooth on each subinterval $[t_k, t_{k+1}]$. Then, we define the contour integral as the sum over each smooth segment: $\int_{\gamma} f(z)dz := \sum_{k=0}^{n} \int_{t_k}^{t_{k+1}}f(\gamma(t)) \gamma^{'}(t)dt$.

In other words, we break the curve into several smooth pieces, integrate f along each piece separately, and then add up the results to get the total contour integral over the entire piecewise path. This additivity is consistent with the idea that the total work (or total accumulated value) along a path is the sum of the work along each part of the path.

Examples

$\gamma^{'}(t) = 1 + i, f(\gamma(t)) = (t + it)^2 = t^2(1+i)^2 = t^2(1+2i+i^2) = t^2(2i).$

$\int_{\gamma} f(z)dz := \int_{a}^{b} f(\gamma(t)) \gamma^{'}(t)dt = \int_{a}^{b} f(\gamma(t)) \gamma^{'}(t)dt = \int_{0}^{1} 2it^2·(1+i)dt = 2i(1+i)\int_{0}^{1} t^2dt = 2i(1+i)\frac{t^3}{3}\big|_{0}^{1} =$

$= \frac{2i(1+i)}{3} = \frac{-2 + 2i}{3}$.

$\int_{\gamma} f(z)dz := \int_{a}^{b} f(\gamma(t)) \gamma^{'}(t)dt = \int_{a}^{b} f(\gamma(t)) \gamma^{'}(t)dt = \int_{0}^{1} e^{t(1+i)}·(1+i)dt = (1+i)\int_{0}^{1} e^{t(1+i)}dt = (1+i)\frac{e^{(1+i)t}}{1+i}\big|_{0}^{1} =$

$= (1+i)\frac{e^{1+i}}{1+i} -(1+i)\frac{e^{0}}{1+i} = e^{1+i} - 1$.

The function $f(z) = \sqrt{z}$ is multi-valued and requires a branch cut. Parametrize $\gamma(t) = e^{it}, 0 \le t \le 2\pi$, with $f(\gamma(t)) = e^{it/2}$.

$\int_{\gamma} f(z)dz := \int_{a}^{b} f(\gamma(t)) \gamma^{'}(t)dt = \int_{a}^{b} f(\gamma(t)) \gamma^{'}(t)dt = \int_0^{2\pi} e^{it/2} i e^{it}dt = i \int_0^{2\pi} e^{3it/2}dt = i\frac{2}{3i} e^{\frac{3i t}{2}}\big|_{0}^{2\pi} =$

$= \frac{2}{3}(e^{3\pi i} - 1) = \frac{2}{3}( \cos(3\pi) + i \sin(3\pi) - 1) = \frac{2}{3} (-1 - 1) = \frac{2}{3} \cdot (-2) = -\frac{4}{3}$

Cauchy’s Integral Theorem. Let f(z) be analytic (holomorphic) in a simply connected region D. If γ is any closed contour lying entirely within D, then $\int_γ f(z)dz = 0$, e.g., since z^2 is entire (analytic everywhere) in $\mathbb{C}, \int_γ z^2 dz = 0$ for any closed contour γ in the complex plane. It states that the integral of an analytic (holomorphic) function over any closed contour is zero, $\oint_γ z^2 \, dz = 0$.

$\int_{\gamma} f(z)dz := \int_{0}^{2\pi} f(e^{it}) ie^{it}dt = \int_{0}^{2\pi} e^{2it}ie^{it}dt = \int_{0}^{2\pi} ie^{3it}dt$.

We can evaluate this integral by recognizing $e^{3it} = \cos(3t) + i\sin(3t)$. Thus:

$\int_{0}^{2\pi} ie^{3it}dt = i\int_{0}^{2\pi} [cos(3t) + isin(3t)]dt = \int_{0}^{2\pi} -sin(3t)dt + i\int_{0}^{2\pi} cos(3t)dt = 0 + 0 = 0$.

Both integrals are zero (each is an integral of a full period of sine or cosine), so the result is $(-1)·0 +i·0 = 0$. As expected, $\int_{\gamma} z^2dz = 0$.

$\int_{\gamma} f(z)dz := \int_{0}^{2\pi} f(e^{it}) rie^{it}dt = \int_{0}^{2\pi} (re^{it})^n rie^{it}dt = \int_{0}^{2\pi} r^{n+1}ie^{i(n+1)t}dt$

$= \int_{0}^{2\pi} r^{n+1}i(cos((n+1)t) + isin((n+1)t))dt = -\int_{0}^{2\pi} r^{n+1}sin((n+1)t)dt + i\int_{0}^{2\pi} r^{n+1}cos((n+1)t)dt$.

We consider two cases for n:

Case 1. If n ≠ -1,

$$ \begin{aligned} \int_{\gamma} f(z)dz &=r^{n+1}\frac{cos((n+1)t)}{n+1}\Big|_{0}^{2\pi} +ir^{n+1}\frac{sin((n+1)t)}{n+1}\Big|_{0}^{2\pi}\\[2pt] &=\text{ each term vanishes because sine and cosine are 2π-periodic } 0+0\\[2pt] &=0. \end{aligned} $$

Case 2. If n = -1, then the integrand becomes constant:

$$ \begin{aligned} \int_{\gamma} f(z)dz &=-\int_{0}^{2\pi} r^{n+1}·0dt + i\int_{0}^{2\pi} r^{n+1}·1dt \\[2pt] &=i\int_{0}^{2\pi}dt\\[2pt] &=i·(2\pi-0) = 2\pi i. \end{aligned} $$

Summarizing these results:

$$\boxed{\displaystyle \int_{\gamma} z^n\,dz = \begin{cases} 0, & n \ne -1,\\[6pt] 2\pi i, & n = -1. \end{cases}}$$

The function $f(z) = \frac{1}{z}$ is well-behaved everywhere except at one point: z = 0. At this point, the denominator is zero, and the function “blows up.” This kind of point is called a singularity, more specifically f(z) has simple pole at z = 0.

A pole is a type of singularity where the function goes to infinity. It’s called “simple” (or a pole of order 1) because the term causing the issue in the denominator, z, is raised to the first power, e.g., $\frac{1}{z^2}$ has a pole of order 2 at z = 0, $\frac{9}{(z-5i)^3}$ has a pole of order 3 at z = 5i, etc.

For every isolated singularity, there is a special number associated with it called the residue. The residue captures the essence of the function’s behavior right at that singular point. For a simple pole at a point $z_0$ is calculated using the formula $Res(f, z_0) = \lim_{z \to z_0}(z-z_0)f(z)$.

In our particular case, $Res(f, 0) = \lim_{z \to 0}(z-0)\frac{1}{z} = \lim_{z \to 0} \frac{z}{z} = \lim_{z \to 0} 1 = 1.$ In words, the residue of the function $f(z) = \frac{1}{z}$ at the singularity z = 0 is 1.

The Residue Theorem states that the integral a function f(z) around a simple closed contour γ is equal to 2πi times the sum of the residues of all singularities inside the contour, $\int_{\gamma} f(z)dz = 2\pi i \sum Res(f, z_k)$ where $z_k$ is a reside inside γ.

Let’s apply it to our problem (the only singularity of f is at z = 0): $\int_{\gamma} \frac{1}{z} dz = 2\pi i \cdot \text{Res}(0) = 2\pi i \cdot 1 = 2\pi i$.

This result is awesome and powerful. We evaluated a complex integral not by parameterizing the path and performing a difficult integration, but by simply finding one “problem point” and calculating a single, simple limit.

Factor the denominator: $\frac{1}{z^2 + 1} = \frac{1}{(z - i)(z + i)}$. So, the function has two simple poles: one at z = i and another at z = -i. They both lie inside the contour (the Residue Theorem only cares about poles that are inside the contour γ). For z = i, the distance from the origin is $\sqrt{0^2+1^2} = 1 \lt 2$. For z = -i, the distance from the origin is $\sqrt{0^2+(-1)^2} = 1 \lt 2$. Computing the residues:

Residue at z = i: $\lim_{z \to i} (z - i) \cdot \frac{1}{(z - i)(z + i)} = \lim_{z \to i} \frac{1}{z+i} = \frac{1}{2i}$. Residue at z = -i: $\lim_{z \to -i} (z + i) \cdot \frac{1}{(z - i)(z + i)} = \lim_{z \to -i} \frac{1}{z-i} \frac{-1}{2i}$

By the Residue Theorem, $\int_{\gamma} f(z)dz = 2\pi i \sum Res(f, z_k) = 2\pi i (Res(i)+Res(−i)) = 2\pi i (\frac{1}{2i} - \frac{1}{2i}) = 2\pi i \cdot 0 = 0$.

Symmetry in residues can cancel contributions, leading to a zero integral.

f(z) = z is analytic, that is, our function is “infinitely smooth” and well-behaved everywhere in a region. It has no singularities (like poles, where it would blow up) and has a well-defined derivative at every point, and for any analytic function, the value of the integral between two points is path-independent.

Because the path doesn’t matter, we can use the Fundamental Theorem of Calculus. If f(z) is analytic in a region and has an antiderivative F(z) (where F′(z) = f(z)), then the integral from point a to point b is simply: $\int_{a}^{b} f(z)dz = F(b) - F(a)$.

Path Independence Theorem. If f(z) is analytic on a contour $\gamma$ from $z_1$ to $z_2$, and f(z) has an antiderivative F(z) (F'(z) = f(z)) on $\gamma$, then $\int_{\gamma} f(z)dz = F(z_2) - F(z_1)$. In words, the valued of its integral between two points $z_1$ and $z_2$, does not depend on the path γ taken to get from $z_1$ to $z_2$.

This powerful theorem only works if two conditions are met within a domain containing the path:

  1. f(z) is analytic, i.e., complex differentiable at every point. Counterexample: $f(z) = \bar{z}$ is not analytic, so the theorem does not apply.
  2. f(z) has an antiderivative F(z): There must be a function F(z) such that F’(z) = f(z).

A direct consequence of this theorem is that for an analytic function f with an antiderivative F, the integral over any closed loop (where $z_1 = z_2$) is always zero: $\oint_\gamma f(z) dz = F(z_1) - F(z_2) = 0$. This is a foundational result that leads to Cauchy’s Integral Theorem.

Since f(z) = z is analytic, the integral is path-independent. Use the antiderivative (just like in real calculus) $F(z) = \frac{z^2}{2}$: $\int_{\gamma} f(z)dz = \int_{0}^{1+i} z dz = F(1+i) - F(0) = \frac{(1+i)^2}{2} - 0 = \frac{2i}{2} = i$. We got this result without ever needing to define the “straight line” mathematically. We could have taken any path from 0 to 1+i and the answer would still be i. This is the power of path independence for analytic functions.

Evaluate $ \int_{\gamma} f(z)dz$, where $\gamma$ is a non-closed contour from 0 to 1 + i and f(z) = z2.

f(z) = z2 is a polynomial, so it’s analytic everywhere. The antiderivative is $F(z) = \frac{z^3}{3}, \int_{\gamma} f(z)dz = \int_{0}^{1+i} z^2 dz = F(1+i) - F(0) = \frac{(1+i)^3}{3} - 0 = \frac{-2 + 2i}{3}$.

This is the answer regardless of the path taken from 0 to 1+i.

Note: (1+i)² = 1 + 2i + i² = 2i, (1+i)³ = (2i)(1+i) = 2i + 2i² = −2 + 2i.

Bitcoin donation

JustToThePoint Copyright © 2011 - 2025 Anawim. ALL RIGHTS RESERVED. Bilingual e-books, articles, and videos to help your child and your entire family succeed, develop a healthy lifestyle, and have a lot of fun. Social Issues, Join us.

This website uses cookies to improve your navigation experience.
By continuing, you are consenting to our use of cookies, in accordance with our Cookies Policy and Website Terms and Conditions of use.