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 1  COMPLEX NUMBERS

Needs["Graphics`Arrow`"]; 
Needs["Graphics`Colors`"]; 
a = b = c = e = P = r = t = θ = v = V = w = x = y = z = Z = 0; 
Clear[a, b, bdd, c, disk, dot, e, eqn, ext, int, k, list, P, r, r1, 
        r2, set, solset, t, θ, θ1, θ2, v, V, values, w, 
        x, x0, x1, x2, x3, xx, y, y0, y1, y2, y3, yy, z, z1, z2, z3, z4, 
        Z];

Section 1.1	The Origin of Complex Numbers

Section 1.2	The Algebra of Complex Numbers

Section 1.3	The Geometry of Complex Numbers

Section 1.4  The Geometry of Complex Numbers, Continued

In Section 1.3 we saw that a complex number  z = x + i y  could be viewed as a vector in the xy-plane whose tail is at the origin and whose head is at the point (x,y). A vector can be uniquely specified by giving its magnitude (i.e., its length) and direction (i.e., the angle it makes with the positive x-axis). In this section, we focus on these two geometric aspects of complex numbers.
	
	Let r be the modulus of z (i.e., r = |z|), and let  θ  be the angle that the line from the origin to the complex number z makes with the positive x-axis. (Note: The number  θ  is undefined if z=0). Then, we make the following definition.

Definition 1.9, (Polar Representation),  Page 23.  The identity 

			z  = (r cos θ, r sin θ) =  
          r (cos θ  +  i sin θ)  

is known as a polar representation of z, and the values r and  θ  are called polar coordinates of z.

Example 1.7,  Page 23.  Find a coordinate representation of  z = 1 + i.

Solution 1.7.

Enter  (Subscript[z, 1]) =  1 + i.

Clear[z]; 
(Subscript[z, 1]) =  1 +  I; 
r = Abs[(Subscript[z, 1])]; 
θ = Arg[(Subscript[z, 1])]; 
(Subscript[V, 1])  =  
        Graphics[{Magenta, 
            Arrow[{0,  0}, {Re[(Subscript[z, 1])], Im[(Subscript[z, 1])]}]}]; 
Show[(Subscript[V, 1]), 
        PlotRange -> {{0, 1.1}, {0, 
              1.1}}, 
Ticks -> {Range[0, 2, (1/2)], 
            Range[0, 1, (1/2)]}, 
AspectRatio -> 1, 
        Axes -> True, 
        AxesLabel -> {"x", "y"}]; 
\(\(Print[\*""\!\(z\_1\) = "", z\_1];\)\ \)
Print["r = ", r]; 
Print["θ = ", θ];

The angle θ  can be any value for which the identities cos θ = (x/r) and cos θ = (y/r) hold true. Given  z ≠ 0, the collection of all values of  θ for which z  = r (cos θ  +  i sin θ) is denoted by arg z. Formally, we have:

Definition 1.10, (Argument, arg z),  Page 23.  If   z ≠ 0,  we denote arg z by  

			arg z  = {θ :  z = 
            r (cos θ  + i sin θ)}.  

If θ  ∈ arg z, we say that θ is an argument of z.

Notice that we write θ  ∈ arg z as opposed to θ  = arg z. This is because arg z is a set, and the designation θ  ∈ arg z indicates that θ is an element of that set. Notice, also,

	if (Subscript[θ, 1]) ∈arg z and (Subscript[θ, 2]) ∈arg z, then there exists some integer n such that  (Subscript[θ, 2])  =  (Subscript[θ, 1])  +  2  n π.

Example 1.8,  Page 24.  Since \(1 + i = \(\@2\) \((Cos[π\/4] + i\ Sin[π\/4])\)\), we have 

			arg (1 + i)={(π/4)+2n π: n an integer}.

Solution 1.8.

Enter several values arg (1 + i)={(π/4)+2n π: n an integer}.

