Skip to content
Tutorials Center
My learning

Topics

Lesson 19 of 36 · Contour Integration

Complex Line Integrals

Define the integral of a complex function along a curve, parametrize segments and circles, and compute contour integrals step by step by hand and in code.

In real calculus you integrate a function along an interval of the x-axis. In complex analysis the "interval" becomes a curve in the plane, because a complex number has two directions to travel in. The integral of a complex function along a curve is called a line integral or contour integral, and it is the main tool of the second half of this course: it leads to Cauchy's theorems, to power series, and to the residue theorem.

This lesson builds the definition from a parametrization, works through the two curves you will meet most often (line segments and circles), and shows how to check your answers numerically.

Curves and contours

A smooth curve is a function γ(t) = x(t) + i·y(t) for a ≤ t ≤ b, where x and y have continuous derivatives and γ'(t) = x'(t) + i·y'(t) is never zero. A contour is a finite chain of smooth curves joined end to end (for example, a square is four segments). A contour is closed if it ends where it starts, and simple if it never crosses itself.

Two parametrizations you should know by heart:

Curve Parametrization γ'(t)
Segment from p to q γ(t) = p + t(q - p), 0 ≤ t ≤ 1 q - p
Circle, center c, radius r, counterclockwise once γ(t) = c + r·e^(it), 0 ≤ t ≤ 2π i·r·e^(it)

The direction matters. Counterclockwise is called the positive orientation of a circle.

The definition

If f is continuous on the curve, the contour integral of f along C (parametrized by γ) is

Text
∫_C f(z) dz = ∫_a^b f(γ(t)) · γ'(t) dt

The right-hand side is an ordinary integral of a complex-valued function of a real variable. You integrate real and imaginary parts separately. The factor γ'(t) plays the role of dz/dt: the substitution z = γ(t) turns dz into γ'(t) dt.

Example 1: a segment

Compute ∫ z² dz along the segment from 0 to 1 + i.

Parametrize γ(t) = (1 + i)t, so γ'(t) = 1 + i. Then

Text
∫ z² dz = ∫_0^1 ((1+i)t)² (1+i) dt = (1+i)³ ∫_0^1 t² dt = (1+i)³ / 3

Since (1+i)² = 2i and (1+i)³ = 2i(1+i) = -2 + 2i, the answer is (-2 + 2i)/3.

Example 2: a circle

Compute ∫ conj(z) dz once around the unit circle. Here γ(t) = e^(it), conj(γ(t)) = e^(-it) and γ'(t) = i·e^(it):

Text
∫ conj(z) dz = ∫_0^(2π) e^(-it) · i e^(it) dt = i ∫_0^(2π) 1 dt = 2πi

Notice that the result is not zero, although we integrated around a closed curve. That is a warning sign that conj(z) is not analytic; you will see in the Cauchy chapter that closed-curve integrals of analytic functions behave much better.

Properties you can rely on

  • Linearity. ∫ (αf + βg) dz = α ∫ f dz + β ∫ g dz for complex constants α, β.
  • Reversal. If -C is the same curve traversed backwards, ∫_(-C) f dz = -∫_C f dz.
  • Additivity. If C is made of C₁ followed by C₂, then ∫_C = ∫_(C₁) + ∫_(C₂).
  • Independence of parametrization. Any two smooth parametrizations that trace the same curve in the same direction give the same integral. Reparametrizing only changes how fast you travel, and the factor γ'(t) compensates exactly.

A contour integral depends on the curve you choose, not only on its endpoints. Example 3 below shows two different paths from 0 to 1 + i giving different answers for the same function.

Try it: a numerical line integral

The first runnable example is a small integrator. It samples the curve at Gauss-Legendre nodes (a standard high-accuracy rule for smooth integrands) and applies the definition directly. We test it on Examples 1 and 2.

Python A numerical contour integrator

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Same endpoints, different paths

Here is the claim from the note, tested. We integrate two functions from 0 to 1 + i along two routes: the straight diagonal, and the "corner" route that goes along the real axis to 1 and then straight up to 1 + i.

For f(z) = conj(z) we computed by hand that the diagonal gives 1, and the corner route gives 1 + i. For f(z) = z² both routes agree. The code confirms this.

Python Does the path matter?

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The function z² has an antiderivative (z³/3), which makes its integral depend only on the endpoints. conj(z) has none. The next lessons turn this observation into a theorem: antiderivatives and path independence.

A recipe

  1. Choose a parametrization γ(t) that traces the contour in the required direction.
  2. Compute γ'(t).
  3. Substitute into f(γ(t)) · γ'(t) and simplify.
  4. Integrate in t over [a, b], real and imaginary parts if needed.
  5. For a contour of several pieces, add the pieces.

For the unit circle, a very common simplification is that γ(t) = e^(it), so z^n becomes e^(int), and ∫_0^(2π) e^(ikt) dt is 2π when k = 0 and 0 for every other integer k. You will use that fact constantly in winding numbers.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. What is the contour integral of f along a curve parametrized by z = γ(t), a ≤ t ≤ b?

    dz becomes γ'(t) dt, so the integrand is f(γ(t)) times γ'(t).
  2. 2. Which parametrization traces the circle |z - 2| = 3 once counterclockwise?

    The center is 2 and the radius is 3. A positive exponent e^(it) goes counterclockwise.
  3. 3. If C is traversed in the opposite direction, the integral of f over it

    Reversing the direction reverses the sign: the integral over -C equals minus the integral over C.
  4. 4. The integral of conj(z) once around the unit circle is 2πi, not 0. What does this show?

    conj(z) is not analytic. For analytic functions on suitable domains, closed integrals vanish, as the Cauchy theorems will show.

Summary

  • A contour integral is defined by ∫_C f dz = ∫ f(γ(t)) γ'(t) dt.
  • Segments use p + t(q - p); circles use c + r·e^(it).
  • The integral is linear, additive over joined curves, and changes sign when the direction is reversed.
  • The result may depend on the path, not only on its endpoints.
  • A numerical integrator is an easy way to check hand calculations.

Next: The ML inequality and estimates