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 5  ELEMENTARY FUNCTIONS

Needs["Graphics`ComplexMap`"];  
Needs["Graphics`Colors`"];  
a = b = d = t = u = v = w = x = y = z = Z = 
                            0;  
Clear[a, b, cos, cosZ, d, eq1, eq2, f, f2, n, r, set, sin, S, S12, 
        S13, t, t1, t2, table, θ, u, U, v, v1, v2, v3, v4, v5, v6, V, 
        w, w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, x, x1, x2, y, y1, y2, z, 
        z0, z1, z2, z3, z4, zn, Z];

Section 5.1  The Complex Exponential Function

How should complex-valued functions such as  (e^z), log (z),  sin (z), etc., be defined ?  Clearly, any responsible definition should satisfy the following criteria:  

(i)  The functions so defined must give the same values as the corresponding function for real variables when the number  z  is a real number.  

(ii)  As far as possible, the properties of these new functions must correspond with their real counterparts.  For example, we would want  \(\(e\^z\_1\) e\^z\_2 = \ e\^\(z\_1 + z\_2\)\)  to be valid regardless of whether  z  were real or complex. 

	These requirements may seem like a tall order to fill.  There is a procedure, however that offers promising results.  It is to put in complex form the expansion of the real functions  (e^x), ln (x),  sin (x), etc., as power series into complex form. This will be our strategy for the next few sections.

Recall that the real exponential function can be represented by the power series (e^x)  =  (∑_(n = 0)^∞) (1/(n!)) 
            (x^n). Thus it is only natural to define the complex exponential (e^z), also written as exp (z), in the following way:

Definition 5.1 (Exponential Function),  Page 161.  The definition of  exp(z)  is  \(exp \((z)\)\  = \ \(e\^z\  = \ ∑\+\(n = 0\)\%∞\( 1\/\(n!\)\) z\^n\)\).

Demonstration for Definition 5.1.

We can use Mathematica to sum a power series.

(E^z) == (∑_(n = 0)^∞) ((z^n)/(n!))
Exp[z] == (E^z)

The ratio test can be used to show that the infinite series converges for all values of   z.

Remove[z];  
Clear[lim, n, q];  
q1 = (((z^(n + 1))/((n + 1)!)))/(((z^n)/(n!)));  
q2 = FullSimplify[q1];  
lim = Limit[q2, n -> ∞];  
\(\(Print[\*""((((z^(n + 1))/((n + 1)!)))/(((z^n)/(n!)))) = "", q1, " = ", q2];\)\ \ \)
Print[""];  
\(\(Print[\*""L = (lim_(n -> ∞)) ((((z^(n + 1))/((n + 1)!)))/(((z^n)/(n!))))""];\)\ \ \)
\(\(Print[\*""L = \!\(lim\+\(n -> ∞\)\) "", 
        q1];\)\ \ \)
\(\(Print[\*""L = \!\(lim\+\(n -> ∞\)\) "", 
        q2, " = ", lim];\)\ \ \)
Print[""];  
Print["The radius of convergence of the series is"];  
\(\(Print[\*""R = \!\(1\/L\) = ∞""];\)\ \ \)

Clearly this definition agrees with that of the real exponential function when z is a real number. We now show that this complex exponential has two of the key properties we associate with its real counterpart, and verify the identity (e^(i θ)) = 
        cos θ + i sin θ, which, back in Chapter 1 (see identity (1-30) of Section 1.4), we promised to establish.

Theorem 5.1,  Page 162.  The function (e^z) is an entire function satisfying the following conditions:

  (i).   exp' (z) = exp (z),  using Leibniz notation  (d/dz) (e^z) = (e^z).  

 (ii).   exp ((Subscript[z, 1]) + (Subscript[z, 2])) = exp ((Subscript[z, 1])) exp ((Subscript[z, 2])),  i.e.  \(e\^\(z\_1 + z\_2\) = \(e\^z\_1\) e\^z\_2\).  

