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	Branches of the Complex Logarithm Function

Section 5.3	Complex Exponents

Section 5.4  Trigonometric and Hyperbolic Functions

Based on the success we had in using power series to define the complex exponential, we have reason to believe this approach will be fruitful for other elementary functions as well. The power series expansions for the real-valued sine and cosine functions are 

		\(cos \((x)\) = ∑\+\(n = 0\)\%∞\(\((\(-1\))\)\^n\ x\^\(2\ n\)\)\/\(\((2\ n)\)!\)\) and sin (x) = \(∑\+\(n = 0\)\%∞\(\((\(-1\))\)\^n\ x\^\(2  n + 1\)\)\/\(\((2  n + 1)\)!\)\).   

Thus, it is natural to make the following definitions.

Definition 5.5,  Page 182.   The series for Sine and Cosine  are 

		\(cos \((z)\) = ∑\+\(n = 0\)\%∞\(\((\(-1\))\)\^n\ z\^\(2\ n\)\)\/\(\((2\ n)\)!\)\) and sin (z) = \(∑\+\(n = 0\)\%∞\(\((\(-1\))\)\^n\ z\^\(2  n + 1\)\)\/\(\((2  n\  + \ 1)\)!\)\).   

	Clearly, these definitions agree with their real counterparts when  z  is real.  Additionally, it is easy to show that  cos(z)  and  sin(z)  are entire functions.  (We leave the proof as an exercise.)
	
	With these definitions in place, it is now easy to create the other complex trigonometric functions, provided the denominators in the following expressions do not equal zero.

Exploration (i), Page 182.  Investigate the series \(cos \((z)\) = ∑\+\(n = 0\)\%∞\(\((\(-1\))\)\^n\ z\^\(2\ n\)\)\/\(\((2\ n)\)!\)\).

Solution for Exploration (i), Page 182.

Consider  cos(z) and use Mathematica to find a Taylor polynomial expanded about z = 0, the remainder is expressed in the Big "O" notation.

Remove[a, z]; 
Clear[cos, k, n, S, S12]; 
cos[z_]  =  Series[Cos[z],  {z, 0, 12}]; 
Print["Cos[z] = ", cos[z]];

Use the general term in the series for  cos(z)  and sum the infinite series.

(Subscript[a, n])_  =  ((((-1))^n)/((2  n)!)); 
S12 = (∑_(n = 0)^6) (((((-1))^n) (z^(2 n)))/((2 n)!)); 
S = (∑_(n = 0)^∞)(((((-1))^n) (z^(2 n)))/((2 n)!)); 
\(\(Print[\*""    \!\(a\_n\) = "", a\_n];\)\ \)
Print[""]; 
\(\(Print[\*""(Subscript[S, 12])[z] = (∑_(n = 0)^6) (((((-1))^n) (z^(2  n)))/((2  n)!))""];\)\ \)
\(\(Print[\*""\!\(S\_12\)[z] = "", S12];\)\ \)
Print[""]; 
\(\(Print[\*"" (Subscript[S, ∞])[z] = (∑_(n = 0)^∞)(((((-1))^n) (z^(2  n)))/((2  n)!))""];\)\ \)
\(\(Print[\*"" \!\(S\_∞\)[z] = "", S];\)\ \)
\(\(Print[\*"" \!\(S\_∞\)[z] = "", 
        PowerExpand[S]];\)\ \)

Use Mathematica to plot some partial sums for cos(z).

Clear[f, m, n, s, 
        z]; 
f[z_] = Cos[z]; 
\(\(For\ [m = 2, 
        m ≤ 
          5, \(m++\), 
s[
            z_] = ∑\+\(n = 0\)\%m\ \(\((\(-1\))\)\^n\ z\^\(2\ n\)\)\/\(\((2\ n)\)!\); \ 
CartesianMap[
          s, {0, π, π\/16}, {\(-1\), 1, 0.25}, 
          PlotRange -> {{\(-1.7\), 1.7}, {\(-1.2\), 1.2}}, 
          AspectRatio -> 1.2\/1.7, 
          Ticks -> {Range[\(-2\), 2, 1], Range[\(-2\), 2, 1]}, 
          AxesLabel -> {"u", "v"}, 
          PlotStyle -> {Blue, 
              Cyan}]; \ \ 
Print["w = s[z,", 
          2  m, "] = ", s[z]];\ ];\)\ \)
