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

Section 5.2  The Complex Logarithm Function

In Section 5.1, we showed that, if w is a nonzero complex number the equation w = (e^z) has infinitely many solutions. Because the function  f (z) = (e^z)  is a many-to-one function, its inverse (the logarithm) is multivalued.

Definition 5.2,  Page 169.  (Multivalued Logarithm)  For z ≠ 0, we define the function log (z) as the inverse of the exponential function;  that is,  

			log (z) = w if and only if z = (e^w).  

	If we go through the same steps as we did in equations (5-8) and (5-9), we find that for a given complex number z ≠ 0, the solutions w to equation (5-10) take the form  

			log (z) = ln | z | + i θ, for z ≠ 0,  

where θ ∈ arg (z) and ln | z |  denotes the natural logarithm of the positive number |z|. Because arg (z) is the set arg (z) ={Arg (z)+2n π: where n is an integer}, we can express the set of values comprising log (z) as  

		log (z)  = {ln | 
              z | + i (Arg  + 2  n π) :  
            where n is an integer},  
	or
		log (z) = ln | z | + i arg (z) for for z ≠ 0,   

where it is understood that identity (5-13) refers to the same set of numbers given in identity (5-12).

	Notice that the different values of  log (z)  all have the same real part and that their imaginary parts differ by the amount  2  π n,  where n is an integer. When n=0, we have a special situation.

Definition 5.3,  Page 170.  (Principal Value of the Logarithm)  For  z ≠ 0,  we define the principal value of the logarithm as follows:

		Log (z) = ln | z | + i Arg (z) where |z|> 0 and \(\(\(-π\)\(\ \)\(<\)\(\ \)\(Arg \((z)\)\)\(\ \)\(≤\)\(\ \)\(π\)\(\ \)\)\).  


	The domain for  f (z) = Log (z) = w  is the set of all nonzero complex numbers in the z-plane, and its range is the horizontal strip  -π  <  Arg (z)  ≤  π  in the w-plane.  We stress again that Log is a single-valued function and corresponds to setting n=0 in equation (5-12). As we demonstrated in Chapter 2, the function Arg is discontinuous at each point along the negative x-axis, hence so is the function Log. In fact, because any branch of the multi-valued function arg  is discontinuous along some ray, a corresponding branch of the logarithm will have a discontinuity along that same ray. This is the choice used by popular software programs such as Mathematica, Maple and MatLab.  

Caution.  A phenomenon inherent in constructing an logarithm function:  It must have a discontinuity!  This is the case because as we saw in Chapter 2, any branch we choose for   arg (z)  is necessarily a discontinuous function.  The principal branch,   arg (z),  is discontinuous at each point along the negative x-axis.

Extra Example on, Page 169.  Investigate the complex logarithm function.

Solution for Extra Example on Page 169.

Enter the function  w = f[z] = Log[x + i y]  and find its real and imaginary parts

Remove[x, y, z]; 
Clear[f, u, v]; 
f[z_]  =  Log[z]; 
u[x_, y_]  =  
        ComplexExpand[Re[f[x + I y]], 
          TargetFunctions -> {Re, Im}]; 
v[x_, y_]  =  
        ComplexExpand[Im[f[x + I y]], 
          TargetFunctions -> {Re, Im}]; 
Print["    Log[x+\[ImaginaryI]y] = ", 
        f[z]]; 
Print["    Log[x+\[ImaginaryI]y] = ", 
        ComplexExpand[f[x + I y]]]; 
Print["    Log[x+\[ImaginaryI]y] = ", 
        u[x, y] +  I v[x, y]]; 
Print[""]; 
Print["Re[Log[x+\[ImaginaryI]y]] = ", u[x, y]]; 
Print["Im[Log[x+\[ImaginaryI]y]] = ", 
        v[x, y]];

Find the polar form of the real and imaginary parts of the logarithm function.

Clear[f, r, θ, u, U, v, V, w, 
        z]; 
f[z_]  =  Log[z]; 
U[r_, θ_]  =  Log[r]; 
V[r_, θ_]  =  θ; 
W  =  
        U[r, θ]  +  I V[r, θ]; 
u[r_, θ_]  =  
        PowerExpand[
          ComplexExpand[
            Re[f[r (E^(I θ))]], 
            TargetFunctions -> {Re, Im}]]; 
v[r_, θ_]  =  
        ComplexExpand[Im[f[r (E^(I θ))]], 
          TargetFunctions -> {Re, Im}]; 
\(\(Print[\*""    Log[r (E^I)θ] = "", f[
          r\ E\^\(I\ θ\)]];\)\ \)
\(\(Print[\*""    Log[r (E^I)θ] = "", ComplexExpand[
          f[r\ E\^\(I\ θ\)]]];\)\ \)
