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 6  COMPLEX INTEGRATION

a = b = c = d = R = t = u = U = v = V = w = W = x = y = z = Z = 
                                      0; 
Clear[a, b, c, center, centers, d, dot, dots, f, F, i, int, int1, 
        int2, Int, ImInt, ImVal, label, path, r, R, ReInt, ReVal, soset, 
        solset, t, u, U, U1, U2, v, V, V1, V2, val, Val, w, W, W1, W2, Wint, 
        x, x0, x1, y, y0, y1, z, z1, z2, Z, Z1, Z2, 
        Z3]; 
Needs["Graphics`Arrow`"]; 
Needs["Graphics`Colors`"];

Section 6.1	Complex Integrals

Section 6.2	Contours and Contour Integrals

Section 6.3	The Cauchy-Goursat Theorem

Section 6.4  The Fundamental Theorems of Integration

Let  f(z)  be analytic in the simply connected domain  D.  The theorems in this section show that an antiderivative  F(z)  can be constructed by contour integration.  A consequence will be that the fact that in a simply connected domain, the integral of an analytic function  f  along any contour joining  (Subscript[z, 1])  to  (Subscript[z, 2])  is the same, and its value is given by  F ((Subscript[z, 2])) - F ((Subscript[z, 1])).  As a result, we can use the antiderivative formulas from Calculus to compute the value of definite integrals. The next two theorems are generalizations of the Fundamental Theorems of Calculus.

Theorem 6.8 (Indefinite Integrals or Antiderivatives), Page 238.  Let  f(z)  be analytic in the simply connected domain  D.  If  (Subscript[z, 0])  is a fixed value in  D  and if  C  is any contour in  D  with initial point  (Subscript[z, 0])  and terminal point  z, then the function given by  

			F (z) = (∫_C) 
            f (z) dz = (∫_((Subscript[z, 0]))^z) 
              f (ζ) dζ  

is well-defined and analytic in D, with derivative given by F' (z) = f (z).

Proof of Theorem 6.8, see text Page 238.

If we set z = (Subscript[z, 1]) in Theorem 6.8, then we obtain the following familiar result for evaluating a definite integral of an analytic function.

Theorem 6.9 (Definite Integrals), Page 240.  Let  f(z)  be analytic in a simply connected domain  D.  If  (Subscript[z, 0])  and  (Subscript[z, 1])  are two points in  D joined by a contour C, then 

	(∫_((Subscript[z, 0]))^((Subscript[z, 1])))f (z) dz  =  
        F ((Subscript[z, 1])) - F ((Subscript[z, 0])),  

where F(z) is any antiderivative of f(z) in D.

Proof of Theorem 6.9, see text Page 240.

Theorem 6.9 gives an important method for evaluating definite integrals when the integrand is an analytic function in a simply connected domain. In essence, it permits us to use all the rules of integration that we learned in Calculus. When the conditions of Theorem 6.9 are met, applying it is generally much easier than parametrizing a contour.

Example 6.17,  Page 240.  Show that  (∫_C) (1/(2  (z^(1/2)))) dz = 
        1 + i where (z^(1/2)) is the principal branch of the square root function and C is the line segment joining 4 to 8+6i.

Remark. Sometimes we write this as \(∫\_4\%\(8\  + \ 6  i\)\(z\^\(\(-1\)/2\)\/2\) dz = 1 + i\).

Solution 6.17.

Enter the function  f[z] = ((z^(-1/2))/2)  and the initial point  (Subscript[Z, 0]) = 4  and terminal point  (Subscript[Z, 1]) = 8 + 6  i.

Remove[z, Z]; 
Clear[f, g, path, val1, val2]; 
f[z_]  =  ((z^(-1/2))/2); 
(Subscript[Z, 0]) = 4; 
(Subscript[Z, 1]) = 8 + 6  I; 
g[z_]  = ∫f[z] \[DifferentialD]z; 
val1  =  g[(Subscript[Z, 1])]  -  g[(Subscript[Z, 0])]; 
val2  =  (∫_((Subscript[Z, 0]))^((Subscript[Z, 1])))f[
              z] \[DifferentialD]z; 