CartesianMap[f, {0, π, (π/16)}, {-1, 1, 0.25}, 
        PlotRange -> {{-1.7, 1.7}, {-1.2, 1.2}}, 
        AspectRatio -> (1.2/1.7), 
        Ticks -> {Range[-2, 2, 1], Range[-2, 2, 1]}, 
        AxesLabel -> {"u", "v"}, 
        PlotStyle -> {Magenta, Red}]; 
Print["  The mapping  w = ", 
        f[z]];

Exploration (ii), Page 182.  Investigate the series sin (z) = \(∑\+\(n = 0\)\%∞\(\((\(-1\))\)\^n\ z\^\(2  n + 1\)\)\/\(\((2  n + 1)\)!\)\).

Solution for Exploration (ii), Page 182.

Consider  sin(z) and use Mathematica to find a Taylor polynomial expanded about z = 0, the remainder is expressed in the Big "O" notation.

Remove[b, z]; 
Clear[k, n, sin, S, S13]; 
sin[z_]  =  Series[Sin[z],  {z, 0, 11}]; 
Print["Sin[z] = ", sin[z]];

Use the general term in the series for  sin(z)  and sum the infinite series.

(Subscript[b, n])_  =  ((((-1))^n)/((2  n + 1)!)); 
S13  =  (∑_(n = 0)^6)(((((-1))^n) (z^(2  n + 1)))/((2  n + 1)!)); 
S  =  (∑_(n = 0)^∞)(((((-1))^n) (z^(2  n + 1)))/((2  n + 1)!)); 
\(\(Print[\*""    \!\(b\_n\) = "", b\_n];\)\ \)
Print[""]; 
\(\(Print[\*""(Subscript[S, 13])[z] = (∑_(n = 0)^6)(((((-1))^n) (z^(2  n + 1)))/((2  n + 1)!))""];\)\ \)
\(\(Print[\*""\!\(S\_13\)[z] = "", S13];\)\ \)
Print[""]; 
\(\(Print[\*"" (Subscript[S, ∞])[z] =  (∑_(n = 0)^∞)(((((-1))^n) (z^(2  n + 1)))/((2  n + 1)!))""];\)\ \)
\(\(Print[\*"" \!\(S\_∞\)[z] = "", S];\)\ \)
\(\(Print[\*"" \!\(S\_∞\)[z] = "", 
        PowerExpand[S]];\)\ \)

Use Mathematica to plot some partial sums for sin(z).

Clear[f, m, n, s, 
        z]; 
f[z_] = Sin[z]; 
\(\(For\ [m = 1, 
        m ≤ 
          3, \(m++\), 
s[
            z_] = ∑\+\(n = 0\)\%m\(\((\(-1\))\)\^n\ z\^\(2  n + 1\)\)\/\(\((2  n + 1)\)!\); \ 
CartesianMap[
          s, {\(-π\)\/2, π\/2, π\/16}, {\(-1\), 1, 0.25}, 
          PlotRange -> {{\(-1.7\), 1.7}, {\(-1.2\), 1.2}}, 
          AspectRatio -> 1.2\/1.7, 
          Ticks -> {Range[\(-2\), 2, 1], Range[\(-2\), 2, 1]}, 
          AxesLabel -> {"u", "v"}, 
          PlotStyle -> {DarkGreen, 
              Green}]; \ \ 
Print["w = s[z,", 
          2  m + 1, "] = ", s[z]];\ ];\)\ \)
CartesianMap[
        f, {((-π)/2), (π/2), (π/16)}, {-1, 1, 0.25}, 
        PlotRange -> {{-1.7, 1.7}, {-1.2, 1.2}}, 
        AspectRatio -> (1.2/1.7), 
        Ticks -> {Range[-2, 2, 1], Range[-2, 2, 1]}, 
        AxesLabel -> {"u", "v"}, 
        PlotStyle -> {Magenta, Red}]; 
Print["  The mapping  w = ", 
        f[z]];

