COMPLEX ANALYSIS: Mathematica 4.1 Notebooks
(c) John H. Mathews, and
Russell W. Howell, 2002
Complimentary software to accompany our textbook:

COMPLEX ANALYSIS: for Mathematics and Engineering, 
4th Edition,  2001,  ISBN: 0-7637-1425-9
Jones & Bartlett Publishers, Inc.  
40 Tall Pine Drive, Sudbury, MA 01776  
Tele.  (800) 832-0034, FAX:  (508)  443-8000  
E-mail:  mkt@jbpub.com  
Internet:  http://www.jbpub.com/  
This free software is compliments of the authors.
John H. Mathews,   mathews@fullerton.edu 
Russell W. Howell,  howell@westmont.edu

CHAPTER 8   RESIDUE THEORY

a = t = x = y = z = Z = 
                  0; 
Clear[A, center, centers, dot, dots, f, f0, F, g, G, i, p, R, Res, 
        Res1, Res2, Res3, Res4, Res5, Res6, solset, sub, S, t, θ, val, 
        x, y, z, z1, z2, z3, z4, z5, z6, Z]; 
Needs["Graphics`Colors`"]; 
Needs["Graphics`FilledPlot`"];

Section 8.1	The Residue Theorem

Section 8.2  Calculation of Residues

The calculation of a Laurent series expansion is tedious in most circumstances.  As the residue at  (Subscript[z, 0])  involves only the coefficient  (Subscript[a, -1])  in the Laurent expansion, we seek a method to calculate the residue from special information about the nature of the singularity at  (Subscript[z, 0]).

	If  f  has a removable singularity at  (Subscript[z, 0]),  then  (Subscript[a, -1]) = 0  for  n = 1, 2,  ... .  Therefore if  (Subscript[z, 0])  is a removable singularity then Res[f, (Subscript[z, 0])] = 0.  Theorem 8.2 gives methods for evaluating residues at poles.

Theorem 8.2,  Page 310.  (Residues at Poles)

(i)  If  f[z]  has a simple pole at  (Subscript[z, 0]),  then  Res[f, (Subscript[z, 0])]  =  
        (lim_(z  ->  (Subscript[z, 0])))  (z - (Subscript[z, 0])) f[z]

(ii)  If  f[z]  has a pole of order 2 at  (Subscript[z, 0]),  then  Res[f, (Subscript[z, 0])]  =  
        (lim_(z  ->  (Subscript[z, 0])))  (∂_z)((((z - (Subscript[z, 0])))^2) 
                f[z])

(iii)  If  f[z]  has a pole of order 3 at  (Subscript[z, 0]),  then  \(Res[f, 
          z\_0]\  = \ \(1\/\(2!\)\) \(lim\+\(z\  -> \ z\_0\)\ \ ∂\_\(z, z\)\((\(\((z - z\_0)\)\^3\) f[z])\)\)\)

Proof of Theorem 8.2, see text Page 310.

Example 8.4,  Page 311.  Find the residue of  f[z] = ((π Cot[π z])/(z^2))  at  (Subscript[z, 0]) = 0.

Solution 8.4.

Enter the function  f[z] = ((π Cot[π z])/(z^2)).

Remove[z]; 
Clear[f, Res, S]; 
f[z_]  =  ((π Cot[π z])/(z^2)); 
Print["f[z] = ", f[z]];

The function  f[z]  has a pole of order  3  at  (Subscript[z, 0]) = 0.  The residue is computed using Theorem 8.2 (c).

ResLim = 
        (1/(2!)) Limit[(∂_(z, z)) ((z^3) f[z]), 
            z -> 0]; 
\(Print[\*""      \!\(z\^3\)f[z] = "", z\^3\ f[z]]; \ \)
\(\(Print[\*"" (∂_z) ((z^3)f[z]) = "", ∂\_z\ \((\(z\^3\) f[z])\)];\)\ \)
\(\(Print[\*""(∂_(z, z)) ((z^3)f[z]) = "", ∂\_\(z, z\)\ \((z\^3\ f[z])\)];\)\ \)
Print[""]; 
\(\(Print[\*""Res[f,0] = (1/(2!)) (lim_(z -> 0)) "", \*""(∂_(z, z))((z^3)f[z])) = "", 
        ResLim];\)\ \)
