Thu Apr 24 09:12:13 MDT 1997 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]:= (* ---------- Trigonometry ---------- *) 0. Second In[6]:= (* => - [(sqrt(5) + 1) sqrt(2)]/[(sqrt(5) - 1) sqrt(sqrt(5) + 5)] = - sqrt[1 + 2/sqrt(5)] From B. F. Caviness, Robert P. Gilbert, Wolfram Koepf, Roman Shtokhamer\ > and David W. Wood, _An Introduction to Applied Symbolic Computation using MACSYMA_, University of Delaware, draft of December 14, 1993, section\ > 2.3.3. *) 0. Second In[7]:= Tan[7*Pi/10] 0. Second 1 + Sqrt[5] Out[7]= -(---------------------) Sqrt[2 (5 - Sqrt[5])] In[8]:= (* => - cos 3 *) 0. Second In[9]:= Sqrt[(1 + Cos[6])/2] 0.02 Second 1 + Cos[6] Out[9]= Sqrt[----------] 2 In[10]:= Simplify[%] 0.08 Second Out[10]= -Cos[3] In[11]:= (* cos(n pi) + sin((4 n - 1)/2 pi) => (-1)^n - 1 for integer n *) 0. Second In[12]:= Cos[n*Pi] + Sin[(4*n - 1)/2 * Pi] 0. Second (-1 + 4 n) Pi Out[12]= Cos[n Pi] + Sin[-------------] 2 In[13]:= Simplify[%] 0.08 Second Out[13]= Cos[n Pi] - Cos[2 n Pi] In[14]:= (* cos(cos(n pi) pi) + sin(cos(n pi) pi/2) => -1 + (-1)^n for\ > integer n *) 0. Second In[15]:= Cos[Cos[n*Pi]*Pi] + Sin[Cos[n*Pi]*Pi/2] 0. Second Pi Cos[n Pi] Out[15]= Cos[Pi Cos[n Pi]] + Sin[------------] 2 In[16]:= (* sin([n^5/5 + n^4/2 + n^3/3 - n/30] pi) => 0 for integer n [Paul Zimmermann] *) 0. Second In[17]:= Sin[(n^5/5 + n^4/2 + n^3/3 - n/30) * Pi] 0. Second 3 4 5 -n n n n Out[17]= Sin[(-- + -- + -- + --) Pi] 30 3 2 5 In[18]:= (* | cos x |, | sin x | => - cos x, - sin x for - 3 pi < x < - 5/2\ > pi *) 0. Second In[19]:= (*assume[-3*Pi < x < -5/2*Pi]*) 0. Second In[20]:= {Abs[Cos[x]], Abs[Sin[x]]} 0.01 Second Out[20]= {Abs[Cos[x]], Abs[Sin[x]]} In[21]:= (* Trigonometric manipulations---these are typically difficult for\ > students *) 0. Second In[22]:= r = Cos[3*x]/Cos[x] 0. Second Out[22]= Cos[3 x] Sec[x] In[23]:= ( (* => cos(x)^2 - 3 sin(x)^2 or similar *) TrigExpand[r] ) 0.01 Second 2 2 Out[23]= Cos[x] - 3 Sin[x] In[24]:= ( (* => 2 cos(2 x) - 1 *) TrigReduce[TrigExpand[r]] ) 0.02 Second Out[24]= -1 + 2 Cos[2 x] In[25]:= (* Use rewrite rules => cos(x)^2 - 3 sin(x)^2 *) 0. Second In[26]:= sincosAngles = { Cos[n_Integer * x_] -> Cos[(n - 1)*x] * Cos[x] - Sin[(n - 1)*x] * Sin[x], Sin[n_Integer * x_] -> Sin[(n - 1)*x] * Cos[x] + Cos[(n - 1)*x] * Sin[x] } 0.01 Second Out[26]= {Cos[(n_Integer) (x_)] -> > Cos[x] Cos[(-1 + n) x] - Sin[x] Sin[(-1 + n) x], > Sin[(n_Integer) (x_)] -> Cos[(-1 + n) x] Sin[x] + Cos[x] Sin[(-1 + n) x]} In[27]:= r //. sincosAngles 0.01 Second 2 2 2 Out[27]= Sec[x] (-2 Cos[x] Sin[x] + Cos[x] (Cos[x] - Sin[x] )) In[28]:= Expand[%] 0.01 Second 2 2 Out[28]= Cos[x] - 3 Sin[x] In[29]:= Clear[r] 0. Second In[30]:= (* Here is a tricky way of writing 0/0 *) 0. Second In[31]:= expr = (Tan[x]^2 + 1 - Sec[x]^2)/(Sin[x]^2 + Cos[x]^2 - 1) 0. Second 2 2 1 - Sec[x] + Tan[x] Out[31]= ---------------------- 2 2 -1 + Cos[x] + Sin[x] In[32]:= (* Let's try simplifying this expression! *) 0. Second In[33]:= Simplify[expr] 1 Power::infy: Infinite expression - encountered. 0 Infinity::indet: Indeterminate expression 0 ComplexInfinity encountered. 0.07 Second Out[33]= Indeterminate In[34]:= (* What is its limit at zero? *) 0. Second In[35]:= Limit[expr, x -> 0] General::dbyz: Division by zero. Infinity::indet: Indeterminate expression 0 ComplexInfinity encountered. 0.86 Second Out[35]= Indeterminate In[36]:= (* What is the derivative? *) 0. Second In[37]:= D[expr, x] 0. Second Out[37]= 0 In[38]:= Clear[expr] 0. Second In[39]:= (* ---------- Quit ---------- *) 0. Second In[40]:= Quit[] real 7.58 user 1.96 sys 0.35