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 5  ELEMENTARY FUNCTIONS
Section 5.1  The Complex Exponential Function
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
GoTo Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11.
GoTo Contents

CHAPTER 5  ELEMENTARY FUNCTIONS

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

    Get["Graphics`ComplexMap`"]; 

    Clear[cos, cosZ, eq1, eq2, f, f2, n, r, sin, S, S12, S13, t1, t2, 
      θ, u, v1, v2, v3, v4, v5, v6, U, v, V, w, wplane, x, x1, x2, y, 
      y1, y2, w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, z, z0, z1, z2, z3, z4, 
      zn, zplane]; \)

Section 5.1  The Complex Exponential Function

A standard result from  calculus is that the exponential function can be represented by the power series  exp(x) = (∑_(n = 0)^∞)(((x^n))/(n!)).  Thus, it is only natural to define the complex exponential in the following way:

Definition 5.1,  Page 125.  The definition of exp(z) is:   exp(z) = (∑_(n = 0)^∞)((z^n)/(n!)).

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

Get["Graphics`ComplexMap`"]

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

\(Clear[f, x, y, z]; 
f[z_] = E\^z; 

    Print[" f[z] = ", f[z]]; 
Print["f'[z] = ", \(f'\)[z]]; 

    Print[" f[0] = ", f[0]]; \)

To see its real and imaginary parts, use complex expand.

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

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

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

Now verify that the "rules of exponents" hold.

\(Clear[x1, x2, y1, y2, w1, w2, w3, w4, w5, w6, z1, z2, z3, z4]; 

    w1\  = \ ComplexExpand[E\^\(x\_1 + I\ y\_1\)]; 
    
w2\  = \ 
      ComplexExpand[E\^\(x\_2 + I\ y\_2\)]; 

    Print[\*""(Subscript[(E^z), 1]) = "", w1]; 

    Print[\*""(Subscript[(E^z), 2]) = "", w2]; 
Print[" "]; 
    
w3\  = \ Expand[w1\ w2]; 

    Print[\*""(Subscript[(E^z), 1])(Subscript[(E^z), 2]) = "", w3]; 
w3\  = \ Simplify[w3, Trig -> False]; 

    Print[\*""(Subscript[(E^z), 1])(Subscript[(E^z), 2]) = "", w3]; 
Print[" "]; 

    z4\  = \ \((x\_1 + I\ y\_1)\) + 
        \((x\_2 + I\ y\_2)\); 

    w4\  = \ ComplexExpand[E\^z4]; 

    Print[\*""(E^((Subscript[z, 1]) + (Subscript[z, 2]))) = "", w4]; 

    w4\  = \ Simplify[w4, Trig -> False]; 

    Print[\*""(E^((Subscript[z, 1]) + (Subscript[z, 2]))) = "", w4]; 

    Print[" "]; 

    Print[\*""Does (Subscript[(E^z), 1])(Subscript[(E^z), 2])= (E^((Subscript[z, 1]) + (Subscript[z, 2]))) ?""]\)\(Print[w3, " = ", w4]; 
Print[" "]; 

    w3\  = \ ComplexExpand[w3]; 
w4\  = \ ComplexExpand[w4]; 

    Print[w3, " = ", w4]; 
Print[" "]; 

    w3\  = \ Simplify[ComplexExpand[w3], Trig -> True]; 

    w4\  = \ Simplify[ComplexExpand[w4], Trig -> True]; 

    Print[w3, " = ", w4]; 
Print[w3 == w4]; \)

Example 5.1,  Page 127.  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])  =  exp((Subscript[z, n])).

\(z0\  = \ 5\/4\  + \(\ I\ 11\ π\)\/6; 

    Print[\*""\!\(z\_0\) = "", z0]\)

Clear[n]\(\(For[n = 0, n ≤ 5, \(n++\), 
\ \ 
      zn\  = \ z0\  + \ I\ 2  π\ n; 
\ \ 
      Print["Exp[", zn, "]  =  ", 
\ \ 
        Factor[ComplexExpand[E\^zn]]\ ]\ ]; \)\)

