On this page
The integral of 1/(1 + x²) over the whole real line is π. You can get that in one line from arctan. The residue theorem gets it a different way, and that way also handles integrals with no friendly antiderivative, such as x²/(1 + x⁴). Here is the method in six steps, with both integrals worked.
What does the residue theorem say?
The residue theorem says that for a positively oriented simple closed curve, the contour integral of f equals 2πi times the sum of the residues of f at the poles inside the curve (Wikipedia: Residue theorem).
For a simple pole at c, where f(z) = g(z)/h(z) with h(c) = 0 and h′(c) ≠ 0, the residue is g(c)/h′(c) (Wikipedia: Residue (complex analysis))).
If polar form and roots of unity feel rusty, revise them first in our post on testing points with complex numbers, because every pole below is a point on a circle.
How do you evaluate a real integral with the residue theorem?
The standard approach extends the integrand to the complex plane, closes part of the real axis with a half-circle, applies the residue theorem, and shows the half-circle's contribution tends to zero as its radius grows (Wikipedia: Residue theorem). As a checklist:
Replace x with z and find the poles: the zeros of the denominator.
Draw the segment from −R to R and close it with a semicircle of radius R in the upper half-plane. Keep only the poles above the real axis.
Find each enclosed residue with g(c)/h′(c).
The integral around the whole contour is 2πi times their sum.
Show that the arc integral goes to 0 as R → ∞.
What remains is the real integral from −∞ to ∞.
Why is the integral of 1/(1 + x²) equal to π?
Take f(z) = 1/(1 + z²). The denominator vanishes at z = i and z = −i. Once R > 1, only i lies inside the upper semicircle.
With g = 1 and h = 1 + z², h′(z) = 2z, so the residue at i is 1/(2i). The contour integral is 2πi × 1/(2i) = π. Harvey Mudd College's Physics 64 notes on contour integration reach the same value with the same semicircle.
Check it the school way: arctan(x) runs from −π/2 to π/2, a change of π.
Why does the arc integral vanish?
The estimation lemma, also called the ML inequality, says the size of a contour integral is at most M × L, where M is the largest value of |f| on the path and L is the path's length (Wikipedia: Estimation lemma).
On the arc, |z| = R, so |1 + z²| ≥ R² − 1 and M ≤ 1/(R² − 1). The arc's length is L = πR. The arc integral is therefore at most πR/(R² − 1), which goes to 0 as R grows. The worked example for e^(itx)/(x² + 1) on the residue theorem page uses the same bound.
How do you integrate x²/(1 + x⁴) with residues?
The poles solve z⁴ = −1: e^(iπ/4), e^(3iπ/4), e^(5iπ/4) and e^(7iπ/4). The first two lie in the upper half-plane.
Here g = z² and h′ = 4z³, so each residue is z²/(4z³) = 1/(4z).
At e^(iπ/4): residue e^(−iπ/4)/4 = (1 − i)/(4√2).
At e^(3iπ/4): residue e^(−3iπ/4)/4 = (−1 − i)/(4√2).
Sum: −2i/(4√2) = −i/(2√2).
Multiply by 2πi: 2πi × (−i/(2√2)) = π/√2, about 2.221. On the arc, |f| ≤ R²/(R⁴ − 1) and L = πR, so the bound πR³/(R⁴ − 1) goes to 0. Denominator degree 4 beats numerator degree 2 by two, as the callout predicts.
Because the integrand is even, the integral from 0 to ∞ is π/(2√2). An NRICH forum answer reaches the same value with the same semicircle and the same residues, 1/(4a) and 1/(4b).
Where do students usually slip?
Counting a pole in the lower half-plane. Draw the contour every time.
Using g(c)/h′(c) at a double pole. It is only for simple poles.
Going clockwise. A clockwise contour flips the sign.
Skipping the arc check. For x²/(1 + x²) the degrees differ by zero, and the real integral does not even converge.
If you get lost mid-solution, the Fermi Problem Library has a step-by-step solver that explains the reasoning rather than printing an answer.
Poles also explain why the power series of 1/(1 + x²) stops converging at |x| = 1: the poles at ±i are at distance 1 from 0. Our post on the radius of convergence of a power series picks up that thread, and Green's theorem for line integrals shows another way a closed curve turns a hard integral into an easy one.