Print[""]; 
Print["Res[f,0] = Res[", f[z], ",0] = ", 
        ResLim];

Aside. We can verify this computation with Mathematica's built in "Residue" procedure.

Res = Residue[f[z], {z, 0}]; 
Print["Res[f,0] = Res[", f[z], ",0] = ", 
        Res];

Which is the coefficient of  (1/z) in the Laurent series expansion for  f[z].

S[z_]  =  Series[f[z], {z, 0, 7}]; 
Res  =  (Subscript[(S[z]), [[3, 3]]]); 
Print["S[z] = ", S[z]]; 
Print[""]; 
Print["Res[f,0] = Res[", f[z], ",0] = ", 
        Res];

Example 8.5,  Page  312.  Use residues to integrate  (∫_C)(( 1)/((z^4)  +  (z^3)  -  
                2  (z^2))) dz  around the circle  C : |z| = 3.

Solution 8.5.

Enter the function  f[z] = (( 1)/((z^4)  +  (z^3)  -  2  (z^2)))  and locate the singularities.

Remove[z, Z]; 
Clear[f, Res1, Res2, Res3, Res4]; 
f[
          z_]  = (( 1)/((z^4)  +  (z^3)  -  2  (z^2))); 
Print["f[z] = ", f[z]]; 
Print[""]; 
Print[Denominator[f[z]] == 0]; 
solset  =  
        Sort[Solve[Denominator[f[z]] == 0, 
            z]];  
Print[solset]; 
Print[""]; 
Print["The singularities are"]; 
(Subscript[Z, 1])  =  
        ReplaceAll[z, 
          (Subscript[solset, [[1]]])];  
\(\(Print[\*""\!\(z\_1\) = "", Z\_1];\)\ \)
(Subscript[Z, 2])  =  
        ReplaceAll[z, 
          (Subscript[solset, [[2]]])];  
\(\(Print[\*""\!\(z\_2\) = "", Z\_2];\)\ \)
(Subscript[Z, 3])  =  
        ReplaceAll[z, 
          (Subscript[solset, [[3]]])];  
\(\(Print[\*""\!\(z\_3\) = "", Z\_3];\)\ \)
(Subscript[Z, 4])  =  
        ReplaceAll[z, 
          (Subscript[solset, [[4]]])];  
\(\(Print[\*""\!\(z\_4\) = "", 
        Z\_4];\)\ \)

Find out which singularities lie within a circle  C : |z| = 3.

dots = 
        Graphics[{{Red, PointSize[0.03], Point[{Re[(Subscript[Z, 1])], Im[(Subscript[Z, 1])]}]}, {Red, 
              PointSize[0.03], Point[{Re[(Subscript[Z, 2])], Im[(Subscript[Z, 2])]}]}, {Red, 
              PointSize[0.03], Point[{Re[(Subscript[Z, 3])], Im[(Subscript[Z, 3])]}]}, {Red, 
              PointSize[0.03], 
              Point[{Re[(Subscript[Z, 4])], Im[(Subscript[Z, 4])]}]}}]; 
\(\(centers = 
        Graphics[{Text[\*""\!\(z\_1\)"", {Re[Z\_1], 
                Im[Z\_1] + 0.2}, {\(-1\), 0}], 
            Text[\*""\!\(z\_2\)"", {Re[Z\_2], Im[Z\_2] + 0.2}, {1, 0}], 
            Text[\*""\!\(z\_3\)"", {Re[Z\_3], Im[Z\_3] + 0.2}, {\(-1\), 
                0}], Text[\*""\!\(z\_4\)"", {Re[Z\_4], 
                Im[Z\_4] + 0.2}, {\(-1\), 
                0}]}];\)\ \)
contour  =  Graphics[{Magenta, Circle[{0, 0}, 3]}]; 
Show[dots, centers, contour, 
        PlotRange -> {{-3.1, 3.1}, {-3.1, 3.1}}, 
        Ticks -> {Range[-3, 3, 1], 
            Range[-3, 3, 1]}, 
AspectRatio -> 1, 
        Axes -> True, 
        AxesLabel -> {"x", "y"}]; 
