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 2   COMPLEX FUNCTIONS

\(
\(Needs["Graphics`ComplexMap`"];\)\ \)
Needs["Graphics`ImplicitPlot`"]; 
Needs["Graphics`Colors`"]; 
Needs["Algebra`InequalitySolve`"]; 
a = u = v = w = x = y = z = Z = 
                      0; 
Clear[a, ac, al, b, bc, bhc, bl, bverti, circlea, circleb, eq1, eq2, 
        eq3, eq4, eq5, eqn, eqns, f,  F, hc, hl, horiz, Iden, ineq, ineq1, 
        ineq2, ineq3, ineq4, ineq5, ineq6, ineq7, ineq8, ineq9, θ, r, 
        u, u0, u1, u2,  U, U0, v, vc, vl, verti, V, w, wplane, W, x,  X, y, 
        Y, z, Z, zplane];

Section 2.1	Functions of a Complex Variable

Section 2.2	Transformations and Linear Mappings

Section 2.3  The Mappings w = (z^n) and w = (z^(1/n))

In  Section 2.2 we investigated linear functions. Here we examine power functions.  

	For z = r (e^i)θ, we can express the function w = f (z) = (z^2) in polar coordinates by 

			\(w = \(f \((z)\) = \(z\^2 = \(r\^2\) e\^i2θ\)\)\).  

If we also use polar coordinates for w = ρ (e^i)ϕ in the w -plane, we can express this mapping by the system of equations 

			ρ = (r^2)  and  ϕ = 2  θ.

Since an argument of the product zz is twice an argument of z, we say that f doubles angles at the origin. Points that lie on the ray r > 0, θ = α are mapped onto points that lie on the ray ρ > 0 , ϕ = 2  α. If we now restrict the domain of w = f (z) = (z^2) to the region  

			\(A = {r\ \(\(e\^iθ\) : \ 
              r > 0\ and\ \(-π\)\/2 < \ θ ≤ π\/2\)}\),  

then the image of A under the mapping w = (z^2) can be described by the set  

			B = {ρ (e^i)ϕ :  ρ > 
                0 and  - π <  ϕ ≤ π},   

which consists of all points in the w-plane except the point w=0.

The inverse mapping of f, which we shall denote by g, is then

			z = g (w) = (w^(1/2)) = (ρ^(1/
                    2)) (e^(iϕ/2)), where w ∈ B.
		That is
			\(z = \(g \((w)\) = \(w\^\(1/2\) = \(\(|\)\(w\)\( | \^\(1/
                    2\)\)\(e\^\(iArg \((w)\)/
                      2\)\)\)\)\)\), where w ≠ 0.  
			
	The function g is so important that it is worth calling special attention to it:

Definition 2.1 (principal Square Root function),  Page 63.  The function 

			\(z = \(g \((w)\) = \(w\^\(1/2\) = \(\(|\)\(w\)\( | \^\(1/
                    2\)\)\(e\^\(iArg \((w)\)/
                      2\)\)\)\)\)\), for w ≠ 0  

is called the principal square root function.

It is left as an exercise to show that f and g satisfy equations g(f(z))=z and f(g(w))=w, and thus they are inverses of each other that map the set A one-to-one and onto the set B and the set B one-to-one and onto the set A, respectively. 

	What are the images of rectangles under the mapping w = (z^2)? To find out, we make use of the Cartesian form  

		w = u + i v = f (z) = (z^2) =(x^2) - 
            (y^2) + i 2 x y= ((x^2) - (y^2), 2 x y) = (u, v)

and the resulting system of equations  u=(x^2)-(y^2) and v=2 x y.

Example 2.12,  Page 63.  The transformation  w = f (z) = (z^2)  usually maps vertical and horizontal lines onto lines or parabolas.
(a) Find the image of the vertical line  x = a.  (b) Find the image of the horizontal line  y = b.  
(c) Find the image of the ray  r > 0, θ = α  and circle r = c.

Solution 2.12.

Enter the function w = f[z] and determine the real and imaginary parts.

Clear[a, b, eq1, eq2, eq3, eq4, x, y, u, u1, u2, 
        v, U, V]; 
