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

In Chapter 3 we saw how the derivative of a complex function is defined.  We now turn our attention to the problem of integrating complex functions.  We will find that integrals of analytic functions are well behaved and that many properties from calculus carry over to the complex case.  To introduce the integral of a complex function, we start by defining what is meant by the integral of a complex-valued function of a real variable.

Definition 6.1 (definite integral of a complex integrand), Page 201. Let   f[t] = u[t] + i v[t]  where u and v are real-valued functions of the real variable t for  a ≤ t ≤ b .  Then

	(∫_a^b) f[
              t] dt  =  (∫_a^b)(u[
                  t] + i v[
                    t]) dt = (∫_a^b) u[
                t] dt + i (∫_a^b) v[
                  t] dt.

We generally evaluate integrals of this type by finding the antiderivatives of  u  and  v  and evaluating the definite integrals on the right side of the equation.  That is, if  U'[t]  =  u[t]  and  V'[t]  =  v[t],  then we write  

	(∫_a^b) f[
              t] dt  =  (∫_a^b) u[
                  t] dt + i (∫_a^b) v[
                    t] dt =  
          U[b] - U[a]  +  i (V[b] - V[a])

Example 6.1,  Page 202.  Show that  \(∫\_0\%1\(\((t - i)\)\^3\) dt = \(-\(5\/4\)\)\).

Solution 6.1.

Method (i).  Expand the integrand f[t] into its real and imaginary parts, then integrate u[t] and v[t].

Remove[t, u, v, w]; 
Clear[f, Int, ImInt, ImVal, ReInt, ReVal, 
        Val]; 
w = (((t  -  I))^3); 
f[t_]  =  ComplexExpand[w]; 
u[t_]  =  ComplexExpand[Re[f[t]]]; 
v[t_]  =  ComplexExpand[Im[f[t]]]; 
U[
          t_]  =  ∫u[
              t] \[DifferentialD]t; 
V[t_]  =  ∫v[t] \[DifferentialD]t; 
Int  =  
        U[t]  +  I V[t]; 
ReVal  =   (∫_0^1) u[
              t] \[DifferentialD]t; 
ImVal  =   (∫_0^1) v[t] \[DifferentialD]t; 
Val  =  ReVal  +  I ImVal; 
Print["f[t] = ", f[t]]; 
Print["f[t] = u[t] + \[ImaginaryI] v[t]"]; 
Print[""]; 
Print["u[t] = ", u[t]]; 
Print["v[t] = ", v[t]]; 
Print[""]; 
Print["U[t] = ∫u[t]\[DifferentialD]t = ", 
        U[t]]; 
Print["V[t] = ∫v[t]\[DifferentialD]t = ", 
        V[t]]; 
Print[""]; 
Print["∫u[t]\[DifferentialD]t + \[ImaginaryI] \
∫v[t]\[DifferentialD]t = (", U[t], ") + \[ImaginaryI](", 
        V[t], ")"]; 
Print[""]; 
\(\(Print[\*""(∫_0^1)"", 
        w, \*""\[DifferentialD]t = (∫_0^1)u[t]\[DifferentialD]t + I (∫_0^1)v[t]\[DifferentialD]t""];\)\ \)
Print[""]; 
\(\(Print[\*""(∫_0^1)"", 
        w, "\[DifferentialD]t = (U[1]-U[0]) + I(V[1]-V[0])"];\)\ \)
\(\(Print[\*""\!\(∫\_0\%1\)"", 
        w, "\[DifferentialD]t = (", ReVal, ") + I(", 
        ImVal, ")"];\)\ \)
\(\(Print[\*""\!\(∫\_0\%1\)"", 
        w, "\[DifferentialD]t = ", Val];\)\ \)

Method (ii).  Compute the integral directly using a complex function for the integrand.

Remove[t]; 
Clear[f, F, val]; 
f[
          t_]  =  (((t  -  I))^3); 
F[
          t_]  =  ∫f[
              t] \[DifferentialD]t; 
val  =  (∫_0^1) f[t] \[DifferentialD]t; 
Print["f[t] = ", f[t]]; 
Print["F[t] = ∫", f[t], "\[DifferentialD]t = ", 
        F[t]]; 
Print[""]; 
\(\(Print[\*""\!\(∫\_0\%1\)"", 
        f[t], "\[DifferentialD]t = F[1] - F[0]"];\)\ \)
