\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{fullpage}

\title{Introduction to Maxima}
\author{Richard H. Rand\\
Dept. of Theoretical and Applied Mechanics, Cornell University
\thanks{Adapted from ``Perturbation Methods, Bifurcation Theory and Computer Algebra''
by Rand and Armbruster, Springer, 1987.
Adapted to \LaTeX\ and HTML by Nelson L. Dias (nldias@simepar.br), 
SIMEPAR Technological Institute and Federal University of Paraná, Brazil.
Updated by Robert Dodier, August 2005.}}
\date{\empty}

\begin{document}
\maketitle

\noindent
Copyright (c) 1988-2010 Richard H. Rand.

\noindent
This document is free; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation. See the GNU General Public License for more
details at http://www.gnu.org/copyleft/gpl.html

\tableofcontents

\newpage
\section{Introduction \label{sec:introduction}}

To invoke Maxima in a console, type
\begin{verbatim}
maxima <enter>
\end{verbatim}


The computer will display a greeting of the sort:
\begin{verbatim}
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
This is a development version of Maxima. The function bug_report()
provides bug reporting information.
(%i1)
\end{verbatim}

The {\tt (\%i1)} 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 i} labels denote your commands and {\tt o} labels
denote displays of the machine's response.  \emph{Never use variable
  names like {\tt \%i1} or {\tt \%o5}, as these will be confused with
  the lines so labeled}.

Maxima distinguishes lower and upper case.  All built-in functions
have names which are lowercase only ({\tt sin}, {\tt cos}, {\tt save},
{\tt load}, etc).  Built-in constants have lowercase names ({\tt \%e},
{\tt \%pi}, {\tt inf}, etc).  If you type {\tt SIN(x)} or {\tt
  Sin(x)}, Maxima assumes you mean something other than the built-in
{\tt sin} function.  User-defined functions and variables can have
names which are lower or upper case or both.  {\tt foo(XY)}, {\tt
  Foo(Xy)}, {\tt FOO(xy)} are all different.


\section{Special keys and symbols \label{sec:keys}}

\begin{enumerate}
\item To end a Maxima session, type {\tt quit();}.

\item To abort a computation without leaving Maxima, type \verb+^C+.
(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.)
It is important for you to
know how to do this in case, for example, you begin a computation which is taking too long.
For example:
% sum (1/x^2, x, 1, 10000);
% ^C
\begin{verbatim}
(%i1) sum (1/x^2, x, 1, 100000)$
^C
Maxima encountered a Lisp error:

 Interactive interrupt at #x7FFFF74A43C3.

Automatically continuing.
To enable the Lisp debugger set *debugger-hook* to nil.
(%i2)
\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, suppresses 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 (\%i5)}, you may do so without typing it over again
  by preceding its label with two single quotes ({\tt ''}), i.e., {\tt
    ''\%i5}. (Note that simply inputing {\tt \%i5} will not do the job
  --- try it.)

\item If you want to refer to the immediately preceding result
  computed by Maxima, you can either use its {\tt o} 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+, \verb+%i+,
  and \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. For example,
% 1/100 + 1/101;
\begin{verbatim}
(%i1) 1/100 + 1/101;
                               201
(%o1)                         -----
                              10100
\end{verbatim}
If irrational numbers are involved in a computation, they are kept in symbolic form:
% (1 + sqrt(2))^5;
% expand (%);
\begin{verbatim}
(%i2) (1 + sqrt(2))^5;
                                      5
(%o2)                    (sqrt(2) + 1)
(%i3) expand (%);
                        7/2
