Title page and opening material
Outline Welcome to Macsyma
How much memory, etc
Running on a diskless node
your system and /usr/mac
setenv vaxima
what you need : manual
Outline: Learing Macsyma
OUtline Using Macsyma:
Constants
Numbers
integers
rational
float
bigfloat
complex
constant symbols:
boolean
pi, e, ...
strings
file names
constant expressions: %e+%pi, sqrt(5), sin(1)
indeterminates
variables
functions
expressions
general mathematical representation
First the suggestion of prefix "+"(a,b) operators
+ * ^ () = ~ > < / .. more can be added ... see ...
operands, parsing
CRE form
Poisson form
matrices
programming objects "data types"
lists
hash arrays
arrays
function definitions: simple lambda?
memo-functions
macros- see appendix
complete prog. lang - see appendix
0
n/m %pi for certain rational numbers (m = 1,2,3,4,6)
n/m, sin(3/4*%pi) ==>sqrt(2)/2
apparently negative, sin(-x) ==> - sin(x);
a sum of an expression and a multiple of %pi, sin(a+%pi/2) ==> cos(a)
a pure imaginary quantity, sin(%i*x) ==> %i*sinh(x)
asin(y): sin(asin(y))==> y
sin(atan(x)) ==> x/(sqrt(x^2+1)
Certain operations, including limit, diff, integrate, taylor, rectform,
polarform
take special knowledge of sin, as well as other functions,
in their manipulations.
For example,
rectform(sin(a+b*%i))==> %i cos(a) sinh(b) + sin(a) cosh(b)
polarform(a+b*%i)==> sqrt(b^2+a^2)*%e^(%i*atan2(b,a))
taylor(sin(x),x,0,3)==> x-x^3/6+...
limit(sin(x)/x,x,0) ==> 1
Two functions are applicable to sines, cosines, and their
hyperbolic counterparts: trigexpand, trigreduce:
trigexpand(sin(x+y)) ==> cos(x) sin(y) + sin(x) cos(y)
trigreduce(cos(x)*sin(y))==> sin(y+x)/2+sin(y-x)/2
Since neither of these always produces the smallest answer,
several other functions such as trigsimp and trigsum, which are
heuristic combinations of these functions and application of
identities, has been developed.
An effective technique for many trigonometric series is the
use of Poisson series (ref sect ) which is similar in capabilities to
trigreduce but is much more efficient.
Certain flags affect simplifications or transformations.
Setting halfangles:true; provides simplifications (!) such as
sin(x/2)==> sqrt(1-cos(x))/sqrt(2)
Setting exponentialize:true; provides simplifications (!) such as
sin(x) ==>-%i*(%e^(%i*x)-%e^-(%i*x))/2
Sometimes Macsyma treats sin(x) as a command to compute a numerical
approximation to the sine function.
The system goes through about like this...
If x is a floating-point number or
x is an integer or rational number and numer:true,
then sin returns a floating-point number.
If x is a bigfloat,
then sin returns a bigfloat (fpprec digits precision).
If you need to compute the value of the sine given an argument
in degrees, you could define a related function,
calling it, for example, sin_d(x):= sin(0.01745329251994329*x);
(That constant is ev(%pi/180,numer)). If you need values to higher
precision, you could compute the appropriate constant as a bigfloat.
Sometimes the two systems of evaluation and simplification interact:
If x is an imaginary number ( e.g 3.0*%i), Macsyma produces %i*sinh(3.0)
and then 10.0178749274099 %i.
Altering the behavior of the sine function.
Sometimes you will want to add to the semantics associated
with the sine function. Here is an example:
From the Taylor series expansion of the sine, you are
reminded that for small arguments, sin(x)~x.
Furthermore, for small x, cos(x) ~ 1
If you uniformly use the name eps to represent a "small quantity",
you might wish to replace sin(eps) by eps and cos(eps) by 1.
This is done by the commands tellsimp(sin(eps),eps); tellsimp(cos(eps),1);
After doing this,
trigexpand(sin(x+eps)) ==>sin(x)+eps*cos(x).
consider cos, tan, csc, sec, cot, and the other trig functions to be handled
with similar attention to detail, although some of them will first be
mapped onto the more usual sin and cos, before great effort is expended.
Also, the functions are extended to the complex plane in the usual fashion,
and may bring into play the sinh, cosh, tanh, csch, sech, coth functions.
The less usual of the hyperbolic functions
are also mapped into the more common hyperbolic functions for simplifications.
Inverse trigonometric and hypergeometric
functions from asin through acoth are also available with simplifications,
evaluations, differentiation, integration, etc.
Furthermore, any of these can be converted into exponential form by
ev(form,exponentialize).
A note on branch cuts: The inverse functions may be expressed in terms of
logarithms. The choice of principal value may not always be the one
you expect, and if it is critical to your calculation to keep consistency
in such choices, please realize that the introduction of symbols whose
sign is unknown may require ambiguity in places that numeric constants
do not.