Definition 5.6,  Page 183.   

	Tan[z] = Sin[z]/Cos[z], Cot[z] = Cos[z]/Sin[z], Sec[z] = (1/Cos)[z], and Csc[z] = (1/Sin)[z].

Exploration for Def. 5.6.

Tan[z] == Sin[z]/Cos[z]

Cot[z] == Cos[z]/Sin[z]

Sec[z] == (1/Cos)[z]

Csc[z] == (1/Sin)[z]

Since the series for the complex sine and cosine agree with the real sine and cosine when z is real, the remaining complex trigonometric functions likewise agree with their real counterparts. What additional properties are common? For starters, we have:

Theorem 5.4,  Page 183.  Sin[z] and Cos[z] are entire functions, with (∂_z) Sin[z] = Cos[z] and (∂_z) Cos[z] = -Sin[z].

Proof of Theorem 5.4,  see text Page 125.

Exploration for Thm. 5.4.

(∂_z) Sin[z] == Cos[z]

(∂_z) Cos[z] == -Sin[z]

For all complex numbers z, the following identities hold:  

			Sin[-z] = -Sin[z],  

			Cos[-z] = Cos[z],  
			
			Cos[z]^2 + Sin[z]^2 = 1.

Exploration for identities.

Sin[-z] == -Sin[z]

Cos[-z] == Cos[z]

eqn = Cos[z]^2 + Sin[z]^2 == 1

Simplify[eqn]

A series exploration (i) the derivative of  cos(z)  is  -sin(z)

Solution of series exploration (i).

Construct the Maclaurin series for cos(z) and sin(z) using Mathematica's "Series" procedure.

Remove[z]; 
Clear[cos, sin]; 
cos[z_]  =  
        Series[Cos[z],  {z, 0, 12}]; 
sin[z_]  =  
        Series[Sin[z],  {z, 0, 11}]; 
Print["Cos[z] = ", cos[z]]; 
Print["Sin[z] = ", sin[z]]; 
Print[""]; 
Print[" Cos'[z] = ", cos'[z]]; 
Print["-Sin[z] = ", -sin[z]]; 
Print[""]; 
Print["Does  Cos'[z] = -Sin[z] ?  ", cos'[
            z]  ==  - sin[z]];

A series exploration (ii) the derivative of  sin(z)  is  cos(z)

Solution of series exploration (ii).

Construct the Maclaurin series for cos(z) and sin(z) using Mathematica's "Series" procedure.

Remove[z]; 
Clear[cos, sin]; 
cos[z_]  =  
        Series[Cos[z],  {z, 0, 12}]; 
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[""]; 
Print["Does  Sin'[z] = Cos[z] ?  ", sin'[z]  ==  
          cos[z]];

For all complex numbers z for which the expressions are defined, we have

			(∂_z) Tan[z] = Sec[z]^2,  

			(∂_z) Cot[z] = -Csc[z]^2,  

			(∂_z) Sec[z] = Sec[z] Tan[z],  

			(∂_z) Csc[z] = -Cot[z] Csc[z].  .

Exploration for more identities.

(∂_z) Tan[z] == Sec[z]^2

(∂_z) Cot[z] == -Csc[z]^2

(∂_z) Sec[z] == Sec[z] Tan[z]

(∂_z) Csc[z] == -Cot[z] Csc[z]

To establish additional properties, it will be useful to express cos z and sin z in the Cartesian form u+iv. (Additionally, the applications in Chapters 9 and 10 will use these formulas.) We begin by observing that the argument given to prove part (iii) in Theorem 5.1 easily generalizes to the complex case with the aid of Definition 5.4. That is,  

			(e^(i z)) = 
        Cos[z] + i Sin[z],

for all z, whether z is real or complex. Hence,  

			(e^(-i z)) = 
        Cos[-z] + i Sin[-z],  
			        =Cos[
            z] - i Sin[z].

Subtracting the second equation from the first and solving for z gives

			\(Sin[
          z] = \(e\^\(i\ z\)\  - \ e\^\(\(-i\)\ z\)\)\/\(2  i\)\),  