Clear[z]; 
(Subscript[z, 1]) =  1 +  I; 
(Subscript[z, 2])  =  (Sqrt[2]) (E^(I π/4)); 
(Subscript[z, 3])  =  (Sqrt[2]) (E^(I 9 π/4)); 
(Subscript[z, 4])  =  (Sqrt[2]) (E^(- I 7 π/4)); 
(Subscript[z, 5])  =  (Sqrt[2]) (E^(I 17  π/4)); 
r = Abs[(Subscript[z, 1])]; 
θ = Arg[(Subscript[z, 1])]; 
(Subscript[V, 1])  =  
        Graphics[{Magenta, 
            Arrow[{0,  0}, {Re[(Subscript[z, 1])], Im[(Subscript[z, 1])]}]}]; 
Show[(Subscript[V, 1]), 
        PlotRange -> {{0, 1.1}, {0, 
              1.1}}, 
Ticks -> {Range[0, 2, (1/2)], 
            Range[0, 1, (1/2)]}, 
AspectRatio -> 1, 
        Axes -> True, 
        AxesLabel -> {"x", "y"}]; 
\(\(Print[\*""\!\(z\_1\) = "", z\_1];\)\ \)
Print["r = ", r]; 
Print["θ = ", θ]; 
\(\(Print[\*""(Subscript[z, 2]) = (Sqrt[2]) (E^("I" π/4))    = "", z\_2, " = ", 
        ComplexExpand[z\_2]];\)\ \)
\(\(Print[\*""(Subscript[z, 3]) = (Sqrt[2]) (E^("I" 13  π/4))  = "", z\_3, " = ", 
        ComplexExpand[z\_3]];\)\ \)
\(\(Print[\*""(Subscript[z, 4]) = (Sqrt[2]) (E^("-I" 11  π/4)) = "", z\_4, " = ", 
        ComplexExpand[z\_4]];\)\ \)
\(\(Print[\*""(Subscript[z, 5]) = (Sqrt[2]) (E^("I" 25  π/4))  = "", z\_5, " = ", 
        ComplexExpand[z\_5]];\)\ \)

Here is another way to look at it.

Clear[n, w]; 
w  =  (Sqrt[2]) (E^(I π/4 +  I 2  π n)); 
Print["w = ", w]; 
w  =  Simplify[w]; 
Print["w = ", w]; 
w  =  
        Simplify[w, Element[n, Integers]]; 
Print["w = ", w];

Mathematicians have agreed to single out a special choice of θ  ∈ arg z. It is that value of θ for which -π < θ ≤ π as the following definition indicates.

Definition 1.11, (The principal value of argument, Arg z),  Page 24.  If   z ≠ 0,  be a complex number.  We define Arg z by  

		Arg z  = θ, provided z  = r (cos θ  +  i sin θ) and -π < θ ≤ π.  

If θ  = Arg z, we call θ is the argument of z.

Example 1.9,  Page 24.  Arg (1 + i) = (π/4).

Solution 1.9.

z = 1 + I; 
θ = Arg[z]; 
Print["z = ", z]; 
Print["θ = Arg[z] = ", θ];

Remark. Clearly if z  = x + i y = 
          r (cos θ  +  i sin θ), where x ≠ 0, then  

			arg z  ⊂  arctan (y/x).  

We specifically identify arg z as a proper subset of arctan (y/x) because arctan θ has period π, whereas cos θ and sin θ  have period 2  π. In selecting the proper values for arg z, we must be careful in specifying the choices of arctan  (y/r) so that the point z associated with r and θ  lies in the appropriate quadrant.

Example 1.10,  Page 24.  Find several polar forms of  z = -(Sqrt[3]) + i.

Solution 1.10.

Enter  (Subscript[z, 1]) =  (Sqrt[3]) + i  and  (Subscript[z, 2]), (Subscript[z, 3]), (Subscript[z, 4]), (Subscript[z, 5]).

Clear[z]; 
(Subscript[z, 1]) =  -(Sqrt[3])  -  I; 
(Subscript[z, 2])  =  
        2 (E^(-I 5  π/6)); 
(Subscript[z, 3])  =  
        2 (E^(I 7  π/6)); 
(Subscript[z, 4])  =  
        2 (E^(- I 17 π/6)); 
(Subscript[z, 5])  =  
        2 (E^(I 19  π/6)); 