\(\(Print[\*""\!\(z\_1\) = "", Z\_1, ", Is |", 
        Z\_1, "| < 3 ?  ", N[Abs[Z\_1]] < 3];\)\ \)
\(\(Print[\*""\!\(z\_2\) = "", Z\_2, ",  Is |", 
        Z\_2, "| < 3 ?   ", N[Abs[Z\_2]] < 3];\)\ \)
\(\(Print[\*""\!\(z\_3\) = "", Z\_3, ",  Is |", 
        Z\_3, "| < 3 ?   ", N[Abs[Z\_3]] < 3];\)\ \)
\(\(Print[\*""\!\(z\_4\) = "", Z\_4, ",  Is |", 
        Z\_4, "| < 3 ?   ", 
        N[Abs[Z\_4]] < 3];\)\ \)

Compute the residues at  (Subscript[z, 1]), (Subscript[z, 2]),  and  (Subscript[z, 4]).

Res1  =  Residue[f[z], {z, (Subscript[Z, 1])}]; 
Res2  =  Residue[f[z], {z, (Subscript[Z, 2])}]; 
Res4  =  Residue[f[z], {z, (Subscript[Z, 4])}]; 
Print["Res[f,", (Subscript[Z, 1]), "] = ", Res1]; 
Print["Res[f,", (Subscript[Z, 2]), "] = ", Res2]; 
Print["Res[f,", (Subscript[Z, 4]), "] = ", 
        Res4];

The integral is computed by the residue calculus.

val  = 
        2 π I (Res1  +  Res2  +  
              Res4); 
Print["Res[f,", (Subscript[Z, 1]), "] = ", Res1]; 
Print["Res[f,", (Subscript[Z, 2]), "] = ", Res2]; 
Print["Res[f,", (Subscript[Z, 4]), "] = ", 
        Res4]; 
dots = 
        Graphics[{{Red, PointSize[0.03], Point[{Re[(Subscript[Z, 1])], Im[(Subscript[Z, 1])]}]}, {Red, 
              PointSize[0.03], Point[{Re[(Subscript[Z, 2])], Im[(Subscript[Z, 2])]}]}, {Red, 
              PointSize[0.03], 
              Point[{Re[(Subscript[Z, 4])], Im[(Subscript[Z, 4])]}]}}]; 
\(\(centers = 
        Graphics[{Text[\*""\!\(z\_1\)"", {Re[Z\_1], 
                Im[Z\_1] + 0.2}, {\(-1\), 0}], 
            Text[\*""\!\(z\_2\)"", {Re[Z\_2], Im[Z\_2] + 0.2}, {\(-1\), 
                0}], Text[\*""\!\(z\_4\)"", {Re[Z\_4], 
                Im[Z\_4] + 0.2}, {\(-1\), 
                0}]}];\)\ \)
contour  =  Graphics[{Magenta, Circle[{0, 0}, 3]}]; 
Show[dots, centers, contour, 
        PlotRange -> {{-3.1, 3.1}, {-3.1, 3.1}}, 
        Ticks -> {Range[-3, 3, 1], 
            Range[-3, 3, 1]}, 
AspectRatio -> 1, 
        Axes -> True, 
        AxesLabel -> {"x", "y"}]; 
\(\(Print[\*""\!\(∮\+C\) "", 
        f[z], " \[DifferentialD]z = 2πI((", 
        Res1\ , ") + (", \ Res2\ , ") + (", \ 
        Res4, "))"];\)\ \)
Print[""]; 
\(\(Print[\*""\!\(∮\+C\) "", 
        f[z], " \[DifferentialD]z = 2πI(", 
        Res1\  + \ Res2\  + \ Res4, ") = ", 
        val];\)\ \)
Print["The contour is the circle  C:|z| = 3,"]; 
Print["with positive orientation."];

Example 8.6,  Page 312.   Use residues to integrate  (∫_C) (1/((z^4)  +  4)) dz  around the circle  C : |z - 1| = 2.