\(\(Print[\*""    Log[r (E^I)θ] = "", u[r, θ] + \ I\ v[
              r, θ]];\)\ \)
\(\(Print[\*""    Log[r (E^I)θ] = "", U[r, θ] + \ I\ V[
              r, θ]];\)\ \)
Print[""]; 
\(\(Print[\*""Re[Log[r (E^I)θ]] = "", u[r, θ]];\)\ \)
\(\(Print[\*""Im[Log[r (E^I)θ]] = "", v[r, θ]];\)\ \)
\(\(Print[\*""Im[Log[r (E^I)θ]] = "", V[r, θ]];\)\ \)

Example 5.3,  Page 170.   Find  \(Log \((1 + i)\)\ \ \ and\ \ \ log \((1 + i)\)\).

Solution 5.3.

Enter  z = 1 + i  and take its logarithm.

Remove[w, z]; 
z = 1 + I; 
w  =  ComplexExpand[Log[z]]; 
Print["Log[", z, "] = ", w];

The best we can do for the multivalued  log (1 + i)  is to add  \(i\ 2  π\ n\ \ \ to\ \ \ Log \((1 + i)\)\).

Remove[w]; 
Clear[n]; 
(Subscript[w, 1])  =  ComplexExpand[Log[z]]; 
(Subscript[w, 2])  =  
        ComplexExpand[
          Log[z]  +  I 2 π n ]; 
Print["Log[", z, "] = ", Log[z]]; 
Print["Log[", z, "] = ", (Subscript[w, 1])]; 
Print[" "]; 
Print["log[", z, "] = ", 
        Log[z]  +  I 2 π n]; 
Print["log[", z, "] = ", 
        (Subscript[w, 2])];

Extra Example, Page 170.  The transformation  w = Log(z)  maps the z-plane punctured at the origin onto the horizontal strip in the w-plane.

Solution for Extra Example, Page 170.

Remove[z]; 
Clear[f]; 
Iden[z_]  =  z; 
f[z_]  =  Log[z]; 
PolarMap[
        Iden,  {(1.0/150), 150.1, 15}, {-3.141, 3.141, (3.141/6)}, 
        PlotRange -> {{-150, 150}, {-150, 150}}, 
        AspectRatio -> 1, 
        Ticks -> {Range[-150, 150, 150], Range[-150, 150, 150]}, 
        AxesLabel -> {"x", "y"}, 
        PlotStyle -> {Blue, Cyan}]; 
\(\(Print["The z-plane punctured at the origin  {z: |z| > 0}."];\)\ \)
PolarMap[f, {(1.0/150), 150.1, 15}, {-3.141, 3.141, (3.141/6)}, 
        PlotRange -> {{-5.3, 5.3}, {-3.3, 3.3}}, 
        AspectRatio -> (3.3/5.3), 
        Ticks -> {Range[-5, 5, 5], Range[-π, π, π]}, 
        AxesLabel -> {"u", "v"}, 
        PlotStyle -> {Blue, Cyan}]; 
Print["The image is the horizontal strip - π < v ≤ \
π,"]; 
Print["under the mapping  w = ", 
        f[z]];

Example 5.4,  Page 170.  (a)  Find  Log (-e),  (b)  Find  Log (-1).

Solution 5.4.

(a)  Enter  z = -e  and take its logarithm.

Remove[z, w]; 
z   =  - E; 
(Subscript[w, 1])  =  Log[Abs[z]]  +  I Arg[z]; 
(Subscript[w, 2])  =  ComplexExpand[Log[z]]; 
Print["z = ", z]; 
Print["Log[Abs[", z, "]] = ", "Log[", 
        Abs[z], "] = ",  Log[Abs[z]]]; 
Print["Arg[", z, "]  = ", 
        Arg[z]]; 
Print[""]; 
Print["Log[Abs[", z, "]] + \[ImaginaryI] Arg[", 
        z, "] = ", (Subscript[w, 1])]; 
Print[""]; 
Print["Log[", z, "] = (", 
        Log[Abs[z]], ") + \[ImaginaryI] (",  
        Arg[z], ")"]; 
Print["Log[", z, "] = ", 
        (Subscript[w, 2])];

(b)  Enter  z = -1  and take its logarithm.

Remove[z, w]; 
z   =  - 1; 
(Subscript[w, 1])  =  Log[Abs[z]]  +  I Arg[z]; 
(Subscript[w, 2])  =  ComplexExpand[Log[z]]; 
Print["z = ", z]; 
Print["Log[Abs[", z, "]] = ", "Log[", 
        Abs[z], "] = ",  Log[Abs[z]]]; 
Print["Arg[", z, "]  = ", 
        Arg[z]]; 
