\setlength{\voffset}{-2.54cm} \setlength{\hoffset}{-2.54cm} \documentclass[a4paper,12pt]{article} \setlength{\evensidemargin}{1.5cm} \setlength{\oddsidemargin}{1.5cm} % ------------------------------------------------------------ % distâncias verticais ------------> 29.7 % ----------------------------------------------------------- \setlength{\topmargin}{2.0cm} % -> 28.7 \setlength{\headheight}{0.50cm} % -> 28.2 \setlength{\headsep}{0.5cm} % -> 27.7 \setlength{\textheight}{24.7cm} % -> 03.0 \setlength{\footskip}{1.0cm} % -> 01.5 \setlength{\textwidth}{18cm} \usepackage[latin1]{inputenc} \title{Introduction to MACSYMA% \thanks{Adapted from ``Perturbation Methods, Bifurcation Theory and Computer Algebra'' by Rand and Armbruster, Springer, 1987} } \author{Richard H. Hand\\ Dept. of Theoretical and Applied Mechanics, Cornell University% \thanks{Adapted to \LaTeX\ and HTML by Nelson L. Dias (nldias@simepar.br), SIMEPAR Technological Institute and Federal University of Paraná, Brazil}} \date{\today} \begin{document} \maketitle \tableofcontents \section{Introduction \label{sec:introduction}} To invoke MAXIMA in Linux, type \begin{verbatim} maxima \end{verbatim} The computer will display a greeting of the sort: \begin{verbatim} GCL (GNU Common Lisp) Version(2.3) ter jun 27 14:16:29 BRT 2000 Licensed under GNU Library General Public License Contains Enhancements by W. Schelter Maxima 5.4 ter jun 27 14:16:11 BRT 2000 (with enhancements by W. Schelter). Licensed under the GNU Public License (see file COPYING) (C1) \end{verbatim} The {\tt (C1)} is a ``label''. Each input or output line is labelled and can be referred to by its own label for the rest of the session. {\tt C} labels denote your commands and {\tt D} labels denote Displays of the machine's response. \emph{Never use variable names like {\tt C1} or {\tt D5}, as these will be confused with the lines so labeled}. MAXIMA is pragmatic about lower and upper case: regardless of your typing {\tt sin(x)} or {\tt SIN(x)}, {\tt \verb+%e^x+} or {\tt \verb+%E^x+}, it will understand that you mean the sine and exponential functions, and will echo in standard uppercase {\tt SIN} and {\tt \verb+%E+}. \emph{That doesn't apply to user variables, though: {\tt x} and {\tt X} are \emph{different} variables for MAXIMA ! (Try it.)} \section{Special keys and symbols \label{sec:keys}} \begin{enumerate} \item To end a MAXIMA session, type {\tt quit();}. If you type \verb+^C+, here is what happens: \begin{verbatim} Correctable error: Console interrupt. Signalled by MACSYMA-TOP-LEVEL. If continued: Type :r to resume execution, or :q to quit to top level. Broken at SYSTEM:TERMINAL-INTERRUPT. Type :H for Help. MAXIMA>>:q (C1) \end{verbatim} Notice that typing {\tt :q} or {\tt :t} (for \emph{top level}) after the {\tt MAXIMA>>} prompt gets you back to the MAXIMA level. \verb+^Y+, on the other hand, won't have any effect but being echoed on the screen; finally \verb+^Z+ will have the same effect as {\tt quit();}. (Here \verb+^+ stands for the control key, so that \verb+^C+ means first press the key marked control and hold it down while pressing the C key.) \item To abort a computation without leaving MAXIMA, type \verb+^C+. It is important for you to know how to do this in case, for example, you begin a computation which is taking too long. Remember to type {\tt :q} at the {\tt MAXIMA>>} prompt to return to MAXIMA. For example: \begin{verbatim} (C1) sum(1/x^2,x,1,1000); Correctable error: Console interrupt. Signalled by MACSYMA-TOP-LEVEL. If continued: Type :r to resume execution, or :q to quit to top level. Broken at SYSTEM:TERMINAL-INTERRUPT. Type :H for Help. MAXIMA>>:q (C2) \end{verbatim} \item In order to tell MAXIMA that you have finished your command, use the semicolon ({\tt ;}), followed by a return. Note that the return key alone does not signal that you are done with your input. \item An alternative input terminator to the semicolon ({\tt ;}) is the dollar sign ({\tt \$}), which, however, supresses the display of MAXIMA's computation. This is useful if you are computing some long intermediate result, and you don't want to waste time having it displayed on the screen. %\item If you want to completely delete the current input line (and start this line fresh from the %beginning), type a double question mark ({\tt ??}). \item If you wish to repeat a command which you have already given, say on line {\tt (C5)}, you may do so without typing it over again by preceding its label with two single quotes ({\tt ''}), i.e., {\tt ''C5}. (Note that simply inputing {\tt C5} will not do the job --- try it.) \item If you want to refer to the immediately preceding result computed my MAXIMA, you can either use its {\tt D} label, or you can use the special symbol percent ({\tt \%}). \item The standard quantities $e$ (natural log base), $i$ (square root of $-1$) and $\pi$ ($3.14159\ldots$) are respectively referred to as \verb+%e+ (or \verb+%E+), \verb+%i+ (or \verb+%I+), and \verb+%pi+ (or \verb+%PI+). Note that the use of {\tt \%} here as a prefix is completely unrelated to the use of {\tt \%} to refer to the preceding result computed. \item In order to assign a value to a variable, MAXIMA uses the colon ({\tt :}), not the equal sign. The equal sign is used for representing equations. \end{enumerate} \section{Arithmetic \label{sec:arithmetic}} The common arithmetic operations are \begin{description} \item [{\tt +}] addition \item [{\tt -}] subtraction \item [{\tt *}] scalar multiplication \item [{\tt /}] division \item [{\tt \^}] or {\tt **} exponentiation \item [{\tt .}] matrix multiplication \item [{\tt sqrt(x)}] square root of {\tt x}. \end{description} MAXIMA's output is characterized by exact (rational) arithmetic. E.g., \begin{verbatim} (C1) 1/100+1/101; 201 (D1) ----- 10100 \end{verbatim} If irrational numbers are involved in a computation, they are kept in symbolic form: \begin{verbatim} (C2) (1+sqrt(2))^5; 5 (D2) (SQRT(2) + 1) (C3) expand(%); (D3) 29 SQRT(2) + 41 \end{verbatim} However, it is often useful to express a result in decimal notation. This may be accomplished by following the expression you want expanded by ``{\tt ,numer}'': \begin{verbatim} (C4) %,numer; (D4) 82.01219330881976 \end{verbatim} Note the use here of \verb+%+ to refer to the previous result. In this version of MAXIMA, {\tt numer} gives 16 significant figures, of which the last is often unreliable. However, MAXIMA can offer \emph{arbitrarily high precision} by using the {\tt bfloat} function: \begin{verbatim} (C5) bfloat(d3); (D5) 8.201219330881976B1 \end{verbatim} The number of significant figures displayed is controlled by the MAXIMA variable {\tt FPPREC}, which has the default value of 16: \begin{verbatim} (C6) fpprec; (D6) 16 \end{verbatim} Here we reset {\tt FPPREC} to yield 100 digits: \begin{verbatim} (C7) fpprec:100; (D7) 100 (C8) ''c5; (D8) 8.20121933088197564152489730020812442785204843859314941221237124017312418# 7540110412666123849550160561B1 \end{verbatim} Note the use of two single quotes ({\tt ''}) in {\tt (C8)} to repeat command {\tt (C5)}. MAXIMA can handle very large numbers without approximation: \begin{verbatim} (C9) 100!; (D9) 9332621544394415268169923885626670049071596826438162146859296389521759999# 322991560894146397615651828625369792082722375825118521091686400000000000000000# 0000000 \end{verbatim} \section{Algebra \label{sec:algebra}} MAXIMA's importance as a computer tool to facilitate analytical calculations becomes more evident when we see how easily it does algebra for us. Here's an example in which a polynomial is expanded: \begin{verbatim} (C1) (x+3*y+x^2*y)^3; 2 3 (D1) (x y + 3 y + x) (C2) expand(%); 6 3 4 3 2 3 3 5 2 3 2 2 4 (D2) x y + 9 x y + 27 x y + 27 y + 3 x y + 18 x y + 27 x y + 3 x y 2 3 + 9 x y + x \end{verbatim} Now suppose we wanted to substitute {\tt 5/z} for {\tt x} in the above expression: \noindent\begin{minipage}{\textwidth} \begin{verbatim} (C3) d2,x=5/z; 2 3 2 3 2 135 y 675 y 225 y 2250 y 125 5625 y 1875 y 9375 y (D3) ------ + ------ + ----- + ------- + --- + ------- + ------ + ------- z 2 2 3 3 4 4 5 z z z z z z z 3 15625 y 3 + -------- + 27 y 6 z \end{verbatim} \end{minipage} The MAXIMA function RATSIMP will place this over a common denominator: \begin{verbatim} (C4) ratsimp(%); 3 6 2 5 3 4 2 3 (D4) (27 y z + 135 y z + (675 y + 225 y) z + (2250 y + 125) z 3 2 2 3 6 + (5625 y + 1875 y) z + 9375 y z + 15625 y )/z \end{verbatim} Expressions may also be {\tt factor}ed: \begin{verbatim} (C5) factor(%); 2 3 (3 y z + 5 z + 25 y) (D5) ---------------------- 6 z \end{verbatim} MAXIMA can obtain exact solutions to systems of nonlinear algebraic equations. In this example we {\tt solve} three equations in the three unknowns {\tt A}, {\tt B}, {\tt C}: \begin{verbatim} (C6) a + b*c=1; (D6) b C + a = 1 (C7) b - a*c=0; (D7) b - a C = 0 (C8) a+b=5; (D8) b + a = 5 (C9) solve([d6,d7,d8],[a,b,c]); 25 SQRT(79) %I + 25 5 SQRT(79) %I + 5 SQRT(79) %I + 1 (D9) [[a = -------------------, b = -----------------, C = ---------------], 6 SQRT(79) %I - 34 SQRT(79) %I + 11 10 25 SQRT(79) %I - 25 5 SQRT(79) %I - 5 SQRT(79) %I - 1 [a = -------------------, b = -----------------, C = - ---------------]] 6 SQRT(79) %I + 34 SQRT(79) %I - 11 10 \end{verbatim} Note that the display consists of a ``list'', i.e., some expression contained between two brackets {\tt [ \ldots ]}, which itself contains two lists. Each of the latter contain a distinct solution to the simultaneous equations. Trigonometric identities are easy to manipulate in MAXIMA. The function {\tt trigexpand} uses the sum-of-angles formulas to make the argument inside each trig function as simple as possible: \begin{verbatim} (C10) sin(u+v)*cos(u)^3; 3 (D10) COS (u) SIN(v + u) (C11) trigexpand(%); 3 (D11) COS (u) (COS(u) SIN(v) + SIN(u) COS(v)) \end{verbatim} The function {\tt trigreduce}, on the other hand, converts an expression into a form which is a sum of terms, each of which contains only a single {\tt sin} or {\tt cos}: \begin{verbatim} (C12) trigreduce(d10); SIN(v + 4 u) + SIN(v - 2 u) 3 SIN(v + 2 u) + 3 SIN(v) (D12) --------------------------- + ------------------------- 8 8 \end{verbatim} The functions {\tt realpart} and {\tt imagpart} will return the real and imaginary parts of a complex expression: \begin{verbatim} (C13) w:3+k*%i; (D13) %I k + 3 (C14) w^2*%e^w; 2 %I k + 3 (D14) (%I k + 3) %E (C15) realpart(%); 3 2 3 (D15) %E (9 - k ) COS(k) - 6 %E k SIN(k) \end{verbatim} \section{Calculus \label{sec:calculus}} MAXIMA can compute derivatives and integrals, expand in Taylor series, take limits, and obtain exact solutions to ordinary differential equations. We begin by defining the symbol {\tt f} to be the following function of {\tt x}: \begin{verbatim} (C1) f:x^3*%E^(k*x)*sin(w*x); 3 k x (D1) x %E SIN(w x) \end{verbatim} We compute the derivative of {\tt f} with respect to {\tt x}: \begin{verbatim} (C2) diff(f,x); 3 k x 2 k x 3 k x (D2) k x %E SIN(w x) + 3 x %E SIN(w x) + w x %E COS(w x) \end{verbatim} Now we find the indefinite integral of {\tt f} with respect to {\tt x}: \begin{verbatim} (C3) integrate(f,x); 6 3 4 5 2 7 3 (D3) (((k w + 3 k w + 3 k w + k ) x 6 2 4 4 2 6 2 4 3 2 5 + (3 w + 3 k w - 3 k w - 3 k ) x + (- 18 k w - 12 k w + 6 k ) x 4 2 2 4 k x - 6 w + 36 k w - 6 k ) %E SIN(w x) 7 2 5 4 3 6 3 5 3 3 5 2 + ((- w - 3 k w - 3 k w - k w) x + (6 k w + 12 k w + 6 k w) x 5 2 3 4 3 3 k x + (6 w - 12 k w - 18 k w) x - 24 k w + 24 k w) %E COS(w x)) 8 2 6 4 4 6 2 8 /(w + 4 k w + 6 k w + 4 k w + k ) \end{verbatim} A slight change in syntax gives definite integrals: \begin{verbatim} (C4) integrate(1/x^2,x,1,inf); (D4) 1 (C5) integrate(1/x,x,0,inf); Integral is divergent -- an error. Quitting. To debug this try DEBUGMODE(TRUE);) \end{verbatim} Next we define the simbol {\tt g} in terms of {\tt f} (previously defined in {\tt C1}) and the hyperbolic sine function, and find its Taylor series expansion (up to, say, order 3 terms) about the point {\tt x = 0}: \noindent\begin{minipage}{\textwidth} \begin{verbatim} (C6) g:f/sinh(k*x)^4; 3 k x x %E SIN(w x) (D6) ----------------- 4 SINH (k x) (C7) taylor(g,x,0,3); 2 3 2 2 3 3 w w x (w k + w ) x (3 w k + w ) x (D7)/T/ -- + --- - -------------- - ---------------- + . . . 4 3 4 3 k k 6 k 6 k \end{verbatim} \end{minipage} The limit of {\tt g} as {\tt x} goes to 0 is computed as follows: \begin{verbatim} (C8) limit(g,x,0); w (D8) -- 4 k \end{verbatim} MAXIMA also permits derivatives to be represented in unevaluated form (note the quote): \begin{verbatim} (C9) 'diff(y,x); dy (D9) -- dx \end{verbatim} The quote operator in {\tt (C9)} means ``do not evaluate''. Without it, MAXIMA would have obtained 0: \begin{verbatim} (C10) diff(y,x); (D10) 0 \end{verbatim} Using the quote operator we can write differential equations: \begin{verbatim} (C11) 'diff(y,x,2) + 'diff(y,x) + y; 2 d y dy (D11) --- + -- + y 2 dx dx \end{verbatim} MAXIMA's {\tt ODE2} function can solve first and second order ODE's: \begin{verbatim} (C12) ode2(d11,y,x); - x/2 SQRT(3) x SQRT(3) x (D12) y = %E (%K1 SIN(---------) + %K2 COS(---------)) 2 2 \end{verbatim} \newpage \section{Matrix calculations \label{sec:matrix}} MAXIMA can compute the determinant, inverse and eigenvalues and eigenvectors of matrices which have symbolic elements (i.e., elements which involve algebraic variables.) We begin by entering a matrix {\tt m} element by element: \begin{verbatim} (C1) m:entermatrix(3,3); Is the matrix 1. Diagonal 2. Symmetric 3. Antisymmetric 4. General Answer 1, 2, 3 or 4 : 4; Row 1 Column 1: 0; Row 1 Column 2: 1; Row 1 Column 3: a; Row 2 Column 1: 1; Row 2 Column 2: 0; Row 2 Column 3: 1; Row 3 Column 1: 1; Row 3 Column 2: 1; Row 3 Column 3: 0; Matrix entered. [ 0 1 a ] [ ] (D1) [ 1 0 1 ] [ ] [ 1 1 0 ] \end{verbatim} Next we find its transpose, determinant and inverse: \begin{verbatim} (C2) transpose(m); [ 0 1 1 ] [ ] (D2) [ 1 0 1 ] [ ] [ a 1 0 ] (C3) determinant(m); (D3) a + 1 (C4) invert(m),detout; [ - 1 a 1 ] [ ] [ 1 - a a ] [ ] [ 1 1 - 1 ] (D4) ----------------- a + 1 \end{verbatim} In {\tt (C4)}, the modifier {\tt DETOUT} keeps the determinant outside the inverse. As a check, we multiply {\tt m} by its inverse (note the use of the period to represent matrix multiplication): \begin{verbatim} (C5) m.d4; [ - 1 a 1 ] [ ] [ 1 - a a ] [ 0 1 a ] [ ] [ ] [ 1 1 - 1 ] (D5) [ 1 0 1 ] . ----------------- [ ] a + 1 [ 1 1 0 ] (C6) expand(%); [ a 1 ] [ ----- + ----- 0 0 ] [ a + 1 a + 1 ] [ ] [ a 1 ] (D6) [ 0 ----- + ----- 0 ] [ a + 1 a + 1 ] [ ] [ a 1 ] [ 0 0 ----- + ----- ] [ a + 1 a + 1 ] (C7) factor(%); [ 1 0 0 ] [ ] (D7) [ 0 1 0 ] [ ] [ 0 0 1 ] \end{verbatim} In order to find the eigenvalues and eigenvectors of {\tt m}, we use the function {\tt EIGENVECTORS}: \noindent\begin{minipage}{\textwidth} \begin{verbatim} (C8) eigenvectors(m); Warning - you are redefining the MACSYMA function EIGENVALUES Warning - you are redefining the MACSYMA function EIGENVECTORS SQRT(4 a + 5) - 1 SQRT(4 a + 5) + 1 (D8) [[[- -----------------, -----------------, - 1], [1, 1, 1]], 2 2 SQRT(4 a + 5) - 1 SQRT(4 a + 5) - 1 [1, - -----------------, - -----------------], 2 a + 2 2 a + 2 SQRT(4 a + 5) + 1 SQRT(4 a + 5) + 1 [1, -----------------, -----------------], [1, - 1, 0]] 2 a + 2 2 a + 2 \end{verbatim} In {\tt D8}, the first triple gives the eigenvalues of {\tt m} and the next gives their respective multiplicities (here each is unrepeated). The next three triples give the corresponding eigenvectors of {\tt m}. In order to extract from this expression one of these eigenvectors, we may use the {\tt PART} function: \begin{verbatim} (C9) part(%,2); SQRT(4 a + 5) - 1 SQRT(4 a + 5) - 1 (D9) [1, - -----------------, - -----------------] 2 a + 2 2 a + 2 \end{verbatim} \end{minipage} \section{Programming in MAXIMA \label{sec:programming}} So far, we have used MAXIMA in the interactive mode, rather like a calculator. However, for computations which involve a repetitive sequence of commands, it is better to execute a program. Here we present a short sample program to calculate the critical points of a function {\tt f} of two variables {\tt x} and {\tt y}. The program cues the user to enter the function {\tt f}, then it computes the partial derivatives $\mathtt{f_x}$ and $\mathtt{f_y}$, and then it uses the MAXIMA command {\tt SOLVE} to obtain solutions to $\mathtt{f_x = f_y = 0}$. The program is written outside of MAXIMA with a text editor, and then loaded into MAXIMA with the {\tt BATCH} command. Here is the program listing: \begin{verbatim} /* -------------------------------------------------------------------------- this is file critpts.max: as you can see, comments in maxima are like comments in C Nelson Luis Dias, nldias@simepar.br created 20000707 updated 20000707 --------------------------------------------------------------------------- */ critpts():=( print("program to find critical points"), /* --------------------------------------------------------------------------- asks for a function --------------------------------------------------------------------------- */ f:read("enter f(x,y)"), /* --------------------------------------------------------------------------- echoes it, to make sure --------------------------------------------------------------------------- */ print("f = ",f), /* --------------------------------------------------------------------------- produces a list with the two partial derivatives of f --------------------------------------------------------------------------- */ eqs:[diff(f,x),diff(f,y)], /* --------------------------------------------------------------------------- produces a list of unknowns --------------------------------------------------------------------------- */ unk:[x,y], /* --------------------------------------------------------------------------- solves the system --------------------------------------------------------------------------- */ solve(eqs,unk) )$ \end{verbatim} The program (which is actually a function with no argument) is called {\tt critpts}. Each line is a valid MAXIMA command which could be executed from the keyboard, and which is separated by the next command by a comma. The partial derivatives are stored in a variable named {\tt eqs}, and the unknowns are stored in {\tt unk}. Here is a sample run: \begin{verbatim} (C1) batch("critpts.max"); batching #/home/nldias/work/papers2000/intromax/critpts.max (C2) (C2) critpts() := (PRINT("program to find critical points"), f : READ("enter f(x,y)"), PRINT("f = ", f), eqs : [DIFF(f, x), DIFF(f, y)], unk : [x, y], SOLVE(eqs, unk)) (C3) critpts(); program to find critical points enter f(x,y) %e^(x^3+y^2)*(x+y); 2 3 y + x f = (y + x) %E (D3) [[x = 0.4588955685487 %I + 0.35897908710869, y = 0.49420173682751 %I - 0.12257873677837], [x = 0.35897908710869 - 0.4588955685487 %I, y = - 0.49420173682751 %I - 0.12257873677837], [x = 0.41875423272348 %I - 0.69231242044203, y = 0.4559120701117 - 0.86972626928141 %I], [x = - 0.41875423272348 %I - 0.69231242044203, y = 0.86972626928141 %I + 0.4559120701117]] \end{verbatim} \section{A partial list of MAXIMA functions} See the MAXIMA Manual in the {\tt maxima-5.4/info/} directory in texinfo or html format. From MAXIMA itself, you can use {\tt DESCRIBE(\textit{function name})}. \begin{description} \item[{\tt ALLROOTS(A)}] Finds all the (generally complex) roots of the polynomial equation {\tt A}, and lists them in {\tt NUMER}ical format (i.e. to 16 significant figures). \item[{\tt APPEND(A,B)}] Appends the list {\tt B} to the list {\tt A}, resulting in a single list. \item[{\tt BATCH(A)}] Loads and runs a BATCH program with filename {\tt A}. \item[{\tt COEFF(A,B,C)}] Gives the coefficient of {\tt B} raised to the power {\tt C} in expression {\tt A}. \item[{\tt CONCAT(A,B)}] Creates the symbol {\tt AB}. \item[{\tt CONS(A,B)}] Adds {\tt A} to the list {\tt B} as its first element. \item[{\tt DEMOIVRE(A)}] Transforms all complex exponentials in {\tt A} to their trigonometric equivalents. \item[{\tt DENOM(A)}] Gives the denominator of {\tt A}. \item[{\tt DEPENDS(A,B)}] Declares {\tt A} to be a function of {\tt B}. This is useful for writing unevaluated derivatives, as in specifying differential equations. \item[{\tt DESOLVE(A,B)}] Attempts to solve a linear system {\tt A} of ODE's for unknowns {\tt B} using Laplace transforms. \item[{\tt DETERMINANT(A)}] Returns the determinant of the square matrix {\tt A}. \item[{\tt DIFF(A,B1,C1,B2,C2,\ldots,Bn,Cn)}] Gives the mixed partial derivative of {\tt A} with respect to each {\tt Bi}, {\tt Ci} times. For brevity, {\tt DIFF(A,B,1)} may be represented by {\tt DIFF(A,B)}. {\tt 'DIFF(\ldots)} represents the unevaluated derivative, useful in specifying a differential equation. \item[{\tt EIGENVALUES(A)}] Returns two lists, the first being the eigenvalues of the square matrix {\tt A}, and the second being their respective multiplicities. \item[{\tt EIGENVECTORS(A)}] Does everything that {\tt EIGENVALUES} does, and adds a list of the eigenvectors of {\tt A}. \item[{\tt ENTERMATRIX(A,B)}] Cues the user to enter an $\mathtt{A} \times\, \mathtt{B}$ matrix, element by element. \item[{\tt EV(A,B1,B2,\ldots,Bn)}] Evaluates {\tt A} subject to the conditions {\tt Bi}. In particular the {\tt Bi} may be equations, lists of equations (such as that returned by {\tt SOLVE}), or assignments, in which cases {\tt EV} ``plugs'' the {\tt Bi} into {\tt A}. The {\tt Bi} may also be words such as {\tt NUMER} (in which case the result is returned in numerical format), {\tt DETOUT} (in which case any matrix inverses in {\tt A} are performed with the determinant factored out), or {\tt DIFF} (in which case all differentiations in {\tt A} are evaluated, i.e., {\tt 'DIFF} in {\tt A} is replaced by {\tt DIFF}). For brevity in a manual command (i.e., not inside a user-defined function), the {\tt EV} may be dropped, shortening the syntax to {\tt A,B1,B2,\ldots,Bn}. \item[{\tt EXPAND(A)}] Algebraically expands {\tt A}. In particular multiplication is distributed over addition. \item[{\tt EXPONENTIALIZE(A)}] Transforms all trigonometric functions in {\tt A} to their complex exponential equivalents. \item[{\tt FACTOR(A)}] Factors {\tt A}. \item[{\tt FREEOF(A,B)}] Is true if the variable {\tt A} is not part of the expression {\tt B}. \item[{\tt GRIND(A)}] Displays a variable or function {\tt A} in a compact format. When used with {\tt WRITEFILE} and an editor outside of MAXIMA, it offers a scheme for producing {\tt BATCH} files which include MAXIMA-generated expressions. \item[{\tt IDENT(A)}] Returns an $\mathtt{A} \times\, \mathtt{A}$ identity matrix. \item[{\tt IMAGPART(A)}] Returns the imaginary part of {\tt A}. \item[{\tt INTEGRATE(A,B)}] Attempts to find the indefinite integral of {\tt A} with respect to {\tt B}. \item[{\tt INTEGRATE(A,B,C,D)}] Attempts to find the indefinite integral of {\tt A} with respect to {\tt B}. taken from $\mathtt{B=C}$ to $\mathtt{B=D}$. The limits of integration {\tt C} and {\tt D} may be taken is {\tt INF} (positive infinity) of {\tt MINF} (negative infinity). \item[{\tt INVERT(A)}] Computes the inverse of the square matrix {\tt A}. \item[{\tt KILL(A)}] Removes the variable {\tt A} with all its assignments and properties from the current MAXIMA environment. \item[{\tt LIMIT(A,B,C)}] Gives the limit of expression {\tt A} as variable {\tt B} approaches the value {\tt C}. The latter may be taken as {\tt INF} of {\tt MINF} as in {\tt INTEGRATE}. \item[{\tt LHS(A)}] Gives the left-hand side of the equation {\tt A}. \item[{\tt LOADFILE(A)}] Loads a disk file with filename {\tt A} from the current default directory. The disk file must be in the proper format (i.e. created by a {\tt SAVE} command). \item[{\tt MAKELIST(A,B,C,D)}] Creates a list of {\tt A}'s (each of which presumably depends on {\tt B}), concatenated from $\mathtt{B=C}$ to $\mathtt{B=D}$ \item[{\tt MAP(A,B)}] Maps the function {\tt A} onto the subexpressions of {\tt B}. \item[{\tt MATRIX(A1,A2,\ldots,An)}] Creates a matrix consisting of the rows {\tt Ai}, where each row {\tt Ai} is a list of {\tt m} elements, {\tt [B1, B2, \ldots, Bm]}. \item[{\tt NUM(A)}] Gives the numerator of {\tt A}. \item[{\tt ODE2(A,B,C)}] Attempts to solve the first- or second-order ordinary differential equation {\tt A} for {\tt B} as a function of {\tt C}. \item[{\tt PART(A,B1,B2,\ldots,Bn)}] First takes the {\tt B1}th part of {\tt A}, then the {\tt B2}th part of that, and so on. \item[{\tt PLAYBACK(A)}] Displays the last {\tt A} (an integer) labels and their associated expressions. If {\tt A} is omitted, all lines are played back. See the Manual for other options. \item[{\tt RATSIMP(A)}] Simplifies {\tt A} and returns a quotient of two polynomials. \item[{\tt REALPART(A)}] Returns the real part of {\tt A}. \item[{\tt RHS(A)}] Gives the right-hand side of the equation {\tt A}. \item[{\tt SAVE(A,B1,B2,\ldots, Bn)}] Creates a disk file with filename {\tt A} in the current default directory, of variables, functions, or arrays {\tt Bi}. The format of the file permits it to be reloaded into MAXIMA using the {\tt LOADFILE} command. Everything (including labels) may be {\tt SAVE}d by taking {\tt B1} equal to {\tt ALL}. \item[{\tt SOLVE(A,B)}] Attempts to solve the algebraic equation {\tt A} for the unknown {\tt B}. A list of solution equations is returned. For brevity, if {\tt A} is an equation of the form $\mathtt{C = 0}$, it may be abbreviated simply by the expression {\tt C}. \item[{\tt STRING(A)}] Converts {\tt A} to MACSYMA's linear notation (similar to FORTRAN's) just as if it had been typed in and puts {\tt A} into the buffer for possible editing. The STRING'ed expression should not be used in a computation. \item[{\tt STRINGOUT(A,B1,B2,\ldots,Bn)}] Creates a disk file with filename {\tt A} in the current default directory, of variables (e.g. labels) {\tt Bi}. The file is in a text format and is not reloadable into MAXIMA. However the strungout expressions can be incorporated into a FORTRAN, BASIC or C program with a minimum of editing. \item[{\tt SUBST(A,B,C)}] Substitutes {\tt A} for {\tt B} in {\tt C}. \item[{\tt TAYLOR(A,B,C,D)}] Expands {\tt A} in a Taylor series in {\tt B} about $\mathtt{B=C}$, up to and including the term $\mathtt{(B-C)^D}$. MAXIMA also supports Taylor expansions in more than one independent variable; see the Manual for details. \item[{\tt TRANSPOSE(A)}] Gives the transpose of the matrix {\tt A}. \item[{\tt TRIGEXPAND(A)}] Is a trig simplification function which uses the sum-of-angles formulas to simplify the arguments of individual {\tt SIN}'s or {\tt COS}'s. For example, {\tt trigexpand(sin(x+y))} gives {\tt COS(x) SIN(y) + SIN(x) COS(y)}. \item[{\tt TRIGREDUCE(A)}] Is a trig simplification function which uses trig identities to convert products and powers of {\tt SIN} and {\tt COS} into a sum of terms, each of which contains only a single {\tt SIN} or {\tt COS}. For example, \verb+trigreduce(sin(x)^2)+ gives {\tt (1 - COS(2x))/2}. \item[{\tt TRIGSIMP(A)}] Is a trig simplification function which replaces {\tt TAN}, {\tt SEC}, etc., by their {\tt SIN} and {\tt COS} equivalents. It also uses the identity $\mathtt{SIN()^2 + COS()^2 = 1}$. \end{description} \end{document}