which can then be used to obtain the important identity

			Sin[x + i y] = 
        Cosh[y] Sin[x] + i Cos[x] Sinh[y]. 

Similarly,

			Cos[x + i y] = 
        Cos[x] Cosh[y] - i Sin[x] Sinh[y].

Exploration for real and imaginary parts of Sin and Cos.

Print[ (E^(I z)) == 
          Cos[z] + I Sin[z] ]; 
ComplexExpand[ (E^(I z)) == 
        Cos[z] + I Sin[z] ]

Print[ (E^(-I z)) == 
          Cos[-z] + I Sin[-z] ]; 
ComplexExpand[ (E^(-I z)) == 
        Cos[-z] + I Sin[-z] ]

Print[ (E^(-I z)) == 
          Cos[z] - I Sin[z] ]; 
ComplexExpand[ (E^(-I z)) == 
        Cos[z] - I Sin[z] ]

Print[ 
        Sin[z] == (((E^(I z)) - (E^(-I z)))/(2  I))]; 
ComplexExpand[ 
      Sin[z] == (((E^(I z)) - (E^(-I z)))/(2  I))]

Print[
        Sin[x + I y] == 
          ComplexExpand[ 
            Sin[x + I y]] ]; 
Print[
        ComplexExpand[
          Sin[x + I y] ==  
            Sin[x + I y]] ];

Print[
        Cos[x + I y] == 
          ComplexExpand[ 
            Cos[x + I y]] ]; 
Print[
        ComplexExpand[
          Cos[x + I y] ==  
            Cos[x + I y]] ];

For all complex numbers z = x + i y, the following identities hold  

			Sin[z + 2  π] = Sin[z],  

			Cos[z + 2  π] = Cos[z],  

			Sin[z + π] = -Sin[z],  

			Cos[z + π] = -Cos[z],  

			Tan[z + π] = Tan[z],  

			Cot[z + π] = Cot[z].

Exploration for trigonometric identities.

Sin[z + 2  π]
Simplify[Sin[z + 2  n π], Element[n, Integers]]

Cos[z + 2  π]
Simplify[Cos[z + 2  n π], Element[n, Integers]]

Sin[z + π]
Simplify[Sin[z + (2  n + 1) π], 
      Element[n, Integers]]

Cos[z + π]
Simplify[Cos[z + (2  n + 1) π], 
      Element[n, Integers]]

Tan[z + π]
Simplify[Tan[z + (2  n + 1) π], 
      Element[n, Integers]]

Cot[z + π]
Simplify[Cot[z + (2  n + 1) π], 
      Element[n, Integers]]

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

Solution for extra trig. example for cos(z).

First, use Mathematica's "Solve" procedure to find some of the solutions to  cos(z) = 0.

Remove[x, y, z]; 
Clear[cosZ, eq1, eq2]; 
cosZ  =  
        ComplexExpand[
          Cos[x  +  I y]]; 
eq1  =  ComplexExpand[Re[cosZ]]  ==  0; 
eq2  =  
        ComplexExpand[Im[cosZ]]  ==  
          0; 
Print[Cos[x  +  I y]  ==  0]; 
Print[cosZ  ==  0]; 
Print[""]; 
Print[eq1 ]; 
Print[eq2]; 
Print[Solve[{eq1, eq2}, {x, y}]];

Remark. It is assumed that both  x  and  y  are real numbers. Hence, the only two valid solution in the above list are  {y -> 0, x -> -(π/2)}, {y -> 0, 
        x -> (π/2)}.  

This is another way to solve the equation  cos(z) = 0.

Remove[z]; 
Clear[solset]; 
solset = Solve[Cos[z] == 0, z]; 
Print[solset]; 
Print["The solutions are to cos(z) = 0 are:"]; 
\(\(Print["2 n π + ", \ 
        solset\_\(\([[\)\(2, 1, 2\)\(]]\)\)];\)\ \)
\(\(Print["2 n π ", 
        solset\_\(\([[\)\(1, 1, 2\)\(]]\)\)];\)\ \)

We can also list some of the solutions.

Clear[n]; 
\(\(For[n = 0, 
        n ≤ 
          5, \(n++\), 
Print[\*""Cos[(π/2)+ "", n, " π] = ", 
          Cos[π\/2 + n\ π]]];\)\ \)

Or by 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]];\)\ \)

