Intuition What this page is
The parent note built the machine. Here we drive it through every kind of terrain . Before each example you make a forecast (guess the answer's shape), then we grind the steps, then we verify . By the end you will have seen every sign, every quadrant of pole placement, every degenerate case, and two "gotcha" cases that break the naive recipe.
Definition Notation used all over this page
Most integrands here are rational functions : a ratio Q ( x ) P ( x ) where ==P is the numerator polynomial and Q is the denominator polynomial==. The symbol deg P means the degree of P — the highest power of x in it (e.g. deg ( x 2 + 1 ) = 2 ). The gap is the single number
gap = deg Q − deg P .
It measures how much faster the denominator grows than the numerator far away — which is exactly what decides whether the big arc of our contour dies. A gap of 2 or more means Q P shrinks like ∣ z ∣ 2 1 or faster.
When an oscillating factor e ia z is present we split the integrand as R ( z ) e ia z , where ==R is the rational part left over== after peeling off the exponential. R is what Jordan's Lemma asks to vanish at infinity.
Every real integral this chapter attacks falls into one of these cells . Each worked example below is labelled with the cell it fills.
Cell
What makes it special
The danger it hides
Example
A Basic rational
gap = deg Q − deg P ≥ 2 , simple poles
picking the wrong half-plane
Ex 1
B Higher-order pole
denominator has a repeated factor
must differentiate residue
Ex 2
C Oscillatory (cos/sin)
integrand has cos a x or sin a x
use e ia z , not cos z
Ex 3
D Odd integrand → sine
the "imaginary part" branch
real part is 0 , sine is the answer
Ex 4
E Trig over [ 0 , 2 π ]
already a loop → unit circle
the mandatory i z 1 factor
Ex 5
F Degenerate: pole on the real axis
contour passes through a spike
indent — take a principal value
Ex 6
G Gap = 1 with no oscillation
arc does not die
recipe fails — must recognise it
Ex 7
H Word problem
physics/engineering dressing
translate to a known cell
Ex 8
We now visit all eight. Watch the labels.
I = ∫ − ∞ ∞ x 4 + 1 x 2 d x
Forecast: The integrand is even and positive , so the answer must be a positive real number , and (from the algebra to come) it will involve 2 . Guess before reading on.
Step 1 — check the arc dies. Why this step? The boxed formula is only legal if the big semicircle contributes nothing. Here P = x 2 so deg P = 2 , and Q = x 4 + 1 so deg Q = 4 ; gap = 4 − 2 = 2 ≥ 2 . ✓ Arc dies, machine is legal.
Step 2 — find the poles. Why? We need every spike the contour can trap. Solve z 4 + 1 = 0 ⇒ z 4 = − 1 = e iπ . The four fourth-roots are
z k = e i ( π + 2 π k ) /4 , k = 0 , 1 , 2 , 3 ,
i.e. angles 4 5 ∘ , 13 5 ∘ , 22 5 ∘ , 31 5 ∘ .
What to see in the figure: the four poles sit evenly spaced on a circle. The yellow path is our contour — the real axis plus the upper arc Γ ρ . The two pink dots (4 5 ∘ and 13 5 ∘ ) are inside the loop (positive imaginary part), so they count; the two blue crosses (22 5 ∘ , 31 5 ∘ ) are below the axis, outside the loop, so we ignore them. The two survivors are
z 0 = e iπ /4 = 2 1 + i , z 1 = e i 3 π /4 = 2 − 1 + i .
Step 3 — residues (simple poles, use g / h ′ ). Why g / h ′ ? Factoring a quartic is ugly; the formula Res = g ( z 0 ) / h ′ ( z 0 ) sidesteps it. Here g = z 2 , h = z 4 + 1 , h ′ = 4 z 3 , so
Res z k = 4 z k 3 z k 2 = 4 z k 1 .
Step 4 — evaluate at each UHP pole. Since z k lies on the unit circle, z k 1 = z k = e − i a r g z k . So
Res z 0 = 4 1 e − iπ /4 , Res z 1 = 4 1 e − i 3 π /4 .
Step 5 — sum and multiply by 2 π i . Why? That's the residue theorem's verdict. Write each exponential in rectangular form so we can add them:
e − iπ /4 = 2 1 − i , e − i 3 π /4 = 2 − 1 − i .
Why this helps: the real parts + 2 1 and − 2 1 cancel , and the imaginary parts − 2 i each add , leaving a purely imaginary sum:
e − iπ /4 + e − i 3 π /4 = 2 − 2 i = − i 2 .
Hence the residue sum is 4 1 ( − i 2 ) = − 4 i 2 , and
I = 2 π i ⋅ ( − 4 i 2 ) = 4 2 π 2 = 2 π = 2 π 2 .
(Note 2 π i ⋅ ( − i ) = 2 π , since − i 2 = 1 — that's what turns the imaginary sum into a real answer.)
Verify: Answer is positive and carries 2 — matches the forecast. Numerically π / 2 ≈ 2.221 , and ∫ of a bump of height ≤ 2 1 over a width ∼ few units is plausibly ≈ 2.2 . ✓
I = ∫ − ∞ ∞ ( x 2 + 4 ) 2 d x
Forecast: Even, positive, and the poles sit at ± 2 i instead of ± i — the answer should be smaller than the ∫ ( x 2 + 1 ) 2 d x = π /2 case because the bump is flatter. Guess a fraction of π .
Step 1 — arc check. P = 1 so deg P = 0 ; Q = ( x 2 + 4 ) 2 so deg Q = 4 ; gap = 4 − 0 = 4 ≥ 2 . Arc dies. ✓
Step 2 — poles. ( z 2 + 4 ) 2 = ( z − 2 i ) 2 ( z + 2 i ) 2 . UHP pole is z = 2 i , order m = 2 . Why order 2? The factor ( z − 2 i ) appears squared.
Step 3 — order-2 residue formula. Why differentiate once? For an order-m pole we take m − 1 = 1 derivative of ( z − 2 i ) 2 f :
Res 2 i = 1 ! 1 lim z → 2 i d z d [ ( z − 2 i ) 2 ⋅ ( z − 2 i ) 2 ( z + 2 i ) 2 1 ] = d z d ( z + 2 i ) − 2 2 i .
Step 4 — do the derivative.
d z d ( z + 2 i ) − 2 = ( z + 2 i ) 3 − 2 .
At z = 2 i : ( 2 i + 2 i ) 3 = ( 4 i ) 3 = 64 i 3 = − 64 i , so Res 2 i = − 64 i − 2 = 32 i 1 .
Step 5 — assemble.
I = 2 π i ⋅ 32 i 1 = 32 2 π = 16 π .
Verify: π /16 ≈ 0.196 , which is much smaller than π /2 ≈ 1.571 — matches "flatter bump" forecast. Sanity scaling: substituting x = 2 u in ∫ ( x 2 + 4 ) 2 d x gives 2 3 1 ∫ ( u 2 + 1 ) 2 d u = 8 1 ⋅ 2 π = 16 π . ✓
I = ∫ − ∞ ∞ x 2 + 4 cos ( 3 x ) d x
Forecast: Positive (the tail of cos is damped by 1/ x 2 and dominated by the peak near 0 where cos ≈ 1 ). The decay factor e − a ⋅ 2 = e − 6 makes it tiny . Guess something like 2 π e − 6 .
Step 1 — replace cos 3 x by e i 3 z . Why not cos z ? Because cos ( 3 z ) = 2 1 ( e i 3 z + e − i 3 z ) and e − i 3 z explodes in the UHP (its modulus is e + 3 y ). Only e i 3 z decays there (Jordan's Lemma ). So set f ( z ) = z 2 + 4 e i 3 z , a = 3 .
Step 2 — Jordan's Lemma legality. Here the rational leftover after peeling off the exponential is R ( z ) = z 2 + 4 1 (recall R from the notation box: the non-oscillating part). It → 0 as ∣ z ∣ → ∞ , and a = 3 > 0 . Jordan says the arc integral → 0 — even though the gap is only 2 , we get the bonus that we'd have it even at gap 1 . ✓
Step 3 — UHP pole & residue. z = 2 i (simple). g = e i 3 z , h ′ = 2 z :
Res 2 i = 2 ( 2 i ) e i 3 ( 2 i ) = 4 i e − 6 .
Why e − 6 ? i ⋅ 3 ⋅ 2 i = 6 i 2 = − 6 .
Step 4 — full complex integral, then take real part.
∫ − ∞ ∞ x 2 + 4 e i 3 x d x = 2 π i ⋅ 4 i e − 6 = 2 π e − 6 .
This is already real, so Real part = 2 π e − 6 and (imag part 0 ) ∫ x 2 + 4 sin 3 x d x = 0 — consistent with the integrand being odd .
Verify: 2 π e − 6 ≈ 1.5708 × 0.00248 ≈ 0.00389 — positive and tiny, exactly as forecast. ✓
I = ∫ − ∞ ∞ x 2 + 1 x sin x d x
Forecast: Note x sin x is even (odd × odd), so the integral is nonzero and positive. This is the case where the sine (imaginary part) carries the answer. Guess π / e -ish.
Step 1 — build the complex integrand. Why? sin x = Im ( e i x ) , so use f ( z ) = z 2 + 1 z e i z , a = 1 .
Step 2 — arc / Jordan check. The rational leftover is R ( z ) = z 2 + 1 z → 0 as ∣ z ∣ → ∞ (gap = 2 − 1 = 1 ), and a = 1 > 0 . Jordan's Lemma applies — the arc dies precisely because the exponential kills it even at gap 1 . This is why we needed Jordan and not the naive gap-2 rule.
Step 3 — UHP pole & residue. z 2 + 1 = 0 ⇒ z = i (UHP). Simple pole, g = z e i z , h ′ = 2 z :
Res i = 2 i i e i ⋅ i = 2 e − 1 .
Why: e i ⋅ i = e i 2 = e − 1 , and the i in g cancels the 2 i down to 2 1 .
Step 4 — assemble the complex integral.
∫ − ∞ ∞ x 2 + 1 x e i x d x = 2 π i ⋅ 2 e − 1 = e π i .
Step 5 — take the imaginary part. Why imaginary? Because we want sin , and sin x = Im ( e i x ) , so
I = Im ( e π i ) = e π .
The real part is 0 — matching that x 2 + 1 x cos x is odd , so its integral vanishes.
Verify: π / e ≈ 1.156 , positive as forecast. Cross-check: the pairing "real part → cos → 0 (odd), imag part → sin → answer" is exactly the parity bookkeeping. ✓
I = ∫ 0 2 π 5 + 4 cos θ d θ
Forecast: The denominator ranges over 5 ± 4 = [ 1 , 9 ] , always positive, so I > 0 . Since the average of 5 + 4 c o s θ 1 is less than 1 over length 2 π , expect I < 2 π ≈ 6.28 . Guess around 2 π /3 .
Step 1 — substitute z = e i θ . Why? The integral is already a loop; on the unit circle it becomes a contour integral we can attack with residues. Use (parent ):
cos θ = 2 z + z − 1 , d θ = i z d z .
Why the i z 1 ? Because d z = i e i θ d θ = i z d θ . Forgetting it is Cell-E's classic trap.
Step 2 — rewrite.
I = ∮ ∣ z ∣ = 1 5 + 2 ( z + z − 1 ) 1 ⋅ i z d z = ∮ i z ( 5 + 2 z + 2 z − 1 ) d z = ∮ i ( 2 z 2 + 5 z + 2 ) d z .
Why did z − 1 vanish? Multiplying numerator and denominator by z cleared it; note this can add a pole at z = 0 — check it! Here z = 0 makes 2 z 2 + 5 z + 2 = 2 = 0 , so no extra pole at the origin.
Step 3 — poles inside ∣ z ∣ = 1 . Solve 2 z 2 + 5 z + 2 = 0 : z = 4 − 5 ± 25 − 16 = 4 − 5 ± 3 , giving z = − 2 1 and z = − 2 .
What to see in the figure: the yellow unit circle is our new contour. The pink dot at z = − 2 1 sits inside it (distance 0.5 < 1 ), so it counts; the blue cross at z = − 2 is outside (distance 2 > 1 ), so it's discarded. Only one residue matters.
Step 4 — residue at z 0 = − 2 1 (simple). With g = i 1 , h = 2 z 2 + 5 z + 2 , h ′ = 4 z + 5 :
Res − 1/2 = 4 ( − 2 1 ) + 5 1/ i = 3 1/ i = 3 i 1 .
Step 5 — assemble.
I = 2 π i ⋅ 3 i 1 = 3 2 π .
Verify: 3 2 π ≈ 2.094 , positive and below 2 π — matches forecast. General formula check: ∫ 0 2 π a + b c o s θ d θ = a 2 − b 2 2 π gives 25 − 16 2 π = 3 2 π . ✓
I = P.V. ∫ − ∞ ∞ x sin x d x
Forecast: This is the famous "sinc" integral; the integrand is even, positive-on-average, and the answer is a clean multiple of π . Guess π .
Step 1 — the degeneracy. Why is this special? f ( z ) = z e i z has a pole at z = 0 , which is on our contour, not inside it. The straight recipe is illegal; we indent the contour with a tiny semicircle γ ε of radius ε that detours over the origin (see Principal Value Integrals ).
What to see in the figure: the yellow path runs along the real axis but makes a small pink half-loop γ ε around the blue pole at the origin, then closes with the big upper arc Γ ρ . Because the detour steps around z = 0 , no pole is enclosed — the whole loop integrates to zero. The answer will come from the tiny arc, not from an enclosed residue.
Step 2 — the closed contour encloses no pole. Why? The only pole z = 0 is excluded by the tiny detour, and none lies strictly inside. So by Cauchy's Integral Theorem & Formula :
∫ real, indented z e i z d z + ∫ γ ε z e i z d z + ∫ Γ ρ z e i z d z = 0.
Step 3 — big arc dies (Jordan). R ( z ) = 1/ z → 0 , a = 1 > 0 ⟹ ∫ Γ ρ → 0 .
Step 4 — small arc contributes a half residue. Why half? The tiny semicircle sweeps an angle of π (half a full loop) clockwise around the simple pole z = 0 . For a simple pole, a small arc of angle ϕ contributes i ϕ ⋅ Res ; here ϕ = − π (clockwise). Res 0 z e i z = e 0 = 1 , so
∫ γ ε z e i z d z → − iπ ⋅ 1 = − iπ .
Step 5 — collect. The indented real integral tends to the principal value P.V. ∫ x e i x d x :
P.V. ∫ − ∞ ∞ x e i x d x − iπ + 0 = 0 ⇒ P.V. ∫ x e i x d x = iπ .
Step 6 — take the imaginary part. sin x = Im ( e i x ) :
∫ − ∞ ∞ x s i n x d x = Im ( iπ ) = π .
(The real part gives P.V. ∫ x c o s x d x = 0 — correct, that integrand is odd.)
Verify: π ≈ 3.1416 , matches forecast. Standard result: ∫ 0 ∞ x s i n x d x = 2 π , doubled by evenness = π . ✓
I = ∫ − ∞ ∞ x 2 + 1 x d x — is the machine legal?
Forecast: The integrand is odd , so the principal value is 0 , but the ordinary integral diverges (like ∫ x d x at large ∣ x ∣ ). The naive residue recipe would hand you a wrong finite number — spot the fraud.
Step 1 — degree/decay check FIRST. Why first? Because this is the guardrail. P = x so deg P = 1 ; Q = x 2 + 1 so deg Q = 2 ; gap = 2 − 1 = 1 . With no oscillating e ia z , Jordan does not apply. So the arc integral does not vanish — the boxed formula is illegal here .
Step 2 — show the arc really survives. On Γ ρ , z = ρ e i θ :
z 2 + 1 z ∼ ρ 1 , arc length = π ρ ⇒ bound ∼ ρ 1 ⋅ π ρ = π → 0.
The estimate stalls at a constant — the arc contributes and cannot be dropped.
Step 3 — what IS true. The principal value exists by oddness:
P.V. ∫ − ∞ ∞ x 2 + 1 x d x = lim R → ∞ ∫ − R R x 2 + 1 x d x = lim R → ∞ [ 2 1 ln ( x 2 + 1 ) ] − R R = 0 ,
because the integrand is odd and the limits are symmetric. But the ordinary two-sided limit diverges.
Verify: Antiderivative 2 1 ln ( x 2 + 1 ) is even , so evaluated symmetrically it gives 0 ; let the upper and lower limits go to infinity independently and it blows up. Lesson: always run the arc/decay check before summing residues. ✓ (P.V. = 0 .)
Worked example Signal energy of a damped resonance
An electrical filter's response is H ( ω ) = ω 2 + ω 0 2 1 with resonance parameter ω 0 > 0 . The total spectral weight is I = ∫ − ∞ ∞ H ( ω ) d ω = ∫ − ∞ ∞ ω 2 + ω 0 2 d ω . Find it, and evaluate for ω 0 = 2 .
Forecast: More damping (larger ω 0 ) should spread and lower the curve, so I should decrease as ω 0 grows — expect I ∝ 1/ ω 0 .
Step 1 — recognise the cell. Why? Rename ω → x : this is Cell A , the basic rational integral. Here P = 1 (deg P = 0 ) and Q = ω 2 + ω 0 2 (deg Q = 2 ), so gap = 2 ≥ 2 — the machine is legal. Poles at ± i ω 0 .
Step 2 — arc check. Gap = 2 . ✓
Step 3 — UHP pole & residue. z = i ω 0 (simple), h ′ = 2 z :
Res i ω 0 = 2 i ω 0 1 .
Step 4 — assemble.
I = 2 π i ⋅ 2 i ω 0 1 = ω 0 π .
Step 5 — plug ω 0 = 2 . I = 2 π .
Verify: I = π / ω 0 indeed shrinks as ω 0 grows — matches the "more damping → lower weight" forecast. Units: π / ω 0 carries the 1/ ω 0 scaling, consistent with a broader, lower Lorentzian. Numerically π /2 ≈ 1.571 , and the elementary check ∫ ω 2 + 4 d ω = 2 1 arctan 2 ω − ∞ ∞ = 2 1 ⋅ π = 2 π . ✓
Recall We covered every cell in the matrix
A basic rational ::: Ex 1 (π / 2 )
B higher-order pole ::: Ex 2 (π /16 )
C cosine via e ia z ::: Ex 3 (2 π e − 6 )
D odd → sine, imaginary part ::: Ex 4 (π / e )
E trig over [ 0 , 2 π ] ::: Ex 5 (2 π /3 )
F pole on the axis, principal value ::: Ex 6 (π )
G arc survives — recipe illegal ::: Ex 7 (P.V. = 0 )
H word problem ::: Ex 8 (π / ω 0 )
Mnemonic The decision tree in four questions
Oscillating? yes → e ia z + Jordan (Cells C, D, F). no → check gap.
Gap ≥ 2 ? yes → semicircle machine (A, B, H). no & not oscillating → recipe illegal, think P.V. (G).
Pole on the axis? yes → indent, half-residue i ϕ Res (F).
Loop over [ 0 , 2 π ] ? → unit circle, remember i z d z (E).