(iii).   If  θ  is a real number, then  (e^(i θ)) = 
        cos θ + i sin θ.  

The exponential function is a solution to the differential equation  f' (z) = f (z)  with the initial condition  f (0) = 1.

Proof of Theorem 5.1,  see text Page 162.

Demonstration for Theorem 5.1 (i).

Enter the D.E. with the given initial condition and solve it. 
Then enter the function  f[z] = (e^z),  compute  f'[z]  and  f[0].

Remove[x, y, z];  
Clear[f, s, u, U, v, V];  
de = f'[z] == f[z];  
solset = DSolve[de, f[z], z];  
Print[de];  
Print[
        (Subscript[solset, [[1]]])];  
ic = f'[0] == 1;  
solset = 
        DSolve[Flatten[{de, ic}], f[z], z];  
Print[""];  
Print[de];  
Print[ic];  
Print[
        (Subscript[solset, [[1]]])];  
f[z_] = (E^z);  
Print[""];  
Print[" f[z] = ", f[z]];  
Print["f'[z] = ", f'[z]];  
Print[" f[0] = ", f[0]];

Construct the Maclaurin series for  f[z] = (e^z),  compute  f'[z]  and  f[0].

\(
\(s[z_] = Series[E\^z, {z, 0, 11}];\)\ \ \)
Print[" f[z] = ", s[z]];  
Print[""];  
Print["f'[z] = ", s'[z]];  
Print[""];  
Print[" f[0] = ", s[0]];

Determine the real and imaginary parts of  \(f[
          z] = \(e\^z = e\^\(x\  + \ i\ y\)\)\).

u[x_, y_] = 
        ComplexExpand[
          Re[(E^(x + I y))]];  
v[x_, y_] = 
        ComplexExpand[
          Im[(E^(x + I y))]];  
Print["    f[z] = ", f[z]];  
Print[" f[x+\[ImaginaryI]y] = ", 
        f[x + I y]];  
Print[" f[x+\[ImaginaryI]y] = ", 
        ComplexExpand[
          f[x + I y]]];  
Print[""];  
\(\(Print[\*""u[x,y] = Re[\!\(E\^z\)] = "", 
        u[x, y]];\)\ \ \)
\(\(Print[\*""v[x,y] = Im[\!\(E\^z\)] = "", 
        v[x, y]];\)\ \ \)
Print[""];  
Print["u[0,0] = ", u[0, 0]];  
Print["v[0,0] = ", v[0, 0]];  
Print[""];  
\(\(Print[" f[0+0I] = u[0,0] + I v[0,0]"];\)\ \ \)
Print[" f[0+0\[ImaginaryI]] = (", 
        u[0, 0] , ") + \[ImaginaryI](",  
        v[0, 0], ")"];  
Print[" f[0+0\[ImaginaryI]] = ", 
        u[0, 0]  +  I v[0, 
              0]];

Determine the real and imaginary parts of the series \(f[
          z] = \(e\^z = ∑\+\(n = 0\)\%∞ z\^n\/\(n!\)\)\).

\(
\(s[z_] = Series[E\^z, {z, 0, 5}];\)\ \ \)
Print[" f[z] = ", 
        s[x + I y]];  
Print[""];  
\(\(Print[\*""  Re[\!\(E\^z\)] = "", 
        ComplexExpand[
          Re[Normal[
              s[x + I\ y]]]]];\)\ \ \)
\(\(Print[\*""  Im[\!\(E\^z\)] = "", 
        ComplexExpand[
          Im[Normal[
              s[x + I\ y]]]]];\)\ \ \)

Compare the above results with the two variable Taylor series expansions for  (e^( x)) 
        Cos[y]   and   (e^( x)) Sin[y].

U = 
        Normal[Series[(E^(x0 + t x)) Cos[y0 + t y], {t, 
              0, 5}]];  
V = 
        Normal[Series[(E^(x0 + t x)) Sin[y0 + t y], {t, 
              0, 5}]];  
u[x_, y_] = 
        ReplaceAll[
          U, {t -> 1, x0 -> 0, 
            y0 -> 0}];  
v[x_, y_] = 
        ReplaceAll[
          V, {t -> 1, x0 -> 0, 
            y0 -> 0}];  
\(\(Print[\*""  Re[\!\(E\^z\)] = "", 
        u[x, y]];\)\ \ \)
\(\(Print[\*""  Im[\!\(E\^z\)] = "", 
        v[x, y]];\)\ \ \)

Demonstration for Theorem 5.1 (ii).

Remove[w, x, y, z];  
(Subscript[w, 1])  =  
        ComplexExpand[(E^((Subscript[x, 1]) + I (Subscript[y, 1])))];  
(Subscript[w, 2])  =  
        ComplexExpand[(E^((Subscript[x, 2]) + I (Subscript[y, 2])))];  
\(\(Print[\*""\!\(E\^z\_1\) = "", 
        w\_1];\)\ \ \)
\(\(Print[\*""\!\(E\^z\_2\) = "", 
        w\_2];\)\ \ \)
Print[" "];  
(Subscript[w, 3])  =  Expand[(Subscript[w, 1]) (Subscript[w, 2])];  
\(\(Print[\*""(Subscript[(E^z), 1])(Subscript[(E^z), 2]) = "", w\_3];\)\ \ \)
(Subscript[w, 3])  =  Simplify[(Subscript[w, 3]), Trig -> False];  
\(\(Print[\*""(Subscript[(E^z), 1])(Subscript[(E^z), 2]) = "", w\_3];\)\ \ \)
Print[" "];  
(Subscript[z, 4])  =  ((Subscript[x, 1]) + I (Subscript[y, 1])) + ((Subscript[x, 2]) + I (Subscript[y, 2]));  
(Subscript[w, 4])  =  ComplexExpand[(Subscript[(E^z), 4])];  
\(\(Print[\*""\!\(E\^\(z\_1 + z\_2\)\) = "", 
        w\_4];\)\ \ \)
(Subscript[w, 4])  =  Simplify[(Subscript[w, 4]), Trig -> False];  
\(\(Print[\*""\!\(E\^\(z\_1 + z\_2\)\) = "", 
        w\_4];\)\ \ \)
Print[" "];  
\(\(Print[\*""Does (Subscript[(E^z), 1])(Subscript[(E^z), 2])= (E^((Subscript[z, 1]) + (Subscript[z, 2]))) ?""];\)\ \ \)
Print[""];  
Print[(Subscript[w, 3]), " = ", (Subscript[w, 4])];  
Print[" "];  
(Subscript[w, 3])  =  ComplexExpand[(Subscript[w, 3])];  
(Subscript[w, 4])  =  ComplexExpand[(Subscript[w, 4])];  
Print[(Subscript[w, 3]), " = ", (Subscript[w, 4])];  
Print[" "];  
(Subscript[w, 3])  =  
        Simplify[ComplexExpand[(Subscript[w, 3])], Trig -> True];  
(Subscript[w, 4])  =  
        Simplify[ComplexExpand[(Subscript[w, 4])], Trig -> True];  
Print[(Subscript[w, 3]), " = ", (Subscript[w, 4])];  
Print[""];  
Print[TrigExpand[(Subscript[w, 3])] == TrigExpand[(Subscript[w, 4])]];

Demonstration for Theorem 5.1 (iii).

This is DeMoivre's formula that was studied in Section 1.5, Page 25.

\(\(\(
\)\(\(Print[\*""(E^I)θ = "", 
        ComplexExpand[E\^\(I\ θ\)]];\)\(\ \ \)\(
\)
    \)\)\)

Note that parts (ii) and (iii) of the Theorem 5.1 combine to verify De Moivre's formula, which we introduced in Section 1.5 (see identity 1-38). 

	If z=x+iy, we also see from parts (ii) and (iii) that
	
			exp (z) = (e^z)= \(e\^\(x\  + i\ y\) = \(e\^\(\(x\)\(\ \)\)\) e\^\(i\ y\)\)\(\(\(\ \)\(\(=\)\(\(e\^\(\(x\)\(\ \)\)\) \((cos\ y + i\ sin\ y)\)\)\)\)\).  

Some texts start with this identity as their definition for (e^z). In the exercises, we show that this is a natural approach from the standpoint of differential equations.

We now explore some additional properties of (e^z). Using identity (5-1), we can easily establish that  

			\(e\^\(z + i2\ n\ π\) = e\^z\),  for all z, provided n is an integer,  

			(e^z) = 1,  if and only if z = i 2 n π, where n  is an integer, and

			(Subscript[(e^z), 1]) = (Subscript[(e^z), 2]), if and only if (Subscript[z, 2]) = (Subscript[z, 1]) + i 2 n π, for some integer n.

Example 5.1,  Page 164.  The points  (Subscript[z, n]) = (5/4) + i (((11 π)/6) + 2 n π) for  n  =   ... , -2, -1, 0, 1, 2,  ...   are mapped onto a single point  (Subscript[w, 0]) = (Subscript[(e^z), n]).

Solution 5.1.

Enter the formula for the points.

Clear[e, n, z, w];  
(Subscript[z, 0])  =  
        (5/4)  + (( I 11 π)/6);  
(Subscript[z, n])_  =  (Subscript[z, 0])  +  I 2  π n;   
w = (Subscript[(E^z), n]);  
\(\(Print[\*""\!\(z\_n\) = "", z\_n];\)\ \ \)
Print[""];  
\(\(Print[\*""w = \!\(e\^z\_n\)""];\)\ \ \)
Print["w = ", w];  
w  =  ComplexExpand[w] ;  
Print["w = ", w];  
w  =  
        Simplify[w, Element[n, Integers]];  
Print["w = ", w];  
w  =  ComplexExpand[w] ;  
Print["w = ", w];  
w  =  Simplify[w] ;  
Print["w = ", w];

Here is another way to look at it.

Remove[z];  
Clear[e, n];  
(Subscript[z, 0])  =  
        (5/4)  + (( I 11 π)/6);  
(Subscript[z, n])_  =  (Subscript[z, 0])  +  I 2  π n ;  
\(Print[\*""\!\(z\_0\) = "", z\_0]\)
\(Print[\*""\!\(z\_n\) = "", z\_n]\)
Print[""];  
For[n = 0, 
        n ≤ 
          5, n++, 
Print[
            (Subscript[(e^z), n]), " = ", 
Factor[
              ComplexExpand[(Subscript[(E^z), n])]]];   ];

Let look at the range of the exponential function. If z=x+iy, we see from identity (5-1) that (e^z) can never equal zero, as (e^x) is never zero, and the cosine and sine functions are never zero at the same point. Suppose, then, that w = (e^z) ≠ 0. If we write w in its exponential form as w = ρ (e^(i ϕ)), identity(5-1) gives 
	
			\(ρ\ e\^\(i\ ϕ\) = \(e\^\(\(x\)\(\ \)\)\) e\^\(i\ y\)\).  

Using identity (5-1), and property (1-39) of Section 1.5 we get 

			ρ = (e^(x )) and ϕ = y + 2  n π, where n is an integer.
Therefore,
			\(ρ = \(\(\(|\)\(e\^\(\(z\)\(\ \)\)\)\(|\)\) = e\^\(\(x\)\(\ \)\)\)\), 
		and
			ϕ ∈ 
          arg ((e^(z )))={Arg ((e^(z )))+2n π:  n is an integer}.

If we solve the equations for x and y, we see that 

			x = ln ρ and  y = ϕ + 2  n π, 
			
where n is an integer. Thus, for any complex number w ≠ 0, there are infinitely many complex numbers z=x+iy such that w = (e^z). From equations (5-8), we see that the numbers z are  

			z = x + i y = 
          ln ρ + i (ϕ + 2  n π)  
		or
			z = ln  | w | +i (Arg w + 2  n π),  

where n is an integer. Hence 

			\(e\^\(ln\  | w | \(+i\) \((Arg\ w + 2  n\ π)\)\) = w\).

In summary, the transformation w = (e^z) maps the complex plane (infinitely often) onto the set of nonzero complex numbers.
	
	If we restrict the solutions in equation (5-9) so that only the principal value of the argument, -π < Arg w ≤ π, is used, we see that the transformation \(w = \(e\^z = e\^\(x + i\ y\)\)\) maps the horizontal strip  {(x, y) :  -π <  y ≤ π},  one-to-one and onto the range set S = {w :  w ≠ 0}. This strip is called the fundamental period strip.

Example 5.2,  Page 166.  Show that the transformation  w = (e^z)  maps the rectangle  R = {(x, y) : 
            a ≤ x ≤ b  and  c ≤ 
              y ≤ d}  onto a portion of an annular region bounded by two rays.

Solution 5.2.

Enter the function  w = f[z] = (e^z).  
For illustration.  We graph the image of  the rectangle R = {(x, y) : -1 ≤ x ≤ 
              1  and  ((-π)/3) ≤ 
              y ≤ (π/4)}.

Remove[z];  
Clear[f]
Iden[z_]  =  z;  
f[z_]  =  (E^z);  
\(\(CartesianMap[
        Iden, \ {\(-1\), 1, 
          0.25}, {\(-π\)\/3, π\/4, π\/12}, 
PlotRange -> {{\(-1.2\), 1.2}, {\(-1.2\), 1.2}}, 
        AspectRatio -> 1, 
        Ticks -> {Range[\(-1\), 1, 1], {\(-π\)\/3, π\/4}}, 
        AxesLabel -> {"x", "y"}, 
        PlotStyle -> {Magenta, 
            Pink}];\)\ \ \ \)
\(\(Print[\*""The rectangle R = {(x,y): -1 ≤ x ≤ 1 and ((-π)/3) ≤ y ≤ (π/4)}.""];\)\ \ \)
\(\(CartesianMap[
        f, {\(-1\), 1, 
          0.25}, {\(-π\)\/3, π\/4, π\/12}, 
PlotRange -> {{\(-0.2\), 3}, {\(-2.5\), 2.3}}, 
        AspectRatio -> 4.8\/3.2, 
        Ticks -> {Range[0, 3, 1], Range[\(-2\), 2, 1]}, 
        AxesLabel -> {"u", "v"}, 
        PlotStyle -> {Magenta, 
            Pink}];\)\ \ \ \)
\(\(Print[\*""The image sector (1/E) < ρ < E  and  ((-π)/3) ≤ ϕ ≤ (π/4),""];\)\ \ \)
Print["under the mapping  w = ", 
        f[z]];

We see that the transformation  w = (e^z)  maps the rectangle  R = {(x, y) : -1 ≤ x ≤ 
              1  and  ((-π)/3) ≤ 
              y ≤ (π/4)}  onto a portion of an annular region  (e^(-1))< | 
        w | <e  bounded by two rays  ((-π)/3) ≤ arg[w] ≤ (π/4).

Section 5.1  Exercises for The Complex Exponential Function
See textbook page 166.

Section 5.2	Branches of the Complex Logarithm Function

Section 5.3	Complex Exponents

Section 5.4	Trigonometric and Hyperbolic Functions

Section 5.5	Inverse Trigonometric and Hyperbolic Functions

GO TO  THE  Table of Contents