Solution 8.6.

Enter the function  f[z] = (1/((z^4)  +  4))  and locate the singularities.

Remove[z, Z]; 
Clear[f, Res1, Res2, Res3, Res4]; 
f[z_]  = (1/((z^4)  +  4)); 
Print["f[z] = ", f[z]]; 
Print[""]; 
Print[Denominator[f[z]] == 0]; 
solset  =  
        Sort[Solve[Denominator[f[z]] == 0, 
            z]];  
Print[solset]; 
Print[""]; 
Print["The singularities are"]; 
(Subscript[Z, 1])  =  
        ReplaceAll[z, 
          (Subscript[solset, [[1]]])]; 
\(\(Print[\*""\!\(z\_1\) = "", Z\_1];\)\ \)
(Subscript[Z, 2])  =  
        ReplaceAll[z, 
          (Subscript[solset, [[2]]])];  
\(\(Print[\*""\!\(z\_2\) = "", Z\_2];\)\ \)
(Subscript[Z, 3])  =  
        ReplaceAll[z, 
          (Subscript[solset, [[3]]])];  
\(\(Print[\*""\!\(z\_3\) = "", Z\_3];\)\ \)
(Subscript[Z, 4])  =  
        ReplaceAll[z, 
          (Subscript[solset, [[4]]])];  
\(\(Print[\*""\!\(z\_4\) = "", 
        Z\_4];\)\ \)

Find out which singularities lie within a circle  C : |z - 1| = 2. .

dots = 
        Graphics[{{Red, PointSize[0.03], Point[{Re[(Subscript[Z, 1])], Im[(Subscript[Z, 1])]}]}, {Red, 
              PointSize[0.03], Point[{Re[(Subscript[Z, 2])], Im[(Subscript[Z, 2])]}]}, {Red, 
              PointSize[0.03], Point[{Re[(Subscript[Z, 3])], Im[(Subscript[Z, 3])]}]}, {Red, 
              PointSize[0.03], 
              Point[{Re[(Subscript[Z, 4])], Im[(Subscript[Z, 4])]}]}}]; 
\(\(centers = 
        Graphics[{Text[\*""\!\(z\_1\)"", {Re[Z\_1], 
                Im[Z\_1] + 0.2}, {\(-1\), 0}], 
            Text[\*""\!\(z\_2\)"", {Re[Z\_2], Im[Z\_2] + 0.2}, {\(-1\), 
                0}], Text[\*""\!\(z\_3\)"", {Re[Z\_3], 
                Im[Z\_3] + 0.2}, {\(-1\), 0}], 
            Text[\*""\!\(z\_4\)"", {Re[Z\_4], Im[Z\_4] + 0.2}, {\(-1\), 
                0}]}];\)\ \)
contour  =  Graphics[{Magenta, Circle[{1, 0}, 2]}]; 
Show[dots, centers, contour, 
        PlotRange -> {{-3.1, 3.1}, {-3.1, 3.1}}, 
        Ticks -> {Range[-3, 3, 1], 
            Range[-3, 3, 1]}, 
AspectRatio -> 1, 
        Axes -> True, 
        AxesLabel -> {"x", "y"}]; 
\(\(Print[\*""\!\(z\_1\) = "", Z\_1, ", Is |", 
        Z\_1, " - 1| < 2 ?  ", N[Abs[Z\_1 - 1]] < 2];\)\ \)
\(\(Print[\*""\!\(z\_2\) = "", Z\_2, ", Is |", 
        Z\_2, " - 1| < 2 ?  ", N[Abs[Z\_2 - 1]] < 2];\)\ \)
\(\(Print[\*""\!\(z\_3\) = "", Z\_3, ",  Is |", 
        Z\_3, " - 1| < 2 ?   ", N[Abs[Z\_3 - 1]] < 2];\)\ \)
\(\(Print[\*""\!\(z\_4\) = "", Z\_4, ",  Is |", 
        Z\_4, " - 1| < 2 ?   ", 
        N[Abs[Z\_4 - 1]] < 2];\)\ \)

Compute the residues at  (Subscript[z, 3]),  and  (Subscript[z, 4]).

