1 \documentclass[a4paper,
12pt
]{article
}
2 \usepackage[utf8
]{inputenc}
5 \title{Introduction to Maxima
}
6 \author{Richard H. Rand\\
7 Dept. of Theoretical and Applied Mechanics, Cornell University
8 \thanks{Adapted from ``Perturbation Methods, Bifurcation Theory and Computer Algebra''
9 by Rand and Armbruster, Springer,
1987.
10 Adapted to
\LaTeX\ and HTML by Nelson L. Dias (nldias@simepar.br),
11 SIMEPAR Technological Institute and Federal University of ParanĂ¡, Brazil.
12 Updated by Robert Dodier, August
2005.
}}
19 Copyright (c)
1988-
2010 Richard H. Rand.
22 This
document is free; you can redistribute it and/or modify it under
23 the terms of the GNU General Public License as published by the Free
24 Software Foundation. See the GNU General Public License for more
25 details at http://www.gnu.org/copyleft/gpl.html
30 \section{Introduction
\label{sec:introduction
}}
32 To invoke Maxima in a console, type
38 The computer will display a greeting of the sort:
40 Distributed under the GNU Public License. See the file COPYING.
41 Dedicated to the memory of William Schelter.
42 This is a development version of Maxima. The function bug_report()
43 provides bug reporting information.
47 The
{\tt (\%i1)
} is a ``label''. Each input or output line is
48 labelled and can be referred to by its own label for the rest of the
49 session.
{\tt i
} labels denote your commands and
{\tt o
} labels
50 denote displays of the machine's response.
\emph{Never use variable
51 names like
{\tt \%i1
} or
{\tt \%o5
}, as these will be confused with
52 the lines so labeled
}.
54 Maxima distinguishes lower and upper case. All built-in functions
55 have names which are lowercase only (
{\tt sin
},
{\tt cos
},
{\tt save
},
56 {\tt load
}, etc). Built-in constants have lowercase names (
{\tt \%e
},
57 {\tt \%pi
},
{\tt inf
}, etc). If you type
{\tt SIN(x)
} or
{\tt
58 Sin(x)
}, Maxima assumes you mean something other than the built-in
59 {\tt sin
} function. User-defined functions and variables can have
60 names which are lower or upper case or both.
{\tt foo(XY)
},
{\tt
61 Foo(Xy)
},
{\tt FOO(xy)
} are all different.
64 \section{Special keys and symbols
\label{sec:keys
}}
67 \item To end a Maxima session, type
{\tt quit();
}.
69 \item To abort a computation without leaving Maxima, type
\verb+^C+.
70 (Here
\verb+^+ stands for the control key, so
71 that
\verb+^C+ means first press the key marked control and hold it down while pressing the C key.)
72 It is important for you to
73 know how to do this in case, for example, you begin a computation which is taking too long.
75 % sum (1/x^2, x, 1, 10000);
78 (
%i1) sum (1/x^2, x, 1, 100000)$
80 Maxima encountered a Lisp error:
82 Interactive interrupt at #x7FFFF74A43C3.
84 Automatically continuing.
85 To enable the Lisp debugger set *debugger-hook* to nil.
89 \item In order to tell Maxima that you have finished your command, use
90 the semicolon (
{\tt ;
}), followed by a return. Note that the return
91 key alone does not signal that you are done with your input.
93 \item An alternative input terminator to the semicolon (
{\tt ;
}) is
94 the dollar sign (
{\tt \$
}), which, however, supresses the display of
95 Maxima's computation. This is useful if you are computing some long
96 intermediate result, and you don't want to waste time having it
97 displayed on the screen.
99 %\item If you want to completely delete the current input line (and start this line fresh from the
100 %beginning), type a double question mark ({\tt ??}).
102 \item If you wish to repeat a command which you have already given,
103 say on line
{\tt (\%i5)
}, you may do so without typing it over again
104 by preceding its label with two single quotes (
{\tt ''
}), i.e.,
{\tt
105 ''\%i5
}. (Note that simply inputing
{\tt \%i5
} will not do the job
108 \item If you want to refer to the immediately preceding result
109 computed by Maxima, you can either use its
{\tt o
} label, or you can
110 use the special symbol percent (
{\tt \%
}).
112 \item The standard quantities $e$ (natural log base), $i$ (square root
113 of $-
1$) and $
\pi$ ($
3.14159\ldots$) are respectively referred to as
114 \verb+
%e+, \verb+%i+,
115 and
\verb+
%pi+. Note that the use of {\tt \%} here as a prefix
116 is completely unrelated to the use of
{\tt \%
} to refer to the
117 preceding result computed.
119 \item In order to assign a value to a variable, Maxima uses the colon
120 (
{\tt :
}), not the equal sign. The equal sign is used for
121 representing equations.
124 \section{Arithmetic
\label{sec:arithmetic
}}
126 The common arithmetic operations are
128 \item [{\tt +
}] addition
129 \item [{\tt -
}] subtraction
130 \item [{\tt *
}] scalar multiplication
131 \item [{\tt /
}] division
132 \item [{\tt \^
}] or
{\tt **
} exponentiation
133 \item [{\tt .
}] matrix multiplication
134 \item [{\tt sqrt(x)
}] square root of
{\tt x
}.
136 Maxima's output is characterized by exact (rational) arithmetic. For example,
144 If irrational numbers are involved in a computation, they are kept in symbolic form:
148 (
%i2) (1 + sqrt(2))^5;
153 (
%o3) 3 2 + 5 sqrt(2) + 41
155 However, it is often useful to express a result in decimal notation.
156 This may be accomplished by following the expression you want expanded
161 (
%o4) 82.01219330881977
163 Note the use here of
\verb+
%+
164 to refer to the previous result. In this version of Maxima,
{\tt
165 numer
} gives
16 significant figures, of which the last is often
166 unreliable. However, Maxima can offer
\emph{arbitrarily high
167 precision
} by using the
{\tt bfloat
} function:
171 (
%o5) 8.201219330881976b1
173 The number of significant figures displayed is controlled by the
174 Maxima variable
{\tt fpprec
}, which has the default value of
16:
180 Here we reset
{\tt fpprec
} to yield
100 digits:
187 (
%o8) 8.20121933088197564152489730020812442785204843859314941221\
188 2371240173124187540110412666123849550160561b1
190 Note the use of two single quotes (
{\tt ''
}) in
{\tt (\%i8)
} to repeat
191 command
{\tt (\%i5)
}. Maxima can handle very large numbers without
196 (
%o9) 9332621544394415268169923885626670049071596826438162146859\
197 2963895217599993229915608941463976156518286253697920827223758251\
198 185210916864000000000000000000000000
201 \section{Algebra
\label{sec:algebra
}}
203 Maxima's importance as a computer tool to facilitate analytical
204 calculations becomes more evident when we see how easily it does
205 algebra for us. Here's an example in which a polynomial is expanded:
206 % (x + 3*y + x^2*y)^3;
209 (
%i1) (x + 3*y + x^2*y)^3;
211 (
%o1) (x y + 3 y + x)
213 6 3 4 3 2 3 3 5 2 3 2
214 (
%o2) x y + 9 x y + 27 x y + 27 y + 3 x y + 18 x y
216 +
27 x y +
3 x y +
9 x y + x
218 Now suppose we wanted to substitute
{\tt 5/z
} for
{\tt x
} in the above
221 \noindent\begin{minipage
}{\textwidth}
226 135 y
675 y
225 y
2250 y
125 5625 y
1875 y
227 (
%o3) ------ + ------ + ----- + ------- + --- + ------- + ------
232 + ------- + -------- +
27 y
237 The Maxima function
{\tt ratsimp
} will place this over a common denominator:
242 (
%o4) (27 y z + 135 y z + (675 y + 225 y) z
244 + (
2250 y +
125) z + (
5625 y +
1875 y) z +
9375 y z
248 Expressions may also be
{\tt factor
}ed:
254 (
%o5) ----------------------
258 Maxima can obtain exact solutions to systems of nonlinear algebraic
259 equations. In this example we
{\tt solve
} three equations in the
260 three unknowns
{\tt a
},
{\tt b
},
{\tt c
}:
264 % solve ([%o6, %o7, %o8], [a, b, c]);
272 (
%i9) solve ([%o6, %o7, %o8], [a, b, c]);
273 25 sqrt(
79)
%i + 25 5 sqrt(79) %i + 5
274 (
%o9) [[a = -------------------, b = -----------------,
275 6 sqrt(
79)
%i - 34 sqrt(79) %i + 11
276 sqrt(
79)
%i + 1 25 sqrt(79) %i - 25
277 c = ---------------
],
[a = -------------------,
278 10 6 sqrt(
79)
%i + 34
279 5 sqrt(
79)
%i - 5 sqrt(79) %i - 1
280 b = -----------------, c = - ---------------
]]
283 Note that the display consists of a ``list'', i.e., some expression
284 contained between two brackets
{\tt [ \ldots ]}, which itself contains
285 two lists. Each of the latter contain a distinct solution to the
286 simultaneous equations.
288 Trigonometric identities are easy to manipulate in Maxima. The
289 function
{\tt trigexpand
} uses the sum-of-angles formulas to make the
290 argument inside each trig function as simple as possible:
291 % sin(u + v) * cos(u)^3;
294 (
%i10) sin(u + v) * cos(u)^3;
296 (
%o10) cos (u) sin(v + u)
297 (
%i11) trigexpand (%);
299 (
%o11) cos (u) (cos(u) sin(v) + sin(u) cos(v))
301 The function
{\tt trigreduce
}, on the other hand, converts an
302 expression into a form which is a sum of terms, each of which contains
303 only a single
{\tt sin
} or
{\tt cos
}:
306 (
%i12) trigreduce (%o10);
307 sin(v +
4 u) + sin(v -
2 u)
3 sin(v +
2 u) +
3 sin(v)
308 (
%o12) --------------------------- + -------------------------
311 The functions
{\tt realpart
} and
{\tt imagpart
} will return the real
312 and imaginary parts of a complex expression:
324 (
%o15) %e (9 - k ) cos(k) - 6 %e k sin(k)
327 \section{Calculus
\label{sec:calculus
}}
329 Maxima can compute derivatives and integrals, expand in Taylor series,
330 take limits, and obtain exact solutions to ordinary differential
331 equations. We begin by defining the symbol
{\tt f
} to be the
332 following function of
{\tt x
}:
333 % f: x^3 * %e^(k*x) * sin(w*x);
335 (
%i1) f: x^3 * %e^(k*x) * sin(w*x);
339 We compute the derivative of
{\tt f
} with respect to
{\tt x
}:
344 (
%o2) k x %e sin(w x) + 3 x %e sin(w x)
348 Now we find the indefinite integral of
{\tt f
} with respect to
{\tt x
}:
351 (
%i3) integrate (f, x);
353 (
%o3) (((k w + 3 k w + 3 k w + k ) x
355 + (
3 w +
3 k w -
3 k w -
3 k ) x
357 + (-
18 k w -
12 k w +
6 k ) x -
6 w +
36 k w -
6 k )
359 %e sin(w x) + ((- w - 3 k w - 3 k w - k w) x
361 + (
6 k w +
12 k w +
6 k w) x
363 + (
6 w -
12 k w -
18 k w) x -
24 k w +
24 k w)
%e
365 cos(w x))/(w +
4 k w +
6 k w +
4 k w + k )
367 A slight change in syntax gives definite integrals:
368 % integrate (1/x^2, x, 1, inf);
369 % integrate (1/x, x, 0, inf);
371 (
%i4) integrate (1/x^2, x, 1, inf);
373 (
%i5) integrate (1/x, x, 0, inf);
375 defint: integral is divergent.
376 -- an error. To debug this try: debugmode(true);
378 Next we define the symbol
{\tt g
} in terms of
{\tt f
} (previously
379 defined in
{\tt \%i1
}) and the hyperbolic sine function, and find its
380 Taylor series expansion (up to, say, order
3 terms) about the point
383 \noindent\begin{minipage
}{\textwidth}
384 % g: f / sinh(k*x)^4;
385 % taylor (g, x, 0, 3);
387 (
%i6) g: f / sinh(k*x)^4;
390 (
%o6) -----------------
393 (
%i7) taylor (g, x, 0, 3);
395 w w x (w k + w ) x (
3 w k + w ) x
396 (
%o7)/T/ -- + --- - -------------- - ---------------- + . . .
401 The limit of
{\tt g
} as
{\tt x
} goes to
0 is computed as follows:
404 (
%i8) limit (g, x, 0);
410 Maxima also permits derivatives to be represented in unevaluated form
419 The quote operator in
{\tt (\%i9)
} means ``do not evaluate''. Without
420 it, Maxima would have obtained
0:
426 Using the quote operator we can write differential equations:
427 % 'diff (y, x, 2) + 'diff (y, x) + y;
429 (
%i11) 'diff (y, x, 2) + 'diff (y, x) + y;
436 Maxima's
{\tt ode2
} function can solve first and second order ODE's:
439 (
%i12) ode2 (%o11, y, x);
440 - x/
2 sqrt(
3) x sqrt(
3) x
441 (
%o12) y = %e (%k1 sin(---------) + %k2 cos(---------))
447 \section{Matrix calculations
\label{sec:matrix
}}
449 Maxima can compute the determinant, inverse and eigenvalues and
450 eigenvectors of matrices which have symbolic elements (i.e., elements
451 which involve algebraic variables.) We begin by entering a matrix
{\tt
452 m
} element by element:
453 % m: entermatrix (3, 3);
455 (
%i1) m: entermatrix (3, 3);
457 Is the matrix
1. Diagonal
2. Symmetric
3. Antisymmetric
4. General
458 Answer
1,
2,
3 or
4 :
486 Next we find its transpose, determinant and inverse:
489 % invert (m), detout;
497 (
%i3) determinant (m);
499 (
%i4) invert (m), detout;
505 (
%o4) -----------------
508 In
{\tt (\%i4)
}, the modifier
{\tt detout
} keeps the determinant
509 outside the inverse. As a check, we multiply
{\tt m
} by its inverse
510 (note the use of the period to represent matrix multiplication):
521 (
%o5) [ 1 0 1 ] . -----------------
526 [ ----- + -----
0 0 ]
530 (
%o6) [ 0 ----- + ----- 0 ]
534 [ 0 0 ----- + -----
]
543 In order to find the eigenvalues and eigenvectors of
{\tt m
}, we use the function
{\tt
546 \noindent\begin{minipage
}{\textwidth}
549 (
%i8) eigenvectors (m);
550 sqrt(
4 a +
5) -
1 sqrt(
4 a +
5) +
1
551 (
%o8) [[[- -----------------, -----------------, - 1],
553 sqrt(
4 a +
5) -
1 sqrt(
4 a +
5) -
1
554 [1,
1,
1]],
[[[1, - -----------------, - -----------------
]],
556 sqrt(
4 a +
5) +
1 sqrt(
4 a +
5) +
1
557 [[1, -----------------, -----------------
]],
[[1, -
1,
0]]]]
560 In
{\tt \%o8
}, the first triple gives the eigenvalues of
{\tt m
} and
561 the next gives their respective multiplicities (here each is
562 unrepeated). The next three triples give the corresponding
563 eigenvectors of
{\tt m
}. In order to extract from this expression
564 one of these eigenvectors, we may use the
{\tt part
} function:
567 (
%i9) part (%o23, 2, 1, 1);
568 sqrt(
4 a +
5) -
1 sqrt(
4 a +
5) -
1
569 (
%o9) [1, - -----------------, - -----------------]
574 \section{Programming in Maxima
\label{sec:programming
}}
576 So far, we have used Maxima in the interactive mode, rather like a
577 calculator. However, for computations which involve a repetitive
578 sequence of commands, it is better to execute a program. Here we
579 present a short sample program to calculate the critical points of a
580 function
{\tt f
} of two variables
{\tt x
} and
{\tt y
}. The program
581 cues the user to enter the function
{\tt f
}, then it computes the
582 partial derivatives $
\mathtt{f_x
}$ and $
\mathtt{f_y
}$, and then it
583 uses the Maxima command
{\tt solve
} to obtain solutions to
584 $
\mathtt{f_x = f_y =
0}$. The program is written outside of Maxima
585 with a text editor, and then loaded into Maxima with the
{\tt batch
}
586 command. Here is the program listing:
588 /* --------------------------------------------------------------------------
589 this is file critpts.max:
590 as you can see, comments in maxima are like comments in C
592 Nelson Luis Dias, nldias@simepar.br
595 --------------------------------------------------------------------------- */
597 print("program to find critical points"),
598 /* ---------------------------------------------------------------------------
600 --------------------------------------------------------------------------- */
601 f:read("enter f(x,y)"),
602 /* ---------------------------------------------------------------------------
603 echoes it, to make sure
604 --------------------------------------------------------------------------- */
606 /* ---------------------------------------------------------------------------
607 produces a list with the two partial derivatives of f
608 --------------------------------------------------------------------------- */
609 eqs:
[diff(f,x),diff(f,y)
],
610 /* ---------------------------------------------------------------------------
611 produces a list of unknowns
612 --------------------------------------------------------------------------- */
614 /* ---------------------------------------------------------------------------
616 --------------------------------------------------------------------------- */
620 The program (which is actually a function with no argument) is called
621 {\tt critpts
}. Each line is a valid Maxima command which could be
622 executed from the keyboard, and which is separated by the next command
623 by a comma. The partial derivatives are stored in a variable named
624 {\tt eqs
}, and the unknowns are stored in
{\tt unk
}. Here is a sample
626 % batch ("critpts.max");
629 (
%i1) batch ("critpts.max");
631 batching #p/home/robert/tmp/maxima-clean/maxima/critpts.max
632 (
%i2) critpts() := (print("program to find critical points"),
633 f : read("enter f(x,y)"), print("f = ", f),
634 eqs :
[diff(f, x), diff(f, y)
], unk :
[x, y
], solve(eqs, unk))
636 program to find critical points
638 %e^(x^3 + y^2)*(x + y);
642 (
%o3) [[x = .4588955685487001 %i + .3589790871086935,
643 y =
.4942017368275118 %i - .1225787367783657],
644 [x =
.3589790871086935 -
.4588955685487001 %i,
645 y = -
.4942017368275118 %i - .1225787367783657],
646 [x =
.4187542327234816 %i - .6923124204420268,
647 y =
0.455912070111699 -
.8697262692814121 %i],
648 [x = -
.4187542327234816 %i - .6923124204420268,
649 y =
.8697262692814121 %i + 0.455912070111699]]
652 \section{A partial list of Maxima functions
}
654 See the Maxima reference manual
{\tt doc/html/maxima
\_toc.html
} (under
655 the main Maxima installation directory). From Maxima itself, you can
656 use
{\tt describe(
\textit{function name
})
}.
659 \item[{\tt allroots(a)
}] Finds all the (generally complex) roots of
660 the polynomial equation
{\tt A
}, and lists them in
{\tt numer
}ical
661 format (i.e. to
16 significant figures).
662 \item[{\tt append(a,b)
}] Appends the list
{\tt b
} to the list
{\tt a
},
663 resulting in a single list.
664 \item[{\tt batch(a)
}] Loads and runs a program with filename
{\tt a
}.
665 \item[{\tt coeff(a,b,c)
}] Gives the coefficient of
{\tt b
} raised to
666 the power
{\tt c
} in expression
{\tt a
}.
667 \item[{\tt concat(a,b)
}] Creates the symbol
{\tt ab
}.
668 \item[{\tt cons(a,b)
}] Adds
{\tt a
} to the list
{\tt b
} as its first element.
669 \item[{\tt demoivre(a)
}] Transforms all complex exponentials in
{\tt
670 a
} to their trigonometric equivalents.
671 \item[{\tt denom(a)
}] Gives the denominator of
{\tt a
}.
672 \item[{\tt depends(a,b)
}] Declares
{\tt a
} to be a function of
{\tt
673 b
}. This is useful for writing unevaluated derivatives, as in
674 specifying differential equations.
675 \item[{\tt desolve(a,b)
}] Attempts to solve a linear system
{\tt a
} of
676 ODE's for unknowns
{\tt b
} using Laplace transforms.
677 \item[{\tt determinant(a)
}] Returns the determinant of the square
679 \item[{\tt diff(a,b1,c1,b2,c2,
\ldots,bn,cn)
}] Gives the mixed partial
680 derivative of
{\tt a
} with respect to each
{\tt bi
},
{\tt ci
} times.
681 For brevity,
{\tt diff(a,b,
1)
} may be represented by
{\tt
682 diff(a,b)
}.
{\tt 'diff(
\ldots)
} represents the unevaluated
683 derivative, useful in specifying a differential equation.
684 \item[{\tt eigenvalues(a)
}] Returns two lists, the first being the
685 eigenvalues of the square matrix
{\tt a
}, and the second being their
686 respective multiplicities.
687 \item[{\tt eigenvectors(a)
}] Does everything that
{\tt eigenvalues
}
688 does, and adds a list of the eigenvectors of
{\tt a
}.
689 \item[{\tt entermatrix(a,b)
}] Cues the user to enter an $
\mathtt{a
}
690 \times\,
\mathtt{b
}$ matrix, element by element.
691 \item[{\tt ev(a,b1,b2,
\ldots,bn)
}] Evaluates
{\tt a
} subject to the
692 conditions
{\tt bi
}. In particular the
{\tt bi
} may be equations,
693 lists of equations (such as that returned by
{\tt solve
}), or
694 assignments, in which cases
{\tt ev
} ``plugs'' the
{\tt bi
} into
695 {\tt a
}. The
{\tt Bi
} may also be words such as
{\tt numer
} (in
696 which case the result is returned in numerical format),
{\tt detout
}
697 (in which case any matrix inverses in
{\tt a
} are performed with the
698 determinant factored out), or
{\tt diff
} (in which case all
699 differentiations in
{\tt a
} are evaluated, i.e.,
{\tt 'diff
} in
{\tt
700 a
} is replaced by
{\tt diff
}). For brevity in a manual command
701 (i.e., not inside a user-defined function), the
{\tt ev
} may be
702 dropped, shortening the syntax to
{\tt a,b1,b2,
\ldots,bn
}.
703 \item[{\tt expand(a)
}] Algebraically expands
{\tt a
}. In particular
704 multiplication is distributed over addition.
705 \item[{\tt exponentialize(a)
}] Transforms all trigonometric functions
706 in
{\tt a
} to their complex exponential equivalents.
707 \item[{\tt factor(a)
}] Factors
{\tt a
}.
708 \item[{\tt freeof(a,b)
}] Is true if the variable
{\tt a
} is not part
709 of the expression
{\tt b
}.
710 \item[{\tt grind(a)
}] Displays a variable or function
{\tt a
} in a
711 compact format. When used with
{\tt writefile
} and an editor
712 outside of Maxima, it offers a scheme for producing
{\tt batch
}
713 files which include Maxima-generated expressions.
714 \item[{\tt ident(a)
}] Returns an $
\mathtt{a
} \times\,
\mathtt{a
}$
716 \item[{\tt imagpart(a)
}] Returns the imaginary part of
{\tt a
}.
717 \item[{\tt integrate(a,b)
}] Attempts to find the indefinite integral
718 of
{\tt a
} with respect to
{\tt b
}.
719 \item[{\tt integrate(a,b,c,d)
}] Attempts to find the indefinite
720 integral of
{\tt a
} with respect to
{\tt b
}. taken from
721 $
\mathtt{b=c
}$ to $
\mathtt{b=d
}$. The limits of integration
{\tt c
}
722 and
{\tt d
} may be taken as
{\tt inf
} (positive infinity) or
{\tt
723 minf
} (negative infinity).
724 \item[{\tt invert(a)
}] Computes the inverse of the square matrix
{\tt
726 \item[{\tt kill(a)
}] Removes the variable
{\tt a
} with all its
727 assignments and properties from the current Maxima environment.
728 \item[{\tt limit(a,b,c)
}] Gives the limit of expression
{\tt a
} as
729 variable
{\tt b
} approaches the value
{\tt c
}. The latter may be
730 taken as
{\tt inf
} or
{\tt minf
} as in
{\tt integrate
}.
731 \item[{\tt lhs(a)
}] Gives the left-hand side of the equation
{\tt a
}.
732 \item[{\tt loadfile(a)
}] Loads a disk file with filename
{\tt a
} from
733 the current default directory. The disk file must be in the proper
734 format (i.e. created by a
{\tt save
} command).
735 \item[{\tt makelist(a,b,c,d)
}] Creates a list of
{\tt a
}'s (each of
736 which presumably depends on
{\tt b
}), concatenated from
737 $
\mathtt{b=c
}$ to $
\mathtt{b=d
}$
738 \item[{\tt map(a,b)
}] Maps the function
{\tt a
} onto the
739 subexpressions of
{\tt b
}.
740 \item[{\tt matrix(a1,a2,
\ldots,an)
}] Creates a matrix consisting of the rows
{\tt ai
}, where each
741 row
{\tt ai
} is a list of
{\tt m
} elements,
{\tt [b1, b2,
\ldots, bm
]}.
742 \item[{\tt num(a)
}] Gives the numerator of
{\tt a
}.
743 \item[{\tt ode2(a,b,c)
}] Attempts to solve the first- or second-order
744 ordinary differential equation
{\tt a
} for
{\tt b
} as a function of
746 \item[{\tt part(a,b1,b2,
\ldots,bn)
}] First takes the
{\tt b1
}th part
747 of
{\tt a
}, then the
{\tt b2
}th part of that, and so on.
748 \item[{\tt playback(a)
}] Displays the last
{\tt a
} (an integer)
749 labels and their associated expressions. If
{\tt a
} is omitted,
750 all lines are played back. See the Manual for other options.
751 \item[{\tt ratsimp(a)
}] Simplifies
{\tt a
} and returns a quotient of
753 \item[{\tt realpart(a)
}] Returns the real part of
{\tt a
}.
754 \item[{\tt rhs(a)
}] Gives the right-hand side of the equation
{\tt a
}.
755 \item[{\tt save(a,b1,b2,
\ldots, bn)
}] Creates a disk file with
756 filename
{\tt a
} in the current default directory, of variables,
757 functions, or arrays
{\tt bi
}. The format of the file permits it to
758 be reloaded into Maxima using the
{\tt loadfile
} command.
759 Everything (including labels) may be
{\tt save
}d by taking
{\tt b1
}
761 \item[{\tt solve(a,b)
}] Attempts to solve the algebraic equation
{\tt
762 a
} for the unknown
{\tt b
}. A list of solution equations is
763 returned. For brevity, if
{\tt a
} is an equation of the form
764 $
\mathtt{c =
0}$, it may be abbreviated simply by the expression
766 \item[{\tt string(a)
}] Converts
{\tt a
} to Maxima's linear notation
767 (similar to Fortran's) just as if it had been typed in and puts
{\tt
768 a
} into the buffer for possible editing. The
{\tt string
}'ed
769 expression should not be used in a computation.
770 \item[{\tt stringout(a,b1,b2,
\ldots,bn)
}] Creates a disk file with
771 filename
{\tt a
} in the current default directory, of variables
772 (e.g. labels)
{\tt bi
}. The file is in a text format and is not
773 reloadable into Maxima. However the strungout expressions can be
774 incorporated into a Fortran, Basic or C program with a minimum of
776 \item[{\tt subst(a,b,c)
}] Substitutes
{\tt a
} for
{\tt b
} in
{\tt c
}.
777 \item[{\tt taylor(a,b,c,d)
}] Expands
{\tt a
} in a Taylor series in
778 {\tt b
} about $
\mathtt{b=c
}$, up to and including the term
779 $
\mathtt{(b-c)^d
}$. Maxima also supports Taylor expansions in more
780 than one independent variable; see the Manual for details.
781 \item[{\tt transpose(a)
}] Gives the transpose of the matrix
{\tt a
}.
782 \item[{\tt trigexpand(a)
}] Is a trig simplification function which
783 uses the sum-of-angles formulas to simplify the arguments of
784 individual
{\tt sin
}'s or
{\tt cos
}'s. For example,
{\tt
785 trigexpand(sin(x+y))
} gives
{\tt cos(x) sin(y) + sin(x) cos(y)
}.
786 \item[{\tt trigreduce(a)
}] Is a trig simplification function which
787 uses trig identities to convert products and powers of
{\tt sin
} and
788 {\tt cos
} into a sum of terms, each of which contains only a single
789 {\tt sin
} or
{\tt cos
}. For example,
\verb+trigreduce(sin(x)^
2)+
790 gives
{\tt (
1 - cos(
2x))/
2}.
791 \item[{\tt trigsimp(a)
}] Is a trig simplification function which
792 replaces
{\tt tan
},
{\tt sec
}, etc., by their
{\tt sin
} and
{\tt
793 cos
} equivalents. It also uses the identity $
\mathtt{sin()^
2 +