Finally, we could just let Mathematica do it.

Cos[(n + (1/2)) π]
Simplify[Cos[(n + (1/2)) π], Element[n, Integers]]

Extra Example for trig. identities (i),  Page 187.  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])).

Solution for extra example for trig identities (i).

Use Mathematica's "ComplexExpand" procedure and the identities Cos[z] =\(\(e\^\(i\ z\) + \ e\^\(\(-\ i\)\ z\)\)\/2\)  and  Sin[z] =\(\(e\^\(i\ \ z\) - \ e\^\(\(-\ i\)\ z\)\)\/\(2  i\)\).

Remove[w, x, y, z]; 
(Subscript[z, 1])  =  (Subscript[x, 1])  +  I (Subscript[y, 1]); 
(Subscript[z, 2])  =  (Subscript[x, 2])  +  I (Subscript[y, 2]); 
(Subscript[w, 1])  =  Cos[(Subscript[z, 1])  +  (Subscript[z, 2])]; 
(Subscript[w, 2])  =  
        Cos[(Subscript[z, 1])] Cos[(Subscript[z, 2])]  -  Sin[(Subscript[z, 1])] Sin[(Subscript[z, 2])]; 
(Subscript[w, 3])  =  
        ReplaceAll[(Subscript[w, 1]), 
          Cos[z_]  -> (((E^(I z)) +  (E^(- I z)))/2)]; 
\(\(w\_4\  = \ 
        ReplaceAll[
          w\_2, {Cos[
                z_]\  -> \(E\^\(I\ z\) + \ E\^\(\(-\ I\)\ \ z\)\)\/2, 
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Sin[
                z_]\  -> \(E\^\(I\ \ z\) - \ E\^\(\(-\ I\)\ z\)\)\/\(2  I\)}];\)\ \)
(Subscript[w, 5])  =  ComplexExpand[(Subscript[w, 3])]; 
(Subscript[w, 6])  =  ComplexExpand[(Subscript[w, 4])]; 
(Subscript[w, 7])  =  Apart[(Subscript[w, 5])]; 
(Subscript[w, 8])  =  Apart[(Subscript[w, 6])]; 
(Subscript[w, 9])  =  Expand[(Subscript[w, 7]), Trig -> True]; 
(Subscript[w, 0])  =  Expand[(Subscript[w, 8]), Trig -> True]; 
\(\(Print[\*""\!\(w\_1\) = "", w\_1];\)\ \)
\(\(Print[\*""\!\(w\_2\) = "", w\_2];\)\ \)
Print[""]; 
\(\(Print[\*""\!\(w\_1\) = "", w\_3];\)\ \)
\(\(Print[\*""\!\(w\_2\) = "", w\_4];\)\ \)
Print[""]; 
\(\(Print[\*""\!\(w\_1\) = "", w\_5];\)\ \)
\(\(Print[\*""\!\(w\_2\) = "", w\_6];\)\ \)
Print[""]; 
\(\(Print[\*""\!\(w\_1\) = "", w\_7];\)\ \)
\(\(Print[\*""\!\(w\_2\) = "", w\_8];\)\ \)
Print[""]; 
\(\(Print[\*""\!\(w\_1\) = "", w\_9];\)\ \)
\(\(Print[\*""\!\(w\_2\) = "", 
        w\_0];\)\ \)
Print[""]; 
\(\(Print[\*""Is \!\(w\_1\) = \!\(w\_2\) ?  "", 
        Expand[w\_9, Trig -> True]\  == \ \ Expand[w\_0, 
            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])).

Extra Example for trig. identities (ii),  Page 187.  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])).

Solution for extra example for trig identities (ii).

Use Mathematica's "ComplexExpand" procedure.

Remove[v, w, x, y, z]; 
(Subscript[v, 1])  =  
        ComplexExpand[
          Cos[(Subscript[x, 1]) + I (Subscript[y, 1])  +  
              (Subscript[x, 2]) + I (Subscript[y, 2])]]; 
(Subscript[v, 2])  =  
        ComplexExpand[Cos[((Subscript[x, 1]) + I (Subscript[y, 1]))]]; 
