Tue Jan 27 21:46:38 MST 1998 euler% math Mathematica 3.0 for Solaris Copyright 1988-96 Wolfram Research, Inc. -- Terminal graphics initialized -- In[1]:= In[2]:= In[3]:= (* ----------[ M a t h e m a t i c a ]---------- *) 0. Second In[4]:= (* ---------- Initialization ---------- *) 0. Second In[5]:= (* ---------- The Complex Domain ---------- *) 0. Second In[6]:= (* Complex functions---separate into their real and imaginary parts. Here, variables default to COMPLEX. [Re(x + i y), Im(x + i y)] => [Re(x) - Im(y), Im(x) + Re(y)] for x and y complex *) 0. Second In[7]:= {Re[x + I*y], Im[x + I*y]} 0. Second Out[7]= {-Im[y] + Re[x], Im[x] + Re[y]} In[8]:= ComplexExpand[%] 0.09 Second Out[8]= {x, y} In[9]:= (* => 1 [W. Kahan] *) 0. Second In[10]:= Abs[3 - Sqrt[7] + I*Sqrt[6*Sqrt[7] - 15]] 0. Second 2 Out[10]= Sqrt[-15 + 6 Sqrt[7] + (3 - Sqrt[7]) ] In[11]:= Simplify[%] 0.02 Second Out[11]= 1 In[12]:= (* => 1/sqrt(a^2 + (1/a + b)^2) for real a, b *) 0. Second In[13]:= Abs[1/(a + I/a + I*b)] 0. Second 1 Out[13]= ---------------- I Abs[- + a + I b] a In[14]:= ComplexExpand[%] 0.03 Second 1 Out[14]= ---------------- I Abs[- + a + I b] a In[15]:= (* This is a challenge problem proposed by W. Kahan: simplify the\ > following expression for complex z. Expanding out the expression produces (z^2 + 1)/(2 z) +- (z + 1)*(z - 1)/(2 z) => z or 1/z in each of its\ > branches *) 0. Second In[16]:= (* => log 5 + i arctan(4/3) *) 0. Second In[17]:= ComplexExpand[Log[3 + 4*I]] 0.01 Second 4 Out[17]= I ArcTan[-] + Log[5] 3 In[18]:= (* => [sin(x) cos(x) + i sinh(y) cosh(y)] / [cos(x)^2 + sinh(y)^2] *) 0. Second In[19]:= ComplexExpand[Tan[x + I*y]] 0.01 Second Sin[2 x] I Sinh[2 y] Out[19]= -------------------- + -------------------- Cos[2 x] + Cosh[2 y] Cos[2 x] + Cosh[2 y] In[20]:= (* Check for branch abuse. See David R. Stoutemyer, ``Crimes and\ > Misdemeanors in the Computer Algebra Trade'', _Notices of the American Mathematical Society_, Volume 38, Number 7, September 1991, 778--785. This first expression can simplify to sqrt(x y)/sqrt(x), but no further in general (consider what happens when x, y = -1). sqrt(x y) = sqrt(x) sqrt(y) if either x >= 0 or y >= 0 or both x and y lie in the right-half plane (Re x, Re y > 0) [considering principal values]. *) 0. Second In[21]:= expr = Sqrt[x*y*Abs[z]^2] / (Sqrt[x]*Abs[z]) 0. Second Sqrt[x y] Out[21]= --------- Sqrt[x] In[22]:= Simplify[%] 0.02 Second Sqrt[x y] Out[22]= --------- Sqrt[x] In[23]:= ComplexExpand[%] 0.07 Second 2 2 Arg[x] Arg[x y] Sqrt[Sqrt[x ] Sqrt[y ]] Cos[------] Cos[--------] 2 2 Out[23]= ------------------------------------------------- - 2 1/4 (x ) 2 2 Arg[x y] Arg[x] I Sqrt[Sqrt[x ] Sqrt[y ]] Cos[--------] Sin[------] 2 2 > --------------------------------------------------- + 2 1/4 (x ) 2 2 Arg[x] Arg[x y] I Sqrt[Sqrt[x ] Sqrt[y ]] Cos[------] Sin[--------] 2 2 > --------------------------------------------------- + 2 1/4 (x ) 2 2 Arg[x] Arg[x y] Sqrt[Sqrt[x ] Sqrt[y ]] Sin[------] Sin[--------] 2 2 > ------------------------------------------------- 2 1/4 (x ) In[24]:= FullSimplify[%] 4.15 Second 2 2 Sqrt[Sqrt[x ] Sqrt[y ]] Out[24]= -------------------------------- I/2 (Arg[x] - Arg[x y]) 2 1/4 E (x ) In[25]:= (* Special case: sqrt(x y |z|^2)/(sqrt(x) |z|) => sqrt(y) [PV] for y\ > >= 0 *) 0. Second In[26]:= PowerExpand[expr] 0. Second Out[26]= Sqrt[y] In[27]:= (* sqrt(1/z) = 1/sqrt(z) except when z is real and negative, in\ > which case sqrt(1/z) = - 1/sqrt(z) [considering principal values] *) 0. Second In[28]:= Sqrt[1/z] - 1/Sqrt[z] 0. Second 1 1 Out[28]= Sqrt[-] - ------- z Sqrt[z] In[29]:= Simplify[%] 0.03 Second 1 1 Out[29]= Sqrt[-] - ------- z Sqrt[z] In[30]:= ( (* Special case: sqrt(1/z) - 1/sqrt(z) => 0 [PV] for z > 0 *) PowerExpand[%] ) 0. Second Out[30]= 0 In[31]:= (* Special case: sqrt(1/z) + 1/sqrt(z) => 0 [PV] for z < 0 *) 0. Second In[32]:= (* sqrt(e^z) = e^(z/2) if and only if Im z is contained in the\ > interval ((4 n - 1) pi, (4 n + 1) pi] for n an integer: ..., (-5 pi, -3 pi], (-pi, pi], (3 pi, 5 pi], ...; otherwise, sqrt(e^z) = - e^(z/2)\ > [considering principal values] *) 0. Second In[33]:= Sqrt[E^z] - E^(z/2) 0. Second z/2 z Out[33]= -E + Sqrt[E ] In[34]:= Simplify[%] 0.03 Second z/2 z Out[34]= -E + Sqrt[E ] In[35]:= ( (* Special case: sqrt(e^z) - e^(z/2) => 0 [PV] for z real *) ComplexExpand[%] ) 0.01 Second Out[35]= 0 In[36]:= (* The principal value of this expression is - e^(3 i) = - cos 3 - i\ > sin 3 *) 0. Second In[37]:= Sqrt[E^(6*I)] 0. Second 6 I Out[37]= Sqrt[E ] In[38]:= ComplexExpand[%] 0.04 Second 6 - 2 Pi 6 - 2 Pi Out[38]= Cos[--------] + I Sin[--------] 2 2 In[39]:= TrigReduce[%] 0.01 Second Out[39]= -Cos[3] - I Sin[3] In[40]:= (* log(e^z) = z if and only if Im z is contained in the interval\ > (-pi, pi] [considering principal values] *) 0. Second In[41]:= Log[E^z] 0. Second z Out[41]= Log[E ] In[42]:= Simplify[%] 0. Second z Out[42]= Log[E ] In[43]:= ( (* Special case: log(e^z) => z [PV] for z real *) ComplexExpand[%] ) 0.01 Second Out[43]= z In[44]:= (* The principal value of this expression is (10 - 4 pi) i *) 0. Second In[45]:= Log[E^(10*I)] 0.02 Second Out[45]= 10 I - 4 I Pi In[46]:= (* (x y)^n = x^n y^n if either x > 0 or y > 0 or both x and y lie in\ > the right-half plane (Re x, Re y > 0) or n is an integer [considering\ > principal values] *) 0. Second In[47]:= expr = (x*y)^(1/n) - x^(1/n)*y^(1/n) 0. Second 1/n 1/n 1/n Out[47]= -(x y ) + (x y) In[48]:= Simplify[%] 0.08 Second 1/n 1/n 1/n Out[48]= -(x y ) + (x y) In[49]:= ComplexExpand[%] 0.07 Second 2 1/(2 n) 2 1/(2 n) Arg[x] Arg[y] Out[49]= -((x ) (y ) Cos[------] Cos[------]) + n n 2 2 1/n Arg[x y] > (Sqrt[x ] Sqrt[y ]) Cos[--------] - n 2 1/(2 n) 2 1/(2 n) Arg[y] Arg[x] > I (x ) (y ) Cos[------] Sin[------] - n n 2 1/(2 n) 2 1/(2 n) Arg[x] Arg[y] > I (x ) (y ) Cos[------] Sin[------] + n n 2 1/(2 n) 2 1/(2 n) Arg[x] Arg[y] > (x ) (y ) Sin[------] Sin[------] + n n 2 2 1/n Arg[x y] > I (Sqrt[x ] Sqrt[y ]) Sin[--------] n In[50]:= FullSimplify[%] 9.87 Second (I (Arg[x] + Arg[y]))/n 2 1/(2 n) 2 1/(2 n) Out[50]= -(E (x ) (y ) ) + (I Arg[x y])/n 2 2 1/n > E (Sqrt[x ] Sqrt[y ]) In[51]:= (* Special case: (x y)^(1/n) - x^(1/n) y^(1/n) => 0 [PV] for y > 0 *) 0. Second In[52]:= PowerExpand[expr, {y}] 0. Second Out[52]= 0 In[53]:= (* Special case: (x y)^n - x^n y^n => 0 [PV] for integer n *) 0. Second In[54]:= (x*y)^n - x^n*y^n 0. Second n n n Out[54]= -(x y ) + (x y) In[55]:= (* arctan(tan(z)) = z for z real if and only if z is contained in\ > the interval (-pi/2, pi/2] [considering principal values] *) 0. Second In[56]:= ArcTan[Tan[z]] 0. Second Out[56]= ArcTan[Tan[z]] In[57]:= Simplify[%] 0. Second Out[57]= ArcTan[Tan[z]] In[58]:= ComplexExpand[%] 0.05 Second -Arg[1 - I Tan[z]] Arg[1 + I Tan[z]] I Out[58]= ------------------ + ----------------- + - Log[Abs[1 - I Tan[z]]] - 2 2 2 I > - Log[Abs[1 + I Tan[z]]] 2 In[59]:= Simplify[%] 0.21 Second Out[59]= (-Arg[1 - I Tan[z]] + Arg[1 + I Tan[z]] + > I (Log[Abs[1 - I Tan[z]]] - Log[Abs[1 + I Tan[z]]])) / 2 In[60]:= Clear[expr] 0. Second In[61]:= (* Special case: arctan(tan(z)) => z [PV] for -pi/2 < z < pi/2 *) 0. Second In[62]:= (* The principal value of this expression is 10 - 3 pi *) 0. Second In[63]:= ArcTan[Tan[10]] 0.01 Second Out[63]= 10 - 3 Pi In[64]:= (* The principal value of this expression is 11 - 4 pi + 30 i =\ > -1.56637 + 30 i *) 0. Second In[65]:= ArcTan[Tan[11 + 30*I]] 0.01 Second Out[65]= 11 + 30 I - 4 Pi In[66]:= ArcTan[Tan[11.0 + 30.0*I]] 0. Second Out[66]= -0.785398 + 32.3636 I In[67]:= (* This is a challenge problem proposed by W. Kahan: simplify the\ > following expression for complex z. Expanding out the expression produces (z^2 + 1)/(2 z) +- (z + 1)*(z - 1)/(2 z) => z or 1/z in each of its\ > branches *) 0. Second In[68]:= w = (z + 1/z)/2 0. Second 1 - + z z Out[68]= ----- 2 In[69]:= expr = w + Sqrt[w + 1]*Sqrt[w - 1] 0. Second 1 1 1 - + z - + z - + z z z z Out[69]= ----- + Sqrt[-1 + -----] Sqrt[1 + -----] 2 2 2 In[70]:= Simplify[expr] 0.2 Second 2 1 1 1 + z + z Sqrt[-2 + - + z] Sqrt[2 + - + z] z z Out[70]= ------------------------------------------- 2 z In[71]:= Clear[w, expr] 0. Second In[72]:= (* ---------- Quit ---------- *) 0. Second In[73]:= Quit[] real 31.34 user 15.91 sys 0.54