(Subscript[V, 1])  =  
        Graphics[{Magenta, 
            Arrow[{0,  0}, {Re[(Subscript[z, 1])], Im[(Subscript[z, 1])]}]}]; 
Show[(Subscript[V, 1]), 
        PlotRange -> {{-2, 0}, {-1, 
              1}}, 
Ticks -> {Range[-2, 2, (1/2)], 
            Range[((-1)/2), 1, 
              (1/2)]}, 
AspectRatio -> 1, 
        Axes -> True, 
        AxesLabel -> {"x", "y"}]; 
\(\(Print[\*""\!\(z\_1\) = "", z\_1];\)\ \)
\(\(Print[\*""(Subscript[z, 2]) = 2 (E^("-I" 5  π/6)) = "", z\_2, " = ", 
        ComplexExpand[z\_2]];\)\ \)
\(\(Print[\*""(Subscript[z, 3]) = 2 (E^("I" 7  π/6))  = "", 
        z\_3, " = ", ComplexExpand[z\_3]];\)\ \)
\(\(Print[\*""(Subscript[z, 4]) = 2 (E^("-I" 17  π/6)) = "", z\_4, " = ", 
        ComplexExpand[z\_4]];\)\ \)
\(\(Print[\*""(Subscript[z, 5]) = 2 (E^("I" 19  π/6))  = "", 
        z\_5, " = ", ComplexExpand[z\_5]];\)\ \)

Here is another way to look at it.

Clear[n, w]; 
w  =  
        2 (E^(-I 5  π/6 +  I 2  π n)); 
Print["w = ", w]; 
w  =  
        Simplify[w, Element[n, Integers]]; 
Print["w = ", w]; 
w  =  ComplexExpand[w]; 
Print["w = ", w];

Example 1.11,  Page 25.  If  z = x + i y = 0 + 4  i, it would be a mistake to attempt to find arg z by looking at arctan (y/x), as x=0, so (y/x) is undefined. If z ≠ 0 is on the y-axis, then  

			Arg z = (π/2)  if ({{Im z, <}})0, and 
			Arg z  =  ((-π)/2) if ({{Im z, <}})0.  

In this case Arg (4 i) = (π/2), and arg (4  i)={(π/2)+2n π: n is an integer}.

As we shall see in Chapter 2, Arg z  is a discontinuous function of z because it "jumps'' by an amount of 2  π as z crosses the negative real axis.
	In Chapter 5 we will define (e^z) for any complex number z. You will see that this complex exponential has all the properties of real exponentials that you studied in earlier mathematics courses. That is, \(\(e\^z\_1\) e\^z\_2 = e\^\(z\_1 + z\_2\)\), and so forth. You will also see, amazingly, that if z=x+iy, then  
			\(e\^z = \(e\^\(x + i\ y\) = \(e\^x\) \((cos\ y\  + \ i\ sin\ y)\)\)\).  

	We will use these facts freely from now on, and will prove the validity of our actions when we get to Chapter 5. If we set x=0 and let θ take the role of y in the above equation, we get a famous result known as Euler Formula: 

			(e^i)θ =  cos θ  +  
            i sin θ = (cos θ , sin θ).  

If θ is a real number, (e^i)θ will be located somewhere on the circle with radius 1 centered at the origin. This is easy to verify since  

			\(\(\(|\)\(e\^iθ\)\(|\)\) = \ \(\@\(cos\^2\ θ\  + \ sin\^2\ θ\) = 1\)\).  

Notice that when θ = π, we get (e^i)π = (cos π , 
            sin π) = (-1 , 0) = -1, so

			(e^i)π + 1 = 0.

Euler was the first to discover this relationship;  it is referred to as Euler's identity. It has been labeled by many as the most amazing relation in analysis, and with good reason. Symbols with a rich history are miraculously woven together---the constant π, used by Hippocrates as early as 400 B.C.;  e the base of the natural logarithms;  the basic concepts of addition + and equality =;  the foundational whole numbers 0 and 1;  and i, the number that is the central focus of this book.
	
	Euler's formula is of tremendous use in establishing important algebraic and geometric properties of complex numbers. You will see shortly that it enables us to multiply complex numbers with great ease. It also allows us to express a polar form of the complex number z in a more compact way. Recall that if r=| z| and  θ  ∈ arg z, then  z  = r (cos θ  +  i sin θ). Using Euler's formula we can now write z in its Exponential Form:  
	
			z = r (e^i)θ.