f[z_] := (z^2); 
eq1  =  
        u  ==  
          ComplexExpand[Re[f[x + I y]]]; 
eq2  =  
        v  ==  
          ComplexExpand[Im[f[x + I y]]]; 
Print["f[z] = ", f[z]]; 
Print["f[z] = ", f[x + I y]]; 
Print["f[z] = ", 
        Expand[f[x + I y]]]; 
Print[""]; 
Print["u + \[ImaginaryI] v = ", 
        Expand[f[x + I y]]]; 
Print[""]; 
Print[eq1]; 
Print[eq2];

(a) Find the image of the vertical line  x = a.

Print[
        eqns  =  ReplaceAll[{eq1, eq2}, x -> a]]; 
Print[eq3  =  Eliminate[eqns, {y}]]; 
Print[solset1  =  Solve[eq3, u]]; 
u1[v_]  =  
        Expand[(Subscript[solset1, [[1, 1, 2]]])]; 
Print[""]; 
Print["u[v] = ", u1[v]];

Hence, the image of the vertical line  x = a  is the parabola  u = (a^2) - ((v^2)/(4 (a^2))).  

(b) Find the image of the horizontal line  y = b.

Print[
        eqns  =  ReplaceAll[{eq1, eq2}, y -> b]]; 
Print[eq4  =  Eliminate[eqns, {x}]]; 
Print[solset2  =  Solve[eq4, u]]; 
u2[v_]  =  
        Expand[(Subscript[solset2, [[1, 1, 2]]])]; 
Print[""]; 
Print["u[v] = ", u2[v]];

Hence, the image of the horizontal line  y = b  is the parabola  u = -(b^2) + ((v^2)/(4 (b^2))).  
Use Mathematica to make a graph of the mapping.

Clear[f, Iden, z]; 
Iden[z_]  =  z; 
f[z_]  =  (z^2); 
CartesianMap[
        Iden,  {0, 0.6, 0.1}, {0, 2, 
          0.1}, 
PlotRange -> {{-0.05, 
              0.65}, {-0.1, 2.1}}, 
        AspectRatio -> 
          (2.2/0.7), 
Ticks -> {Range[0, 0.5, 0.5], 
            Range[0, 2, 1]}, AxesLabel -> {"x", "y"}, 
        PlotStyle -> {Magenta, Pink}]; 
\(\(Print["Vertical lines x = a, and horizontal lines y = b."];\)\ \)
CartesianMap[
        f,  {0, 0.6, 0.1}, {0, 2.0, 
          0.1}, 
PlotRange -> {{-4, 
              0.5}, {-0.2, 2.4}}, 
        AspectRatio -> 
          (2.6/4.5), 
Ticks -> {Range[-4, 0, 1], 
            Range[0, 2, 1]}, AxesLabel -> {"u", "v"}, 
        PlotStyle -> {Magenta, Pink}];  
\(\(Print[\*""The image parabolas u= (a^2)-\!\(v\^2\/\(4\\ a\^2\)\) and u = -(b^2)+\!\(v\^2\/\(4\\ b\^2\)\),""];\)\ \)
Print["under the mapping  w = ", 
        f[z]];

(c) Find the image of the ray  r > 0, θ = α  and circle r = c.  
We will use Mathematica to graph these images.

\(
\(PolarMap[
        Iden, {0, 1.4, 
          0.1}, {0, \(\(\ \)\(π\)\)\/2, \ \(\(\ \)\(π\)\)\/24}, 
PlotRange -> {{0, 1.5}, {0, 1.5}}, 
        AspectRatio -> 1, 
        Ticks -> {{0, 1\/2, 1, \@2}, {0, 1\/2, 1, \@2}}, 
        AxesLabel -> {"x", "y"}, 
        PlotStyle -> {DarkGreen, Green}];\)\ \)
\(\(Print["The rays r > 0, θ = α, and circles r = c."];\)\ \)
\(\(PolarMap[
        f\ , {0, 1.4, 
          0.1}, {0, \(\(\ \)\(π\)\)\/2, \ \(\(\ \)\(π\)\)\/24}, 
PlotRange -> {{\(-2\), 2}, {0, 2}}, 
        AspectRatio -> 1\/2, 
        Ticks -> {Range[\(-1\), 2, 1], Range[0, 2, 1]}, 
        AxesLabel -> {"u", "v"}, 
        PlotStyle -> {DarkGreen, Green}];\)\ \)