(%o3)                3 2    + 5 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}'':
% %, numer;
\begin{verbatim}
(%i4) %, numer;
(%o4)                   82.01219330881977
\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:
% bfloat (%o3);
\begin{verbatim}
(%i5) bfloat (%o3);
(%o5)                  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:
% fpprec;
\begin{verbatim}
(%i6) fpprec;
(%o6)                          16
\end{verbatim}
Here we reset {\tt fpprec} to yield 100 digits:
% fpprec: 100;
% ''%i5;
\begin{verbatim}
(%i7) fpprec: 100;
(%o7)                          100
(%i8) ''%i5;
(%o8) 8.20121933088197564152489730020812442785204843859314941221\
2371240173124187540110412666123849550160561b1
\end{verbatim}
Note the use of two single quotes ({\tt ''}) in {\tt (\%i8)} to repeat
command {\tt (\%i5)}.  Maxima can handle very large numbers without
approximation:
% 100!;
\begin{verbatim}
(%i9) 100!;
(%o9) 9332621544394415268169923885626670049071596826438162146859\
2963895217599993229915608941463976156518286253697920827223758251\
185210916864000000000000000000000000
\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:
% (x + 3*y + x^2*y)^3;
% expand (%);
\begin{verbatim}
(%i1) (x + 3*y + x^2*y)^3;
                          2             3
(%o1)                   (x  y + 3 y + x)
(%i2) expand (%);
       6  3      4  3       2  3       3      5  2       3  2
(%o2) x  y  + 9 x  y  + 27 x  y  + 27 y  + 3 x  y  + 18 x  y
                                        2      4        2      3
                                + 27 x y  + 3 x  y + 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}
% %o2, x=5/z;
\begin{verbatim}
(%i3) %o2, x=5/z;
           2        3                 2               3
      135 y    675 y    225 y   2250 y    125   5625 y    1875 y
(%o3) ------ + ------ + ----- + ------- + --- + ------- + ------
        z         2       2        3       3       4         4
                 z       z        z       z       z         z
                                             2          3
                                       9375 y    15625 y        3
                                     + ------- + -------- + 27 y
                                          5          6
                                         z          z
\end{verbatim}
\end{minipage}
The Maxima function {\tt ratsimp} will place this over a common denominator:
% ratsimp (%);
\begin{verbatim}
(%i4) ratsimp (%);
           3  6        2  5         3           4
(%o4) (27 y  z  + 135 y  z  + (675 y  + 225 y) z
          2         3          3            2         2
 + (2250 y  + 125) z  + (5625 y  + 1875 y) z  + 9375 y  z
          3   6
 + 15625 y )/z
\end{verbatim}
Expressions may also be {\tt factor}ed:
% factor (%);
\begin{verbatim}
(%i5) factor (%);
                           2              3
                     (3 y z  + 5 z + 25 y)
(%o5)                ----------------------
                                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}:
% a + b*c = 1;
% b - a*c = 0;
% a + b = 5;
% solve ([%o6, %o7, %o8], [a, b, c]);
\begin{verbatim}
(%i6) a + b*c = 1;
(%o6)                      b c + a = 1
(%i7) b - a*c = 0;
(%o7)                      b - a c = 0
(%i8) a + b = 5;
(%o8)                       b + a = 5
(%i9) solve ([%o6, %o7, %o8], [a, b, c]);
              sqrt(79) %i - 11      sqrt(79) %i + 9
(%o9) [[a = - ----------------, b = ---------------,
                     4                     4
    sqrt(79) %i + 1        sqrt(79) %i + 11
c = ---------------], [a = ----------------,
          10                      4
      sqrt(79) %i - 9        sqrt(79) %i - 1
b = - ---------------, c = - ---------------]]
             4                     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:
% sin(u + v) * cos(u)^3;
% trigexpand (%);
\begin{verbatim}
(%i10) sin(u + v) * cos(u)^3;
                          3
(%o10)                 cos (u) sin(v + u)
(%i11) trigexpand (%);
                3
(%o11)       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}:
% trigreduce (%o10);
\begin{verbatim}
(%i12) trigreduce (%o10);
       sin(v + 4 u) + sin(v - 2 u)   3 sin(v + 2 u) + 3 sin(v)