Example 1.12,  Page 19.  In a previous example we investigated the polar form of  z = - (Sqrt[3]) - i.  Now we have z = 2 (e^(i (-5 π/6))).

Solution 1.12.

Enter  z = - (Sqrt[3]) - i  and compute  (Subscript[z, 1])  and  (Subscript[z, 2]).

Clear[e, θ, r, z]; 
z  =  - (Sqrt[3])  -  I; 
r  =  Abs[z]; 
θ = Arg[z]; 
Z = 
        r (Cos[θ]  +  I Sin[θ]); 
V  =  
        Graphics[{Purple, Arrow[{0,  0}, {Re[z], Im[z]}]}]; 
Show[V, 
        PlotRange -> {{-2, 0}, {-1, 
              0}}, 
Ticks -> {Range[-2, 0, (1/2)], 
            Range[-1, 0, (1/2)]}, 
AspectRatio -> 
          (1/2), Axes -> True, 
        AxesLabel -> {"x", "y"}]; 
Print["z = ", z]; 
Print["r = |z| = ", r]; 
Print["θ = Arg[z] = ", θ]; 
\(\(Print[\*""Z = r \!\(e\^"iθ"\)""\ ];\)\ \)
Print["  = ", r, " ", 
        (e^(i θ))]; 
Print["  = ", Z ]; 
Print["  = ", ComplexExpand[Z] ];

Together with the rules for exponentiation that we will verify in Chapter 5, the exponential form has interesting applications. 
	
If (Subscript[z, 1]) = (Subscript[r, 1]) (e^i)(Subscript[θ, 1]) and (Subscript[z, 2]) = (Subscript[r, 2]) (e^i)(Subscript[θ, 2]), then  

	\(\(z\_1\) 
          z\_2 = \(\(\(r\_1\) \(e\^iθ\_1\) \(r\_2\) e\^iθ\_2\)\(=\)\(\ \)\)\)\(\(\(\(r\_1\) \(r\_2\) e\^\(i \((θ\_1 + θ\_2)\)\)\)\(=\)\(\ \)\)\)\(\(r\_1\) \(r\_2\) \((cos \((θ\_1 + θ\_2)\) + i\ sin \((θ\_1 + θ\_2)\))\)\).  

	We have already seen that the modulus of the product is the product of the moduli;  that is, |(Subscript[z, 1]) (Subscript[z, 2])| = |(Subscript[z, 1]) || (Subscript[z, 2])|. The above identity establishes that an argument of (Subscript[z, 1]) (Subscript[z, 2]) is an argument of (Subscript[z, 1]) plus an argument of (Subscript[z, 2]). It also answers the question posed at the end of Section 1.3 regarding why the product (Subscript[z, 1]) (Subscript[z, 2]) was in a different quadrant than either (Subscript[z, 1]) or (Subscript[z, 2]). It further offers an interesting explanation as to why the product of two negative real numbers is a positive real number. The negative numbers, each of which has an angular displacement of π radians, combine to produce a product that is rotated to a point with an argument of π + π = 2  π radians, coinciding with the positive real axis.
	
	Using exponential form, if z ≠ 0, we can write  arg z,  a little more compactly as 

			arg z  =  {θ :  z = 
            r (e^i)θ}.  

This enables us to see a nice relationship between the sets arg ((Subscript[z, 1]) (Subscript[z, 2])), arg ((Subscript[z, 1])), and arg ((Subscript[z, 2])).

Theorem 1.3,  Page 27.  If (Subscript[z, 1]) = (Subscript[r, 1]) (e^i)(Subscript[θ, 1]) ≠ 
          0 and (Subscript[z, 2]) = (Subscript[r, 2]) (e^i)(Subscript[θ, 2]) ≠ 
          0, then as sets,

			arg ((Subscript[z, 1]) (Subscript[z, 2])) = arg ((Subscript[z, 1])) + arg ((Subscript[z, 2])).