\(\(Print[\*""The image rays r>0, θ=2α, and circles r=\!\(c\^2\),""];\)\ \)
Print["under the mapping  w = ", 
        f[z]];

We can use knowledge of the inverse mapping w = (z^(1/2)) to get further insight into how the mapping w = (z^(1/2)) acts on rectangles. If we let z = x + i y ≠ 0, then  

			z = (w^2)  = (u^2) - (v^2) + i 2 u v,  

and we see that the point z=x+iy in the z-plane is related to the point w = (z^(1/2)) in the w-plane by the system of equations  

			x=(u^2)-(v^2) and y=2 u v.

Example 2.13,  Page 65. The transformation  w = (z^(1/2))  usually maps vertical and horizontal lines onto lines or hyperbolas.
(a) Find the image of the vertical line  x = a.  (b) Find the image of the horizontal line  y = b.  
(c) Find the image of the ray  r > 0, θ = α  and circle r = c.

Solution 2.13.

Before we start, make x, y, u and v real variables.

Remove[u, v, x, y, 
        z]; 
Clear[f, F, X, Y, U, V, Z]; 
TagSet[x, Im[x], 0]; 
TagSet[y, Im[y], 0]; 
TagSet[u, Im[u[x, y]], 0]; 
TagSet[v, Im[v[x, y]], 0]; 
TagSet[x, Re[x], x]; 
TagSet[y, Re[y], y]; 
TagSet[u, Re[u[x, y]], u[x, y]]; 
TagSet[v, Re[v[x, y]], v[x, y]];

The mapping  w = (z^(1/2))  can be manipulated as follows.

eq0 = (Sqrt[z]) == w; 
eq1 = z == (w^2); 
eq2 = 
        ReplaceAll[
          eq1, {z -> x + I y, 
            w -> u + I v}]; 
eq3 = ComplexExpand[eq2]; 
eq4 = ComplexExpand[Map[Re, eq3]]; 
eq5 = Thread[-eq4, Equal]; 
eq6 = Thread[eq5 + eq3, Equal]; 
eq7 = ComplexExpand[Map[Im, eq6]]; 
Print[eq0]; 
Print[eq1]; 
Print[eq2]; 
Print[eq3]; 
Print[""]; 
Print[eq4]; 
Print[eq7];

(a) Find the image of the vertical line  x = a.

Print["The vertical line is"]; 
Print[
        (Subscript[eq4, [[1]]]) == a]; 
Print[""]; 
Print["Its image is the hyperbola"]; 
Print[
        (Subscript[eq4, [[2]]]) == a];

(b) Find the image of the horizontal line  y = b.

Print["The horizontal line is"]; 
Print[
        (Subscript[eq7, [[1]]]) == b]; 
Print[""]; 
Print["Its image is the hyperbola"]; 
Print[
        (Subscript[eq7, [[2]]]) == b];

Use Mathematica to make a graph of the mapping.

Clear[f, Iden]; 
Iden[z_] = z; 
f[z_] = (z^(1/2)); 
CartesianMap[
        Iden,  {-9, 9, 1}, {0, 9, 
          1}, 
PlotRange -> {{-9, 10}, {-0.5, 
              10}}, AspectRatio -> 
          (1/2), 
Ticks -> {Range[-9, 9, 3], 
            Range[0, 9, 3]}, AxesLabel -> {"x", "y"}, 
        PlotStyle -> {Cyan, Blue}]; 
\(\(Print["Vertical lines x = a, and horizontal lines y = b."];\)\ \)
CartesianMap[
        f,  {-9, 9, 1}, {0, 9, 
          1}, 
PlotRange -> {{-0.3, 
              3.3}, {-0.3, 3.3}}, AspectRatio -> 1, 
        Ticks -> {Range[0, 3, 1], Range[0, 3, 1]}, 
        AxesLabel -> {"u", "v"}, 
        PlotStyle -> {Cyan, Blue}]; 