\(
\(Res3\  = \ Residue[f[z], {z, Z\_3}];\)\ \)
Res4  =  Residue[f[z], {z, (Subscript[Z, 4])}]; 
Print["Res[f,", (Subscript[Z, 3]), "] = ", Res3]; 
Print["Res[f,", (Subscript[Z, 4]), "] = ", 
        Res4];

The integral is computed by the residue calculus.

val  = 
        2 π I ( 
            Res3  +  Res4); 
Print["Res[f,", (Subscript[Z, 3]), "] = ", Res3]; 
Print["Res[f,", (Subscript[Z, 4]), "] = ", 
        Res4]; 
dots = 
        Graphics[{{Red, PointSize[0.03], Point[{Re[(Subscript[Z, 3])], Im[(Subscript[Z, 3])]}]}, {Red, 
              PointSize[0.03], 
              Point[{Re[(Subscript[Z, 4])], Im[(Subscript[Z, 4])]}]}}]; 
\(\(centers = 
        Graphics[{Text[\*""\!\(z\_3\)"", {Re[Z\_3], 
                Im[Z\_3] + 0.2}, {\(-1\), 0}], 
            Text[\*""\!\(z\_4\)"", {Re[Z\_4], Im[Z\_4] + 0.2}, {\(-1\), 
                0}]}];\)\ \)
contour  =  Graphics[{Magenta, Circle[{1, 0}, 2]}]; 
Show[dots, centers, contour, 
        PlotRange -> {{-2.1, 4.1}, {-3.1, 3.1}}, 
        Ticks -> {Range[-2, 4, 1], 
            Range[-3, 3, 1]}, 
AspectRatio -> 1, 
        Axes -> True, 
        AxesLabel -> {"x", "y"}]; 
\(\(Print[\*""\!\(∮\+C\) "", 
        f[z], " \[DifferentialD]z = 2πI((", \ 
        Res3\ , ") + (", \ 
        Res4, "))"];\)\ \)
Print[""]; 
\(\(Print[\*""\!\(∮\+C\) "", 
        f[z], " \[DifferentialD]z = 2πI(", 
        Res3\  + \ Res4, ") = ", val];\)\ \)
Print["The contour is the circle  C:|z-1| = 2,"]; 
Print["with positive orientation."];

The theory of residues can be used to expand the quotient of two polynomials into its partial fraction representation.

Example 8.7,  Page 313.  Let  P(z)  be a polynomial of degree at most  2.  If  a, b  and  c  are distinct complex numbers, then  

	\(f \((z)\) = \(\(P \((z)\)\)\/\(\((z\  - \ a)\) \((z\  - \ b)\) \((z\  - \ c)\)\) = A\/\(z\  - \ a\) + B\/\(z\  - \ b\) + C\/\(z\  - \ c\)\)\),

where  A = Res[f, 
            a] = ((P (a))/((a  -  b) (a  -  c))),  B = Res[f, 
            b] = ((P (b))/((b  -  a) (b  -  c))),  and  C = Res[f, 
            c] = ((P (c))/((c  -  a) (c  -  b))).

Solution of Example 8.7, see text Page249.

Example 8.8,  Page 314.  Find the partial fraction expansion  f[z] = ((3  z  +  2)/(z (z  -  1) (z  -  2))).

Solution 8.8.

Enter the function  f[z] = ((3  z  +  2)/(z (z  -  1) (z  -  2)))  and find the partial fraction expansion.

Remove[z, Z]; 
Clear[f, F, i, p, R, solset]; 
f[
          z_]  =  ((3  z  +  2)/(z (z - 1) (z - 2))); 
Print["f[z] = ", f[z]]; 
Print[""]; 
Print[Denominator[f[z]] == 0]; 
Print[""]; 
solset  =  
        Sort[Solve[Denominator[f[z]] == 0, z]]; 
