# Residue theorem and multiple poles in contour integral

I had a query on multiples poles in [Contour Integral] using the [Residue Theorem]. I had an integral which I wanted to solve using the Residue Theorem. By the help of mathematica experts i solved my problem.

       Δ = .3;
λ = .1;
b =  .1;
a1 = λ^2 + Δ^2 - b^2;
a2 = 2*Δ*λ;

den[z_] := z (z^4*a2 - z^2*I*2*a1 - a2)
num[y_] := I*(y^2 (Δ - I*λ) - (Δ + I*λ))^2
poles = z /. Solve[den[z] == 0, z];
fun[z_] := (1/a2) num[z]/(Times @@ (z - poles))
cand = {#, Residue[fun[z], {z, #}]} & /@ poles;
Total@Cases[cand, {_?(Abs@# < 1 &), y_} :> y] // Timing


And the output is

       {0., 1.14907 - 1.11022*10^-16 I}


By using Principlevalue command output is same but

       D1 = 1/\[Pi] Integrate[(Δ*Sin[z] - λ*Cos[z])^2/(
a1 - a2*Sin[2*z]), {z, 0, 2*\[Pi]}, PrincipalValue -> True] //
Timing


And the out put is {1.016, 1.14907 + 0. I}
Both are same but Residue sum method takes smaller time. Thanks to everyone for helping me in solving this problem.

• Unfortunately no. By using calculator i found net sum of residues {-0.0399975 - 0.0849706 I, 0.0229189 - 0.0305566 I, 0.0233393 + 0.0495896 I}. And sum of all these resiudes is 0.917871 + 0.0366954 I. – Hazoor Imran Sep 6 '15 at 8:00

The Residue can be zero at a pole (look here). For example $1/z^2$ has a residue 0 at z=0. If you make a Laurent Series there will no term with 1/z. (It depends on the analyticity of the function at the pole). For your function you can verify it easily by following b.gatessucks 's suggestion.

f = NPI11[z]/D1;
Normal[Series[NPI11[z]/D1, {z, #, 1}]] & /@ dM


and you will see for only z0=0 the series has a term with 1/z and hence the Residue gives you zero for other poles.

For verifying your result you can also check How to calculate contour integrals with Mathematica? .

Another example

Another example you can check is Sin[x]/x which has one pole at z=0 and 0 residue.

Residue[Sin[z]/z, {z, 0}]

• ,But my function dont have any second order pole because all of the poles are distinct. There is no 1/z^2 comparison possible here. – Hazoor Imran Sep 6 '15 at 8:08
• Is there any command in mathematica which can replace the list of poles which are solution of denominator to (z-z1)(z-z2)(z-z3)..(z-zn) form. I think then it may work. – Hazoor Imran Sep 6 '15 at 8:45
• you can look for TransferFunctionPoles or may be simply Factor[D1]. – Sumit Sep 6 '15 at 8:50

Some definitions:

subs = {\[CapitalDelta] -> .3, \[Lambda] -> .1,
a1 -> 0.090001 - 0.0002 I, a2 -> 0.06};
num = -(z^2 (\[CapitalDelta] - I*\[Lambda]) - (\[CapitalDelta] +
I*\[Lambda]))^2 ;
den = z (z^4*a2 - z^2*I*2*a1 - a2);
poles = Solve[den == 0, z]


This gives a list with the pairs pole, residue analytically:

polres = Map[{#[[1, 2]], Residue[num/den, {z, #[[1, 2]]}]} &, poles]


Now we can get the numeric value corresponding to your parameters:

polres /. subs
(*
{{0, 1.33333 + 1. I},
{-0.43636 - 0.437662 I, -0.668455 + 0.0745192 I},
{0.43636 + 0.437662 I, -0.668455 + 0.0745192 I},
{-1.14584 - 1.14243 I, -0.664878 - 0.0745192 I},
{1.14584 + 1.14243 I, -0.664878 - 0.0745192 I}}
*)


However if we calculate the residues on the numerical values:

Map[{#[[1, 2]], Residue[num/den, {z, #[[1, 2]]}]} &, poles /. subs]
(*
{{0, (\[CapitalDelta]^2 + 2 I \[CapitalDelta] \[Lambda] - \[Lambda]^2)/a2},
{-0.43636 - 0.437662 I, 0},
{0.43636 + 0.437662 I, 0},
{-1.14584 - 1.14243 I, 0},
{1.14584 + 1.14243 I, 0}}
*)


Using the specified values and defining numerator and denominator

den[z_] := z (z^4*a2 - z^2*I*2*a1 - a2)
num[y_] := -(y^2 (\[CapitalDelta] - I*\[Lambda]) - (\[CapitalDelta] +
I*\[Lambda]))^2


As you are dealing with polynomials you can just use the polynomial roots and make life easier for Residue:

roots = z /. Solve[num[z] == 0, z];
poles = z /. Solve[den[z] == 0, z];
fun[z_] := (-(\[CapitalDelta] - I*\[Lambda])^2/
a2) Times @@ (z - roots)/(Times @@ (z - poles))


then the contour integral (unit circle):

cand = {#, Residue[fun[z], {z, #}]} & /@ poles;
2 Pi I Total@ Cases[cand, {_?(Abs@# < 1 &), y_} :> y]


yielding: -7.21962 - 0.022478 I

The poles and residues

TableForm[
cand /. {{x_?(Abs@# < 1 &), y_} :> {Style[x, Red], Style[y, Red]}}, Note: the leading coefficientis taken into account in redefinition: fun[z]`