Example 5.2,  Page 129.  Show that the transformation  w = exp(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.

Clear[f, z]\(Iden[z_]\  = \ z; 
f[z_]\  = \ E\^z; 

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

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

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

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

GoTo Chapter 5

Section 5.2  Branches of the Complex Logarithm Function

If  w  is a nonzero complex number, then the equation w = exp(z) has infinitely many solutions.  Because the function exp(z) is a many-to-one function, its inverse (the logarithm) is multivalued.

Definition 5.2,  Page 132.  (Multivalued Logarithm)
log(z)  =  ln|z|  +  i arg(z)                      (for z ≠ 0).
log(z)  =  ln|z|  +  i (Arg(z) + 2 π n)      (for z ≠ 0).

Definition 5.3,  Page 132.  (Principal Value of the Logarithm)
Log(z)  =  ln|z|  +  i Arg(z)      (for z ≠ 0).

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

Get["Graphics`ComplexMap`"]

Example on, Page 132.  Investigate the Logarithm function.

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

    w\  = \ ComplexExpand[Log[\((x + I\ y)\)]]; 

    u[x_, y_]\  = \ 
      ComplexExpand[Re[Log[\((x + I\ y)\)]], 
        TargetFunctions -> {Re, Im}]; 

    v[x_, y_]\  = \ 
      ComplexExpand[Im[Log[\((x + I\ y)\)]], 
        TargetFunctions -> {Re, Im}]; 

    Print["    Log[(x+Iy)] = ", w]; 

    Print["    Log[(x+Iy)] = ", 
      u[x, y] + \ I\ v[x, y]]; 

    Print["Re[Log[(x+Iy)]] = ", u[x, y]]; 

    Print["Im[Log[(x+Iy)]] = ", v[x, y]]; \)

\(Clear[r, θ, U, V]; 
U[r_, θ_]\  = \ Log[r]; 

    V[r_, θ_]\  = \ θ; 

    W\  = \ U[r, θ]\  + \ I\ V[r, θ]; 

    Print[\*""    Log[r \!\(E\^\(I\\ θ\)\)] = "", W]\)\(Print[
      \*""Re[Log[r \!\(E\^\(I\\ θ\)\)]] = "", U[r, θ]]\)\(Print[
      \*""Im[Log[r \!\(E\^\(I\\ θ\)\)]] = "", V[r, θ]]\)

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

Clear[w]\(w\  = \ ComplexExpand[Log[1\  + \ I]]; 

    Print["Log[1+I] = ", w]\)

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

\(Clear[n, w1, w2]; 
w1\  = \ ComplexExpand[Log[1\  + \ I]]; 
    
w2\  = \ 
      ComplexExpand[
        Log[1\  + \ I]\  + \ I\ 2\ π\ n\ ]; 

    Print["Log[1+I] = ", Log[1 + I]]; 

    Print["Log[1+I] = ", w1]; 
Print[" "]; 

    Print["log[1+I] = ", 
      Log[1 + I]\  + \ I\ 2\ π\ n]; 

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

The transformation  w = Log(z)  maps the punctured z-plane onto the horizontal strip  in the w-plane.

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

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

    wplane\  = \ 
      PolarMap[f, {1.0\/150, 150.1, 15}, {\(-3.141\), 3.141, 3.141\/6}, 
        PlotRange -> {{\(-5.2\), 5.2}, {\(-5.2\), 5.2}}, 
        AspectRatio -> 1, 
        Ticks -> {Range[\(-5\), 5, 5], Range[\(-π\), π, π]}, 
        AxesLabel -> {"u", "v"}, 
        DisplayFunction -> Identity]; 

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

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

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

\(Clear[z, w1, w2]; 
z\ \  = \ \(-\ E\); 

    w1\  = \ Log[Abs[z]]\  + \ I\ Arg[z]; 

    w2\  = \ ComplexExpand[Log[z]]; 

    Print["                    z  = ", z]; 

    Print["Log[Abs[z]] + I Arg[z] = ", w1]; 

    Print["                Log[z] = ", w2]; \)

\(Clear[z, w1, w2]; 
z\ \  = \ \(-1\); 

    w1\  = \ Log[Abs[z]]\  + \ I\ Arg[z]; 

    w2\  = \ ComplexExpand[Log[z]]; 

    Print["                    z  = ", z]; 

    Print["Log[Abs[z]] + I Arg[z] = ", w1]; 

    Print["                Log[z] = ", w2]; \)

Page 134,  Property (10)  of  Log(z).

\(v1\  = \ 
      ComplexExpand[Log[\((x\_1 + I\ y\_1)\)], 
\ \ \ \ \ \ \ 
        TargetFunctions -> {Im, Re}]; 

    v2\  = \ ComplexExpand[Log[\((x\_2 + I\ y\_2)\)], 

        \ \ \ \ \ \ \ TargetFunctions -> {Im, Re}]; 

    v3\  = \ ComplexExpand[
        Log[\((x\_1 + I\ y\_1)\) 
            \((x\_2 + I\ y\_2)\)], 
\ \ \ \ \ \ \ 
        TargetFunctions -> {Im, Re}]; 

    Print[\*""Log[\!\(z\_1\)] = "", v1]; 

    Print[\*""Log[\!\(z\_2\)] = "", v2]; 

    Print[\*""Log[\!\(z\_1\) \!\(z\_2\)] = "", v3]; \)

What about those pesky ArcTan's ?

Example on,   Page 135.  Verify that   Log((Subscript[z, 1]) (Subscript[z, 2]))   ≠   Log((Subscript[z, 1]))  +  Log((Subscript[z, 2])).

\(z1\  = \ \(-\ \@3\)\  + \ I; 

    z2\  = \ \(-\ 1\)\  + \ I\ \@3; 
z3\  = \ Expand[z1\ z2]; 

    w1\  = \ ComplexExpand[Log[z1]]; 
w2\  = \ ComplexExpand[Log[z2]]; 

    w3\  = \ ComplexExpand[Log[z3]]; 

    Print[\*""             (Subscript[z, 1]) = "", z1]; 

    Print[\*""             (Subscript[z, 2]) = "", z2]; 

    Print[\*""          (Subscript[z, 1]) (Subscript[z, 2]) = "", z3]; 

    Print[" "]; 
Print[\*""        Log[(Subscript[z, 1])] = "", w1]; 

    Print[\*""        Log[(Subscript[z, 2])] = "", w2]; 

    Print[\*""     Log[(Subscript[z, 1]) (Subscript[z, 2])] = "", w3]; 

    Print[\*""Log[(Subscript[z, 1])]+Log[(Subscript[z, 2])] = "", w1 + w2]; 

    Print[\*""  Is Log[(Subscript[z, 1]) (Subscript[z, 2])] = Log[(Subscript[z, 1])] + Log[(Subscript[z, 2])] = ?  "", w3\  == w1 + w2]; \)

So we see that   Log((Subscript[z, 1]) (Subscript[z, 2]))   ≠   Log((Subscript[z, 1]))  +  Log((Subscript[z, 2])).

GoTo Chapter 5

Section 5.3  Complex Exponents

Definition 5.4,  Page 138.  Let  c  be a complex number.   We define  (z^( c))  as:
       (z^( c))  =  exp[c log(z)].

Example 5.5,  Page 139.  (a)  Find the principal value of   (((1  +  i))^(1/2)).

\(Clear[w0, w1, w2, w3, z0]; 
z0\  = \ 1\  + \ I; 

    w0\  = \ ComplexExpand[Log[z0]]; 

    w1\  = \ ComplexExpand[Exp[1\/2\ Log[z0]]]; 

    w2\  = \ ComplexExpand[\@z0]; 
w3\  = N[\@z0]; 

    Print["       Log[", z0, "] = ", w0]; 

    Print[\*""Exp[\!\(1\/2\)Log["", z0, "]] = ", w1]; 

    Print[" "]; 
Print["          ", \@z0, " = ", w2]; 

    Print["          ", \@z0, " = ", w3]; \)

(b)  Find the principal value of  (((-1))^i).

\(Clear[w1, w2, w3]; 
w1\  = \ Exp[I\ Log[\(-1\)]]; 

    w2\  = ComplexExpand[\((\(-1\))\)\^I]; 

    w3\  = Chop[N[\((\(-1\))\)\^I]]; 

    Print["Exp[I Log[-1]] = ", w1]; 
Print[" "]; 

    Print[\*""         (-1\!\(\()\^I\)\) = "", w2]; 

    Print[\*""         (-1\!\(\()\^I\)\) = "", w3]; \)

Example 5.6,  Page 140.  Find the values of   (2^(1/9  +  i/50)).

The principal value is:

\(Clear[pts, w1, w2, w3]; 

    w1\  = \ E\^\(\((1\/9\  + \(\ I\)\/50)\)\ 
          Log[2]\); 
w2\  = \ 2\^\(1/9\  + \ I/50\); 

    w3\  = \ N[2\^\(1/9\  + \ I/50\)]; 

    Print[\*""\!\(E\^\(\((1\/9\\  + \(\\ I\)\/50)\)\\ Log[2]\)\) = "", w1]; 

    Print[\*""     \!\(2\^\(1/9\\  + \\ I/50\)\) = "", 
      w2]; 
Print[
      \*""     \!\(2\^\(1/9\\  + \\ I/50\)\) = "", w3]; 
    \)

Some of the other values are:

pts = Table[{
              N[Re[(E^(((1/9)  + (( I)/50)) 
                      (Log[2] + 2  π I n)))], 3], 
              N[Im[(E^(((1/9)  + (( I)/50)) 
                      (Log[2] + 2  π I n)))], 3]}, {n, 
              -9, 9, 1}];
ListPlot[pts, PlotRange -> {{-2, 3.5}, {-2, 3.5}}, 
          AspectRatio -> 1, 
          Prolog -> {PointSize[0.02], RGBColor[1, 0, 0]}];
Print["     Some values of \!\(TraditionalForm\`\*
StyleBox[\(2\^\(1/9 + i/50\)\),
FontSize->15]\)"];
Print[Table[{
              N[(E^(((1/9)  + (( I)/50)) 
                    (Log[2] + 2  π I n))), 3]}, {n, 
              -9, 9, 1}]];

Example 5.7,  Page 140.  (a)  Find the values of    (((((i^2))))^i).
(b)  Find the values of   (((i))^(2 i)).

The principal values are:

Clear[t1, t2, w1, w2, w3, w4];
w1  =  (E^(I Log[(I^2)]));
w2  =  (E^(2  I Log[I]));
w3  = N[(E^(I Log[(I^2)]))];
w4  =  
        N[(E^(2  I Log[I]))];
Print[((((I^2)))^I), " = ", w1];
Print[(I^(2I))," = ",w2];
Print[((((I^2)))^I), " = ", w3];
Print[(I^(2I))," = ",w4];

Some of the other values are given in the sets:

\(t1\  = \ 
        Table[E\^\(I\ 
              \((Log[I\^2] + 2  π\ I\ n)\)\), 

          \ \ \ \ \ \ \ \ \ \ {n, \(-4\), 4, 1}]\);
\(t2\  = \ 
        Table[E\^\(2  I 
              \((\ Log[I]\ \  + 2  π\ I\ n)\)\), 
          
\ \ \ \ \ \ \ \ \ \ {n, \(-4\), 4, 1}]\);
Print[((((I^2)))^I), " = ", t1];
Print[(I^(2I))," = ",t2];

Remark.  The two sets are different.  Therefore, in general ,  ((((z^a)))^b)  ≠  (z^ab).

GoTo Chapter 5

Section 5.4  Trigonometric and Hyperbolic Functions

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

Get["Graphics`ComplexMap`"]

Definition 5.5,  Page 143.   The series for   cos(z)   and   sin(z)  are:

\(Clear[a, cos, n, S, S12, z]; 

    cos[z_]\  = \ Series[Cos[z], \ {z, 0, 12}]; 

    Print["Cos[z] = ", cos[z]]; \)

The general coefficient for  cos(z)   is:

\(a[n_]\  = \ \(\((\(-1\))\)\^n\ z\^\(2  n\)\)\/\(\((2  n)\)!\); 

    S12\  = \ ∑\+\(n = 0\)\%6 a[n]; 

    S\  = \ ∑\+\(n = 0\)\%∞ a[n]; 

    Print[\*""    \!\(a\_n\) = "", a[n]]; 

    Print[\*""\!\(S\_12\)[z] = "", S12]; 

    Print[\*"" \!\(S\_∞\)[z] = "", S]; 

    Print[\*"" \!\(S\_∞\)[z] = "", PowerExpand[S]]; \)

\(Clear[b, n, sin, S, S13, z]; 

    sin[z_]\  = \ Series[Sin[z], \ {z, 0, 11}]; 

    Print["Sin[z] = ", sin[z]]; \)

The general coefficient for  sin(z)   is:

\(b[n_]\  = \ \(\((\(-1\))\)\^n\ z\^\(2  n + 1\)\)\/\(\((2  n + 1)\)!\); 
    
S13\  = \ ∑\+\(n = 0\)\%6 b[n]; 

    S\  = \ ∑\+\(n = 0\)\%∞ b[n]; 

    Print[\*""    \!\(b\_n\) = "", b[n]]; 

    Print[\*""\!\(S\_13\)[z] = "", S13]; 

    Print[\*"" \!\(S\_∞\)[z] = "", S]; 

    Print[\*"" \!\(S\_∞\)[z] = "", PowerExpand[S]]; \)

The derivative of  cos(z)   is   - sin(z):

\(Print["Cos[z] = ", cos[z]]; 
Print["Sin[z] = ", sin[z]]; 

    Print[" "]; 
Print[" Cos'[z] = ", \(cos'\)[z]]; 

    Print["-Sin[z] = ", \(-sin[z]\)]; 

    Print["Does  Cos'[z] = -Sin[z] ?  ", 
      \(cos'\)[z]\  == \ \(-\ sin[z]\)]; \)

Remark. In order to verify that the derivative of  sin(z)   is   cos(z),  it is necessary to adjust the length of the  sin(z)  series.

\(sin[z_]\  = \ Series[Sin[z], \ {z, 0, 13}]; 

    Print["Sin[z] = ", sin[z]]; 
Print[" "]; 

    Print["Sin'[z] = ", \(sin'\)[z]]; 
Print[" Cos[z] = ", cos[z]]; 
    
Print["Does  Sin'[z] = Cos[z] ?  ", \(sin'\)[z]\  == \ cos[z]]; \)

Figure 5.9, Page 145.  Graph the transformation   w  =  sin(z).

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

    zplane\  = \ 
      CartesianMap[Iden, 
        \ {\(-π\)\/2, π\/2, π\/16}, {\(-1\), 1, 0.25}, 
        PlotRange -> {{\(-1.7\), 1.7}, {\(-3.4\), 3.4}}, 
        AspectRatio -> 1, 
        Ticks -> {Range[\(-1\), 1, 1], Range[\(-3\), 3, 1]}, 
        AxesLabel -> {"x", "y"}, 
        DisplayFunction -> Identity]; 

    wplane\  = \ 
      CartesianMap[
        f, {\(-π\)\/2, π\/2, π\/16}, {\(-1\), 1, 0.25}, 
        PlotRange -> {{\(-1.6\), 1.6}, {\(-1.6\), 1.6}}, 
        AspectRatio -> 1, 
        Ticks -> {Range[\(-10\), 10, 5], Range[\(-10\), 10, 5]}, 
        AxesLabel -> {"u", "v"}, 
        DisplayFunction -> Identity]; 

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

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

Example 5.8,  Page 146.  Verify the identity   cos(z) = 0,  if and only if  
z = (n + (1/2))π   for  n  an integer.

Clear[cosZ, eq1, eq2, x, y, z]\(Print[cosZ\  = \ ComplexExpand[Cos[x\  + \ I\ y]]]; 

    Print[cosZ\  == \ 0]; 

    Print[eq1\  = \ ComplexExpand[Re[cosZ]]\  == \ 0]; 

    Print[eq2\  = \ ComplexExpand[Im[cosZ]]\  == \ 0]; 

    Print[Solve[{eq1, eq2}, {x, y}]]; \)

Remark.  It is assumed that both  x  and  y  are real numbers.
Hence, the only valid solution is   x = (π/2) ,  y = 0.

Print[Solve[Cos[z]  ==  0 ,  z]];

The other solutions are obtained by adding  π n  to this result.

\(Print[\*""   Cos[\!\(π\/2\)] = "", Cos[π\/2]]; 

    Print[\*"" Cos[\!\(π\/2\)+π] = "", Cos[π\/2 + π]]; 
    
Print[\*""Cos[\!\(π\/2\)+3π] = "", 
      Cos[π\/2 + 3  π]]; 

    Print[\*""Cos[\!\(π\/2\)+4π] = "", 
      Cos[π\/2 + 4  π]]; \)

Or showing that the system of equations is satisfied.

\(Print[\*""Cos[\!\(π\/2\)]Cosh[0] = "", Cos[π\/2] Cosh[0], 
      
\*"",   -Sin[\!\(π\/2\)]Sinh[0] = "", 
      \(-Sin[π\/2]\) Sinh[0]]; 
Print[" "]; 

    Print[\*""Cos[\!\(π\/2\)+π]Cosh[0] = "", 
      Cos[π\/2 + π] Cosh[0], 

      \*"",   -Sin[\!\(π\/2\)+π]Sinh[0] = "", 
      \(-Sin[π\/2 + π]\) Sinh[0]]; 
Print[" "]; 

    Print[\*""Cos[\!\(π\/2\)+2π]Cosh[0] = "", 
      Cos[π\/2 + 2  π] Cosh[0], 

      \*"",   -Sin[\!\(π\/2\)+2π]Sinh[0] = "", 
      \(-Sin[π\/2 + 2  π]\) Sinh[0]]; 
Print[" "]; 

    Print[\*""Cos[\!\(π\/2\)+3π]Cosh[0] = "", 
      Cos[π\/2 + 3  π] Cosh[0], 

      \*"",   -Sin[\!\(π\/2\)+3π]Sinh[0] = "", 
      \(-Sin[π\/2 + 3  π]\) Sinh[0]]; \)

Example 5.9,  Page 146.  Establish the trigonometric identity for complex numbers:
      cos((Subscript[z, 1]) + (Subscript[z, 2]))  =  cos((Subscript[z, 1]))cos((Subscript[z, 2]))  -  sin((Subscript[z, 1]))sin((Subscript[z, 2]))

\(Clear[w, w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, x, x1, x2, y, y1, y2, 
      z, z1, z2]; 
z1\  = \ x\_1\  + \ I\ y\_1; 

    z2\  = \ x\_2\  + \ I\ y\_2; 
w1\  = \ Cos[z1\  + \ z2]; 

    w2\  = \ Cos[z1] Cos[z2]\  - \ Sin[z1] Sin[z2]; 

    w3\  = \ ReplaceAll[w1, 
        Cos[z_]\  -> 
          \(E\^\(I\ z\) + \ 
              E\^\(\(-\ I\)\ z\)\)\/2]; 

    w4\  = \ ReplaceAll[
        w2, {Cos[z_]\  -> 
            \(E\^\(I\ z\) + \ 
                E\^\(\(-\ I\)\ z\)\)\/2, 

          \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
          Sin[z_]\  -> 
            \(E\^\(I\ z\) - \ 
                E\^\(\(-\ I\)\ z\)\)\/\(2  I\)}]; 

    w5\  = \ ComplexExpand[w3]; 
w6\  = \ ComplexExpand[w4]; 

    w7\  = \ Apart[w5]; 
w8\  = \ Apart[w6]; 

    w9\  = \ Expand[w7, Trig -> True]; 

    w0\  = \ Expand[w8, Trig -> True]; 

    Print[\*""\!\(w\_1\) = "", w1]; 

    Print[\*""\!\(w\_2\) = "", w2]; 
Print[" "]; 

    Print[\*""\!\(w\_1\) = "", w3]; 

    Print[\*""\!\(w\_2\) = "", w4]; 
Print[" "]; 

    Print[\*""\!\(w\_1\) = "", w5]; 

    Print[\*""\!\(w\_2\) = "", w6]; 
Print[" "]; 

    Print[\*""\!\(w\_1\) = "", w7]; 

    Print[\*""\!\(w\_2\) = "", w8]; 
Print[" "]; 

    Print[\*""\!\(w\_1\) = "", w9]; 

    Print[\*""\!\(w\_2\) = "", w0]; 

    Print[\*""Is \!\(w\_1\) = \!\(w\_2\) ?  "", 
      Expand[w9, Trig -> True]\  == \ \ Expand[w0, Trig -> True]]; 
    \)

Therefore,  cos((Subscript[z, 1]) + (Subscript[z, 2]))  =  cos((Subscript[z, 1]))cos((Subscript[z, 2]))  -  sin((Subscript[z, 1]))sin((Subscript[z, 2])).

Properties of sin(z) and cos(z) on  Page 146.

Clear[w1, w2, w3, x, y]\(w1\  = \ ComplexExpand[Cos[x\  + \ I\ y]]; 

    w2\  = \ ComplexExpand[Sin[x\  + \ I\ y]]; 

    w3\  = \ ComplexExpand[Tan[x\  + \ I\ y]]; 

    Print["Cos[x+Iy] = ", w1]; 

    Print["Sin[x+Iy] = ", w2]; 

    Print["Tan[x+Iy] = ", w3]; \)

Establish the trigonometric identity for complex numbers:
      cos((Subscript[z, 1]) + (Subscript[z, 2]))  =  cos((Subscript[z, 1]))cos((Subscript[z, 2]))  -  sin((Subscript[z, 1]))sin((Subscript[z, 2]))

\(Clear[v1, v2, v3, v4, v5, v6, w, x, x1, x2, y, y1, y2, z, z1, z2]; 

    v1\  = \ ComplexExpand[
        Cos[x\_1 + I\ y\_1\  + \ x\_2 + I\ y\_2]]; 

    v2\  = \ ComplexExpand[Cos[\((x\_1 + I\ y\_1)\)]]; 

    v3\  = \ ComplexExpand[Cos[\((x\_2 + I\ y\_2)\)]]; 

    v4\  = \ ComplexExpand[Sin[\((x\_1 + I\ y\_1)\)]]; 

    v5\  = \ ComplexExpand[Sin[\((x\_2 + I\ y\_2)\)]]; 

    v6\  = \ v2\ v3\  - \ v4\ v5; 

    Print[\*""(Subscript[w, 1]) = Cos[(Subscript[z, 1])+(Subscript[z, 2])]""]; 

    Print[\*""(Subscript[w, 2]) = Cos[(Subscript[z, 1])]Cos[(Subscript[z, 2])]-Sin[(Subscript[z, 1])]Sin[(Subscript[z, 2])]""]; 

    Print[" "]; 
Print[\*""(Subscript[w, 1]) = "", v1]; 

    Print[\*""(Subscript[w, 2]) = "", v6]; 

    v7\  = \ Expand[v6, Trig -> True]; 
Print[" "]; 

    Print[\*""(Subscript[w, 1]) = "", v1]; 

    Print[\*""(Subscript[w, 2]) = "", v7]; 

    v1\  = \ Expand[v1, Trig -> True]; 
Print[" "]; 

    Print[\*""(Subscript[w, 1]) = "", v1]; 

    Print[\*""(Subscript[w, 2]) = "", v7]; 

    Print[\*""Is (Subscript[w, 1]) = (Subscript[w, 2]) ?  "", v1\  == \ v7]; \)

Therefore, cos((Subscript[z, 1]) + (Subscript[z, 2]))  =  cos((Subscript[z, 1]))cos((Subscript[z, 2]))  -  sin((Subscript[z, 1]))sin((Subscript[z, 2]))

Next we have two identities relating  sin(z).

\(Clear[aw, w]; 
w\ \  = \ ComplexExpand[Sin[x\  + \ I\ y]]; 
    
aw\  = \ 
      ComplexExpand[Abs[w], 
\ \ \ \ \ \ \ 
        TargetFunctions -> {Im, Re}]; 

    Print["  Sin[x+Iy] = ", w]; 

    Print["|Sin[x+Iy]| = ", aw]; 

    Print["|Sin[x+Iy]| = ", FullSimplify[aw]]; \)

Figure 5.9, Page 145.  Graph the transformation   w  =  sin(z).

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

    zplane\  = \ 
      CartesianMap[Iden, 
        \ {\(-π\)\/4, π\/4, π\/16}, {\(-3\), 3, 0.25}, 
        PlotRange -> {{\(-1\), 1}, {\(-3.2\), 3.2}}, 
        AspectRatio -> 1, 
        Ticks -> {Range[\(-1\), 1, 1], Range[\(-3\), 3, 1]}, 
        AxesLabel -> {"x", "y"}, 
        DisplayFunction -> Identity]; 

    wplane\  = \ 
      CartesianMap[
        f, {\(-π\)\/4, π\/4, π\/16}, {\(-3\), 3, 0.25}, 
        PlotRange -> {{\(-1.1\), 1.1}, {\(-1.1\), 1.1}}, 
        AspectRatio -> 1, 
        Ticks -> {Range[\(-1\), 1, 1], Range[\(-1\), 1, 1]}, 
        AxesLabel -> {"u", "v"}, 
        DisplayFunction -> Identity]; 

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

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

Example 5.10,  Page 147.  Let us find all the values of  z  for which the equation
cos z = cosh 2  holds true.

\(Clear[solset, z]; 
solset = Solve[Cos[z] == Cosh[2], z]; 

    Print[solset]; 
Print["The solutions are to cos(z) = cosh(2) are:"]; 
    
Print["2kπ + ", \ 
      solset[[2, 1, 2]]]; 

    Print["2kπ ", 
      solset[[1, 1, 2]]]; \)

GoTo Chapter 5

Section 5.5  Inverse Trigonometric and Hyperbolic Functions

The trigonometric and hyperbolic functions were expressed in Section 5.4 in terms of the exponential function.  When we solve for their inverses, we will obtain formulas that involve the logarithm.

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

Get["Graphics`ComplexMap`"]

The Inverse Sine      arcsin(z)

Page 152,  Formula (1)      arcsin(z)  =  - i Log[ i z + (((1-(z^2)))^(1/2))]   is correct, we can verify this graphically.   (At least for values of z in the upper half plane  Im(z) > 0.)

\(Clear[f, z]; 

    f[z_]\  = \ 
      \(-\ I\)\ Log[I\ z\  + \ \@\(1\  - \ z\^2\)]; 

    CartesianMap[\ f, {\(-π\)\/2 + 0.001, π\/2 - 0.001}, {0.001, 3}]; 
    
Print["       The mapping  w = ", f[z]]; \)

\(Clear[f, z]; 
f[z_]\  = \ ArcSin[z]; 

    CartesianMap[\ f, {\(-π\)\/2 + 0.001, π\/2 - 0.001}, {0.001, 3}]; 
    
Print["       The mapping  w = ", f[z]]; \)

REMARK.  If you mess around with the square root it will be wrong.  The portion that is supposed to be in the first quadrant appears symmetrically through  z = (π/2)  in the fourth quadrant.

\(Clear[f2, z]; 

    f2[z_]\  = \ 
      \(-\ I\)\ 
        Log[I\ z\  + \ I\ \@\(z\^2\  - \ 1\)]; 

    CartesianMap[\ 
      f2, {\(-π\)\/2 + 0.001, π\/2 - 0.001}, {0.001, 3}]; 

    Print["Not so good mapping  w = ", f2[z]]; \)

The Inverse Cosine      arccos(z)

Page 152,  Formula (2)      arccos(z)  =  - i Log[ z + i (((1-(z^2)))^(1/2))]   is correct, we can verify this graphically.   (At least for values of z in the upper half plane  Im(z) > 0.)

\(Clear[f, z]; 

    f[z_]\  = \ 
      \(-\ I\)\ Log[z\  + \ I\ \@\(1\  - \ z\^2\)]; 

    CartesianMap[\ f, {\(-π\)\/2 + 0.001, π\/2 - 0.001}, {0.001, 3}]; 
    
Print["     The mapping  w = ", f[z]]; \)

\(Clear[f, z]; 
f[z_]\  = \ ArcCos[z]; 

    CartesianMap[\ f, {\(-π\)\/2 + 0.001, π\/2 - 0.001}, {0.001, 3}]; 
    
Print["        The mapping  w = ", f[z]]; \)

REMARK. If you mess around with the square root it will be wrong.

\(Clear[f, z]; 

    f[z_]\  = \ \(-\ I\)\ Log[z\  + \ \@\(z\^2\  - \ 1\)]; 

    CartesianMap[\ 
      f2, {\(-π\)\/2 + 0.001, π\/2 - 0.001}, {0.001, 3}]; 

    Print["Not so good mapping  w = ", f[z]]; \)

The Inverse Tangent      arctan(z)

Page 152,  Formula (3)      arctan(z)  =  (i/2) Log[(((i  +  z))/((i  -  z))) ]   is correct, we can verify this graphically.   (At least for values of z in the upper half plane  Im(z) > 0.)

\(Clear[f, z]; 

    f[z_]\  = \ 
      I\/2\ 
        Log[\(I\  + \ z\)\/\(I\  - \ z\)]; 

    CartesianMap[\ f, {\(+0.001\), π\/2 - 0.001}, {0.001, 3}]; 

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

\(Clear[f, z]; 
f[z_]\  = ArcTan[z]; 

    CartesianMap[\ f, {\(+0.001\), π\/2 - 0.001}, {0.001, 3}]; 

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

Example 5.11,  Page 154.  Find the values of  arcsin ((Sqrt[2]))  are given by  
arcsin ((Sqrt[2])) = 
        - i log 
          (i (Sqrt[ 2])  ±  i).
Solution.  Use the formulas in the text to get the solutions.

ComplexExpand[
      - I 
        (Log[((Sqrt[2]) + 1) I] +  I 2  n π)
          ]ComplexExpand[
      - I 
        (Log[((Sqrt[2]) - 1) I] +  I 2  n π)
          ]

Example 5.12,  Page 154.  The principal value   Arcsin ((Sqrt[2]))  is 
Arcsin ((Sqrt[2]))=(π/2)- i Log (1  +  (Sqrt[2])).
Solution.  Mathematica can the solution.

ComplexExpand[ArcSin[(Sqrt[2])]]

Example 5.13,  Page 155.  Find the values of  arctanh (1  +  2  i)
Solution.  Use the formula in the text to get the solutions.

ComplexExpand[
      (1/2) (Log[-1  +  I] +  I 2  n π)
          ]

The Inverse Hyperbolic Sine      arcsinh(z)

Page 155,  Formula (11)      arcsinh(z)   =   Log[z + ((((z^2)+1))^(1/2))]   is correct, we can verify this graphically.

\(Clear[f, z]; 
f[z_]\  = \ Log[z\  + \ \@\(z\^2\  + \ 1\)]; 

    CartesianMap[f, {0, 10}, {0.001, 10}, 
      PlotRange -> {{0, 4}, {0, 2}}]; 

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

\(Clear[f, z]; 
f[z_]\  = \ \ ArcSinh[z]; 

    CartesianMap[f, {0, 10}, {0.001, 10}, 
      PlotRange -> {{0, 4}, {0, 2}}]; 

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

The Inverse Hyperbolic Cosine     arccosh(z)

Page 155,  Formula (12)     arccosh(z)  =  Log[z + ((((z^2)-1))^(1/2))]   is correct, we can verify this graphically.   But it is correct only in quadrants  I  and  IV.

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

    CartesianMap[\ f, {0, 10}, {0.001, 10}]; 

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

\(Clear[f, z]; 
f[z_]\  = \ ArcCosh[z]; 

    CartesianMap[\ f, {0, 10}, {0.001, 10}]; 

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

REMARK. However, for other places it might not agree!  For Example in Quadrant II and III.  Here we must use the other branch of square root!  We use   arccosh(z)  =  Log[z - ((((z^2) - 1))^(1/2))].

\(Clear[f, z]; 
f[z_]\  = \ Log[z\  - \ \@\(z\^2\  - \ 1\)]; 

    CartesianMap[\ f, {\(-10\), \(-0.001\)}, {0.001, 10}]; 

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

\(Clear[f, z]; 
f[z_]\  = \ ArcCosh[z]; 

    CartesianMap[\ f, {\(-10\), \(-0.001\)}, {0.001, 10}]; 

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

The Inverse Hyperbolic Tangent      arctanh(z)

Page 155,  Formula (13)      arctanh(z)  =  (1/2)Log[(((1  +  z))/((1  -  z)))]   is correct, we can verify this graphically.

\(Clear[f, z]; 
f[z_]\  = \ 1\/2\ Log[\(1\  + \ z\)\/\(1 - z\)]; 

    CartesianMap[\ f, {0, 10}, {0.001, 10}]; 

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

\(Clear[f, z]; 
f[z_]\  = \ ArcTanh[z]; 

    CartesianMap[\ f, {0, 10}, {0.001, 10}]; 

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

GoTo Chapter 5