COMPLEX ANALYSIS: Mathematica 3.0 Notebooks
(c) John H. Mathews, and
Russell W. Howell, 1998
Complimentary software to accompany our textbook:

COMPLEX ANALYSIS: for Mathematics and Engineering, 
3rd Edition,  1997,  ISBN: 0-7637-0270-6
Jones & Bartlett Publishers, Inc.
40 Tall Pine Drive, Sudbury, MA 01776
Tele.  (800) 832-0034, FAX:  (508)  443-8000
E-mail:  mkt@jbpub.com,     http://www.jbpub.com/
This free software is compliments of the authors.
mathews@fullerton.edu,  howell@westmont.edu

CHAPTER 2   COMPLEX FUNCTIONS
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
Section 2.4  Limits and Continuity
Section 2.5  Branches of Functions
Section 2.6 The Reciprocal Transformation  w = 1/z
GoTo Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11.
GoTo Contents

CHAPTER 2   COMPLEX FUNCTIONS

\(SetOptions[Graphics, DefaultColor -> RGBColor[0, 0, 1]]; 

    Get["Graphics`ComplexMap`"]; 

    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

A function  f(z) of the complex variable  z  can be written:
     f(z)  =  f(x + i y)  =  u(x,y)  + i v(x,y).
The polar coordinate form of a complex function is:
     f(z)  =  f(r (e^i)θ)  =  u(r, θ ) + i v(r, θ ).

These are the two approaches to defining a complex function in Mathematica.

\(Clear[f, u, v, x, y]; 
x /: Im[x] = 0; 
y /: Im[y] = 0; 

    u /: Im[u[x, y]] = 0; 
v /: Im[v[x, y]] = 0; 
x /: Re[x] = x; 

    y /: Re[y] = y; 
u /: Re[u[x, y]] = u[x, y]; 

    v /: Re[v[x, y]] = v[x, y]; \)

Method 1. Make  f  a function of two real variables (x,y).

\(Clear[f, u, v, x, y]; 

    f[x_, y_]\  := \ u[x, y]\  + \ I\ v[x, y]\)\(Print["f[x,y] = ", f[x, y]]; 
Print["f[2,1] = ", f[2, 1]]; 

    Print["Re[f[x,y]] = ", ComplexExpand[Re[f[x, y]]]]; 

    Print["Im[f[x,y]] = ", ComplexExpand[Im[f[x, y]]]]; \)

Method 2. Make  F  a function of z.

\(Clear[F, x, y, X, Y, u, v, U, V, Z]; 

    F[Z_]\  := \ 
      Module[{X = Re[Z], Y = Im[Z]}, 
        Return[u[X, Y]\  + \ I\ v[X, Y]]\ ]; 

    Print[" F[2+I] = ", F[2 + I]]; 

    Print["F[x+Iy] = ", F[x + I\ y]]; 

    Print["F[x+Iy] = ", 
      MapAll[ComplexExpand, \ F[x + I\ y]]]; \)

Remark:  It was necessary to use the power of  MapAll  to achieve the last result.

Print["Re[F[x+\[ImaginaryI]y]] = ", 
      MapAll[ComplexExpand,  Re[F[x + I y]]]]Print["Im[F[x+\[ImaginaryI]y]] = ", 
      MapAll[ComplexExpand,  Im[F[x + I y]]]];

Example 2.1,  Page 38.  Write  f(z)= (z^4)  in the f(z)  =  u(x,y)  + i v(x,y)  form.

\(Clear[f, x, y]; 

    f[x_, y_]\  = \ ComplexExpand[\((x\  + \ I\ y)\)\^4]; 

    Print["f[x,y] = ", f[x, y]]; 
Print["f[1,2] = ", f[1, 2]]; \)

\(Clear[F, x, y, z]; 
x /: Im[x] = 0; 
y /: Im[y] = 0; 

    x /: Re[x] = x; 
y /: Re[y] = y; 

    F[z_]\  := \ 
      Module[{x = Re[z], y = Im[z]}, 
        Return[Expand[\((x\  + \ I\ y)\)\^4]]\ ]; 

    Print["F[x+Iy] = ", F[x + I\ y]]; 

    Print[" F[1+2I] = ", F[1 + 2  I]]; \)

Example 2.2,  Page 39.  Write  f(z)  =   \(TraditionalForm\`z\&_\) Re(z)  +  (z^2) +  Im(z) in the form
     f(z)  =  u(x,y)  + i v(x,y).

\(Clear[f, F, x, y]; 

    f[x_, y_]\  = \ 
      ComplexExpand[
        Conjugate[x\  + \ I\ y] Re[x\  + \ I\ y]\  + 
          \ \((x\  + \ I\ y)\)\^2\  + \ 
          Im[x\  + \ I\ y]]; 
Print["f[x,y] = ", f[x, y]]; 

    Print["f[3,2] = ", f[3, 2]]; \)

\(x /: Im[x] = 0; 
y /: Im[y] = 0; 
x /: Re[x] = x; 
y /: Re[y] = y; 

    F[z_]\  := \ 
      Module[{x = Re[z], y = Im[z]}, 
        Return[ComplexExpand[
            Conjugate[x\  + \ I\ y] Re[x\  + \ I\ y]\ 
               + \ \((x\  + \ I\ y)\)\^2\  + \ 
              Im[x\  + \ I\ y]]]\ ]; 

    Print["F[x+Iy] = ", F[x + I\ y]]; 

    Print["F[3+2I] = ", F[3 + 2  I]]; \)

Example 2.3,  Page 39.  Express  f(z) = 4(x^2)+ i 4(y^2)  with a formula involving  z  and  \(TraditionalForm\`z\&_\).

\(Clear[f, w, x, y, z]; 
w\  = \ 4  x\^2\  + \ 4  y\^2; 

    f[z_]\  = \ 
      ReplaceAll[w
        \ , {x -> \(z\  + \ Conjugate[z]\)\/2, 
          y -> \(z\  - \ Conjugate[z]\)\/\(2  I\)}]; 

    Print["      w = ", w]; 
Print["   f[z] = ", f[z]]; 

    Print["   f[z] = ", Expand[f[z]]]; 

    Print["f[x+Iy] = ", f[x + I\ y]]; 

    Print["f[x+Iy] = ", 
      ComplexExpand[f[x + I\ y]]]; \)

Example 2.4,  Page 39.  Express  f(z)  =  (z^5)+ 4 (z^2) - 6  in polar coordinate form.

\(Clear[f, r, θ, z]; 
f[z_]\  = \ z\^5\  + \ 4\ z\^2\  - \ 6; 

    F[r, θ]\  = \ 
      ReplaceAll[
        f[z]\ , {
          z\^2 -> 
            r\^2\ Cos[2  θ]\  + \ 
              I\ r\^2\ Sin[2  θ], 
          z\^5 -> 
            r\^5\ Cos[5  θ]\  + \ 
              I\ r\^5\ Sin[5  θ]}]; 

    Print["  f[z] = ", f[z]]; 

    Print["F[r,θ] = ", F[r, θ]]; \)

GoTo Chapter 2

Section 2.2  Transformations and Linear Mappings

In the study of complex analysis the elementary transformation of the form  w = W (z) = A z + B  is called a linear transformation and it is a one-to-one mapping of the complex z-plane onto the complex w-plane.  Any geometric object is mapped onto an object that is similar to the original object: hence linear transformations can be called similarity mappings.
     Notice that the usage of the word "linear" is different than that used in linear algebra.

Load Mathematica's  ComplexMap package.  Make sure this is done only ONCE during a Mathematica  session.

Get["Graphics`ComplexMap`"];

Example 2.5,  Page 42.  Show that the function  f(z)  =  i z  maps 
the line  y = x + 1  onto the line  v = -u - 1.

\(Clear[eq1, eq2, eq3, F, solset, u, v, x, y, z]; 
x /: Im[x] = 0; 

    y /: Im[y] = 0; 
x /: Re[x] = x; 
y /: Re[y] = y; 

    F[z_]\  := \ I\ z\)\(Print["   F[z] = ", F[z]]; 

    Print["F[x+Iy] = ", F[\ x + I\ y]]; 

    Print["F[x+Iy] = ", Expand[F[\ x + I\ y]]]; 
    \)

\(eq1\  = \ u\  == \ ComplexExpand[Re[F[x + I\ y]]]; 

    eq2\  = \ v\  == \ ComplexExpand[Im[F[x + I\ y]]]; 

    eq3\  = \ y\  == \ x\  + \ 1; 

    solset\  = \ Eliminate[{eq1, eq2, eq3}, {x, y}]; 
Print[eq3]; 

    Print[solset]; \)

Example 2.6,  Page 44.  Show that the linear transformation  w  =  i z + i  maps 
the right half plane  Re(z) > 1  onto the upper half plane  Im(w) > 2.

\(Clear[eq1, eq2, f, ineq, u, v, w, x, y, z, zz, Z]; 
x /: Im[x] = 0; 

    y /: Im[y] = 0; 
x /: Re[x] = x; 
y /: Re[y] = y; 

    f[z_]\  := \ I\ z\  + \ I; 

    Print["   f[z] = ", f[z]]; 

    Print["f[x+Iy] = ", f[x + I\ y]]; 

    Print["f[x+Iy] = ", Expand[f[x + I\ y]]]; \)

\(solset\  = \ Solve[w\  == \ I\ z\  + \ I, \ z]; 
    
zz\  = \ solset[[1, 1, 2]]; 

    Z\  = \ ReplaceAll[zz\ , w -> u\  + \ I\ v]; 

    Print["w = ", f[z]]; 

    Print["w = ", f[x\  + \ I\ y]]; 

    Print["w = ", Expand[f[x + I\ y]]]; 

    Print["u = ", ComplexExpand[Re[f[x + I\ y]]]]; 

    Print["v = ", ComplexExpand[Im[f[x + I\ y]]]]; 

    Print[" "]; 
Print[solset]; 
Print[" "]; 

    Print["z = ", zz]; 
Print["z = ", Z]; 

    Print["z = ", Expand[Z]]; 
Print["x = ", ComplexExpand[Re[Z]]]; 
    
Print["y= ", ComplexExpand[Im[Z]]]; \)

To express  x > 1, we use the computations.

\(Print[ineq\  = \ ComplexExpand[Re[Z]]\  > \ 1]; 

    Print[Distribute[ineq\  + \ 1, \ Greater]]; \)

This solution is the upper half plane  Im(w) > 2.

\(Clear[f, Iden, wplane, z, zplane]; 
Iden[z_]\  = \ z; 

    f[z_]\  = \ I\ z\  + \ I; 

    zplane\  = \ 
      CartesianMap[Iden, \ {1, 5, 0.5}, {\(-6\), 4, 0.5}, 
        PlotRange -> {{\(-1\), 6}, {\(-3\), 4}}, AspectRatio -> 1, 
        Ticks -> {Range[\(-1\), 6, 1], Range[\(-3\), 4, 1]}, 
        AxesLabel -> {"x", "y"}, 
        DisplayFunction -> Identity]; \ 

    wplane\  = \ 
      CartesianMap[f, \ {1, 5, 0.5}, {\(-6\), 4, 0.5}, 
        PlotRange -> {{\(-1\), 6}, {\(-1\), 6}}, AspectRatio -> 1, 
        Ticks -> {Range[\(-1\), 6, 1], Range[\(-1\), 6, 1]}, 
        AxesLabel -> {"u", "v"}, 
        DisplayFunction -> Identity]; \ 

    Show[GraphicsArray[{zplane, wplane}], 
      DisplayFunction -> $DisplayFunction]; 

    Print["     The mapping  w = ", f[z]]; \)

Example 2.7,  Page 45.  Show that the image of the open disk   |z + 1 + i|  <  1  
under the transformation  w = (3 - 4 i) z + 6 + 2 i   is the open disk   |w + 1 - 3 i|  <  5.

\(Clear[f, ineq, solset, term, w, z, Z]; 

    f[z_]\  = \ 
      \((3\  - \ 4  I)\) z\  + \ 6\  + \ 2  I; 

    Print["   f[z] = ", f[z]]; 

    Print["f[x+Iy] = ", f[x + I\ y]]; 

    Print["f[x+Iy] = ", 
      ComplexExpand[f[x + I\ y]]]; \)

Solve for  z  in terms of  w.

\(solset\  = \ Solve[w\  == \ f[z], z]; 

    Z\  = \ Factor[solset[[1, 1, 2]]]; 

    term\  = \ Together[Z + 1 + I]; 
Print[solset]; 

    Print["        z = ", Z]; 

    Print[z + 1 + I, " = ", Z + 1 + I]; 

    Print[z + 1 + I, " = ", term]; \)

Solve for  |z|  < 1.

\(Print[Abs[z + 1 + I]\  < \ 1]; 

    Print[ineq\  = \ Abs[term[\([1]\)]]\ Abs[term[\([2]\)]]\  < \ 1]; 

    Print[Distribute[5\ ineq, \ Less]]; \)

Which is the disk   |w + 1 - 3i| < 5   in the w-plane.

\(Clear[f, Iden, wplane, W, z, zplane, Z]; 
Iden[z_]\  = \ z; 

    f[z_]\  = \ 
      \((3\  - \ 4  I)\) z\  + \ 6\  + \ 2  I; 

    Z[z_]\  = \ Iden[z - 1 - I]; 

    W[z_]\  = \ f[z - 1 - I]; 

    zplane\  = \ 
      PolarMap[Z\ , {0, 1, 0.2}, {0, 2  π, π\/12}, 
        PlotRange -> {{\(-6\), 4}, {\(-2\), 8}}, AspectRatio -> 1, 
        Ticks -> {Range[\(-6\), 4, 1], Range[\(-2\), 8, 1]}, 
        AxesLabel -> {"x", "y"}, 
        DisplayFunction -> Identity]; 

    wplane\  = \ 
      PolarMap[W\ , {0, 1, 0.2}, {0, 2  π, π\/12}, 
        PlotRange -> {{\(-6\), 4}, {\(-2\), 8}}, AspectRatio -> 1, 
        Ticks -> {Range[\(-6\), 4, 1], Range[\(-2\), 8, 1]}, 
        AxesLabel -> {"u", "v"}, 
        DisplayFunction -> Identity]; 

    Show[GraphicsArray[{zplane, wplane}], 
      DisplayFunction -> $DisplayFunction]; 

    Print["     The mapping  w = ", f[z]]; \)

Example 2.8,  Page 46.  Show that the image of the right half plane  Re(z) > 1 
under the linear transformation  w  =  (-1 + i) z  - 2 + 3 i   is the half plane  v > u + 7.

\(Clear[f, ineq1, ineq2, ineq3, x, y, z]; 
x /: Im[x] = 0; 

    y /: Im[y] = 0; 
x /: Re[x] = x; 
y /: Re[y] = y; 

    f[z_]\  := \ 
      \((\(-1\)\  + \ I)\) z\  - \ 2\  + \ 3  I; 

    Print["   f[z] = ", f[z]]; 

    Print["f[x+Iy] = ", f[\ x + I\ y]]; 

    Print["f[x+Iy] = ", 
      ComplexExpand[f[\ x + I\ y]]]; \)

Solve for  z  in terms of  w.

\(solset\  = \ 
      Solve[w\  == \ 
          \((\(-1\)\  + \ I)\) z\  - \ 2\  + \ 3  I, 
        \ z]; 
zz\  = \ 
      solset[[1, 1, 2]]; 

    Z\  = \ ReplaceAll[zz\ , w -> u\  + \ I\ v]; 

    Print["w = ", f[z]]; 

    Print["w = ", f[x\  + \ I\ y]]; 

    Print["w = ", Expand[f[x + I\ y]]]; 

    Print["u = ", ComplexExpand[Re[f[x + I\ y]]]]; 

    Print["v = ", ComplexExpand[Im[f[x + I\ y]]]]; 

    Print[" "]; 
Print[solset]; 
Print[" "]; 

    Print["z = ", zz]; 
Print["z = ", Z]; 

    Print["z = ", Expand[Z]]; 
Print["x = ", ComplexExpand[Re[Z]]]; 
    
Print["y= ", ComplexExpand[Im[Z]]]; \)

Solve for Re(z)  > 1.

\(Print[Re[z]\  > \ 1]; 

    Print[ineq1\  = \ ComplexExpand[Re[Z]]\  > \ 1]; 

    Print[ineq2\  = \ MapAll[Together, ineq1]]; 

    Print[ineq3\  = \ Distribute[2\ ineq2, \ Greater]]; 

    Print[Distribute[ineq3\  + \ u\  + \ 5, \ Greater]]; \)

Which is the right half plane  v > 7 + u  in the w-plane.

\(Clear[f, Iden, wplane, z, zplane]; 
Iden[z_]\  = \ z; 

    f[z_]\  = \ 
      \((\(-1\)\  + \ I)\) z\  - \ 2\  + \ 3  I; 

    zplane\  = \ 
      CartesianMap[Iden, \ {1, 5, 0.5}, {\(-6\), 7, 0.5}, 
        PlotRange -> {{\(-1\), 6}, {\(-1\), 6}}, AspectRatio -> 1, 
        Ticks -> {Range[\(-1\), 6, 1], Range[\(-1\), 6, 1]}, 
        AxesLabel -> {"x", "y"}, 
        DisplayFunction -> Identity]; \ 

    wplane\  = \ 
      CartesianMap[f, \ {1, 5, 0.5}, {\(-6\), 7, 0.5}, 
        PlotRange -> {{\(-10\), 2}, {\(-2\), 10}}, 
        AspectRatio -> 1, 
        Ticks -> {Range[\(-10\), 2, 2], Range[2, 10, 2]}, 
        AxesLabel -> {"u", "v"}, 
        DisplayFunction -> Identity]; \ 

    Show[GraphicsArray[{zplane, wplane}], 
      DisplayFunction -> $DisplayFunction]; 

    Print["     The mapping  w = ", f[z]]; \)

GoTo Chapter 2

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

The function  w = f (z) = (z^2) = (x^2) - (y^2) + i 2  xy  can be expressed in polar coordinates by   w = f (z) =(z^2) = (r^2) (e^i2)θ.

     The function  w  = f (z) = (z^(1/2))  can be expressed in polar coordinates by  w = f (z)=(z^(1/2))= (r^(1/2))(e^(iθ/2)).

Load Mathematica's  ComplexMap package. Make sure this is done only ONCE during a Mathematica  session.

Get["Graphics`ComplexMap`"]

Example 2.9,  Page 49.  The transformation w = (z^2) maps lines onto lines or parabolas.

\(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["   ", 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[solset1[[1, 1, 2]]]; 

    Print["u[v] = ", u1[v]]; \)

Hence, the image of the vertical line  x = a  is a parabola.

(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[solset2[[1, 1, 2]]]; 

    Print["u[v] = ", u2[v]]; \)

Hence, the image of the horizontal line  y = b  is a parabola.

\(Clear[f, Iden, wplane, z, zplane]; 
Iden[z_]\  = \ z; 

    f[z_]\  = \ z\^2; 

    zplane\  = \ 
      CartesianMap[Iden, \ {0, 0.5, 0.1}, {0, 2, 0.1}, 
        PlotRange -> {{\(-0.1\), 1}, {\(-0.2\), 2.2}}, 
        AspectRatio -> 1, 
        Ticks -> {Range[0, 0.5, 0.5], Range[0, 2, 1]}, 
        AxesLabel -> {"x", "y"}, 
        DisplayFunction -> Identity]; \ 

    wplane\  = \ 
      CartesianMap[f, \ {0, 0.5, 0.1}, {0, 2, 0.1}, 
        PlotRange -> {{\(-4\), 0.5}, {\(-0.2\), 2.2}}, 
        AspectRatio -> 2.4\/4.5, 
        Ticks -> {Range[\(-4\), 0, 1], Range[0, 2, 1]}, 
        AxesLabel -> {"u", "v"}, 
        DisplayFunction -> Identity]; \ 

    Show[GraphicsArray[{zplane, wplane}], 
      DisplayFunction -> $DisplayFunction]; 

    Print["          The mapping  w = ", f[z]]; \)

Example 2.10,  Page 50. The transformation w = (z^(1/2)) maps lines onto lines or hyperbolas.

\(Clear[f, Iden, wplane, z, zplane]; 
Iden[z_]\  = \ z; 

    f[z_]\  = \ \@z; 

    zplane\  = \ 
      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"}, 
        DisplayFunction -> Identity]; \ 

    wplane\  = \ 
      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"}, 
        DisplayFunction -> Identity]; 

    Show[GraphicsArray[{zplane, wplane}], 
      DisplayFunction -> $DisplayFunction]; 

    Print["          The mapping  w = ", f[z]]; \)

GoTo Chapter 2

Section 2.4  Limits and Continuity

Let  u = u(x,y)  be a real-valued function of the two real variables x and y.  We say that   u  has the limit  (Subscript[u, 0])  as  (x,y)  approaches  ((Subscript[x, 0]),(Subscript[y, 0]))  provided that the value of  u(x,y)  gets close to the value  (Subscript[u, 0])  as   (x,y)  gets close to  ((Subscript[x, 0]),(Subscript[y, 0])).  We write
		(lim_((x, y) -> ((Subscript[x, 0]), (Subscript[y, 0]))))u (x, y)=(Subscript[u, 0]).

Theorem 2.1,  Page 55.  Let  f (z) = u (x, y) +  i v (x, y)  be a complex function that is defined in some neighborhood of  (Subscript[z, 0]),  except perhaps at  (Subscript[z, 0])=(Subscript[x, 0])+i (Subscript[y, 0]).  Then  
	(lim_(z -> (Subscript[z, 0])))f (z)=(Subscript[w, 0])=(Subscript[u, 0]) + i (Subscript[v, 0])  
if and only if
	(lim_((x, y) -> ((Subscript[x, 0]), (Subscript[y, 0]))))u (x, y)=(Subscript[u, 0])    and    (lim_((x, y) -> ((Subscript[x, 0]), (Subscript[y, 0]))))v (x, y)=(Subscript[v, 0]).

Theorem 2.2,  Page 56.  Let  (lim_(z -> (Subscript[z, 0])))f (z) = A  and  (lim_(z -> (Subscript[z, 0])))g (z) = B.  Then
	(lim_(z -> (Subscript[z, 0])))f (z) + g (z) = A + B,  
	(lim_(z -> (Subscript[z, 0])))f (z) - g (z) = A - B,  
	(lim_(z -> (Subscript[z, 0])))f (z) g (z) = A B,  
	(lim_(z -> (Subscript[z, 0])))((f (z))/(g (z)))=(A/B),  where  B ≠ 0.

Theorem 2.3,  Page 56.  Let  f (z) = u (x, y) +  i v (x, y)  be a defined in some neighborhood of  (Subscript[z, 0]).  Then  f (z)  is continuous at  (Subscript[z, 0])=(Subscript[x, 0])+i (Subscript[y, 0])  if and only if  u (x, y)  and  v (x, y)  are continuous at  ((Subscript[x, 0]),(Subscript[y, 0])).

Theorem 2.4,  Page 56.  Suppose that  f (z)  and  g (z)  are continous at the point  (Subscript[z, 0]).  Then the following functions are continuous at (Subscript[z, 0]):
Their sum   f (z) + g (z),  
Their difference   f (z) - g (z),  
Their product   f (z) g (z),  
Their quotient   ((f (z))/(g (z))),  provided that  g((Subscript[z, 0]))≠0.
Their composition  f (g (z))  provided that  f (z)  is continuous in a neighborhood of the point  g((Subscript[z, 0])).

Example 2.11,  Page 53.  The function    u(x,y)  =  (((x^3))/((x^2) + (y^2)))  has the limit  0
as  (x,y)  approaches (0,0).

\(Clear[lim, r, θ, u, u0, u1, u2, U, U0, x, y]; 

    u[x_, y_]\  = \ x\^3\/\(x\^2 + y\^2\); 
Print["u[x,y] = ", u[x, y]]; 
    \)

\(u0\  = \ u[x, y]; 
u1\  = \ Limit[u0, x -> 0]; 

    u2\  = \ Limit[u1, y -> 0]; 

    Print[\*""    \!\(lim\+\(x -> 0\)\) "", u[x, y], " = ", 
      u1]; 
Print[
      \*""\!\(lim\+\(y -> 0\)\) \!\(lim\+\(x -> 0\)\) "", 
      u[x, y], " = ", u2]; \)

\(u0\  = \ u[x, y]; 
u1\  = \ Limit[u0, y -> 0]; 

    u2\  = \ Limit[u1, x -> 0]; 

    Print[\*""    \!\(lim\+\(y -> 0\)\) "", u[x, y], " = ", 
      u1]; 
Print[
      \*""\!\(lim\+\(x -> 0\)\) \!\(lim\+\(y -> 0\)\) "", 
      u[x, y], " = ", u2]; \)

\(U0\  = \ u[r\ Cos[θ], r\ Sin[θ]]; 

    U[r_, θ_]\  = \ Simplify[U0]; 

    lim\  = \ Limit[U[r, θ], r -> 0]; 

    Print["U[r,θ] = ", U0]; 

    Print["U[r,θ] = ", U[r, θ]]; 

    Print[\*""\!\(lim\+\(r -> 0\)\) "", U[r, θ], " = ", 
      lim]; \)

\(lim\  = \ Limit[U[r, θ], r -> 0]; 

    Print[\*""\!\(lim\+\(r -> 0\)\) "", U[r, θ], " = ", 
      lim]; \)

So, along all lines through the origin, the limit is 0.
A more rigorous proof is needed for other approaches to the origin.

Example 2.12,  Page 54.  The function    u(x,y)  =  ((x y)/((x^2) + (y^2)))
does NOT have a limit as  (x,y)  approaches (0,0).

\(Clear[lim, r, θ, u, u0, u1, u2, U, U0, x, y]; 

    u[x_, y_]\  = \(\ x\ y\)\/\(x\^2 + y\^2\); 

    Print["u[x,y] = ", u[x, y]]; \)

\(u0\  = \ u[x, y]; 
u1\  = \ Limit[u0, x -> 0]; 

    u2\  = \ Limit[u1, y -> 0]; 

    Print[\*""    \!\(lim\+\(x -> 0\)\) "", u[x, y], " = ", 
      u1]; 
Print[
      \*""\!\(lim\+\(y -> 0\)\) \!\(lim\+\(x -> 0\)\) "", 
      u[x, y], " = ", u2]; \)

\(u0\  = \ u[x, y]; 
u1\  = \ Limit[u0, y -> 0]; 

    u2\  = \ Limit[u1, x -> 0]; 

    Print[\*""    \!\(lim\+\(y -> 0\)\) "", u[x, y], " = ", 
      u1]; 
Print[
      \*""\!\(lim\+\(x -> 0\)\) \!\(lim\+\(y -> 0\)\) "", 
      u[x, y], " = ", u2]; \)

\(U0\  = \ u[r\ Cos[θ], r\ Sin[θ]]; 

    U[r_, θ_]\  = \ Simplify[U0]; 

    lim\  = \ Limit[U[r, θ], r -> 0]; 

    Print["U[r,θ] = ", U0]; 

    Print["U[r,θ] = ", U[r, θ]]; 

    Print[\*""\!\(lim\+\(r -> 0\)\) "", U[r, θ], " = ", 
      lim]; \)

Since this value is dependent on the angle θ  of approach to 0.
Therefore, u(x,y)  =  ((x y)/((x^2) + (y^2)))  does NOT have a limit  as  (x,y)  approaches (0,0).

Example on page 56.  Find the limit of  f(z)  =  (z^2) - 2z + 1  as  z -> 1 + i.

\(Clear[f, lim, z]; 
f[z_]\  = \ z\^2\  - \ 2  z\  + \ 1; 

    lim\  = \ Limit[f[z], z -> 1 + I]; 

    Print["f[z] = ", f[z]]; 

    Print[\*""\!\(lim\+\(z -> 1 + I\)\) "", f[z], 
      " = ", lim]; \)

Example 2.13,  Page 57.  Show that the polynomial function given by
      w  =  P(z)  =  (Subscript[a, 0])  +  (Subscript[a, 1])z  +  (Subscript[a, 2])(z^2)  +  ...  +  (Subscript[a, n])(z^n)
is continuous at each point  (Subscript[z, 0])  in the complex plane.

For illustration, we use  n = 5.

\(Clear[a, lim, P, z, z0]; 
P[z_]\  = \ Sum[a[n] z\^n, \ {n, 0, 5}]; 

    lim\  = \ Limit[P[z], \ z -> z0]; 
Print["     P[z] = ", P[z]]; 
    
Print[" "]; 
Print[\*""    P[(Subscript[z, 0])] = "", P[z0]]; 

    Print[\*""(lim_(z -> (Subscript[z, 0]))) P[z] = "", lim]; 

    Print[\*"" Is P[(Subscript[z, 0])] = (lim_(z -> (Subscript[z, 0]))) P[z] ?  "", lim\ \  == \ \ P[z0]]; \)

Therefore  P(z)  is continuous.

Example 2.14,  Page 58.  
Find the limit of   f(z)  =  (((z^2) - 2 i)/((z^2) - 2 z + 2))   as   z -> 1 + i.

\(Clear[f, g, lim, z]; 

    f[z_]\  = \ \(z\^2\  - \ 2  I\)\/\(z\^2\  - \ 2  z\  + \ 2\); 
    
Print["f[z] = ", f[z]]; \)

Try to evaluate f(1+i).

Print["f[1+\[ImaginaryI]] = ", f[1 + I]];

\(lim\  = \ Limit[f[z], z -> 1 + I]; 

    Print[\*""\!\(lim\+\(z -> 1 + I\)\) "", f[z], 
      " = ", lim]; \)

\(g[z_]\  = \ Factor[f[z]]; 
Print["       f[z] = ", f[z]]; 

    Print["f[z] = g[z] = ", g[z]]; 

    Print["     g[1+I] = ", g[1 + I]]; \)

GoTo Chapter 2

Section 2.5  Branches of Functions

In Section 2.3 we defined the principal square root function and investigated some of its properties.  We now investigate the branches of the square root function.

First load the ComplexMap package.  Make sure this is done only ONCE in any Mathematica  session

Get["Graphics`ComplexMap`"]

Example 2.15,  Page 60.  Find the image of the plane cut along the 
negative x-axis under the mappings 
w  =  (Subscript[f, 1])(z)  =   (z^(1/2))   =   (r^(1/2)) (cos((θ/2)) + i sin((θ/2))),    and
w  =  (Subscript[f, 2])(z)  =  - (z^(1/2))  =   (r^(1/2)) (cos(((θ + 4 π)/2)) + i sin(((θ + 4 π)/2))).

\(Clear[f, Iden, wplane, z, zplane]; 
Iden[z_]\  = \ z; 

    f[z_]\  = \ \@z; 

    zplane\  = 
      PolarMap[Iden, {0, 4, 0.5}, {\(-3.14\), \ 3.14, \ 3.14\/12}, 
        PlotRange -> {{\(-4\), 4.4}, {\(-4\), 4.4}}, 
        AspectRatio -> 1, 
        Ticks -> {Range[\(-4\), 4, 2], Range[\(-4\), 4, 2]}, 
        AxesLabel -> {"x", "y"}, 
        DisplayFunction -> Identity]; 

    wplane\  = \ 
      PolarMap[f\ , {0, 4, 0.5}, {\(-3.14\), \ 3.14, \ 3.14\/12}, 
        PlotRange -> {{\(-0.2\), 2.2}, {\(-2.2\), 2.2}}, 
        AspectRatio -> 2, 
        Ticks -> {Range[0, 2, 1], Range[\(-2\), 2, 1]}, 
        AxesLabel -> {"u", "v"}, 
        DisplayFunction -> Identity]; 

    Show[GraphicsArray[{zplane, wplane}], 
      DisplayFunction -> $DisplayFunction]; 

    Print["        The mapping  w = ", f[z]]; \)

\(Clear[f, Iden, wplane, z, zplane]; 
Iden[z_]\  = \ z; 

    f[z_]\  = \ \(-\@z\); 

    zplane\  = \ 
      PolarMap[Iden, {0, 4, 0.5}, {\(-3.14\), \ 3.14, \ 3.14\/12}, 
        PlotRange -> {{\(-4\), 4.4}, {\(-4\), 4.4}}, 
        AspectRatio -> 1, 
        Ticks -> {Range[\(-4\), 4, 2], Range[\(-4\), 4, 2]}, 
        AxesLabel -> {"x", "y"}, 
        DisplayFunction -> Identity]; 

    wplane\  = \ 
      PolarMap[f\ , {0, 4, 0.5}, {\(-3.14\), \ 3.14, \ 3.14\/12}, 
        PlotRange -> {{\(-2.2\), 0.2}, {\(-2.2\), 2.2}}, 
        AspectRatio -> 2, 
        Ticks -> {Range[\(-2\), 0, 1], Range[\(-2\), 2, 1]}, 
        AxesLabel -> {"u", "v"}, 
        DisplayFunction -> Identity]; 

    Show[GraphicsArray[{zplane, wplane}], 
      DisplayFunction -> $DisplayFunction]; 

    Print["        The mapping  w = ", f[z]]; \)

Example 2.16,  Page 61.  Show that the function  (Subscript[f, 1])(z)  is discontinuous along the negative real axis,
where   w  =  (Subscript[f, 1])(z)  =   (z^(1/2))   =   (r^(1/2)) (cos((θ/2)) + i sin((θ/2))).

\(Clear[f, r, θ]; 

    f[r_, θ_]\  = \ 
      \(\@r\) \((Cos[θ\/2] + I\ Sin[θ\/2])\); 

    lim1\  = PowerExpand[Limit[f[r, θ], θ -> π]]; 

    lim2\  = PowerExpand[Limit[f[r, θ], θ -> \(-π\)]]; 
    
Print["f[z] = ", f[r, θ]]\)\(Print[\*""\!\(lim\+\(θ -> π\)\) f[z] = "", lim1]; 
    
Print[\*""\!\(lim\+\(θ -> \(-π\)\)\) f[z] = "", 
      lim2]; \)

GoTo Chapter 2

Section 2.6 The Reciprocal Transformation  w = (1/z)

The reciprocal transformation is:  w=f(z)=(1/z).  It maps the "extended complex  z-plane" one-to-one and onto the "extended complex  w-plane".

     It is convenient to extend the system of complex numbers by joining to it an "ideal" point denoted by  ∞  and called the point at infinity.  This new set is called the extended complex plane.

First load the ComplexMap package.  Make sure this is done only ONCE in any Mathematica  session.

Get["Graphics`ComplexMap`"]

Example 2.17,  Page 67.  Show that the image of the right half plane  Re(z) > (1/2)
under the reciprocal transformation   w  =  (1/z)   is the disk  |w - 1| < 1.

\(Clear[f, Iden, ineq1, ineq2, ineq3, ineq4, wplane, z, zplane]; 

    Print[ineq1\  = \ x\  > \ 1\/2]; 

    Print[ineq2\  = \ 
        ReplaceAll[ineq1
          \ , {x -> u\/\(u\^2\  + \ v\^2\), 
            y -> \(-v\)\/\(u\^2\  + \ v\^2\)}]]; 

    Print[ineq3\  = \ 
        Distribute[\ 2 \((u\^2\  + \ v\^2)\)\ ineq2, \ Greater]]; 

    Print[ineq4\  = \ Distribute[\ 1\  - \ 2  u\  + \ ineq3, \ Greater]]; \)

\(Clear[f, Iden, wplane, z, zplane]; 
Iden[z_]\  = \ z; 

    f[z_]\  = \ 1\/z; 

    zplane\  = \ 
      CartesianMap[Iden, \ {0.5, 10, 0.5}, {\(-5\), 5, 0.25}, 
        PlotRange -> {{\(-0.1\), 10}, {\(-5\), 5}}, 
        AspectRatio -> 1, 
        Ticks -> {Range[0, 10, 2], Range[\(-5\), 5, 1]}, 
        AxesLabel -> {"x", "y"}, 
        DisplayFunction -> Identity]; \ 

    wplane\  = \ 
      CartesianMap[f, \ {0.5, 10, 0.5}, {\(-5\), 5, 0.25}, 
        PlotRange -> {{\(-0.1\), 2.1}, {\(-1.1\), 1.1}}, 
        AspectRatio -> 1, 
        Ticks -> {Range[0, 2, 1], Range[\(-2\), 2, 1]}, 
        AxesLabel -> {"u", "v"}, 
        DisplayFunction -> Identity]; \ 

    Show[GraphicsArray[{zplane, wplane}], 
      DisplayFunction -> $DisplayFunction]; 

    Print["        The mapping  w = ", f[z]]; \)

Example 2.18,  Page 67.  Find the image of the portion of the right half plane
Re(z) > (1/2)  that lies inside the circle  |z - (1/2)| < 1  under the transformation  w  =  (1/2).

\(Clear[f, Iden, ineq1, ineq2, ineq3, ineq4, ineq5, ineq6, ineq7, ineq8, 
      ineq9, wplane, z, zplane]; 
Print[ineq1\  = \ x\  > \ 1\/2]; 

    Print[ineq2\  = 
        ReplaceAll[ineq1
          \ , {x -> u\/\(u\^2\  + \ v\^2\), 
            y -> \(-v\)\/\(u\^2\  + \ v\^2\)}]]; 

    Print[ineq3\  = \ 
        Distribute[\ 2 \((u\^2\  + \ v\^2)\)\ ineq2, \ Greater]]; 

    Print[ineq4\  = \ Distribute[\ 1\  - \ 2  u\  + \ ineq3, \ Greater]]; \)

Which is the disk  |w - 1| < 1.

\(Print[ineq1\  = \ x\^2\  - \ x\  + \ 1\/4\  + \ y\^2\  < \ 1]; 

    Print[ineq2\  = \ 
        ReplaceAll[ineq1
          \ , {x -> u\/\(u\^2\  + \ v\^2\), 
            y -> \(-v\)\/\(u\^2\  + \ v\^2\)}]]; 

    Print[ineq3\  = \ MapAll[Together, ineq2]]; 

    Print[ineq4\  = \ Distribute[\ 4 \((u\^2\  + \ v\^2)\)\ ineq3, \ Less]]; 
    
Print[ineq5\  = \ MapAll[Expand, ineq4]]; 

    Print[ineq6\  = \ 
        Distribute[\ 4  u\  - u\^2\  - \ v\^2\  + \ ineq5, \ Less]]; 

    Print[ineq7\  = \ Distribute[\ 1\/3\ ineq6, \ Less]]; 

    Print[ineq8\  = \ MapAll[Expand, ineq7]]; 

    Print[ineq9\  = \ Distribute[\ \((2\/3)\)\^2\  + ineq8, \ Less]]; \)

Which is the exterior of the circle   |w + (2/3)| = (4/3).

\(Print[ineq4]; 
Print[ineq9]; \)

The image is the crescent shaped region in the w-plane which is the
portion of the disk  |w - 1| < 1 that lies outside the circle  |w + (2/3)| = (4/3).

\(Clear[f, Iden, wplane, W, z, zplane, Z]; 
Iden[z_]\  = \ z; 

    f[z_]\  = \ 1\/z; 
Z[z_]\  = \ Iden[z + 1\/2]; 

    W[z_]\  = \ f[z + 1\/2]; 

    zplane\  = \ 
      PolarMap[Z\ , {0, 1, 0.1}, {\(-π\)\/2, π\/2, π\/12}, 
        PlotRange -> {{\(-0.1\), 2.1}, {\(-1.1\), 1.1}}, 
        AspectRatio -> 1, 
        Ticks -> {Range[\(-6\), 4, 1], Range[\(-2\), 8, 1]}, 
        AxesLabel -> {"x", "y"}, 
        DisplayFunction -> Identity]; 

    wplane\  = \ 
      PolarMap[W\ , {0, 1, 0.1}, {\(-π\)\/2, π\/2, π\/12}, 
        PlotRange -> {{\(-0.1\), 2.1}, {\(-1.1\), 1.1}}, 
        AspectRatio -> 1, 
        Ticks -> {Range[0, 2, 1], Range[\(-1\), 1, 1]}, 
        AxesLabel -> {"u", "v"}, 
        DisplayFunction -> Identity]; 

    Show[GraphicsArray[{zplane, wplane}], 
      DisplayFunction -> $DisplayFunction]; 

    Print["        The mapping  w = ", f[z]]; \)

Example 2.19,  Page 69.  Find the images of the vertical lines  x = a  and the
horizontal lines  y = b  under the mapping  w  =  (1/z).

\(Clear[a, ac, al, b, bc, bl, circlea, circleb, hc, hl, horiz, x, y, u, 
      v, vc, verti, vl, wplane, zplane]; 
Print[eq1\  = \ x\  == \ a]; 

    Print[eq2\  = \ 
        ReplaceAll[eq1
          \ , {x -> u\/\(u\^2\  + \ v\^2\), 
            y -> \(-v\)\/\(u\^2\  + \ v\^2\)}]]; 

    Print[eq3\  = \ Distribute[\ \((u\^2\  + \ v\^2)\)\/a\ \ eq2, \ Equal]]; 
    
Print[eq4\  = \ Distribute[\ \(-\ u\)\/a\  + \ eq3, \ Equal]]; 

    Print[eq5\  = \ Distribute[\ 1\/\((2  a)\)\^2\  + \ eq4, \ Equal]]; \)

The image is the circle   |w - (1/(2 a))|  =  (1/(|2 a | )),
with center  (Subscript[w, 0]) = (1/(2 a))  and radius (1/(|2 a|)).

\(Print[eq1\  = \ y\  == \ b]; 

    Print[eq2\  = \ 
        ReplaceAll[eq1
          \ , {x -> u\/\(u\^2\  + \ v\^2\), 
            y -> \(-v\)\/\(u\^2\  + \ v\^2\)}]]; 

    Print[eq3\  = \ Distribute[\ \((u\^2\  + \ v\^2)\)\/b\ \ eq2, \ Equal]]; 
    
Print[eq4\  = \ Distribute[\ v\/b\  + \ eq3, \ Equal]]; 

    Print[eq5\  = \ Distribute[\(\ 1\)\/\((2  b)\)\^2\  + \ eq4, \ Equal]]; 
    \)

The image is the circle   |w +(( i)/(2 b))|  =  (1/(|2 b | )),
with center  (Subscript[w, 0]) = (( -i)/(2 b))  and radius  (1/(|2 b | )).

Now make some horizontal and vertical lines:

\(hl[b_]\  = \ Line[{{\(-2\), b}, {2, b}}]; 

    horiz\  = \ {hl[\(-1\)], hl[\(-1\)\/2], hl[1\/2], hl[1]}; 

    bl\  = \ Graphics[horiz]; 
vl[a_]\  = \ Line[{{a, \(-2\)}, {a, 2}}]; 

    verti\  = \ {vl[\(-1\)], vl[\(-1\)\/2], vl[1\/2], vl[1]}; 

    al\  = \ Graphics[verti]; \)

Now make some images of horizontal and vertical lines:

\(hc[b_]\  = \ Circle[{0, \(-1\)\/\(2  b\)}, 1\/Abs[2  b]]; 

    circleb\  = \ {hc[\(-1\)], hc[\(-1\)\/2], hc[1\/2], hc[1]}; 

    bc\  = \ Graphics[circleb]; 

    vc[a_]\  = \ Circle[{1\/\(2  a\), 0}, 1\/Abs[2  a]]; 

    circlea\  = \ {vc[\(-1\)], vc[\(-1\)\/2], vc[1\/2], vc[1]}; 

    ac\  = \ Graphics[circlea]; \)

\(zplane\  = \ 
      Show[al, bl, PlotRange -> {{\(-2.2\), 2.2}, {\(-2.2\), 2.2}}, 
        AspectRatio -> 1, Axes -> True, 
        Ticks -> {Range[\(-4\), 4, 1], Range[\(-4\), 4, 1]}, 
        AxesLabel -> {"x", "y"}, 
        DisplayFunction -> Identity]; 

    wplane\  = \ 
      Show[ac, bc, PlotRange -> {{\(-2.2\), 2.2}, {\(-2.2\), 2.2}}, 
        AspectRatio -> 1, Axes -> True, 
        Ticks -> {Range[\(-4\), 4, 1], Range[\(-4\), 4, 1]}, 
        AxesLabel -> {"u", "v"}, 
        DisplayFunction -> Identity]; 

    Show[GraphicsArray[{zplane, wplane}], 
      DisplayFunction -> $DisplayFunction]; \ 

    Print[\*""        The mapping  w = \!\(1\/z\)""]; \)

GoTo Chapter 2