Print["f[z] = ", f[z]]; 
Print["g[z] = ∫", "(", 
        f[z], ")\[DifferentialD]z = ", g[z]]; 
Print["g[", (Subscript[Z, 1]), "] = ", g[(Subscript[Z, 1])], ",      g[", 
        (Subscript[Z, 0]), "] = ", g[(Subscript[Z, 0])]]; 
path  =  
        Graphics[{{Blue, PointSize[0.03], Point[{Re[(Subscript[Z, 0])], Im[(Subscript[Z, 0])]}]}, {Red, 
              PointSize[0.03], 
              Point[{Re[(Subscript[Z, 1])], Im[(Subscript[Z, 1])]}]}, 
{Green, 
              Dashing[{0.1, 0.03}], 
              Arrow[{Re[(Subscript[Z, 0])], Im[(Subscript[Z, 0])]}, {Re[(Subscript[Z, 1])], Im[(Subscript[Z, 1])]}, 
                HeadScaling -> Absolute]}}]; 
Show[path, PlotRange -> {{-0.2, 8.2}, {-0.2, 6.2}}, 
        Ticks -> {Range[0, 8, 2], 
            Range[0, 6, 2]}, 
AspectRatio -> 1, 
        Axes -> True, 
        AxesLabel -> {"x", "y"}]; 
Print["It is permissible to use the straight line path."]; 
\(\(Print["∫"\+\(Z\_0\)\%\(Z\_1\), "(", 
        f[z], ")\[DifferentialD]z = g[", Z\_1, "] - g[", 
        Z\_0, "]"];\)\ \)
Print["      = (", g[(Subscript[Z, 1])] , ") - (",  g[(Subscript[Z, 0])], ") = ", 
        ComplexExpand[val1]]; 
Print[""]; 
\(\(Print["∫"\+\(Z\_0\)\%\(Z\_1\), "(", 
        f[z], ")\[DifferentialD]z = ", 
        ComplexExpand[val2]];\)\ \)
\(\(Print["∫"\+\(Z\_0\)\%\(Z\_1\), "(", 
        f[z], ")\[DifferentialD]z = ", 
        N[val2]];\)\ \)

Example 6.18,  Page 241.  Evaluate the definite integral  (∫_1^i) 
            cos (z) dz = - 
              sin (1) + i sinh (1).

Solution 6.18.

Enter the function  f[z] = Cos[z]  and the initial point  (Subscript[Z, 0]) = 1  and terminal point  (Subscript[Z, 1]) = i.

Remove[z, Z]; 
Clear[f, g, path, val1, val2]; 
f[z_]  =  Cos[z]; 
(Subscript[Z, 0]) = 1; 
(Subscript[Z, 1]) = I; 
g[z_]  = ∫f[z] \[DifferentialD]z; 
val1  =  g[(Subscript[Z, 1])]  -  g[(Subscript[Z, 0])]; 
val2  =  (∫_((Subscript[Z, 0]))^((Subscript[Z, 1])))f[
              z] \[DifferentialD]z; 
Print["f[z] = ", f[z]]; 
Print["g[z] = ∫", "(", 
        f[z], ")\[DifferentialD]z = ", 
        g[z]]; 
Print["g[", (Subscript[Z, 1]), "] = ", g[(Subscript[Z, 1])], ",      g[", 
        (Subscript[Z, 0]), "] = ", g[(Subscript[Z, 0])]]; 