Z  =  Table[0, {Length[solset]}]; 
R  =  Table[0, {Length[solset]}]; 
F[z_]  =  0; 
\(\(For[i = 1, 
        i ≤ 
          Length[solset], \(i++\), 
\ \ \ Z\_\(\([[\)\(i\)\(]]\)\) = 
          ReplaceAll[z, 
            solset\_\(\([[\)\(i\)\(]]\)\)]; \ 
\ \ \ If[1 == i, p\  = \ 1]; \ 
\ \ \ If[1 < i; \ 
          Z\_\(\([[\)\(i - 1\)\(]]\)\) == Z\_\(\([[\)\(i\)\(]]\)\), 
          p = p + 1, p = 1]; \ 
\ \ \ Print["z"\_i, " = ", 
          Z\_\(\([[\)\(i\)\(]]\)\)]; \ 
\ \ \ R\_\(\([[\)\(i\)\(]]\)\)\  = \ 
          Residue[\(\((z - 
                      Z\_\(\([[\)\(i\)\(]]\)\))\)\^\(p - 1\)\) f[z], {z, 
              Z\_\(\([[\)\(i\)\(]]\)\)}]; \ 
\ \ \ Print["Res[", \((z - Z\_\(\([[\)\(i\)\(]]\)\))\)\^\(p - 1\), " f,", 
          Z\_\(\([[\)\(i\)\(]]\)\), "] = ", R\_\(\([[\)\(i\)\(]]\)\)]; \ 
\ \ \ Print[" "]; \ 
\ \ \ F[z_]\  = \ 
          F[z]\  + \ 
            R\_\(\([[\)\(i\)\(]]\)\)\/\((z - Z\_\(\([[\)\(i\)\(]]\)\))\)\^p;\ ];\)\ \)
Print["f[z] = ", f[z]]; 
Print["f[z] = ", F[z]];

Compare this with Mathematica's Apart  procedure for the partial fraction expansion.

Print["f[z] = ", f[z]]; 
Print["f[z] = ", Apart[f[z]]];

In a moment, we will see that our subroutine will work for complex factors and "Apart" does not.

Remark 8.1.  If a repeated root occurs, then the process is similar, and it is easy to show that if P(z) has degree of at most 2, then

		\(f \((z)\) = \(P \((z)\)\)\/\(\(\((z\  - \ a)\)\^2\) \((z\  - \ b)\)\)\) =(A/(((z  -  a))^2)) + (B/(z  -  a)) + 
          (C/(z  -  b)),

where  A = Res[(z - a) f (z), a],  B = Res[f, a],  and  C = Res[f, b].

Example 8.9,  Page 314.  Find the partial fraction expansion of  f[z] = (((z^2)  +  3  z  +  2)/((z^2) (z  -  1))).

Solution 8.9.

Enter the function  f[z] = (((z^2)  +  3  z  +  2)/((z^2) (z  -  1))) and find the partial fraction expansion.

Remove[z, Z]; 
Clear[f, F, i, p, R, solset]; 
f[
          z_]  =  (((z^2)  +  3  z  +  2)/((z^2) (z - 1))); 
Print["f[z] = ", f[z]]; 
Print[""]; 
Print[Denominator[f[z]] == 0]; 
Print[""]; 
solset  =  
        Sort[Solve[Denominator[f[z]] == 0, z]]; 
Z  =  Table[0, {Length[solset]}]; 
R  =  Table[0, {Length[solset]}]; 
F[z_]  =  0; 
\(\(For[i = 1, 
        i ≤ 
          Length[solset], \(i++\), 
\ \ \ Z\_\(\([[\)\(i\)\(]]\)\) = 
          ReplaceAll[z, 
            solset\_\(\([[\)\(i\)\(]]\)\)]; \ 
\ \ \ If[1 == i, p\  = \ 1]; \ 
\ \ \ If[1 < i; \ 
          Z\_\(\([[\)\(i - 1\)\(]]\)\) == Z\_\(\([[\)\(i\)\(]]\)\), 
          p = p + 1, p = 1]; \ 
\ \ \ Print["z"\_i, " = ", 
          Z\_\(\([[\)\(i\)\(]]\)\)]; \ 
\ \ \ R\_\(\([[\)\(i\)\(]]\)\)\  = \ 
          Residue[\(\((z - 
                      Z\_\(\([[\)\(i\)\(]]\)\))\)\^\(p - 1\)\) f[z], {z, 
              Z\_\(\([[\)\(i\)\(]]\)\)}]; \ 
\ \ \ Print["Res[", \((z - Z\_\(\([[\)\(i\)\(]]\)\))\)\^\(p - 1\), " f,", 
          Z\_\(\([[\)\(i\)\(]]\)\), "] = ", R\_\(\([[\)\(i\)\(]]\)\)]; \ 
\ \ \ Print[" "]; \ 
\ \ \ F[z_]\  = \ 
          F[z]\  + \ 
            R\_\(\([[\)\(i\)\(]]\)\)\/\((z - Z\_\(\([[\)\(i\)\(]]\)\))\)\^p;\ ];\)\ \)