(Subscript[v, 3])  =  
        ComplexExpand[Cos[((Subscript[x, 2]) + I (Subscript[y, 2]))]]; 
(Subscript[v, 4])  =  
        ComplexExpand[Sin[((Subscript[x, 1]) + I (Subscript[y, 1]))]]; 
(Subscript[v, 5])  =  
        ComplexExpand[Sin[((Subscript[x, 2]) + I (Subscript[y, 2]))]]; 
(Subscript[v, 6])  =  (Subscript[v, 2]) (Subscript[v, 3])  -  (Subscript[v, 4]) (Subscript[v, 5]); 
\(\(Print[\*""\!\(w\_1\) = Cos[\!\(z\_1\)+\!\(z\_2\)]""];\)\ \)
\(\(Print[\*""(Subscript[w, 2]) = Cos[(Subscript[z, 1])]Cos[(Subscript[z, 2])]-Sin[(Subscript[z, 1])]Sin[(Subscript[z, 2])]""];\)\ \)
Print[""]; 
\(\(Print[\*""\!\(w\_1\) = "", v\_1];\)\ \)
\(\(Print[\*""\!\(w\_2\) = "", v\_6];\)\ \)
(Subscript[v, 7])  =  Expand[(Subscript[v, 6]), Trig -> True]; 
Print[""]; 
\(\(Print[\*""\!\(w\_1\) = "", v\_1];\)\ \)
\(\(Print[\*""\!\(w\_2\) = "", v\_7];\)\ \)
(Subscript[v, 1])  =  Expand[(Subscript[v, 1]), Trig -> True]; 
Print[""]; 
\(\(Print[\*""\!\(w\_1\) = "", v\_1];\)\ \)
\(\(Print[\*""\!\(w\_2\) = "", 
        v\_7];\)\ \)
Print[""]; 
\(\(Print[\*""Is \!\(w\_1\) = \!\(w\_2\) ?  "", 
        v\_1\  == \ v\_7];\)\ \)

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

Extra Example for Sin(z), Page 187.  Graph the transformation   w  =  sin(z).

Solution for Page 145.

Enter the formula f[z] = Sin[z] and graph the transformation.

Remove[z]; 
Clear[f, wplane]; 
Iden[z_]  =  z; 
f[z_]  =  Sin[z]; 
CartesianMap[
        Iden,  {((-π)/2), (π/2), (π/16)}, {-1, 1, 0.25}, 
        PlotRange -> {{-1.7, 1.7}, {-1.1, 1.1}}, 
        AspectRatio -> (1.1/1.7), 
        Ticks -> {Range[-2, 2, 1], Range[-1, 1, 1]}, 
        AxesLabel -> {"x", "y"}, 
        PlotStyle -> {Magenta, Red}]; 
\(\(Print[\*""The lines forming the rectangle ((-π)/2) ≤ x ≤ (π/2), -1 ≤ y ≤ 1.""];\)\ \)
CartesianMap[
        f, {((-π)/2), (π/2), (π/16)}, {-1, 1, 0.25}, 
        PlotRange -> {{-1.6, 1.6}, {-1.2, 1.2}}, 
        AspectRatio -> (1.2/1.6), 
        Ticks -> {Range[-2, 2, 1], Range[-2, 2, 1]}, 
        AxesLabel -> {"u", "v"}, 
        PlotStyle -> {Magenta, Red}]; 
Print["The image hyperbolas and ellipses,"]; 
Print["under the mapping  w = ", 
        f[z]];

Identities for  \(\(|\)\(Sin[x + iy]\)\( | \^2\)\),  on Page 187.

Solution for identities for \(\(|\)\(Sin[x + iy]\)\( | \^2\)\).

Remove[w]; 
Clear[aw]; 
w   =  ComplexExpand[Sin[x  +  I y]]; 
\(\(aw\  = \ 
        ComplexExpand[
          Abs[w], 
\ \ \ \ \ \ \ TargetFunctions -> {Im, 
              Re}];\)\ \)
aw1 = 
        ReplaceAll[
          (aw^2), {Cos[x]^2 -> 1 - Sin[x]^2, 
            Cosh[y]^2 -> 
              1 + Sinh[y]^2}]; 