Print[""]; 
Print["Log[Abs[", z, "]] + \[ImaginaryI] Arg[", 
        z, "] = ", (Subscript[w, 1])]; 
Print[""]; 
Print["Log[", z, "] = (", 
        Log[Abs[z]], ") + \[ImaginaryI] (",  
        Arg[z], ")"]; 
Print["Log[", z, "] = ", 
        (Subscript[w, 2])];

Example 5.5,   Page 171.  Show that the identity Log[(Subscript[z, 1]) (Subscript[z, 2])] =  Log[(Subscript[z, 1])] + Log[(Subscript[z, 2])] is not always valid.

Select (Subscript[z, 1])=-(Sqrt[3])+i  and  (Subscript[z, 2])=-1 + i (Sqrt[3]), show for this choice, that  Log[(Subscript[z, 1]) (Subscript[z, 2])] ≠  Log[(Subscript[z, 1])] + Log[(Subscript[z, 2])].

Solution 5.5.

Enter  \(z\_1 = \(\(-\@3\) + i\ \ and\ \ z\_2 = \(-1\) + i\ \@3\)\)  and take their logarithms.

Remove[z, w]; 
(Subscript[z, 1])  =  - (Sqrt[3])  +  I; 
(Subscript[z, 2])  =  - 1  +  I (Sqrt[3]); 
(Subscript[z, 3])  =  Expand[(Subscript[z, 1]) (Subscript[z, 2])]; 
(Subscript[w, 1])  =  ComplexExpand[Log[(Subscript[z, 1])]]; 
(Subscript[w, 2])  =  ComplexExpand[Log[(Subscript[z, 2])]]; 
(Subscript[w, 3])  =  ComplexExpand[Log[(Subscript[z, 3])]]; 
\(\(Print[\*""             \!\(z\_1\) = "", z\_1];\)\ \)
\(\(Print[\*""             \!\(z\_2\) = "", z\_2];\)\ \)
\(\(Print[\*""          \!\(z\_1\) \!\(z\_2\) = "", 
        z\_3];\)\ \)
Print[" "]; 
\(\(Print[\*""        Log[\!\(z\_1\)] = "", w\_1];\)\ \)
\(\(Print[\*""        Log[\!\(z\_2\)] = "", w\_2];\)\ \)
\(\(Print[\*""     Log[\!\(z\_1\) \!\(z\_2\)] = "", 
        w\_3];\)\ \)
\(\(Print[\*""Log[\!\(z\_1\)]+Log[\!\(z\_2\)] = "", 
        w\_1 + w\_2];\)\ \)
Print[" "]; 
Print[(Subscript[w, 1]) + (Subscript[w, 2]), " =? ", (Subscript[w, 3])]; 
Print[" "]; 
\(\(Print[\*""  Is Log[(Subscript[z, 1]) (Subscript[z, 2])] = Log[(Subscript[z, 1])] + Log[(Subscript[z, 2])] = ?  "", 
        w\_3\  == w\_1 + w\_2];\)\ \)

So we find in this counter example that it is possible for  Log[(Subscript[z, 1]) (Subscript[z, 2])] ≠  Log[(Subscript[z, 1])] + Log[(Subscript[z, 2])],
this is in contrast to the multivalued logarithm for which  log ((Subscript[z, 1]) (Subscript[z, 2])) = log ((Subscript[z, 1])) + log ((Subscript[z, 2])).

Our next result explains why the identity Log[(Subscript[z, 1]) (Subscript[z, 2])] =  Log[(Subscript[z, 1])] + Log[(Subscript[z, 2])] did not hold for the particular numbers we chose.

Theorem 5.2,  Page 172.  The identity  Log[(Subscript[z, 1]) (Subscript[z, 2])] =  Log[(Subscript[z, 1])] + Log[(Subscript[z, 2])] holds true if and only if -π < Arg[(Subscript[z, 1])] + Arg[(Subscript[z, 2])] ≤ π.

Proof of Theorem 5.2,  see text Page 172.

As Example 5.5 and Theorem 5.2 illustrate, properties of the complex logarithm do not carry over when arguments of products combine in such a way that they drop down to -π or rise above -π. This is because of the restrictions placed on the domain of the function Arg. If we look at the set of numbers associated with the multivalued logarithm, however, we can formulate properties that look exactly the same as the ones corresponding with the real logarithm.

Theorem 5.3,  Page 172.  Let (Subscript[z, 1]) and (Subscript[z, 2]) be nonzero complex numbers. The multivalued function log obeys the familiar properties of logarithms: 

			log ((Subscript[z, 1]) (Subscript[z, 2])) = log ((Subscript[z, 1])) + log ((Subscript[z, 2])),  

			log (((Subscript[z, 1])/( (Subscript[z, 2])))) = 
        log ((Subscript[z, 1])) - log ((Subscript[z, 2])), and

			log ((1/( z))) = -log (z).