\(\(Print[\*""\!\(∫\_0\%1\)"", 
        f[t], "\[DifferentialD]t = (", F[1]\ , ") - (", 
        F[0], ")"];\)\ \)
\(\(Print[\*""\!\(∫\_0\%1\)"", 
        f[t], "\[DifferentialD]t = ", 
        val];\)\ \)

Example 6.2,  Page 202.  Show that  \(∫\_0\%\(π/2\)\(e\^\(t + i\ t\)\) dt = \(1\/2\) \((e\^\(π/2\) - 
                1)\) + \(\(\(i\)\(\ \)\)\/2\) \((e\^\(π/2\) + 1)\)\).

Solution 6.2.

Method (i).  Expand the integrand f[t] into its real and imaginary parts, then integrate u[t] and v[t].

Remove[t, u, v, w]; 
Clear[f, Int, ImInt, ImVal, ReInt, ReVal, 
        Val]; 
w = (E^(t  +  I t)); 
f[t_]  =  ComplexExpand[w]; 
u[t_]  =  ComplexExpand[Re[f[t]]]; 
v[t_]  =  ComplexExpand[Im[f[t]]]; 
U[
          t_]  =  ∫u[
              t] \[DifferentialD]t; 
V[t_]  =  ∫v[t] \[DifferentialD]t; 
Int  =  
        U[t]  +  I V[t]; 
ReVal  =   (∫_0^(π/2))u[
              t] \[DifferentialD]t; 
ImVal  =   (∫_0^(π/2))v[
              t] \[DifferentialD]t; 
Val  =  ReVal  +  I ImVal; 
Print["f[t] = ", f[t]]; 
Print["f[t] = u[t] + \[ImaginaryI] v[t]"]; 
Print[""]; 
Print["u[t] = ", u[t]]; 
Print["v[t] = ", v[t]]; 
Print[""]; 
Print["U[t] = ∫u[t]\[DifferentialD]t = ", 
        U[t]]; 
Print["V[t] = ∫v[t]\[DifferentialD]t = ", 
        V[t]]; 
Print[""]; 
\(\(Print[\*""U[\!\(π\/2\)] = "", 
        U[π\/2], ",   ", \ "U[0] = ", 
        U[0]];\)\ \)
\(\(Print[\*""V[\!\(π\/2\)] = "", 
        V[π\/2], ",   ", "V[0] = ", 
        V[0]];\)\ \)
Print[""]; 
Print["∫u[t]\[DifferentialD]t + \[ImaginaryI] \
∫v[t]\[DifferentialD]t = ", Int]; 
Print[""]; 
\(\(Print[\*""(∫_0^(π/2))"", 
        w, \*""\[DifferentialD]t = (∫_0^(π/2))u[t]\[DifferentialD]t + I (∫_0^(π/2))v[t]\[DifferentialD]t""];\)\ \)
Print[""]; 
\(\(Print[\*""(∫_0^(π/2))"", 
        w, "\[DifferentialD]t = (U[1]-U[0]) + I(V[1]-V[0])"];\)\ \)
\(\(Print[\*""\!\(∫\_0\%\(π/2\)\)"", 
        w, "\[DifferentialD]t = ", ReVal, " + I(", 
        ImVal, ")"];\)\ \)
\(\(Print[\*""\!\(∫\_0\%\(π/2\)\)"", 
        w, "\[DifferentialD]t = ", Val];\)\ \)

Using Definition (6-1) it is easy to show that the integral of their sum is the sum of their integrals, that is  

		(∫_a^b)(f[t] + 
                g[t]) dt = (∫_a^b) f[
                t] dt + (∫_a^b) g[
                t] dt.

If we divide the interval a ≤ t ≤ b into a ≤ t ≤ c and c ≤ t ≤ b and integrate f(t) over these subintervals using definition (6-1) we get 

			(∫_a^b) f[
              t] dt = (∫_a^c) f[
                t] dt + (∫_c^b) f[
                t] dt.

Similarly, if α + i β denotes a complex constant, then

			\(∫\_a\%b\((α + i\ β)\) 
            f[t] dt = \((α + i\ β)\) \(∫\_a\%b f[t] dt\)\).

If the limits of integration are reversed, then

			(∫_a^b) f[
              t] dt = -(∫_b^a) f[
                t] dt.

The integral of the product fg becomes

(∫_a^b) f[t] g[t] dt= (∫_a^b)(u[t] + i v[t]) (p[
                t] + i q[t]) dt    