path  =  
        Graphics[{{Blue, PointSize[0.03], Point[{Re[(Subscript[Z, 0])], Im[(Subscript[Z, 0])]}]}, {Red, 
              PointSize[0.03], 
              Point[{Re[(Subscript[Z, 1])], Im[(Subscript[Z, 1])]}]}, 
{Green, 
              Dashing[{0.1, 0.03}], 
              Arrow[{Re[(Subscript[Z, 0])], Im[(Subscript[Z, 0])]}, {Re[(Subscript[Z, 1])], Im[(Subscript[Z, 1])]}, 
                HeadScaling -> Absolute]}}]; 
Show[path, PlotRange -> {{-0.1, 1.1}, {-0.1, 1.1}}, 
        Ticks -> {Range[0, 1, (1/2)], 
            Range[0, 1, (1/2)]}, 
AspectRatio -> 1, 
        Axes -> True, 
        AxesLabel -> {"x", "y"}]; 
Print["It is permissible to use the straight line path."]; 
\(\(Print["∫"\+\(Z\_0\)\%\(Z\_1\), "(", 
        f[z], ")\[DifferentialD]z = g[", Z\_1, "] - g[", 
        Z\_0, "]"];\)\ \)
Print["      = (", g[(Subscript[Z, 1])] , ") - (",  g[(Subscript[Z, 0])], ") = ", 
        ComplexExpand[val1]]; 
Print[""]; 
\(\(Print["∫"\+\(Z\_0\)\%\(Z\_1\), "(", 
        f[z], ")\[DifferentialD]z = ", 
        ComplexExpand[val2]];\)\ \)
\(\(Print["∫"\+\(Z\_0\)\%\(Z\_1\), "(", 
        f[z], ")\[DifferentialD]z = ", 
        N[val2]];\)\ \)

Example 6.19,  Page 241.  We let D = {z = 
            r (e^(i θ)) :  
                r > 0 and  - π < θ < π} be the simply connected domain which is the z-plane slit along the negative x-axis. We know that f (z) = (1/z) is analytic in D, and has an antiderivative f (z) = Log (z) for all z in D. If C is a contour in D that joins the point (Subscript[z, 1]) to the point (Subscript[z, 2]), then Theorem 6.9 implies that  

			(∫_((Subscript[z, 1]))^((Subscript[z, 2])))(1/z) dz = 
        Log (Subscript[z, 2]) - Log (Subscript[z, 1]).

Example 6.20,  Page 241.  Show that  (∫_C) (1/z) dz = 
        2 π i,  where C is the unit circle C: |z| = 1, taken with positive orientation.

Solution 6.20.

Enter the function  f[z] = (1/z).

Remove[z, Z]; 
Clear[f, g, path, val1, val2]; 
f[z_]  =  (1/z); 
(Subscript[Z, 0]) = -1 + I 0.0208; 
(Subscript[Z, 1]) = -1 - I 0.0208; 
g[z_]  = ∫f[z] \[DifferentialD]z; 
z[θ_]  =  (E^(I θ)); 
lim2  =  
        Limit[g[z[θ]], θ -> π, 
          Direction -> 1]; 
lim1  =  
        Limit[g[z[θ]], θ -> -π, 
          Direction -> -1]; 
Print["f[z] = ", f[z]]; 
Print["g[z] = ∫", "(", 
        f[z], ")\[DifferentialD]z = ", g[z]]; 
Print[""]; 
\(\(Print[\*""(Subscript[limit, 2]) = (lim_(θ -> π)) Log[(E^I)θ] = "", 
        lim2];\)\ \)
\(\(Print[\*""(Subscript[limit, 1]) = (lim_(θ -> -π)) Log[(E^I)θ] = "", 
        lim1];\)\ \)
Print[""]; 
\(\(Print["g[", 
        Re[Z\_1], \*""+ I \!\(\(0\^+\)\)] = "", 
        lim2, ",      g[", 
        Re[Z\_0], \*""+ I \!\(\(0\^-\)\)] = "", 
        lim1];\)\ \)