Using the exponential form,z = r (e^i)θ, we see that 

			(z^(-1)) = (1/z) = (1/(r (e^i)θ)) = (1/r) 
              (e^(-iθ)).  

In other words,

			\(z\^\(-1\) = \(\(1\/r\)[
            cos \((\(-θ\))\) + i\ sin\ \((\(-θ\))\)] = \(1\/r\) e\^\(-iθ\)\)\).  

Recalling that cos (-θ) = cos (θ) and sin (-θ) = -sin (θ), we also have  

		\(\(\(z\)\(\ \)\)\&_\  = \ \(\(r \((cos\ θ\  - \ i\ sin\ θ)\)\)\(=\)\(\ \)\)\)\(r[
          cos\ \((\(-θ\))\)\  + \ i\ sin \((\(-\ θ\))\)] = r\ e\^\(-iθ\)\),
	and
  		\(z\_1\/z\_2 = \(\(r\_1\/r\_2\)[
            cos\ \((θ\_1 - θ\_2)\)\  + \ i\ sin \((θ\_1 - θ\_2)\)] = \(r\_1\/r\_2\) 
            e\^\(\(-i\) \((θ\_1 - θ\_2)\)\)\)\).

Example 1.13,  Page 28.  Given  z = 1 + i,  compute  (1/z).

Solution 1.13.

Enter  z  =  1  + i  and compute (1/z).

Clear[r, w, z]; 
z  =  1 + I; 
r  =  Abs[z]; 
(Subscript[z, 1])  =  Conjugate[z]; 
(Subscript[z, 2])  =  Conjugate[z]/r; 
(Subscript[z, 3])  =  (1/r) Conjugate[z]/r; 
w = ComplexExpand[(1/z)]; 
(Subscript[V, 1])  =  
        Graphics[{Red, Arrow[{0,  0}, {Re[z], Im[z]}]}]; 
(Subscript[V, 2])  =  
        Graphics[{Blue, Arrow[{0,  0}, {Re[w], Im[w]}]}]; 
g1 = 
        Show[(Subscript[V, 1]), 
          PlotRange -> {{-0.1, 1.1}, {-0.1, 
                1.1}}, 
Ticks -> {Range[0, 5, 1], 
              Range[0, 12, 1]}, 
AspectRatio -> 1, 
          Axes -> True, 
          AxesLabel -> {"x", "y"}]; 
g2 = 
        Show[(Subscript[V, 2]), 
          PlotRange -> {{-0.1, 1.1}, {-1.1, 
                0.1}}, 
Ticks -> {Range[0, 1, (1/2)], 
              Range[-1, 0, (1/2)]}, 
AspectRatio -> 
            1, Axes -> True, 
          AxesLabel -> {"x", "y"}]; 
Print["z = ", z]; 
Print["r = |z| = ", r]; 
Print[""]; 
\(\(Print[\*""\!\(z\&_\) = "", z\_1];\)\ \)
\(\(Print[\*""\!\(z\&_\/r\) = "", 
        z\_2];\)\ \)
Print[""]; 
\(\(Print[\*""  \!\(1\/z\) = "", 
        1\/z];\)\ \)
\(\(Print[\*""\!\(1\/r\)\!\(z\&_\/r\) = "", 
        z\_3];\)\ \)
Print[""]; 
\(\(Print[\*""Is \!\(1\/z\) =  \!\(1\/r\)\!\(z\&_\/r\) ?  "", 
        1\/z\  == \ 
          1\/r\ Conjugate[z]\/r];\)\ \)

Example 1.14,  Page 29.  Given  (Subscript[z, 1]) = 8  i  and  (Subscript[z, 2]) = 
          1 + i (Sqrt[3]),  compute  ((Subscript[z, 1])/(Subscript[z, 2]))  using polar computations.

Solution 1.14.

Enter  (Subscript[z, 1]) = 8  i  and  (Subscript[z, 2]) = 
          1 + i (Sqrt[3])   and compute ((Subscript[z, 1])/(Subscript[z, 2])).