\(\(Print[\*""The image hyperbolas (u^2)-(v^2) = a and 2uv = b,""];\)\ \)
Print["under the mapping  w = ", 
        f[z]];

(c) Find the image of the ray  r > 0, θ = α  and circle r = c.

\(
\(PolarMap[
        Iden, {0, 9, 
          0.5}, {0, \ π, \ \(\(\ \)\(π\)\)\/12}, 
PlotRange -> {{\(-9\), 9}, {0, 9}}, 
        AspectRatio -> 1\/2, 
        Ticks -> {Range[\(-9\), 9, 1], Range[0, 9, 1]}, 
        AxesLabel -> {"x", "y"}, 
        PlotStyle -> {DarkGreen, Green}];\)\ \)
\(\(Print["The rays r > 0, θ = α, and circles r = c."];\)\ \)
\(\(PolarMap[
        f\ , {0, 9, 
          0.5}, {0, \ π, \ \(\(\ \)\(π\)\)\/12}, 
PlotRange -> {{0, 3}, {0, 3}}, 
        AspectRatio -> 
          1, 
Ticks -> {Range[0, 3, 1], 
            Range[0, 3, 1]}, AxesLabel -> {"u", "v"}, 
        PlotStyle -> {DarkGreen, Green}];\)\ \)
\(\(Print[\*""The image rays r>0, θ=(α/2), and circles r=(Sqrt[c]),""];\)\ \)
Print["under the mapping  w = ", 
        f[z]];

We can easily extend what we've done to integer powers higher than two. Let n be a positive integer and consider the function w = f (z) = (z^n), for z = r (e^i)θ ≠ 0. This can be expressed in the polar coordinate form  

			\(w = \(f \((z)\) = \(z\^n = \(r\^n\) e\^inθ\)\)\).  

If we use polar coordinates for w = ρ (e^i)ϕ in the w -plane, we can express this mapping by the system of equations 

			ρ = (r^n)  and  ϕ = nθ.  

	We see that the image of the ray r > 0, θ = α  is the ray  ρ > 0 , ϕ = nα  and that angles at the origin are increased by the factor n. Since the functions cos nθ and sin nθ are periodic with period ((2  π)/n), we see that f is in general an n-to-one function;  that is, n points in the z-plane are mapped onto each non zero point in the w-plane.

If we now restrict the domain of w = f (z) = (z^n) to the region 

			\(E = {r\ \(\(e\^iθ\) : \ 
              r > 0\ and\ \(-π\)\/n < \ θ ≤ π\/n\)}\),  

then the image of E under the mapping w = (z^n) can be described by the set  

			F = {ρ (e^i)ϕ :  ρ > 
                0 and  - π <  ϕ ≤ π},   

which consists of all points in the w-plane except the point w=0. The inverse mapping of f, which we shall denote by g, is then

			z = g (w) = (w^(1/n)) = (ρ^(1/
                    n)) (e^(iϕ/n)), where w ∈ F.
		That is
			\(z = \(g \((w)\) = \(w\^\(1/n\) = \(\(|\)\(w\)\( | \^\(1/
                    n\)\)\(e\^\(iArg \((w)\)/
                      n\)\)\)\)\)\), where w ≠ 0.  

As with the principle square root function, we make an analogous definition for (n^th) roots.

Definition 2.2 (principal n-th root function),  Page 67.  The function 

			\(z = \(g \((w)\) = \(w\^\(1/n\) = \(\(|\)\(w\)\( | \^\(1/
                    n\)\)\(e\^\(iArg \((w)\)/
                      n\)\)\)\)\)\), for w ≠ 0  

is called the principal (n^th) root function.

It is left as an exercise to show that f and g are inverses of each other that map the set E one-to-one and onto the set F and the set F one-to-one and onto the set E, respectively.

Section 2.3  Exercises for The Mappings  w = (z^n)  and  w = (z^(1/n))
See textbook page 67.

Section 2.4	Limits and Continuity

Section 2.5	Branches of Functions

Section 2.6	The Reciprocal Transformation w  = 1/z

GO TO  THE  Table of Contents