path  =  
        Graphics[{{Blue, PointSize[0.03], Point[{Re[(Subscript[Z, 0])], Im[(Subscript[Z, 0])]}]}, {Red, 
              PointSize[0.03], 
              Point[{Re[(Subscript[Z, 1])], Im[(Subscript[Z, 1])]}]}, 
{Green, 
              Dashing[{0.1, 0.025}], 
Circle[{0, 0}, 
                1, {-3.125, 3.125}]
}}]; 
Show[path, PlotRange -> {{-1.1, 1.1}, {-1.1, 1.1}}, 
        Ticks -> {Range[-1, 1, 1], 
            Range[-1, 1, 1]}, 
AspectRatio -> 1, 
        Axes -> True, 
        AxesLabel -> {"x", "y"}]; 
\(\(Print[\*""(∫_C)("", 
        f[z], \*"")\[DifferentialD]z = (Subscript[limit, 2]) - (Subscript[limit, 1]) = ("", lim2, ") - (", lim1, ")"];\)\ \)
Print[""]; 
\(Print[\*""\!\(∮\+C\) ("", 
      f[z], ") \[DifferentialD]z = ", lim2 - lim1]\)
Print["The contour is the unit circle  C: |z| = 1."];

Another approach is to parameterize the integrand.

w  =  
        f[z[θ]] z'[θ]; 
G[θ_]   =  ∫w \[DifferentialD]θ; 
val  =  G[π]  -  G[-π]; 
Print["         z[θ] = ",  z[θ]]; 
Print["        z'[θ] = ",  z'[θ]]; 
Print["         f[z] = ",  f[z]] ; 
Print[" f[z[θ]]z'[θ] = ",  
        w]; 
Print[""]; 
Print["  G[θ] = ∫f[z[θ]]z'[θ]\
\[DifferentialD]θ = ∫(", 
        w, ")\[DifferentialD]θ = " , 
        G[θ]]; 
Print[""]; 
Print["  G[π] = ",  G[π],  ",  G[-π] = ", 
        G[-π]]; 
Print[""]; 
\(\(Print[\*""\!\(∫\+C\)("", 
        f[z], ")\[DifferentialD]z = G[π] - G[-π] = (", 
        G[π], ") - (", 
        G[\(-π\)], ")"];\)\ \)
\(Print[\*""\!\(∮\+C\) ("", 
      f[z], ") \[DifferentialD]z = ", val]\)
Print["The contour is the unit circle C: |z| = 1."];

Extra Example,  Page 242.  Evaluate the definite integral  \(∫\_0\%\(2\  + \ \(i\ π\)\/4\)\(e\^z\) dz = \(-1\) + \(\((1\  + \ i)\)\ e\^2\)\/\@2\).

Solution for Extra Example, Page 242.

Enter the function  f[z] = (e^z)  and the initial point  (Subscript[Z, 0]) = 0  and terminal point  (Subscript[Z, 1]) = 2 + ((i π)/4).

Remove[z, Z]; 
Clear[f, g, path, val1, val2]; 
f[z_]  =  (E^z); 
(Subscript[Z, 0]) = 0; 
(Subscript[Z, 1]) = 2 + ((I π)/4); 
g[z_]  = ∫f[z] \[DifferentialD]z; 
val1  =  g[(Subscript[Z, 1])]  -  g[(Subscript[Z, 0])]; 
val2  =  (∫_((Subscript[Z, 0]))^((Subscript[Z, 1])))f[
              z] \[DifferentialD]z; 
Print["f[z] = ", f[z]]; 
Print["g[z] = ∫", "(", 
        f[z], ")\[DifferentialD]z = ", 
        g[z]]; 
Print["g[", (Subscript[Z, 1]), "] = ", g[(Subscript[Z, 1])], ",      g[", 
        (Subscript[Z, 0]), "] = ", g[(Subscript[Z, 0])]]; 
path  =  
        Graphics[{{Blue, PointSize[0.03], Point[{Re[(Subscript[Z, 0])], Im[(Subscript[Z, 0])]}]}, {Red, 
              PointSize[0.03], 
              Point[{Re[(Subscript[Z, 1])], Im[(Subscript[Z, 1])]}]}, 
{Green, 
              Dashing[{0.1, 0.03}], 
              Arrow[{Re[(Subscript[Z, 0])], Im[(Subscript[Z, 0])]}, {Re[(Subscript[Z, 1])], Im[(Subscript[Z, 1])]}, 
                HeadScaling -> Absolute]}}]; 
Show[path, PlotRange -> {{-0.1, 2.1}, {-0.1, 1.1}}, 
        Ticks -> {Range[0, 2, 1], 
            Range[0, 1, (1/2)]}, 
AspectRatio -> 1, 
        Axes -> True, 
        AxesLabel -> {"x", "y"}]; 
Print["It is permissible to use the straight line path."]; 
\(\(Print["∫"\+\(Z\_0\)\%\(Z\_1\), "(", 
        f[z], ")\[DifferentialD]z = g[", Z\_1, "] - g[", 
        Z\_0, "]"];\)\ \)
Print["      = (", g[(Subscript[Z, 1])] , ") - (",  g[(Subscript[Z, 0])], ") = ", 
        ComplexExpand[val1]]; 
Print[""]; 
\(\(Print["∫"\+\(Z\_0\)\%\(Z\_1\), "(", 
        f[z], ")\[DifferentialD]z = ", 
        ComplexExpand[val2]];\)\ \)
\(\(Print["∫"\+\(Z\_0\)\%\(Z\_1\), "(", 
        f[z], ")\[DifferentialD]z = (", 
        ComplexExpand[Re[val2]], ") + I(", 
        ComplexExpand[Im[val2]], ")"];\)\ \)
\(\(Print["∫"\+\(Z\_0\)\%\(Z\_1\), "(", 
        f[z], ")\[DifferentialD]z = ", 
        N[val2]];\)\ \)

The integral could be computed parametrically as suggested in the textbook.

Remove[t]; 
F[t_]=(2 + ((I π)/4))∫((E^(2  
                            t + I π t/4)))\[DifferentialD]t; 
Print["F[t] = (2+I(π/4))∫(",(E^(t + Iπt/4)),\!\(\*
StyleBox["\"",
FontSize->15]\))\[DifferentialD]t = ",F[t]]; 
Print[""]; 
Val = F[1] - F[0] ; 
Print["F[1]-F[0] = ", Val]; 
Print["F[1]-F[0] = ", Simplify[Val]]; 
Print[""]; 
Print["(2+I(π/4))∫(",(E^(t + Iπt/4)),\!\(\*
StyleBox["\"",
FontSize->15]\))\[DifferentialD]t = ",F[t]]; 
Print[""]; 
Print["(2+I(π/4))(∫_0^1)",(E^(2  t + Iπt/4)),\!\(\*
StyleBox["\"",
FontSize->15]\)\[DifferentialD]t = ",Simplify[Val]]; 
Print["(2+I(π/4))(∫_0^1)",(E^(2  t + Iπt/4)),\!\(\*
StyleBox["\"",
FontSize->15]\)\[DifferentialD]t = ",ComplexExpand[Simplify[Val]]]; 
Print["(2+I(π/4))(∫_0^1)",(E^(2  t + Iπt/4)),\!\(\*
StyleBox["\"",
FontSize->15]\)\[DifferentialD]t = ",Simplify[ComplexExpand[Re[Val]]],") + I(",Simplify[ComplexExpand[Im[Val]]],")"]; 
Print["(2+I(π/4))(∫_0^1)",(E^(2  t + Iπt/4)),\!\(\*
StyleBox["\"",
FontSize->15]\)\[DifferentialD]t = ",N[Val]];

Section 6.4  Exercises for The Fundamental Theorems of Integration
See textbook page 242.

Section 6.5	Integral Representations for Analytic Functions

Section 6.6	The Theorems of Morera and Liouville and Some Applications

GO TO  THE  Table of Contents