Skip to content
Mathematical Methods

From real to complex and back: real integrals with residues, Jordan's lemma and all the contours

Semicircle for rational functions, Jordan's lemma proved, the integral of sine x over x with the indented contour, keyhole, sector and Fresnel integrals, rectangle and Gaussian, trigonometric integrals, sum of the series of reciprocal squares.

This page goes deeper into the lesson on the residue theorem with the most spectacular application of complex analysis: computing real integrals by going through the complex plane. An integral along a line, often impossible with the methods of Calculus 1, becomes part of an integral along a closed curve; the residue theorem computes it with a little algebra; an estimate makes the extra pieces vanish; and one returns to the real line with the result. All the classical techniques are covered, each with its own contour: the semicircle, Jordan’s lemma, the indented contour, the keyhole, the sector, the rectangle, and finally the summation of a series.

The strategy

  1. Choose a complex function f(z) that coincides with the integrand on the real axis (or has the integrand as its real or imaginary part).
  2. Choose a closed curve that contains the real stretch [-R, R] (or [0, R]) and “closes” it with other pieces.
  3. By the residue theorem, \oint f\,dz = 2\pi i\sum\text{Res} at the poles inside the curve.
  4. Show, with the ML estimate or Jordan’s lemma, that the added pieces tend to zero (or to something known) as R \to \infty.
  5. The limit of the real stretch is the integral sought.

Rational functions: the semicircle

Theorem. Let P, Q be polynomials with \deg Q \ge \deg P + 2 and Q with no real roots. Then

    \[ \int_{-\infty}^{\infty}\frac{P(x)}{Q(x)}dx = 2\pi i\sum_{\text{Im}\,z_k \gt  0}\text{Res}\left(\frac{P}{Q}, z_k\right) \]

Proof. Integrate on the contour formed by [-R, R] and the semicircle C_R in the upper half-plane. For R large enough all the poles of the upper half-plane are inside. On C_R, since the denominator has degree at least 2 more, \left|\frac{P}{Q}\right| \le \frac{M}{R^2} for some constant M; the length is \pi R; by the ML estimate \left|\int_{C_R}\right| \le \frac{\pi M}{R} \to 0. ∎