aw2 = Simplify[aw1]; 
Print[" Sin[x+\[ImaginaryI]y] = ", 
        w]; 
Print[""]; 
Print[("Sin[x+\[ImaginaryI]y]"^2), " = ", 
        (aw^2)]; 
Print[("Sin[x+\[ImaginaryI]y]"^2), " = ", 
        aw1]; 
Print[""]; 
Print[("Sin[x+\[ImaginaryI]y]"^2), " = ", 
        aw2];

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

Solution 5.10.

First, use Mathematica's "Solve" procedure to find some of the solutions to  cos z = cosh 2.

Remove[x, y, z]; 
Clear[cosZ, eq1, eq2]; 
cosZ  =  
        ComplexExpand[
          Cos[x  +  I y]]; 
eq1  =  ComplexExpand[Re[cosZ]]  ==  Cosh[2]; 
eq2  =  
        ComplexExpand[Im[cosZ]]  ==  
          0; 
Print[
        Cos[x  +  I y]  ==   Cosh[2]]; 
Print[cosZ  ==  0]; 
Print[""]; 
Print[eq1 ]; 
Print[eq2]; 
Print[Solve[{eq1, eq2}, {x, y}]];

This is another way to solve the equation  cos(z) = cosh(2).

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

We can also list some of the solutions.

Clear[k]; 
For[k = 0, 
        k ≤ 5, k++, 
Print["Cos[", 
          2  k, " π + 2\[ImaginaryI]] = ", 
          Cos[2  k π + 
              2  I]]]; 
Print[""]; 
For[k = 0, 
        k ≤ 5, k++, 
Print["Cos[", 
          2  k, " π - 2\[ImaginaryI]] = ", 
          Cos[2  k π - 
              2  I]]];

Expansion for tan(x+iy) on  Page 188.

Solution of  expansion of tan(x+iy) on  Page 188.

Remove[w, x, y]; 
(Subscript[w, 3])  =  
        ComplexExpand[Tan[x  +  I y]]; 
Print["Tan[x+\[ImaginaryI]y] = ", 
        (Subscript[w, 3])];

Extra example for tan(z), Page 188.  Graph the transformation  w = tan(z).

Solution 5.9 for extra example for tan(z).

Enter the formula f[z] = Tan[z] and graph the transformation.

Remove[z]; 
Clear[f, Iden]; 
Iden[z_]  =  z; 
f[z_]  =  Tan[z]; 
CartesianMap[
        Iden,  {((-π)/4), (π/4), (π/16)}, {-3, 3, 0.25}, 
        PlotRange -> {{-1, 1}, {-3.2, 3.2}}, 
        AspectRatio -> 1, 
        Ticks -> {Range[((-π)/4), (π/4), (π/4)], 
            Range[-3, 3, 1]}, AxesLabel -> {"x", "y"}, 
        PlotStyle -> {Magenta, Pink}];  
\(\(Print[\*""The lines forming the rectangle ((-π)/4) ≤ x ≤ (π/4), -3 ≤ y ≤ 3.""];\)\ \)
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"}, 
        PlotStyle -> {Magenta, Pink}];  
Print["The image disk  |w| < 1,"]; 
Print["under the mapping  w = ", 
        f[z]];

Definition 5.7,  Page 189.   The hyperbolic cosine and hyperbolic sine functions are  

		\(Cosh[
          z] = \(1\/2\) \((e\^z + e\^\(-z\))\)\) and \(Sinh[
          z] = \(1\/2\) \((e\^z - e\^\(-z\))\)\).

Definition 5.8,  Page 189.   Identities for the hyperbolic trigonometric functions are  

		Tanh[z] = Sinh[z]/Cosh[z],  

		Coth[z] = Cosh[z]/Sinh[z],  

		Sech[z] = (1/Cosh)[z],  

		Csch[z] = (1/Sinh)[z].

Section 5.4  Exercises for Trigonometric and Hyperbolic Functions
See textbook page 192.

Section 5.5	Inverse Trigonometric and Hyperbolic Functions

GO TO  THE  Table of Contents