Proof of Theorem 5.3,  see text Page 172.

Property of  Log(z).  We know that log ((Subscript[z, 1]) (Subscript[z, 2])) = log ((Subscript[z, 1])) + log ((Subscript[z, 2])), what about Log[z]?

Solution of Property of Log(z).

Since the Mathematica function  Log[z]  is the principal value of the logarithm, we will investigate the relationship for  Log[(Subscript[z, 1]) (Subscript[z, 2])]  and  Log[(Subscript[z, 1])] + Log[(Subscript[z, 2])].

Remove[v, x, y, z, 
        Z]; 
(Subscript[Z, 1]) = (Subscript[x, 1]) + I (Subscript[y, 1]); 
(Subscript[Z, 2]) = (Subscript[x, 2]) + I (Subscript[y, 2]); 
(Subscript[Z, 3]) = 
        ComplexExpand[((Subscript[x, 1]) + I (Subscript[y, 1])) ((Subscript[x, 2]) + I (Subscript[y, 2]))]; 
\(\(v\_1\  = \ 
        ComplexExpand[
          Log[\((x\_1 + I\ y\_1)\)], 
\ \ \ \ \ \ \ TargetFunctions -> {Im, Re}];\)\ \)
\(\(v\_2\  = \ 
        ComplexExpand[
          Log[\((x\_2 + I\ y\_2)\)], 
\ \ \ \ \ \ \ TargetFunctions -> {Im, Re}];\)\ \)
\(\(v\_3\  = \ 
        ComplexExpand[
          Log[\((x\_1 + I\ y\_1)\) \((x\_2 + I\ y\_2)\)], 
\ \ \ \ \ \ \ TargetFunctions -> {Im, 
              Re}];\)\ \)
\(\(U = 
        ComplexExpand[
          Log[Abs[\((x\_1 + I\ y\_1)\) \((x\_2 + I\ y\_2)\)]], 
\ \ \ \ \ \ \ TargetFunctions -> {Im, 
              Re}];\)\ \)
\(\(V = 
        ComplexExpand[
          Arg[\((x\_1 + I\ y\_1)\) \((x\_2 + I\ y\_2)\)], 
\ \ \ \ \ \ \ TargetFunctions -> {Im, 
              Re}];\)\ \)
\(\(Print[\*""\!\(z\_1\) = "", Z\_1];\)\ \)
\(\(Print[\*""\!\(z\_2\) = "", 
        Z\_2];\)\ \)
Print[""]; 
\(\(Print[\*""Log[\!\(z\_1\)] = "", v\_1];\)\ \)
\(\(Print[\*""Log[\!\(z\_2\)] = "", 
        v\_2];\)\ \)
Print[""]; 
\(\(Print[\*""\!\(z\_1\) \!\(z\_2\) = "", 
        Z\_3];\)\ \)
\(\(Print[\*""Log[Abs[\!\(z\_1\) \!\(z\_2\)]] = "", 
        U];\)\ \)
\(\(Print[\*""Arg[\!\(z\_1\) \!\(z\_2\)] = "", 
        V];\)\ \)
Print[""]; 
\(\(Print[\*""Log[\!\(z\_1\) \!\(z\_2\)] = "", 
        v\_3];\)\ \)

Remark. The above formulas are for  Log[z]  and not  log(z).  What do you think about those pesky ArcTan's ? They are functions of two variables and evaluate properly throughout the complex plane to find  Arg[z].

	Arg[-1]         =  ArcTan[-1, 
            0]     =  π
Arg[-1 + i]  =  ArcTan[-1, 
            1]     =  ((3  π)/4)
Arg[i]           =  ArcTan[0, 
            1]        =  (π/2)
Arg[
          1 + i]    =  ArcTan[1, 
            1]        =  (π/4)
Arg[1]           =  ArcTan[1, 0]        =  0
Arg[
          1 - i]    =  ArcTan[
            1, -1]     =  ((-π)/4)
Arg[-i]        =  ArcTan[
            0, -1]     =  ((-π)/2)
\(Arg[\(-1\) - i]\  = \ \(ArcTan[\(-1\), \(-1\)]\  = \ \(\(-3\) π\)\/4\)\)

Library Research Experience for Undergraduates

Project I. Write a report about complex logarithms.

1. Huestis, Stephen P., (1995),''Exploring Complex-Base Logarithms,'' Math. Mag., Vol. 68, No.1, pp. 65-67

2. Schoenfeld, Lowell, (1959), ''Some Remarks on the Logarithmic Function in the Complex Plane'', Math. Mag.,Vol 32, pp. 189-202.

Section 5.2  Exercises for The Complex Logarithm Function
See textbook page 169.

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