Example. \int_{-\infty}^{\infty}\frac{dx}{1 + x^4}. The poles of \frac{1}{1 + z^4} are the fourth roots of -1: e^{i\pi/4}, e^{3i\pi/4} in the upper half-plane. At a simple pole z_k of \frac{1}{Q}, \text{Res} = \frac{1}{Q'(z_k)} = \frac{1}{4z_k^3} = -\frac{z_k}{4} (because z_k^4 = -1). Sum: -\frac{1}{4}\left(e^{i\pi/4} + e^{3i\pi/4}\right) = -\frac{1}{4}\cdot i\sqrt 2. So the integral is 2\pi i\cdot\left(-\frac{i\sqrt 2}{4}\right) = \frac{\pi}{\sqrt 2}.

The semicircle contour
The segment from minus R to R on the real axis is closed by the semicircle C R in the upper half-plane; for large R the contour encloses the poles of the upper half-plane, such as i, and leaves out those of the lower half-plane.

Jordan’s lemma and Fourier integrals

For \int\frac{\cos ax}{x^2 + b^2}dx one uses f(z) = \frac{e^{iaz}}{z^2 + b^2}, with a \gt  0: on the real axis its real part is the integrand, and in the upper half-plane |e^{iaz}| = e^{-a\,\text{Im}\,z} \le 1. When the denominator has degree only one more than the numerator the ML estimate is not enough, and a finer result is needed.

Jordan’s lemma. If |g(z)| \le M_R on C_R with M_R \to 0 and a \gt  0, then \int_{C_R}g(z)e^{iaz}dz \to 0.

Proof. With z = Re^{i\theta}: |e^{iaz}| = e^{-aR\sin\theta}, so \left|\int_{C_R}\right| \le M_RR\int_0^\pi e^{-aR\sin\theta}d\theta = 2M_RR\int_0^{\pi/2}e^{-aR\sin\theta}d\theta. On [0, \frac{\pi}{2}] we have \sin\theta \ge \frac{2\theta}{\pi} (sine is concave and lies above the chord), so the integral is at most \int_0^{\pi/2}e^{-2aR\theta/\pi}d\theta \lt  \frac{\pi}{2aR}. In total \left|\int_{C_R}\right| \lt  \frac{\pi M_R}{a} \to 0. ∎

Jordan's inequality
Between 0 and pi over 2 the sine, in blue, lies above the line 2 theta over pi, dashed: this is the estimate that controls the exponential factor on the semicircle.

Example. \int_{-\infty}^{\infty}\frac{\cos ax}{x^2 + b^2}dx with a, b \gt  0. Only pole in the upper half-plane: z = ib, with residue \frac{e^{iaib}}{2ib} = \frac{e^{-ab}}{2ib}. The integral of f along the line is 2\pi i\cdot\frac{e^{-ab}}{2ib} = \frac{\pi}{b}e^{-ab}; it is real, so it is exactly the integral of the cosine (that of the sine is zero, by symmetry). The result decays exponentially in a: it is the Fourier transform of the Lorentzian (Fourier transform exercises).

The indented contour: the integral of \sin x/x

Theorem. \displaystyle\int_0^\infty\frac{\sin x}{x}dx = \frac{\pi}{2}.

The sine integral has no elementary antiderivative. Use f(z) = \frac{e^{iz}}{z}, which has a pole on the real axis, at 0. The contour goes round it with a small semicircle C_\varepsilon above zero, traversed clockwise, and is closed with the large C_R. There are no poles inside, so the total integral is zero.

Small semicircle lemma. If f has a simple pole at z_0, the integral over a semicircle of radius \varepsilon around z_0, traversed clockwise, tends to -i\pi\,\text{Res}(f, z_0).

Proof. Near the pole f(z) = \frac{c}{z - z_0} + h(z), with h holomorphic and hence bounded: its integral over the arc tends to 0 by the ML estimate (the length is \pi\varepsilon). For the first term, with z = z_0 + \varepsilon e^{i\theta}, \theta from \pi to 0: \int c\,i\,d\theta = -i\pi c. ∎

Proof of the theorem. On the contour: \int_{-R}^{-\varepsilon} + \int_{C_\varepsilon} + \int_\varepsilon^R + \int_{C_R} = 0. The piece on C_R tends to 0 by Jordan (g = \frac{1}{z}, M_R = \frac{1}{R}); the one on C_\varepsilon tends to -i\pi\cdot 1 (residue of \frac{e^{iz}}{z} at 0). The two real stretches give, joining x and -x, \int_\varepsilon^R\frac{e^{ix} - e^{-ix}}{x}dx = 2i\int_\varepsilon^R\frac{\sin x}{x}dx. In the limit: 2i\,I - i\pi = 0, i.e. I = \frac{\pi}{2}. ∎

The indented contour
The path runs along the real axis from minus R to minus epsilon, goes round the origin with the small semicircle C epsilon in the upper half-plane, continues along the axis to R and is closed with the large semicircle C R. The pole at the origin stays outside.

The keyhole: non-integer powers

Theorem. For 0 \lt  a \lt  1: \displaystyle\int_0^\infty\frac{x^{a-1}}{1 + x}dx = \frac{\pi}{\sin\pi a}.

Proof. The function z^{a-1} = e^{(a-1)\log z} is multivalued: choose the argument in (0, 2\pi), with the branch cut along the positive real half-axis. The “keyhole” contour runs along the upper edge of the cut from \varepsilon to R, the large circle, the lower edge from R to \varepsilon and the small circle. On the upper edge z^{a-1} = x^{a-1}; on the lower one the argument is 2\pi, so z^{a-1} = e^{2\pi i(a-1)}x^{a-1}.

The circles do not contribute in the limit: on the small one the integrand is about \varepsilon^{a-1} and the length 2\pi\varepsilon, product \sim\varepsilon^a \to 0; on the large one \sim\frac{R^{a-1}}{R}\cdot 2\pi R = 2\pi R^{a-1} \to 0. Only pole: z = -1 = e^{i\pi}, with residue e^{i\pi(a-1)}. So

    \[ I\left(1 - e^{2\pi i(a-1)}\right) = 2\pi i\,e^{i\pi(a-1)} \;\Rightarrow\; I = \frac{2\pi i}{e^{-i\pi(a-1)} - e^{i\pi(a-1)}} = \frac{2\pi i}{-2i\sin(\pi(a - 1))} = \frac{\pi}{\sin\pi a} \]

∎ With a = \frac{1}{2}: \int_0^\infty\frac{dx}{\sqrt x(1 + x)} = \pi. It is also the reflection formula of the Gamma function, \Gamma(a)\Gamma(1 - a) = \frac{\pi}{\sin\pi a}.

The keyhole contour
The path runs above the cut along the positive real half-axis, goes round the large circle, comes back below the cut, where the function has a different phase factor, and closes with the small circle around the origin. It encloses the pole at minus 1.

The sector: exploiting a symmetry

Example. \int_0^\infty\frac{dx}{1 + x^3}. The function z^3 does not change when z is rotated by \frac{2\pi}{3}: integrate over the sector of opening \frac{2\pi}{3}. On the return ray z = re^{2\pi i/3}, z^3 = r^3, and that piece equals -e^{2\pi i/3}I. The arc tends to zero (ML: \frac{1}{R^3}\cdot R). Inside there is a single pole, p = e^{i\pi/3}, with residue \frac{1}{3p^2}. So

    \[ \left(1 - e^{2\pi i/3}\right)I = \frac{2\pi i}{3e^{2\pi i/3}} \;\Rightarrow\; I = \frac{2\pi}{3\sqrt 3} \]

(with 1 - e^{2\pi i/3} = -2i\,e^{i\pi/3}\sin\frac{\pi}{3} and a couple of simplifications).

The sector contour
The path goes from 0 to R along the real axis, follows the arc up to the angle two thirds of pi and returns to the origin along the ray; inside there is only the pole e to the i pi over 3.

Fresnel integrals. With f(z) = e^{iz^2} and the sector of opening \frac{\pi}{4}: there are no poles inside; on the ray z = re^{i\pi/4}, iz^2 = -r^2, and the function becomes a Gaussian. The arc tends to zero with the same idea as Jordan (\sin 2\theta \ge \frac{4\theta}{\pi}). So \int_0^\infty e^{ix^2}dx = e^{i\pi/4}\int_0^\infty e^{-r^2}dr = e^{i\pi/4}\frac{\sqrt\pi}{2}, and separating real and imaginary parts

    \[ \int_0^\infty\cos x^2\,dx = \int_0^\infty\sin x^2\,dx = \sqrt{\frac{\pi}{8}} \]

These are the integrals of Fresnel diffraction in optics and of the clothoid curve used for road and railway transition curves.

The sector of opening pi over 4
On the ray inclined at 45 degrees the complex exponential e to the i z squared becomes the Gaussian e to the minus r squared, which can be integrated.

The rectangle: shifting a Gaussian

Example. \int_{-\infty}^{\infty}e^{-x^2}\cos bx\,dx. Integrate e^{-z^2}, holomorphic everywhere, over the rectangle with vertices \pm R and \pm R + i\frac{b}{2}. On the upper side z = x + i\frac{b}{2}: e^{-z^2} = e^{-x^2}e^{b^2/4}e^{-ibx}. The vertical sides tend to zero (the integrand is about e^{-R^2}). So e^{b^2/4}\int e^{-x^2}e^{-ibx}dx = \int e^{-x^2}dx = \sqrt\pi, and taking the real part

    \[ \int_{-\infty}^{\infty}e^{-x^2}\cos bx\,dx = \sqrt\pi\,e^{-b^2/4} \]

It is the Fourier transform of the Gaussian, derived in the Fourier transform in-depth study with a differential equation: here with a rectangle.

The rectangle contour
The path runs along the real axis from minus R to R, goes up the right side to height i b over 2, comes back along the upper side and down the left side; the function e to the minus z squared has no poles.

Trigonometric integrals

With z = e^{i\theta}, \cos\theta = \frac{z + z^{-1}}{2}, \sin\theta = \frac{z - z^{-1}}{2i}, d\theta = \frac{dz}{iz}, an integral over [0, 2\pi] becomes an integral over the unit circle (lesson). For a power, \cos n\theta = \text{Re}\,z^n.

Example. \int_0^{2\pi}\frac{\cos 2\theta}{5 - 4\cos\theta}d\theta = \text{Re}\oint\frac{z^2}{5 - 2(z + z^{-1})}\cdot\frac{dz}{iz} = \text{Re}\oint\frac{i\,z^2}{2z^2 - 5z + 2}dz. The roots of 2z^2 - 5z + 2 are 2 and \frac{1}{2}: inside the circle only \frac{1}{2}, with residue \frac{i\cdot\frac{1}{4}}{4\cdot\frac{1}{2} - 5} = -\frac{i}{12}. Integral: \text{Re}\left(2\pi i\cdot\left(-\frac{i}{12}\right)\right) = \frac{\pi}{6}.

Summing a series with residues

Theorem. \displaystyle\sum_{n=1}^{\infty}\frac{1}{n^2} = \frac{\pi^2}{6}.

Proof. The function \pi\cot\pi z has simple poles at every integer n, with residue 1. So f(z) = \frac{\pi\cot\pi z}{z^2} has residue \frac{1}{n^2} at every n \ne 0. At 0 the expansion \pi\cot\pi z = \frac{1}{z} - \frac{\pi^2z}{3} + \dots gives f = \frac{1}{z^3} - \frac{\pi^2}{3z} + \dots, residue -\frac{\pi^2}{3}. On the square C_N with vertices \pm(N + \frac{1}{2})(1 \pm i), which passes between the integers, \cot\pi z is bounded by a constant independent of N; then |f| \le \frac{K}{N^2}, the length is about 8N, and the integral tends to 0. So the sum of all the residues tends to 0:

    \[ 2\sum_{n=1}^{N}\frac{1}{n^2} - \frac{\pi^2}{3} \to 0 \]

∎ This is the Basel problem, solved by Euler in 1734 with another method. With the same idea one sums \sum\frac{1}{n^4} = \frac{\pi^4}{90} and many series of physics.

The square contour for summing a series
The square C N passes halfway between the integers; inside are the poles at every integer from minus N to N, in red, and the triple pole at the origin, in purple. Enlarging the square, the integral tends to zero and so does the sum of the residues.

Exercises with all these contours are on the exercise page linked at the top.

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x