(%o12) --------------------------- + -------------------------
                    8                            8
\end{verbatim}
The functions {\tt realpart} and {\tt imagpart} will return the real
and imaginary parts of a complex expression:
% w: 3 + k*%i;
% w^2 * %e^w;
% realpart (%);
\begin{verbatim}
(%i13) w: 3 + k*%i;
(%o13)                      %i k + 3
(%i14) w^2 * %e^w;
                               2   %i k + 3
(%o14)               (%i k + 3)  %e
(%i15) realpart (%);
                3       2               3
(%o15)        %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}:
% f: x^3 * %e^(k*x) * sin(w*x);
\begin{verbatim}
(%i1) f: x^3 * %e^(k*x) * sin(w*x);
                         3   k x
(%o1)                   x  %e    sin(w x)
\end{verbatim}
We compute the derivative of {\tt f} with respect to {\tt x}:
% diff (f, x);
\begin{verbatim}
(%i2) diff (f, x);
         3   k x               2   k x
(%o2) k x  %e    sin(w x) + 3 x  %e    sin(w x)
                                                 3   k x
                                            + w x  %e    cos(w x)
\end{verbatim}
Now we find the indefinite integral of {\tt f} with respect to {\tt x}:
% integrate (f, x);
\begin{verbatim}
(%i3) integrate (f, x);
            6      3  4      5  2    7   3
(%o3) (((k w  + 3 k  w  + 3 k  w  + k ) x
       6      2  4      4  2      6   2
 + (3 w  + 3 k  w  - 3 k  w  - 3 k ) x
            4       3  2      5         4       2  2      4
 + (- 18 k w  - 12 k  w  + 6 k ) x - 6 w  + 36 k  w  - 6 k )
   k x                 7      2  5      4  3    6     3
 %e    sin(w x) + ((- w  - 3 k  w  - 3 k  w  - k  w) x
         5       3  3      5     2
 + (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
             8      2  6      4  4      6  2    8
 cos(w x))/(w  + 4 k  w  + 6 k  w  + 4 k  w  + k )
\end{verbatim}
A slight change in syntax gives definite integrals:
% integrate (1/x^2, x, 1, inf);
% integrate (1/x, x, 0, inf);
\begin{verbatim}
(%i4) integrate (1/x^2, x, 1, inf);
(%o4)                           1
(%i5) integrate (1/x, x, 0, inf);

defint: integral is divergent.
 -- an error. To debug this try: debugmode(true);
\end{verbatim}
Next we define the symbol {\tt g} in terms of {\tt f} (previously
defined in {\tt \%i1}) 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}
% g: f / sinh(k*x)^4;
% taylor (g, x, 0, 3);
\begin{verbatim}
(%i6) g: f / sinh(k*x)^4;
                         3   k x
                        x  %e    sin(w x)
(%o6)                   -----------------
                               4
                           sinh (k x)
(%i7) taylor (g, x, 0, 3);
                        2    3   2         2    3   3
         w    w x   (w k  + w ) x    (3 w k  + w ) x
(%o7)/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:
% limit (g, x, 0);
\begin{verbatim}
(%i8) limit (g, x, 0);
                               w
(%o8)                          --
                                4
                               k
\end{verbatim}
Maxima also permits derivatives to be represented in unevaluated form
(note the quote):
% 'diff (y, x);
\begin{verbatim}
(%i9) 'diff (y, x);
                               dy
(%o9)                          --
                               dx
\end{verbatim}
The quote operator in {\tt (\%i9)} means ``do not evaluate''.  Without
it, Maxima would have obtained 0:
% diff (y, x);
\begin{verbatim}
(%i10) diff (y, x);
(%o10)                          0
\end{verbatim}
Using the quote operator we can write differential equations:
% 'diff (y, x, 2) + 'diff (y, x) + y;
\begin{verbatim}
(%i11) 'diff (y, x, 2) + 'diff (y, x) + y;
                           2
                          d y   dy
(%o11)                    --- + -- + y
                            2   dx
                          dx
\end{verbatim}
Maxima's {\tt ode2} function can solve first and second order ODE's:
% ode2 (%o11, y, x);
\begin{verbatim}
(%i12) ode2 (%o11, y, x);
             - x/2          sqrt(3) x            sqrt(3) x
(%o12) 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:
% m: entermatrix (3, 3);
\begin{verbatim}
(%i1) 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 ]
                           [         ]
