Mon Feb 22 22:10:44 MST 1999 aquarius% macsyma Starting Macsyma math engine with no window system... /opt/local/macsyma_422/macsyma.422 local This is Macsyma 422.0 for Sparc (Solaris 2.x) computers. Copyright (c) 1982 - 1998 Macsyma Inc. All rights reserved. Portions copyright (c) 1982 Massachusetts Institute of Technology. All rights reserved. Type "DESCRIBE(TRADE_SECRET);" to see important legal notices. Type "HELP();" for more information. /aquarius/data2/opt/local/macsyma_422/system/init.lsp being loaded. /aquarius/home/wester/macsyma-init.lsp being loaded. (c1) (c2) /* ----------[ M a c s y m a ]---------- */ /* ---------- Initialization ---------- */ symbol_display_case: lower_case$ Time= 0 msecs (c3) showtime: all$ Time= 0 msecs (c4) prederror: false$ Time= 0 msecs (c5) /* ---------- Trigonometry ---------- */ /* => - [(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. */ tan(7*%pi/10); Time= 10 msecs %pi (sqrt(5) + 5) cos(---) 10 (d5) - ---------------------- 5 (c6) ev(%, %piargs:all); Time= 0 msecs 3/2 (sqrt(5) + 5) (d6) - ---------------- 10 sqrt(2) (c7) factor(rootscontract(%)); Time= 20 msecs sqrt(5) sqrt(2 sqrt(5) + 5) (d7) - --------------------------- 5 (c8) /* => - cos 3 */ sqrt((1 + cos(6))/2); Time= 40 msecs sqrt(cos(6) + 1) (d8) ---------------- sqrt(2) (c9) /* cos(n pi) + sin((4 n - 1)/2 pi) => (-1)^n - 1 for integer n */ declare(n, integer)$ Time= 0 msecs (c10) cos(n*%pi) + sin((4*n - 1)/2 * %pi); Time= 20 msecs n (d10) (- 1) - 1 (c11) /* cos(cos(n pi) pi) + sin(cos(n pi) pi/2) => -1 + (-1)^n for integer n */ cos(cos(n*%pi)*%pi) + sin(cos(n*%pi)*%pi/2); Time= 30 msecs n (d11) (- 1) - 1 (c12) /* sin([n^5/5 + n^4/2 + n^3/3 - n/30] pi) => 0 for integer n [Paul Zimmermann] */ sin((n^5/5 + n^4/2 + n^3/3 - n/30) * %pi); Time= 320 msecs (d12) 0 (c13) remove(n, integer)$ Time= 0 msecs (c14) /* | cos x |, | sin x | => - cos x, - sin x for - 3 pi < x < - 5/2 pi */ assume(-3*%pi < x, x < -5/2*%pi)$ Time= 330 msecs (c15) [abs(cos(x)), abs(sin(x))]; Time= 130 msecs (d15) [abs(cos(x)), abs(sin(x))] (c16) forget(-3*%pi < x, x < -5/2*%pi)$ Time= 10 msecs (c17) /* Trigonometric manipulations---these are typically difficult for students */ r: cos(3*x)/cos(x); Time= 0 msecs cos(3 x) (d17) -------- cos(x) (c18) /* => cos(x)^2 - 3 sin(x)^2 or similar */ ratsimp(trigexpand(r)); Time= 10 msecs 2 2 (d18) cos (x) - 3 sin (x) (c19) /* => 2 cos(2 x) - 1 */ poissimp(ratsimp(trigexpand(r))); /aquarius/data2/opt/local/macsyma_422/library1/pois2.so being loaded. Time= 280 msecs (d19) 2 cos(2 x) - 1 (c20) ratsimp(trigreduce(ratsimp(trigexpand(r)))); /aquarius/data2/opt/local/macsyma_422/library1/trgred.so being loaded. /aquarius/data2/opt/local/macsyma_422/library1/binoml.so being loaded. Time= 190 msecs (d20) 2 cos(2 x) - 1 (c21) /* Use rewrite rules => cos(x)^2 - 3 sin(x)^2 */ matchdeclare(n, integerp, x, true)$ Time= 0 msecs (c22) defrule(cos_angles, cos(n*x), cos((n - 1)*x) * cos(x) - sin((n - 1)*x) * sin(x)); Time= 10 msecs (d22) cos_angles : cos(n x) -> cos(x) cos((n - 1) x) - sin(x) sin((n - 1) x) (c23) defrule(sin_angles, sin(n*x), sin((n - 1)*x) * cos(x) + cos((n - 1)*x) * sin(x)); Time= 10 msecs (d23) sin_angles : sin(n x) -> cos(x) sin((n - 1) x) + sin(x) cos((n - 1) x) (c24) apply2(r, cos_angles, sin_angles); Time= 250 msecs 2 2 2 cos(x) (cos (x) - sin (x)) - 2 cos(x) sin (x) (d24) --------------------------------------------- cos(x) (c25) ratsimp(%); Time= 0 msecs 2 2 (d25) cos (x) - 3 sin (x) (c26) remvalue(r)$ Time= 0 msecs (c27) /* Here is a tricky way of writing 0/0 */ expr: (tan(x)^2 + 1 - sec(x)^2)/(sin(x)^2 + cos(x)^2 - 1); Time= 0 msecs 2 2 tan (x) - sec (x) + 1 (d27) --------------------- 2 2 sin (x) + cos (x) - 1 (c28) /* Let's try simplifying this expression! */ trigsimp(expr); /aquarius/data2/opt/local/macsyma_422/share/trigsimp.so being loaded. Time= 50 msecs 1 (d28) ------- 2 cos (x) (c29) /* What is its limit at zero? */ limit(expr, x, 0); Time= 1660 msecs 2 2 2 cos (x) tan (x) + cos (x) - 1 (d29) limit ----------------------------------- x -> 0 2 2 4 2 cos (x) sin (x) + cos (x) - cos (x) (c30) /* What is the derivative? */ diff(expr, x); Time= 10 msecs (d30) 0 (c31) remvalue(expr)$ Time= 0 msecs (c32) /* ---------- Quit ---------- */ quit(); Bye. real 7.15 user 3.84 sys 1.16