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

Section 1.5  The Algebra of Complex Numbers, Revisited

The real numbers are deficient in the sense that not all algebraic operations on them produce real numbers. Thus, for (Sqrt[-1]) to make sense, we must lift our sights to the domain of complex numbers. Do complex numbers have this same deficiency? That is, if we are to make sense out of expressions like (Sqrt[1 + i]), must we appeal to yet another new number system? The answer to this question is no. It turns out that any reasonable algebraic operation we perform on complex numbers gives us complex numbers. In this respect, we say that the complex numbers are complete. Later we will learn how to evaluate intriguing algebraic expressions such as (((-1))^i). For now we will be content to study integral powers and roots of complex numbers.
	
	The important players in this regard are the exponential and polar forms of a non-zero complex number   z = r (e^i)θ = 
          r (cos θ  +  i sin θ). By the laws of exponents (which, you recall, we have promised to prove in Chapter 5) we have  

			\(z\^n = \(\((r\ e\^\(i\ θ\))\)\^n = \(r\^n\) e\^\(i\ n\ θ\)\)\)\(\(\(\ \)\(\(=\)\(\(r\^n\)[
          cos\ \((nθ)\)\  + \ i\ sin\ \((nθ)\)]\)\)\)\),  
		and
			\(z\^\(-n\) = \(\((r\ e\^\(i\ θ\))\)\^\(-n\) = \(\(r\^\(-n\)\) e\^\(i\ n\ θ\) = \(r\^\(-n\)\)[
              cos\ \((\(-nθ\))\)\  + \ i\ sin\ \((\(-nθ\))\)]\)\)\).

Example 1.15,  Page 31.  Show that  (((-(Sqrt[3]) - i))^3) = -8 i  in two ways.

Solution 1.15.

Enter  z  = - (Sqrt[3]) - i  and compute  (((-(Sqrt[3]) - i))^3).

Clear[e, θ, r, z, Z]; 
z  =  - (Sqrt[3])  -  I; 
r  =  Abs[z]; 
θ  =  Arg[z]; 
Z  =  
        ComplexExpand[
          r (E^(I θ))]; 
(Subscript[V, 1])  =  
        Graphics[{Blue, 
            Arrow[{0,  0}, {Re[z], Im[z]}]}]; 
(Subscript[V, 2])  =  
        Graphics[{Magenta, 
            Arrow[{0,  0}, {Re[(z^3)], Im[(z^3)]}]}]; 
Show[(Subscript[V, 1]), (Subscript[V, 2]), 
        PlotRange -> {{-2, 0.5}, {-8, 
              0.5}}, 
Ticks -> {Range[-2, 0, 1], 
            Range[-8, 0, 1]}, 
AspectRatio -> 
          (8.5/2.5), Axes -> True, 
        AxesLabel -> {"x", "y"}]; 
Print["z = ", z]; 
Print["r = |z| = ", r]; 
Print["θ = Arg[z] = ", θ]; 
\(\(Print[\*""z = r(E^I)θ = "", r, e\^\(I\ θ\)];\)\ \)
\(\(Print[\*""z = r(E^I)θ = "", Z];\)\ \)
Print[" "]; 
\(\(Print[\*""\!\(z\^3\) = "", \ 
        z\^3];\)\ \)