Print["f[z] = ", f[z]]; 
Print["f[z] = ", F[z]];

Compare this with Mathematica's Apart  procedure for the partial fraction expansion.

Print["f[z] = ", f[z]]; 
Print["f[z] = ", Apart[f[z]]];

In the next example we will see that our subroutine will work for complex factors and "Apart" does not.

Extra Example,  Page 314.  Find the partial fraction expansion  of  f[z] = (1/((z^4)  -  1)).

Solution for Extra Example, Page 314.

Enter the function  f[z] = (1/((z^4)  -  1)) and find the partial fraction expansion.

Remove[z, Z]; 
Clear[f, F, i, p, R, solset]; 
f[z_]  =  (1/((z^4) - 1)); 
Print["f[z] = ", f[z]]; 
Print[""]; 
Print[Denominator[f[z]] == 0]; 
Print[""]; 
solset  =  
        Sort[Solve[Denominator[f[z]] == 0, z]]; 
Z  =  Table[0, {Length[solset]}]; 
R  =  Table[0, {Length[solset]}]; 
F[z_]  =  0; 
\(\(For[i = 1, 
        i ≤ 
          Length[solset], \(i++\), 
\ \ \ Z\_\(\([[\)\(i\)\(]]\)\) = 
          ReplaceAll[z, 
            solset\_\(\([[\)\(i\)\(]]\)\)]; \ 
\ \ \ If[1 == i, p\  = \ 1]; \ 
\ \ \ If[1 < i; \ 
          Z\_\(\([[\)\(i - 1\)\(]]\)\) == Z\_\(\([[\)\(i\)\(]]\)\), 
          p = p + 1, p = 1]; \ 
\ \ \ Print["z"\_i, " = ", 
          Z\_\(\([[\)\(i\)\(]]\)\)]; \ 
\ \ \ R\_\(\([[\)\(i\)\(]]\)\)\  = \ 
          Residue[\(\((z - 
                      Z\_\(\([[\)\(i\)\(]]\)\))\)\^\(p - 1\)\) f[z], {z, 
              Z\_\(\([[\)\(i\)\(]]\)\)}]; \ 
\ \ \ Print["Res[", \((z - Z\_\(\([[\)\(i\)\(]]\)\))\)\^\(p - 1\), " f,", 
          Z\_\(\([[\)\(i\)\(]]\)\), "] = ", R\_\(\([[\)\(i\)\(]]\)\)]; \ 
\ \ \ Print[" "]; \ 
\ \ \ F[z_]\  = \ 
          F[z]\  + \ 
            R\_\(\([[\)\(i\)\(]]\)\)\/\((z - Z\_\(\([[\)\(i\)\(]]\)\))\)\^p;\ ];\)\ \)
Print["f[z] = ", f[z]]; 
Print["f[z] = ", F[z]];

Which is an improvement on Mathematica's "Apart"  procedure.

Print["f[z] = ", f[z]]; 
Print["f[z] = ", Apart[f[z]]];

Section 8.2  Exercises for Calculation of Residues
See textbook page 315.

Section 8.3	Trigonometric Integrals

Section 8.4	Improper Integrals of Rational Functions

Section 8.5	Improper Integrals Involving Trigonometric Functions

Section 8.6	Indented Contour Integrals

Section 8.7	Integrands with Branch Points

Section 8.8	The Argument Principle and Rouche's Theorem

GO TO  THE  Table of Contents