Skip to content
Tutorials Center
My learning

Topics

Lesson 35 of 36 · Projects and Practice

Practice Set: Contour Integrals and Residues

Ten graded problems on contour integrals, Cauchy's formulas, residues, real integrals and Rouché, with worked solutions and a numerical answer checker.

Contour integration is learned by doing. This practice set has ten problems that mix the tools from the last five chapters: the ML inequality, Cauchy's formulas, Laurent series, residues, real integrals and Rouché. Try each problem on paper first. Then check your answers with the checker below, and read the solutions to compare methods.

All contours are circles traversed once counterclockwise.

The problems

Part A: Cauchy's formulas and residues

  1. Compute ∮_(|z|=1) sin z / z² dz.
  2. Compute ∮_(|z|=3) dz / ((z - 1)(z + 2)).
  3. Compute ∮_(|z|=2) z / (z² + 1) dz.
  4. Compute ∮_(|z|=1) e^(1/z) dz.
  5. Compute ∮_(|z|=2) dz / (z²(z - 1)).
  6. Compute ∮_(|z|=1) cos z / z³ dz.
  7. Compute ∮_(|z|=2) cot z dz.

Part B: real integrals

  1. Compute ∫_(-∞)^∞ dx/(x² + 4).
  2. Compute ∫_0^(2π) dθ/(5 + 4 cos θ).

Part C: counting zeros

  1. How many zeros does z⁷ - 5z³ + 12 have in |z| < 1, in |z| < 2, and in the annulus 1 < |z| < 2?

Before looking at the solutions, remember the three workhorses: Cauchy's formula ∮ f/(z - a)^(n+1) dz = 2πi f^(n)(a)/n!, the residue sum 2πi Σ Res, and the rule that only the coefficient of (z - a)^(-1) matters.

Solutions

1. The integrand is f(z)/z² with f = sin, and n + 1 = 2, so n = 1. The integral is 2πi · f'(0) = 2πi · cos 0 = 2πi. (Check by series: sin z/z² = 1/z - z/6 + ..., the coefficient of 1/z is 1.)

2. Both poles 1 and -2 are inside |z| = 3. Residues: at 1, 1/(1 + 2) = 1/3; at -2, 1/(-2 - 1) = -1/3. The sum is 0, so the integral is 0. (Alternatively, the integrand decays like 1/z², so the large-circle integral tends to zero by the ML inequality, and the integral is independent of the radius once both poles are inside.)

3. z/(z² + 1) has simple poles at ±i, both inside. With p/q' the residue is z/(2z) = 1/2 at each. The sum is 1, so the integral is 2πi.

4. The Laurent series is Σ z^(-n)/n!, with c_(-1) = 1. The integral is 2πi. This is an essential singularity, so only the series gives the residue.

5. Poles at 0 (double) and 1 (simple), both inside |z| = 2. Residue at 1: 1/1² = 1. At 0: d/dz [1/(z - 1)] at 0 equals -1/(z - 1)² at 0, so -1. The sum is 0, so the integral is 0.

6. n + 1 = 3, so n = 2: the integral is 2πi · f''(0)/2! with f = cos, f'' = -cos, f''(0) = -1. So 2πi · (-1)/2 = -πi.

7. cot z = cos z/sin z has simple poles at multiples of π. Inside |z| = 2 only 0 lies (since π ≈ 3.14 > 2). The residue is cos 0/cos 0 = 1, so the integral is 2πi.

8. The pole in the upper half-plane is 2i. The residue of 1/(z² + 4) there is 1/(2z) = 1/(4i). So I = 2πi/(4i) = π/2. Check: ∫ dx/(x² + 4) = (1/2)[arctan(x/2)] from -∞ to ∞ = π/2.

9. From the lesson on real integrals, ∫_0^(2π) dθ/(a + b cos θ) = 2π/√(a² - b²) for a > |b|. With a = 5, b = 4: 2π/√9 = 2π/3.

10. On |z| = 1: take f = 12 and g = z⁷ - 5z³. Then |f| = 12 and |g| ≤ 1 + 5 = 6 < 12. So the polynomial has the same number of zeros in |z| < 1 as the constant 12: zero. On |z| = 2: take f = z⁷ with |f| = 128 and g = -5z³ + 12 with |g| ≤ 40 + 12 = 52 < 128, so seven zeros in |z| < 2. In the annulus: 7 - 0 = seven.

Try it: the answer checker

The program below computes the numerical value of each of Problems 1 to 9 (by contour integration for Part A and by direct integration for Part B). Fill in the mine dictionary with your answers (complex numbers in Python are written like 2j*pi) and run. A check mark appears when your answer agrees within 1e-6.

Python Check your answers

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.

Try it: a residue explorer

For your own practice functions, the next program finds the residues you list numerically (small circles around each), adds the ones inside the radius you choose, and compares 2πi Σ Res with the direct integral over that circle. Edit f, the list of poles and the radius to experiment, for example by changing the radius so that fewer poles are inside.

Python Residues and the big circle

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.

If the two numbers at the bottom disagree, a pole is missing from your list, or one lies close to the circle (so the small-circle radius 0.1 hits another singularity).

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. What is ∮_(|z|=1) cos z / z dz?

    By Cauchy's formula with f = cos and a = 0, the integral is 2πi cos 0 = 2πi.
  2. 2. Which tool is best for ∮_(|z|=1) e^(1/z) dz?

    e^(1/z) has an essential singularity at 0; its Laurent series Σ z^(-n)/n! gives residue 1.
  3. 3. In Problem 10, why does 12 dominate on |z| = 1?

    On |z| = 1, |z⁷ - 5z³| ≤ 1 + 5 = 6, which is less than 12, so Rouché applies.
  4. 4. ∫_0^(2π) dθ/(a + b cos θ) for a > |b| equals

    This is the standard result of the residue calculation inside the unit circle.

Summary

  • Match each problem to its tool: Cauchy's formula for one pole with analytic numerator, the residue theorem for several poles, Laurent series for essential singularities, upper-half-plane residues for real integrals, Rouché for counting zeros.
  • Always check which singularities lie inside the contour.
  • Verify answers numerically with a contour integral whenever you can.

Next: Project: a zero finder based on the argument principle