Clear[θ, r, w, z]; 
(Subscript[z, 1]) = 8  I; 
(Subscript[z, 2]) = 1 + I (Sqrt[3]); 
(Subscript[w, 3]) = ComplexExpand[((Subscript[z, 1])/(Subscript[z, 2]))]; 
v1  =  
        Graphics[{Red, Arrow[{0,  0}, {Re[(Subscript[z, 1])], Im[(Subscript[z, 1])]}]}]; 
v2  =  
        Graphics[{Green, Arrow[{0, 0}, {Re[(Subscript[z, 2])], Im[(Subscript[z, 2])]}]}]; 
v3  =  
        Graphics[{Blue, 
            Arrow[{0,  0}, {Re[(Subscript[w, 3])], Im[(Subscript[w, 3])]}]}]; 
Show[v1, v2, v3, 
        PlotRange -> {{-0.5, 3.5}, {-0.5, 
              8.5}}, 
Ticks -> {Range[0, 3, 1], 
            Range[0, 8, 1]}, 
AspectRatio -> (9/4), 
        Axes -> True, 
        AxesLabel -> {"x", "y"}]; 
\(\(Print[\*""\!\(z\_1\) = ""\ , \ 
        z\_1, \*"",  \!\(z\_2\) = ""\ , \ z\_2];\)\ \)
\(\(Print[\*""\!\(z\_1\/z\_2\) = ""\ , \ 
        w\_3];\)\ \)
Print[" "]; 
(Subscript[r, 1]) = Abs[(Subscript[z, 1])]; 
(Subscript[θ, 1]) = Arg[(Subscript[z, 1])]; 
\(\(Print[\*""\!\(z\_1\) = "", z\_1];\)\ \)
\(\(Print[\*""\!\(r\_1\) = |\!\(z\_1\)| = "", r\_1];\)\ \)
\(\(Print[\*""(Subscript[θ, 1]) = Arg[(Subscript[z, 1])] = "", θ\_1];\)\ \)
(Subscript[r, 2]) = Abs[(Subscript[z, 2])]; 
(Subscript[θ, 2]) = Arg[(Subscript[z, 2])]; 
\(\(Print[\*""\!\(z\_2\) = "", z\_2];\)\ \)
\(\(Print[\*""\!\(r\_2\) = |\!\(z\_2\)| = "", r\_2];\)\ \)
\(\(Print[\*""(Subscript[θ, 2]) = Arg[(Subscript[z, 2])] = "", θ\_2];\)\ \)
(Subscript[w, 1]) = ((Subscript[z, 1])/(Subscript[z, 2])); 
(Subscript[w, 2]) = 
        ((Subscript[r, 1])/(Subscript[r, 2])) (E^(I ((Subscript[θ, 1]) - (Subscript[θ, 2])))); 
Print[" "]; 
\(\(Print[\*""\!\(z\_1\/z\_2\) = "", w\_1];\)\ \)
\(\(Print[\*""((Subscript[r, 1])/(Subscript[r, 2]))(E^(I ((Subscript[θ, 1]) - (Subscript[θ, 2])))) = "", w\_2];\)\ \)
Print[""]; 
\(\(Print[\*""\!\(z\_1\/z\_2\) = "", 
        ComplexExpand[w\_1]];\)\ \)
\(\(Print[\*""((Subscript[r, 1])/(Subscript[r, 2]))(E^(I ((Subscript[θ, 1]) - (Subscript[θ, 2])))) = "", 
        ComplexExpand[w\_2]];\)\ \)
\(\(Print[\*""Is ((Subscript[z, 1])/(Subscript[z, 2])) = ((Subscript[r, 1])/(Subscript[r, 2]))(E^(I ((Subscript[θ, 1]) - (Subscript[θ, 2])))) ?  "", 
ComplexExpand[
            z\_1\/z\_2]\  == \ 
          ComplexExpand[
            r\_1\/r\_2\ E\^\(I \((θ\_1 - θ\_2)\)\)]];\)\ \)

Section 1.4  Exercises for The Geometry of Complex Numbers, Continued.
See textbook page 29.

Section 1.5	The Algebra of Complex Numbers, Revisited

Section 1.6	The Topology of Complex Numbers

GO TO  THE  Table of Contents