\(\(Print[\*""\!\(z\^3\) = ("", \ z, ")", 
        z\^2];\)\ \)
\(\(Print[\*""\!\(z\^3\) = ("", \ z, ")", "(", 
        Expand[z\^2], ")"];\)\ \)
\(\(Print[\*""\!\(z\^3\) = "", \ 
        Expand[z\^3]];\)\ \)
Print[" "]; 
\(\(Print[\*""(z^3) = (r^3)(E^I)3θ = "", \ r\^3\ , 
        e\^\(I\ 3  θ\)];\)\ \)
\(\(Print[\*""(z^3) = (r^3)(E^I)3θ = "", \ 
        r\^3\ E\^\(I\ 3\ θ\)];\)\ \)

Which method would you use if you were asked to compute (((-(Sqrt[3]) - i))^30)?

Example 1.16,  Page 32.  Evaluate  (((-(Sqrt[3]) - i))^30).

Solution 1.16.

Enter  z  = - (Sqrt[3]) - i  and compute  (((-(Sqrt[3]) - i))^30).

Clear[e, θ, r, z, Z]; 
z  =  - (Sqrt[3])  -  I; 
r  =  Abs[z]; 
θ  =  Arg[z]; 
Z  =  
        ComplexExpand[
          r (E^(I θ))]; 
Print["z = ", z]; 
Print["r = |z| = ", r]; 
Print["θ = Arg[z] = ", θ]; 
\(\(Print[\*""z = r(E^I)θ = "", r, e\^\(I\ θ\)];\)\ \)
\(\(Print[\*""z = r(E^I)θ = "", Z];\)\ \)
Print[" "]; 
\(\(Print[\*""(z^30) = (r^30)(E^I)30θ = "", \ r\^30\ , 
        e\^\(I\ 30  θ\)];\)\ \)
\(\(Print[\*""(z^30) = (r^30)(E^I)30θ = "", \ 
        r\^30\ E\^\(I\ 30\ θ\)];\)\ \)
Print[" "]; 
\(\(Print[\*""\!\(z\^30\) = "", \ 
        z\^30];\)\ \)
\(\(Print[\*""\!\(z\^30\) = "", \ 
        Expand[\((\(-\ \@3\)\  - \ i)\)\^30]];\)\ \)
\(\(Print[\*""\!\(z\^30\) = "", \ 
        Expand[z\^30]];\)\ \)

Extra Example for Page 32.  Evaluate  (((-(Sqrt[3]) - i))^(-6)) = ((- 1)/64)  in two ways.

Solution for Page 32.

Enter  z = - (Sqrt[3]) - i  and compute (((-(Sqrt[3]) - i))^(-6)).

Clear[e, θ, r, z, Z]; 
z  = - (Sqrt[3])  -  I; 
r  =  Abs[z]; 
θ  =  Arg[z]; 
Z  =  
        ComplexExpand[
          r (E^(I θ))]; 
(Subscript[V, 1])  =  
        Graphics[{Blue, Arrow[{0,  0}, {Re[z], Im[z]}]}]; 
(Subscript[V, 2])  =  
        Graphics[{Magenta, 
            Arrow[{0,  0}, {Re[(z^(-6))], Im[(z^(-6))]}]}]; 
Show[(Subscript[V, 1]), 
        PlotRange -> {{-2, 0.1}, {-1, 
              0.05}}, 
Ticks -> {Range[-(Sqrt[3]), 
              0, (Sqrt[3])], 
            Range[-8, 0, 1]}, 
AspectRatio -> 
          (1/2), Axes -> True, 
        AxesLabel -> {"x", "y"}]; 
Print["z = ", z]; 
Show[(Subscript[V, 2]), 
        PlotRange -> {{-0.05, 0.01}, {-0.03, 
              0.03}}, 
Ticks -> {Range[((-3)/64), 0, 
              (1/64)], Range[((-2)/100), (2/100), 
              (1/100)]}, 
AspectRatio -> 1, 
        Axes -> True, 
        AxesLabel -> {"u", "v"}]; 
\(\(Print[\*""\!\(z\^\(-6\)\) = "", \ 
        ExpandAll[z\^\(-6\)]];\)\ \)
Print[""]; 
Print["z = ", z]; 
Print["r = |z| = ", r]; 
Print["θ = Arg[z] = ", θ]; 
\(\(Print[\*""z = r(E^I)θ = "", r, e\^\(I\ θ\)];\)\ \)
\(\(Print[\*""z = r(E^I)θ = "", Z];\)\ \)
\(\(Print[\*""\!\(z\^6\) = "", z\^6, " = ", 
        Expand[z\^6]];\)\ \)
Print[" "]; 
\(\(Print[\*""\!\(z\^\(-6\)\) = "", \ 
        Expand[z\^\(-6\)], \ " = "\ , \ 
        ExpandAll[z\^\(-6\)]];\)\ \)
Print[" "]; 
\(\(Print[\*""(z^(-6)) = (r^(-6))(E^(-I6θ)) = "", \ 
        r\^\(-6\)\ , 
        e\^\(\(-I\)\ 6\ θ\)];\)\ \)
\(\(Print[\*""(z^(-6)) = (r^(-6))(E^(-I6θ)) = "", \ 
        r\^\(-6\)\ E\^\(\(-I\)\ 6\ θ\)];\)\ \)

An interesting application of the laws of exponents comes from putting the equation \(\((e\^\(i\ θ\))\)\^n = e\^\(i\ n\ θ\)\) into its polar form. This gives  

			(((cos θ  + i sin θ))^n)  =  
        cos (n θ)  + i sin (n θ), 
	
	which is known as De Moivre's Formula, in honor of the French mathematician Abraham de Moivre (1667--1754).

Example 1.17,  Page 32.  Use DeMoivre's formula to establish the trigonometric identity cos (5 θ) = (cos^5) (θ) - 
          10 (cos^3) (θ) (sin^2) (θ) + 
          5 cos[θ] (θ) (sin^4) (θ).  

Furthermore, we establish the trigonometric identity 
Sin[5 θ] = 
        5 Cos[θ]^4 Sin[θ] - 
          10 Cos[θ]^2 Sin[θ]^3 + Sin[θ]^5.

Solution 1.17.

Enter  (Subscript[z, 1]) = Cos[n θ] + i Sin[n θ]  and compute  (((Cos[θ]  +  i Sin[θ]))^n).

Clear[θ, z]; 
Clear[n]; 
n = 5; 
(Subscript[z, 1]) = 
        Cos[n θ] + I Sin[n θ]; 
(Subscript[z, 2])  =  (((Cos[θ]  +  I Sin[θ]))^n); 
(Subscript[z, 3])  =  ComplexExpand[(Subscript[z, 2])]; 
Print[(Subscript[z, 1]), " = ", (Subscript[z, 2])]; 
Print[" "]; 
Print[(Subscript[z, 1]), " = ", (Subscript[z, 3])]; 
Print[""]; 
Print["Take the real part of both sides and obtain"]; 
Print[""]; 
Print[
        ComplexExpand[Re[(Subscript[z, 1])]]  ==  
          ComplexExpand[Re[(Subscript[z, 3])]]]; 
Print[""]; 
Print["Take the imaginary part of both sides and obtain"]; 
Print[""]; 
Print[
        ComplexExpand[Im[(Subscript[z, 1])]]  ==  
          ComplexExpand[Im[(Subscript[z, 3])]]];

A key ingredient in determining roots of complex numbers turns out to be a corollary to the Fundamental Theorem of Algebra. We will prove the theorem in Chapter 6. Our proofs must be independent of conclusions we derive here since we are going to make use of the corollary now:

Theorem 1.4  (Corollary to the Fundamental Theorem of Algebra),  Page 32.  If  P(z)  is a polynomial of degree n  (n>0)  with complex coefficients, then the equation  P(z) = 0  has precisely  n  (not necessarily distinct) solutions.

Proof of Corollary 1.1, see text Page 206.

Example 1.18,  Page 33.  Factor the polynomial  P (z) = 
        (z^3) + (2 - 2  i) (z^2) + (-1 - 
                4  i) z - 2, and find its zeros.

Solution 1.18.

Enter the polynomial  P[z] = 
        (z^3) + (2 - 2  i) (z^2) + (-1 - 
                4  i) z - 2  and factor it.

Clear[P, z]; 
P[z_]  =  
        (z^3)  +  (2 - 2  I) (z^2)  +  (-1 - 
                4  I) z  -  
          2; 
solset = Solve[P[z] == 0, z]; 
Print["P[z] = ", P[z]]; 
Print["P[z] = ", Factor[P[z]]]; 
Print[" "]; 
Print["And we can find the roots of P[z]"]; 
Print["Solve ", P[z] , " = 0"]; 
Print[solset]; 
\(\(Print[\*""(Subscript[z, 1]) = "", 
        solset\_\(\([[\)\(1, 1, 2\)\(]]\)\)];\)\ \)
\(\(Print[\*""(Subscript[z, 2]) = "", 
        solset\_\(\([[\)\(2, 1, 2\)\(]]\)\)];\)\ \)
\(\(Print[\*""(Subscript[z, 3]) = "", 
        solset\_\(\([[\)\(3, 1, 2\)\(]]\)\)];\)\ \)

The corollary implies that if we can find n distinct solutions to the equation (z^n) = c  (or (z^n) - c = 0) , we will have found all the solutions. We begin our search for these solutions by looking at the simpler equation (z^n) = 1. You will soon see that solving this equation will enable us to handle the more general one quite easily.

The n solutions to  (z^n) = 1  are can be expressed as  

	(Subscript[z, k])=(e^(i 2  π k/n))\(\(\(\ \)\(\(=\)\(cos \( 2\ π\ k\)\/n + i\ sin \( 2\ π\ k\)\/n\)\)\)\)  for  k = 0, 1, ⋯, n - 1.

Definition 1.9 (nth Root of Unity),  Page 33.  For any natural number n, the value (Subscript[ω, n]) given by  

			(Subscript[ω, n])=(e^(i2 π/n))=\(cos \( 2\ π\)\/n + i\ sin \( 2\ π\)\/n\)

is called the primitive nth root of unity.

By De Moivre's formula, the (n^th) roots of unity can be expressed as  

			\(1, ω\_n, ω\_n\%2, ω\_n\%3,  ... , ω\_n\%\(n - 1\)\).  

Geometrically, the (n^th) roots of unity are equally spaced points that lie on the unit circle (Subscript[C, 1]) (0) = {z :  |z| = 1} and form the vertices of a regular polygon with n sides.

Example 1.19,  Page 34.  Find all the solutions to the equation  (z^8) = 1.

Solution 1.19.

Enter the polynomial  P[z] = (z^8) - 1  and find its zeros.

Clear[k, list, set, solset, values, xx, yy, 
        z]; 
P[z_]  =  (z^8)  -  1 ; 
solset = Solve[P[z] == 0, z]; 
values  =  
        solset[[Table[k, {k, Length[solset]}], 1, 2]]; 
set  =  
        N[solset[[Table[k, {k, Length[solset]}], 1, 2]]]; 
set  =   ReplaceAll[set, xx_Real -> {xx, 0}]; 
list  =   ReplaceAll[set, 
          Complex[xx_, yy_] -> {xx, yy}]; 
\(\(ListPlot[list, 
        Prolog -> {PointSize[0.03], 
            Green}, 
AspectRatio -> 1, 
        AxesLabel -> {"x", "y"}, 
Ticks -> {{\(-1\), \(-1\)\/\@2, 1\/\@2, 1}, {\(-1\), \(-1\)\/\@2, 1\/\@2, 
              1}}, 
PlotRange -> {{\(-1.1\), 
              1.1}, {\(-1.1\), 1.1}}];\)\ \)
Print["P[z] = ", P[z]]; 
Print["Solve ", P[z] == 0]; 
Print[""]; 
\(\(Print[\*""The roots of  \!\(z\^8\) = 1  are""];\)\ \)
\(\(Print[\*""\!\(1\^\(1\/8\)\) = "", 
        values];\)\ \)
Print[""]; 
Print["The expanded form of the roots are"]; 
\(\(Print[\*""\!\(1\^\(1\/8\)\) = "", 
        ComplexExpand[values]];\)\ \)

Example 1.20,  Page 35.  Find all the cube roots of  8  i,  i.e. find all solutions to the equation  (z^3) = 8  i.

Solution 1.20.

Enter the polynomial  P[z] = (z^3) - 8  i  and find its zeros.

Clear[k, list, set, solset, values, xx, yy, 
        z]; 
P[z_]  =  (z^3) - 8  I ; 
solset = Solve[P[z] == 0, z]; 
values  =  
        solset[[Table[k, {k, Length[solset]}], 1, 2]]; 
set  =  
        N[solset[[Table[k, {k, Length[solset]}], 1, 2]]]; 
set  =  ReplaceAll[set, xx_Real -> {xx, 0}]; 
list  =   ReplaceAll[set, 
          Complex[xx_, yy_] -> {xx, yy}]; 
\(\(ListPlot[list, 
        Prolog -> {PointSize[0.03], 
            Orange}, 
AspectRatio -> 1, 
        AxesLabel -> {"x", "y"}, 
Ticks -> {{\(-\@3\), \(-1\), 1, \@3}, 
            Range[\(-2\), 2, 
              1]}, 
PlotRange -> {{\(-2.1\), 
              2.1}, {\(-2.1\), 2.1}}];\)\ \)
Print["P[z] = ", P[z]]; 
Print["Solve ", P[z] == 0]; 
Print[""]; 
Print["The cube roots of  8\[ImaginaryI]  are"]; 
\(\(Print[\*""(8I\!\(\()\^\(1\/3\)\)\) = "", 
        values];\)\ \)
Print[""]; 
Print["The expanded form of the cube roots are"]; 
\(\(Print[\*""(8I\!\(\()\^\(1\/3\)\)\) = "", 
        ComplexExpand[values]];\)\ \)

Theorem 1.5  (Quadratic Formula), Page 36.  If a (z^2) +  b z  +  c  =   0, then the solution set for z is 

			\({z -> \(\(-b\)\  + \ \((b\^2 - 4\ a\ c)\)\^\(1/2\)\)\/\(2\ a\)}\),  

where by  ((((b^2) - 4 a c))^(1/2)) we mean all distinct square roots of the number inside the radical.

Proof of Theorem 1.5. The proof is left as an exercise.

Example 1.21,  Page 36.  Find all solutions to the equation (z^2) + (1 + i) z + 5  i = 0.

Solution 1.21.

Enter the polynomial  P[z] = (z^2) + (1 + i) z + 5  i  and find its zeros.

Clear[k, list, set, solset, values, xx, yy, 
        z]; 
P[z_]  =  
        (z^2) + (1 + I) z + 
          5  I ; 
solset = Solve[P[z] == 0, z]; 
values  =  
        solset[[Table[k, {k, Length[solset]}], 1, 2]]; 
set  =  
        N[solset[[Table[k, {k, Length[solset]}], 1, 2]]]; 
set  =  ReplaceAll[set, xx_Real -> {xx, 0}]; 
list  =   ReplaceAll[set, 
          Complex[xx_, yy_] -> {xx, yy}]; 
\(\(ListPlot[list, 
        Prolog -> {PointSize[0.03], 
            Orange}, 
AspectRatio -> 1, 
        AxesLabel -> {"x", "y"}, 
Ticks -> {{\(-\@3\), \(-1\), 1, \@3}, 
            Range[\(-2\), 2, 
              1]}, 
PlotRange -> {{\(-2.1\), 
              2.1}, {\(-2.1\), 2.1}}];\)\ \)
Print["P[z] = ", P[z]]; 
Print["Solve ", P[z] == 0]; 
Print[""]; 
Print["The solution set is "]; 
Print[values];

Library Research Experience for Undergraduates

Project I. Write a report on quaternions.

1. Altmann, Simon L., (1989), ''Hamilton, Rodrigues, and the Quaternion Scandal,'' Math. Mag., V. 62, No. 5., pp. 291-307.

2. Deavours, C. A., ''The Quaternion Calculus,'' Am. Math. M., Vol. 80, No. 9. (Nov., 1973), pp. 995-1008, Jstor.   

3. McAllister, Byron L., (1989), ''A Quick Introduction to Quaternions,'' Pi Mu Epsilon J., V. 9, No. 1, pp. 23-25.

4. Van Der Waerden, B. L., (1976), ''Hamilton's Discovery of Quaternions,'' Math. Mag., V. 49, No. 5, pp. 227-234.

Project II. Write a report on complex roots of polynomials.

1. Ballantine, J. P., ''Complex Roots of Real Polynomials (in Classroom Notes),'' Am. Math. M., Vol. 66, No. 5. (May, 1959), pp. 411-414, Jstor.   

2. Denton, Brian, (1985), ''Roots of unity revisited!'' The Math. Gazette, V. 69, No. 447, pp. 17-20.

3. Farnsworth, David, (1983), ''Measuring Complex Roots,'' Math. and Comp. Ed., V. 17, No. 3, pp. 191-194.

4. Gehman, H. M. ''Complex Roots of a Polynomial Equation,'' Am. Math. M., Vol. 48, No. 4. (Apr., 1941), pp. 237-239, Jstor.   

5. Gomez-Calderon, Javier and David M. Wells, ''Why Polynomials Have Roots,'' The College Math. J., Vol. 27, No. 2, March 1996.

6. Henriquez, Garcia, ''The Graphical Interpretation of the Complex Roots of Cubic Equations (in Questions, Discussions, and Notes),'' Am. Math. M., Vol. 42, No. 6. (Jun. - Jul., 1935), pp. 383-384., Jstor.   

7. Kim, David and Robert Travers, (1982), ''Those elusive imaginary zeros,'' The Math. Teach., V. 75, pp. 62-64.

8. Kowalski, Robert and Helen Skala, (1990), ''Determining Roots of Complex Functions with Computer Graphics,'' Coll. Micro., V. VIII, No.1, pp. 51-54.

9. Long, Cliff and Thomas Hern, (1989), ''Graphing the Complex Zeros of Polynomials Using Modulus Surfaces,'' Coll. Math. J., V. 20, No. 2, pp. 98-105.

10. Long, Cliff, (1971), ''A note on the Geometry of Zeros of Polynomials,'' Math. Mag., V. 44, pp. 157-159.

11. Norton, Alec and Benjamin Lotto, (1984), ''Complex Roots Made Visible,'' Coll. Math. J., V. 15, No. 3, pp. 248-249.

12. Renka, Robert J. and Floyd Vest, (1988), ''Graphical Representation of Complex Function,'' Math. and Comp. Ed., V. 22, No. 1, pp. 33-45.

13. Vest, Floyd, (1985), ''Graphing the Complex Roots of a Quadratic Equation,'' Coll. Math. J., V. 16, No. 4, pp. 257-261.

14. Ward, James A., (1937), ''Graphical Representation of Complex Roots,'' Math. Mag., Vol. 11 , pp. 297-303.

Section 1.5  Exercises for The Algebra of Complex Numbers, Revisited.
See textbook page 37.

Section 1.6	The Topology of Complex Numbers

GO TO  THE  Table of Contents