Intuition What this page is for
The parent note gave you the machinery:
d z = z ′ ( t ) d t , the fact that only 1/ z survives a loop, Cauchy's theorem, and the residue
theorem. This page is the firing range . We list every kind of problem the topic can throw at
you, then shoot each one down with a full worked example. Nothing here is new theory — it is the
same four tools, applied until no scenario surprises you.
Before anything: three facts, one convention, and one piece of notation we will lean on constantly.
So you never have to chase the parent note, here they are, restated in full.
∮ — what the little circle means
∫ γ means "integrate along the path γ ". When γ is a closed loop (it
ends where it began), we draw a tiny circle through the integral sign and write ∮ γ .
Picture a walk that returns home. The circle is only a reminder that the path closes — it does
not by itself say which way round; that is fixed by the orientation convention below (default:
counterclockwise). Every ∮ you meet on this page is a closed-loop integral.
Recall The three parent facts, restated here (so you never leave this page)
Parent fact 1 — the power lemma. On the unit circle z = e i t , every integer power obeys
∮ ∣ z ∣ = 1 z n d z = { 2 π i , 0 , n = − 1 n ∈ Z , n = − 1.
Why: substituting z = e i t turns the integral into i ∫ 0 2 π e i ( n + 1 ) t d t ; that
exponential completes whole loops and cancels to 0 unless n + 1 = 0 , where it is the constant
i , giving 2 π i . Only the z 1 term survives a loop — this is the seed of everything.
Parent fact 2 — Cauchy's theorem. If f is analytic on and inside a closed loop γ ,
then ∮ γ f d z = 0 . Why: writing f = u + i v and applying Green's theorem
turns the loop integral into area integrals whose integrands are exactly the
Cauchy–Riemann equations u x = v y , u y = − v x — both vanish.
Parent fact 3 — the deform-to-a-tiny-circle argument (the "inside" test). If f is analytic
in the ring between a big loop and a small circle around a pole a , the two loop integrals are
equal (the ring encloses no singularity, so by fact 2 the difference is 0 ). Shrinking the
small circle z = a + ε e i t gives ∮ γ z − a f ( z ) d z = 2 π i f ( a ) .
Consequence: a pole outside your loop can be pushed off to nothing and contributes 0 ; a
pole inside always contributes 2 π i times its residue.
Definition Orientation convention (used on every example below)
Positive orientation = counterclockwise. A counterclockwise unit circle is z = e i t ,
t : 0 → 2 π . Reversing the walk (clockwise) multiplies every contour integral by − 1 . Unless
a problem says "clockwise", assume counterclockwise.
Definition Pole and residue (quick anchor)
A pole is a point z 0 where f "blows up" — the denominator hits 0 and f → ∞ .
Picture a sharp spike sticking out of the flat complex plane.
A residue Res z 0 f is a single number measuring the strength of that
spike — it is the coefficient c − 1 of the z − z 0 1 term in the Laurent series .
The whole game is: find the spikes inside your loop, add their strengths, multiply by 2 π i .
p / q ′ shortcut — what p and q mean
Whenever an integrand is a ratio f ( z ) = q ( z ) p ( z ) where the top p and bottom
q are both analytic (nice, no blow-up) near a pole z 0 , and q ( z 0 ) = 0 but q ′ ( z 0 ) = 0 (a
simple pole), then
Res z 0 q p = q ′ ( z 0 ) p ( z 0 ) .
Why: near z 0 , q ( z ) ≈ q ′ ( z 0 ) ( z − z 0 ) , so f ≈ q ′ ( z 0 ) p ( z 0 ) ⋅ z − z 0 1 ,
and that coefficient of z − z 0 1 is the residue. We name p and q explicitly in every
example that uses this.
Every contour problem lives in one of these cells. The examples below are labelled by cell.
Cell
What makes it distinct
Which tool wins
A — non-analytic integrand
f like z ˉ ; Cauchy fails
brute parametrise d z = z ′ d t
B — analytic, no pole inside
f smooth everywhere in the loop
Cauchy's theorem ⇒ 0
C — one simple pole inside
one spike
2 π i ⋅ q ′ p
D — several poles, some in some out
selection by "is it inside?"
sum only the enclosed residues
E — higher-order (repeated) pole
spike counted twice
derivative residue formula
F — pole exactly ON the contour
degenerate/limiting
undefined (or principal value)
G — real integral ∫ − ∞ ∞
close with a big arc
arc → 0 , then residues
H — real word/exam twist
phrased in disguise
translate, then use C–G
I — essential singularity
e 1/ z -type, infinitely sharp
read c − 1 off the Laurent series
J — branch point / branch cut
z , log z , x s
keyhole contour, cannot encircle freely
We now cover cells A → J. Watch the sign, the "inside?" test, and the degenerate cases.
∫ γ z ˉ 2 d z along z ( t ) = e i t , t : 0 → π (upper half of unit circle, counterclockwise)
Forecast: z ˉ is not analytic, so path matters and the answer need not be 0 or a
multiple of 2 π i . Guess: some plain complex number. Write your guess down.
Parametrise. z = e i t ⇒ z ˉ = e − i t , so z ˉ 2 = e − 2 i t , and
z ′ ( t ) = i e i t . Why this step? Cauchy's theorem needs analyticity; z ˉ has u x = v y ,
so we cannot shortcut — we must literally walk the path with clock t .
Assemble the integrand. z ˉ 2 z ′ = e − 2 i t ⋅ i e i t = i e − i t .
Why? This is just f ( z ( t )) z ′ ( t ) from the definition.
Integrate in t . ∫ 0 π i e − i t d t = i ⋅ − i e − i t 0 π = − e − i t 0 π = − ( e − iπ − e 0 ) = − ( − 1 − 1 ) = 2.
Verify: the answer 2 is a plain real number — exactly what "non-analytic, path matters"
predicted. It is not 0 , and not a multiple of 2 π i . If you got 0 you probably treated
z ˉ as analytic — see the Analytic functions warning.
∮ ∣ z ∣ = 1 cos z d z
Forecast: cos z is analytic on the whole plane (an entire function — no spikes anywhere).
Predict the loop value before computing.
Check analyticity inside the loop. cos z satisfies the Cauchy–Riemann equations
everywhere; there is no denominator to vanish, so no pole is enclosed. Why this step? Cauchy's
theorem's only hypothesis is "analytic on and inside γ " (parent fact 2).
Apply Cauchy's Integral Theorem. ∮ ∣ z ∣ = 1 cos z d z = 0 . Why this step? An analytic
function on and inside the loop has a single-valued antiderivative there (sin z for cos z );
a closed loop returns to its starting point, so antiderivative at end minus antiderivative at
start = 0 . This is exactly Cauchy's theorem, and it is why "analytic inside" forces the loop to
vanish.
Verify (brute check that it really is 0 ). Parametrise z = e i t :
∫ 0 2 π cos ( e i t ) i e i t d t . The antiderivative of cos z is sin z , and sin z
returns to its start after a full loop (z ends where it began), so the integral is sin z
evaluated at the same point minus itself = 0 . ✔
∮ ∣ z ∣ = 1 2 z − 1 e z d z
Forecast: one denominator zero at z = 2 1 . Is it inside ∣ z ∣ = 1 ? ∣ 2 1 ∣ = 2 1 < 1
— yes. So expect a nonzero 2 π i × ( something ) .
Name p and q ; locate the pole. Write f = q ( z ) p ( z ) with top p ( z ) = e z
and bottom q ( z ) = 2 z − 1 . Then q ( z ) = 0 ⇒ z = 2 1 , inside the unit circle.
Why? Only spikes inside the loop count (parent fact 3: a pole outside pushes off to nothing).
Simple-pole residue by p / q ′ . q ′ ( z ) = 2 , so
Res z = 1/2 = q ′ ( 1/2 ) p ( 1/2 ) = 2 e 1/2 .
Why p / q ′ ? See the shortcut definition above — the coefficient of z − 1/2 1 is the residue.
Residue theorem. ∮ = 2 π i ⋅ 2 e 1/2 = π i e 1/2 .
Verify: rewrite 2 z − 1 e z = 2 1 ⋅ z − 1/2 e z . By Cauchy's Integral
Formula this is 2 1 ⋅ 2 π i e z z = 1/2 = π i e 1/2 . Same answer. ✔
Figure s01 — the inside/outside test. The lavender loop is the counterclockwise unit circle
∣ z ∣ = 1 . A coral star at z = 2 1 sits inside the loop (its residue counts ); a grey star at
z = 2 sits outside (its residue is ignored — parent fact 3 pushes it off to nothing). The small
lavender arrow on the circle reminds you the walk is counterclockwise. The whole trick of Cell D is
reading this picture: circle, then sum only the stars inside it.
∮ ∣ z ∣ = 1 ( z − 2 1 ) ( z − 2 ) 1 d z
Forecast: two poles, z = 2 1 and z = 2 . Only z = 2 1 is inside. Predict: a single
residue survives.
Inside/outside test. ∣ 2 1 ∣ = 2 1 < 1 → inside. ∣2∣ = 2 > 1 → outside, ignored.
Why? Deforming the contour past a pole you don't enclose leaves it out of the count entirely.
Residue at z = 2 1 . Simple pole; cover the ( z − 2 1 ) factor and plug in the rest:
Res 1/2 = ( 2 1 − 2 ) 1 = − 2 3 1 = − 3 2 .
Why cover-up? Res = lim z → 1/2 ( z − 2 1 ) f ( z ) removes the singular factor,
leaving the finite value of the rest.
Sum only enclosed residues. ∮ = 2 π i ( − 3 2 ) = − 3 4 π i .
Verify: partial fractions ( z − 2 1 ) ( z − 2 ) 1 = z − 2 1 − 2/3 + z − 2 2/3 .
The second term is analytic inside ∣ z ∣ = 1 (its pole is outside) → its loop integral is 0 . The
first gives − 3 2 ⋅ 2 π i = − 3 4 π i . ✔ Only the inside pole spoke.
m pole and its residue
If the denominator vanishes like ( z − z 0 ) m , the spike is sharper : an order-m pole .
The simple p / q ′ rule no longer applies. Instead we peel off m − 1 derivatives:
Res z 0 f = ( m − 1 )! 1 lim z → z 0 d z m − 1 d m − 1 [ ( z − z 0 ) m f ( z ) ] .
Why derivatives? Multiplying by ( z − z 0 ) m kills the blow-up and turns f into a nice power
series; the c − 1 we want is now the coefficient of ( z − z 0 ) m − 1 , and reading that
coefficient off a power series is exactly what ( m − 1 )! 1 d z m − 1 d m − 1 does.
∮ ∣ z ∣ = 1 z 2 e z d z (double pole at 0 )
Forecast: pole of order 2 at the centre. Guess which power of z in e z lands on the
z 1 term after dividing by z 2 .
Identify order. z 2 in the denominator → m = 2 pole at z 0 = 0 . Why? Determines which
formula (need one derivative, since m − 1 = 1 ).
Apply the order-2 residue formula. ( z − 0 ) 2 f = e z , so
Res 0 = 1 ! 1 d z d e z z = 0 = e 0 = 1 .
Residue theorem. ∮ = 2 π i ⋅ 1 = 2 π i .
Verify (Laurent view): z 2 e z = z 2 1 ( 1 + z + 2 z 2 + … ) = z 2 1 + z 1 + 2 1 + … . The z 1 coefficient is 1 — the only term
that survives the loop (parent fact 1). ∮ = 2 π i . ✔
Common mistake "Just take the residue anyway."
Why it feels right: the machinery ran fine in cells C–E. The catch: the residue theorem
requires poles strictly inside (or strictly outside) — never on the path. If a spike sits on
your loop, the integral is not defined as an ordinary contour integral: the walk passes
straight through infinity.
Definition Principal value + indentation (the self-contained repair)
When a simple pole z 0 lies on the contour, we cut a tiny semicircular notch of radius
ε around z 0 (an indentation ) and let ε → 0 . The straight parts
that skip the pole, taken symmetrically, define the Cauchy principal value of the integral.
The tiny semicircle contributes
∫ semicircle f d z ε → 0 ± π i Res z 0 f ,
which is half of a full loop's 2 π i Res . Why exactly half? A full circle
spans angle 2 π ; a semicircle spans angle π — and the deform-to-a-tiny-circle integral
i ∫ f ( z 0 + ε e i t ) d t over t ∈ [ α , α + π ] picks up exactly half the
angular sweep, hence half the residue. The sign is + if the notch is traversed counterclockwise,
− if clockwise.
∮ ∣ z ∣ = 1 z − 1 d z
Forecast: pole at z = 1 . But ∣1∣ = 1 — it lies on the circle. Predict: trouble.
Inside/outside test fails. z = 1 is neither inside nor outside; it is on γ .
Why this matters? The deformation argument (parent fact 3) assumes clear space around the pole;
here there is none.
Diagnose. Near t = 0 the integrand e i t − 1 1 behaves like i t 1 , whose
integral over the singularity diverges. So the ordinary contour integral does not exist .
The repair (using the indentation rule above): notch a tiny semicircle around z = 1 . That
detour contributes π i ⋅ Res z = 1 z − 1 1 = π i ⋅ 1 = π i — half
a full loop — and the remaining principal-value arc supplies the other half's worth of the
analysis. See Residue theorem applications for the full principal-value bookkeeping.
Verify (why "no value"): compare with z = 1 moved slightly inside (∮ = 2 π i ) versus
slightly outside (∮ = 0 ). The two limits disagree (2 π i = 0 ), so the on-contour case
genuinely has no single value. ✔ The disagreement is the proof it is degenerate — and note the
half-residue π i sits exactly midway between 0 and 2 π i , as the indentation rule predicts.
Figure s02 — the semicircular (Jordan) contour. The mint segment along the real axis is the
integral we actually want, [ − R , R ] ; the lavender arc of radius R closes the loop through the
upper half-plane. Coral stars mark the poles the loop encloses (upper half); grey stars mark
the ones it leaves out (lower half). The two arrows show the walk: rightward along the real axis,
then counterclockwise back along the arc. As R → ∞ the arc's contribution shrinks to 0 , so
the real integral equals 2 π i times the coral residues only.
∫ − ∞ ∞ x 4 + 1 x 2 d x
Forecast: the integrand is positive and decays like 1/ x 2 , so the answer is a positive real
number. Guess a value near 2 (spoiler: it is 2 π ≈ 2.22 ).
Choose the contour. Real axis [ − R , R ] + upper semicircular arc z = R e i θ ,
θ : 0 → π . Call the loop γ R . Why upper? We need the arc to vanish so that the
closed loop equals the real-line integral in the limit.
Show the arc contribution → 0 (the key WHY). On the arc, ∣ z ∣ = R , so
z 4 + 1 ≥ R 4 − 1 and ∣ z 2 ∣ = R 2 . Hence the integrand is bounded by
R 4 − 1 R 2 . By the ML-estimate (integral ≤ max-modulus M times arc-length
L ), with L = π R ,
=\frac{\pi R^3}{R^4-1}\xrightarrow{R\to\infty}0.$$
*Why this bound?* $R^3/R^4=1/R\to0$: the denominator's degree beats the numerator by two powers
*plus* the extra $R$ from the arc length, so the arc genuinely dies. (This is the elementary
version of Jordan's lemma.)
Find enclosed poles. z 4 + 1 = 0 ⇒ z = e iπ /4 , e i 3 π /4 , e i 5 π /4 , e i 7 π /4 .
The two in the upper half-plane are z 1 = e iπ /4 and z 2 = e i 3 π /4 . Why only upper?
Our loop only encloses the top; the bottom two are outside.
Residues via p / q ′ . Name top p ( z ) = z 2 and bottom q ( z ) = z 4 + 1 , so q ′ ( z ) = 4 z 3
and Res = 4 z 3 z 2 = 4 z 1 .
At z 1 = e iπ /4 : 4 1 e − iπ /4 .
At z 2 = e i 3 π /4 : 4 1 e − i 3 π /4 .
Sum, multiply, take R → ∞ . Sum = 4 1 ( e − iπ /4 + e − i 3 π /4 ) = 4 1 ( 2 2 − i 2 2 − 2 2 − i 2 2 ) = 4 1 ( − i 2 ) = − 2 2 i .
So ∮ γ R = 2 π i ⋅ ( − 2 2 i ) = 2 π . As R → ∞
the arc drops out (Step 2), leaving
∫ − ∞ ∞ x 4 + 1 x 2 d x = 2 π .
Verify: numerically 2 π ≈ 2.2214 , a positive real — matching the forecast
and the fact that the answer of a real integral of a real function must be real (the i 's
cancelled, as they must). ✔
Worked example H1 — A signal-processing average:
2 π 1 ∫ 0 2 π 5 + 4 cos θ d θ
Forecast: this is a real trig integral, but the 2 π and cos θ scream "unit circle
in disguise." Guess a small positive number (it is an average of 5 + 4 c o s θ 1 , which
ranges from 9 1 to 1 ).
Substitute z = e i θ . Then cos θ = 2 1 ( z + z 1 ) and
d θ = i z d z , and as θ : 0 → 2 π , z traces ∣ z ∣ = 1 once counterclockwise.
Why this step? It converts the trig integral into a contour integral we can attack with
residues — the whole reason contour methods matter to "real" problems.
Rewrite. 5 + 4 cos θ = 5 + 2 ( z + z 1 ) = z 2 z 2 + 5 z + 2 . So
=\frac{1}{2\pi i}\oint_{|z|=1}\frac{dz}{2z^2+5z+2}.$$
Poles inside. 2 z 2 + 5 z + 2 = ( 2 z + 1 ) ( z + 2 ) = 0 ⇒ z = − 2 1 (inside) or z = − 2 (outside).
Why check? Only enclosed spikes count (Cell D logic).
Residue at z = − 2 1 . Name top p ( z ) = 1 and bottom q ( z ) = 2 z 2 + 5 z + 2 , so
q ′ ( z ) = 4 z + 5 ; at z = − 2 1 , q ′ = − 2 + 5 = 3 , giving Res = 3 1 .
Assemble. 2 π i 1 ⋅ 2 π i ⋅ 3 1 = 3 1 .
Verify: 3 1 ≈ 0.333 sits between 9 1 ≈ 0.111 and 1 — a legitimate
average of 5 + 4 c o s θ 1 . Units: dimensionless average, matches. ✔
Definition Essential singularity
Some singularities are worse than any pole: the Laurent series has infinitely many negative
powers of z − z 0 . Example: e 1/ z = 1 + z 1 + 2 ! z 2 1 + 3 ! z 3 1 + … .
There is no finite m making ( z − z 0 ) m f nice, so the pole-order formulas of Cell E fail.
But the residue is still just c − 1 — read it straight off the series.
∮ ∣ z ∣ = 1 e 1/ z d z
Forecast: infinitely sharp spike at 0 . You cannot use p / q ′ or the derivative formula.
Guess: the answer is still 2 π i × ( the 1/ z coefficient ) .
Expand the Laurent series. e 1/ z = ∑ k ≥ 0 k ! z k 1 = 1 + z 1 + 2 ! z 2 1 + … . Why series? No pole order exists, so the only handle is
the coefficient list itself (parent fact 1: only z 1 survives).
Read off c − 1 . The coefficient of z 1 is the k = 1 term: 1 ! 1 = 1 . So
Res 0 e 1/ z = 1 .
Residue theorem. ∮ = 2 π i ⋅ 1 = 2 π i .
Verify: integrate term by term. Every term k ! 1 z − k is a power z n with
n = − k ; by parent fact 1 all give 0 except n = − 1 (i.e. k = 1 ), which gives 2 π i ⋅ 1 .
So ∮ = 2 π i . ✔ The infinitely many other terms integrate to 0 — the spike's shape is
irrelevant, only its c − 1 matters.
Figure s03 — the keyhole contour. Functions like z or x s are multivalued : walk
once around z = 0 and the value changes (e.g. z flips sign). A branch point at 0
forces a branch cut (the coral ray along the positive real axis) that the contour is forbidden to
cross. The lavender keyhole hugs the cut: a big circle out, back just above the cut, a tiny
circle around 0 , and back just below . The gap between "above" and "below" the cut is exactly what
makes the method work. This is why you cannot naively drop a residue at a branch point — there is no
single-valued c − 1 to read.
∫ 0 ∞ x + 1 x − 1/2 d x via a keyhole
Forecast: x − 1/2 has a branch point at 0 ; the standard result is π . Guess a value
near 3 .
Set up the keyhole. Use f ( z ) = z + 1 z − 1/2 with the branch cut along the positive
real axis, and define z − 1/2 = e − 2 1 l o g z with arg z ∈ [ 0 , 2 π ) . Why a keyhole?
A plain loop around 0 is illegal — the value jumps across the cut; the keyhole runs along
both sides of the cut instead of crossing it.
Two edges disagree by a known factor. Above the cut (arg z = 0 ) the integrand is
x + 1 x − 1/2 . Below the cut (arg z = 2 π ), z − 1/2 = e − 2 1 ( 2 π i ) x − 1/2 = e − iπ x − 1/2 = − x − 1/2 . Walking back the other way flips the direction too, so the two
straight edges add to ( 1 − e − iπ ) ∫ 0 ∞ x + 1 x − 1/2 d x = 2 ∫ 0 ∞ x + 1 x − 1/2 d x .
Why this step? The whole trick is that the multivaluedness turns the same integral into a
nonzero difference we can solve for.
Residue at the enclosed pole z = − 1 . In our branch z = − 1 = e iπ , so
z − 1/2 = e − iπ /2 = − i ; residue of z + 1 z − 1/2 at the simple pole z = − 1 is
z − 1/2 z = − 1 = − i . The small and large circles contribute 0 as radii → 0 , ∞ .
Assemble. 2 ∫ 0 ∞ x + 1 x − 1/2 d x = 2 π i ⋅ ( − i ) = 2 π , so the
integral is π .
Verify: substitute x = u 2 : ∫ 0 ∞ x + 1 x − 1/2 d x = ∫ 0 ∞ u 2 + 1 2 d u = 2 ⋅ 2 π = π . ✔ Matches the keyhole answer — and shows why a branch point demands its
own contour rather than a residue drop.
Worked example H2 — Same integrand, reversed loop:
∮ ∣ z ∣ = 1 , clockwise z d z
Forecast: counterclockwise gave + 2 π i (parent fact 1 with n = − 1 ). Reversing the walk should
flip the sign to − 2 π i . Predict that before computing.
Reverse the parametrisation. Clockwise means the angle decreases , so take z = e − i t ,
t : 0 → 2 π . Then z ′ ( t ) = − i e − i t . Why? The sign of the exponent's derivative is what encodes
"which way round" — the − i carries the flip.
Assemble the integrand. z 1 z ′ = e − i t 1 ⋅ ( − i e − i t ) = − i .
Why? Same f ( z ( t )) z ′ ( t ) recipe; the e − i t factors cancel, leaving a constant.
Integrate in t . ∫ 0 2 π ( − i ) d t = − i ⋅ 2 π = − 2 π i .
Verify: this is exactly − 1 times the counterclockwise value 2 π i . ✔ Orientation is a
single global sign, nothing more. General rule (from our convention): counterclockwise is + ,
clockwise is − ; reversing γ multiplies the integral by − 1 . Every earlier example
assumed the + convention; running one clockwise just negates the result.
Recall Which cell, and what's the first move?
∮ ∣ z ∣ = 1 z ˉ d z ::: Cell A (non-analytic) — brute parametrise, cannot use residues.
∮ ∣ z ∣ = 1 sin z d z ::: Cell B (analytic, no pole) — equals 0 by Cauchy's theorem.
∮ ∣ z ∣ = 1 z 3 e z d z ::: Cell E (order-3 pole) — need two derivatives; answer 2 π i ⋅ 2 1 = π i .
A pole sits at z = 1 on ∣ z ∣ = 1 ::: Cell F — integral undefined; needs principal value / indentation.
∮ ∣ z ∣ = 1 e 1/ z d z ::: Cell I (essential singularity) — read c − 1 = 1 off the series; answer 2 π i .
∫ 0 ∞ x + 1 x − 1/2 d x ::: Cell J (branch point) — keyhole contour, not a plain loop.
Reverse a loop to clockwise ::: Multiply the whole integral by − 1 .
I·S·R·M — I nside? (test each pole) · S ign (CCW is + ) · R esidue (simple p / q ′ ,
order-m derivative, essential/branch → series or keyhole) · M ultiply by 2 π i .
Analytic functions — Cell A vs B: analyticity decides whether paths matter.
Cauchy–Riemann equations — the test behind "is it analytic inside?"
Laurent series — reading residues off c − 1 (Cells E, I, and the origin of it all).
Green's theorem — the engine that makes Cell B's answer 0 .
Residue theorem applications — Cells G, H, J and the principal-value repair of Cell F.
Cauchy theorem gives zero
Test each pole inside or outside
Simple pole use p over q prime
Order m pole use derivative rule
Essential or branch use series or keyhole
Pole on contour is degenerate
Multiply by two pi i times sum of residues