\(\(\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \)\(\(=\)\(\ \)\)\)\)(∫_a^b)(u[t] p[t] - 
                v[t] q[t]) dt + i (∫_a^b)(u[t] q[t] + 
                v[t] p[t]) dt.

Example 6.3,  Page 203.  Let us verify property (6-5): 

 ∫(c + i d) (u[
                  t] + i v[t]) dt = 
        c ∫u[t] dt - 
          d ∫v[
                  t] dt + i d ∫u[
                  t] dt + i c ∫v[
                  t] dt.

Solution 6.3.

Clear[c, d, int1, int2, t, u, v]; 
int1  = ∫(c  +  I d) (u[
                  t]  +  I v[
                    t]) \[DifferentialD]t; 
int2  =  MapAll[Distribute, int1]; 
Print[int1, " = "]; 
Print[int2];

It is worthwhile to point out the similarity between equation (6-2) and its counterpart in calculus. Suppose that U and V are differentiable on  a < t < b  and F (t) = U (t) + i V (t).  Since \(F' \((t)\) = \(U' \((t)\) + i\ V' \((t)\) = \(u \((t)\) + i\ v \((t)\) = f \((t)\)\)\)\), equation (6-2) takes on the familiar form 

			\(∫\_a\%b f[
              t] dt = \(\(F \((t)\)\)\( | \_\(t = a\)\%\(t = 
                b\)\)\)\)=F (b) - F (a).

Example 6.4,  Page 204.  Use the above equation (6-8) to show that  \(∫\_0\%\(π/2\)\(e\^\(t + i\ t\)\) dt = \(1\/2\) \((e\^\(π/2\) - 
                1)\) + \(\(\(i\)\(\ \)\)\/2\) \((e\^\(π/2\) + 1)\)\).

Solution 6.4.

Method (ii).  Compute the integral directly using a complex function for the integrand.

Remove[t]; 
Clear[f, F, val]; 
f[
          t_] = (E^(t  +  I t)); 
F[
          t_]  =  ∫(E^(t + I t)) \[DifferentialD]t; 
val  =  (∫_0^(π/2))f[
              t] \[DifferentialD]t; 
Print["f[t] = ", f[t]]; 
Print["F[t] = ∫", f[t], "\[DifferentialD]t = ", 
        F[t]]; 
Print[""]; 
\(\(Print[\*""\!\(∫\_0\%\(π/2\)\)"", 
        f[t], "\[DifferentialD]t = F[1] - F[0]"];\)\ \)
\(\(Print[\*""\!\(∫\_0\%\(π/2\)\)"", 
        f[t], "\[DifferentialD]t = ", F[1]\ , " - (", 
        F[0], ")"];\)\ \)
\(\(Print[\*""\!\(∫\_0\%\(π/2\)\)"", 
        f[t], "\[DifferentialD]t = ", 
        val];\)\ \)
\(\(Print[\*""\!\(∫\_0\%\(π/2\)\)"", 
        f[t], "\[DifferentialD]t = ", 
        ComplexExpand[val]];\)\ \)

Which is the same result we obtained in Example 6.2, but with a lot less work.

Extra Example for Page 204.  Show that  \(∫\_0\%π\( e\^\(i\ t\)\) dt = 2  i\).

Solution for Extra Example, Page 204.

Compute the integral directly using a complex function for the integrand.

Clear[f, F, int, t, val]; 
f[
          t_]  =  ((E )^(I t)); 
F[t_] = ∫f[t] \[DifferentialD]t; 
val  =  (∫_0^π) f[t] \[DifferentialD]t; 
Print["f[t] = ", f[t]]; 
Print["F[t] = ∫f[t]\[DifferentialD]t = ", 
        F[t]]; 
Print[""]; 
Print["F[π] = ", F[π], ",  F[0] = ", 
        F[0]]; 
Print[""]; 
\(\(Print[\*""(∫_0^π)f[t]\[DifferentialD]t = F[π] - F[0]""];\)\ \)
\(\(Print[\*""(∫_0^π)f[t]\[DifferentialD]t = ("", F[π], ") - (", F[0], ") = ", 
        val];\)\ \)

Section 6.1  Exercises for Complex Integrals
See textbook page 205.

Section 6.2	Contours and Contour Integrals

Section 6.3	The Cauchy-Goursat Theorem

Section 6.4	The Fundamental Theorem of Integration

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