(%o1)                      [ 1  0  1 ]
                           [         ]
                           [ 1  1  0 ]
\end{verbatim}
Next we find its transpose, determinant and inverse:
% transpose (m);
% determinant (m);
% invert (m), detout;
\begin{verbatim}
(%i2) transpose (m);
                           [ 0  1  1 ]
                           [         ]
(%o2)                      [ 1  0  1 ]
                           [         ]
                           [ a  1  0 ]
(%i3) determinant (m);
(%o3)                         a + 1
(%i4) invert (m), detout;
                        [ - 1   a    1  ]
                        [               ]
                        [  1   - a   a  ]
                        [               ]
                        [  1    1   - 1 ]
(%o4)                   -----------------
                              a + 1
\end{verbatim}
In {\tt (\%i4)}, 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):
% m . %o4;
% expand (%);
% factor (%);
\begin{verbatim}
(%i5) m . %o4;
                               [ - 1   a    1  ]
                               [               ]
                               [  1   - a   a  ]
                 [ 0  1  a ]   [               ]
                 [         ]   [  1    1   - 1 ]
(%o5)            [ 1  0  1 ] . -----------------
                 [         ]         a + 1
                 [ 1  1  0 ]
(%i6) expand (%);
         [   a       1                                 ]
         [ ----- + -----        0              0       ]
         [ a + 1   a + 1                               ]
         [                                             ]
         [                  a       1                  ]
(%o6)    [       0        ----- + -----        0       ]
         [                a + 1   a + 1                ]
         [                                             ]
         [                                 a       1   ]
         [       0              0        ----- + ----- ]
         [                               a + 1   a + 1 ]
(%i7) factor (%);
                           [ 1  0  0 ]
                           [         ]
(%o7)                      [ 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}
% eigenvectors (m);
\begin{verbatim}
(%i8) eigenvectors (m);
           sqrt(4 a + 5) - 1  sqrt(4 a + 5) + 1
(%o8) [[[- -----------------, -----------------, - 1], 
                   2                  2
                    sqrt(4 a + 5) - 1    sqrt(4 a + 5) - 1
[1, 1, 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 \%o8}, 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:
% part (%, 2, 1, 1);
\begin{verbatim}
(%i9) part (%o23, 2, 1, 1);
                sqrt(4 a + 5) - 1    sqrt(4 a + 5) - 1
(%o9)     [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:
% batch ("critpts.max");
% critpts ();
\begin{verbatim} 
(%i1) batch ("critpts.max");

batching #p/home/robert/tmp/maxima-clean/maxima/critpts.max
(%i2) 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))
(%i3) 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        
(%o3) [[x = .4588955685487001 %i + .3589790871086935, 
y = .4942017368275118 %i - .1225787367783657], 
[x = .3589790871086935 - .4588955685487001 %i, 
y = - .4942017368275118 %i - .1225787367783657], 
[x = .4187542327234816 %i - .6923124204420268, 
y = 0.455912070111699 - .8697262692814121 %i], 
[x = - .4187542327234816 %i - .6923124204420268, 
y = .8697262692814121 %i + 0.455912070111699]]
\end{verbatim}

\section{A partial list of Maxima functions}

See the Maxima reference manual {\tt doc/html/maxima\_toc.html} (under
the main Maxima installation directory).  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 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 an 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 as {\tt inf} (positive infinity) or {\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} or {\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 Maxima'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 {\tt 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}
