Frequently-Asked Questions

This FAQ resides at http://maxima.sourceforge.net/faq/faq.html. Maxima version at last update: 5.9.0.

For more information about this faq, please contact Judah Milgram, email address formed by last name, at eng dot umd dot edu.


FAQ Revised: Wednesday 23 July 2003 16:14:24


Table of Contents

1. General
2. Documentation
3. Installing Maxima
4. Lisp
5. Emacs
6. Bugs and other problems
7. Additional Packages
8. Beginner Questions
9. TeX Output

1. General

1.1. Acknowledgements

Numerous people have contributed material to this FAQ and/or to the Maxima mailing list (from which much of the FAQ material is snarfed :) Notably: Jay Belanger, Richard Fateman, David Holmgren, Nikolaos Ioakimidis, Stavros Macrakis, Martin Rubey, Raymond Toy, Barton Willis, and many others, - above all: William Schelter. (if you know of someone I've forgotten, please drop me a line).



Return to top of page

1.2. Did anybody really ask any of these questions?

Many of them :)



Return to top of page

1.3. What is Maxima?

From the README: Maxima is a full symbolic computation program. It is full featured doing symbolic manipulation of polynomials, matrices, rational functions, integration, Todd-coxeter, graphing, bigfloats. It has a symbolic debugger source level debugger for maxima code. Maxima is based on the original Macsyma developed at MIT in the 1970's. It is quite reliable, and has good garbage collection, and no memory leaks. It comes with hundreds of self tests.



Return to top of page

1.4. Macsyma vs. DOE-Macsyma vs. Symbolics Macsyma vs. Maxima?

The system developed at MIT was called Macsyma (although the nicknames MACSYM and MAXIMA were sometimes used since filenames were limited to six uppercase-only characters in sixbit character code).

Symbolics licensed Macsyma from M.I.T. and registered "Macsyma" as a trademark at some point (presumably with M.I.T.'s permission).

When Macsyma source ceased to be freely available, pressure was put on M.I.T. (mostly by Fateman) to transfer the code which had been developed largely with Department of Energy (DOE) funding to the DOE, which then released it to others under certain conditions.

That codebase was called DOE Macsyma. I don't know what legal rights the DOE had to the *name* Macsyma as opposed to the codebase, but presumably the non-commercial users of DOE Macsyma wanted to avoid any legal wrangling around the name, and started using the name Maxima at some point (but I don't know when that was).

So the short answer as I understand it is that Maxima is simply the most recent name for the branch that started under the name DOE Macsyma.

- Stavros

Return to top of page

1.5. Who wrote it?

(From the home page: Maxima is a descendant of DOE Macsyma, which had its origins in the late 1960s at MIT. It is the only system based on that effort still publicly available and with an active user community, thanks to its open source nature. Macsyma was the first of a new breed of computer algebra systems, leading the way for programs such as Maple and Mathematica. This particular variant of Macsyma was maintained by William Schelter from 1982 until he passed away in 2001. In 1998 he obtained permission to release the source code under GPL. It was his efforts and skill which have made the survival of Maxima possible, and we are very grateful to him for volunteering his time and skill to keep the original Macsyma code alive and well.



Return to top of page

1.6. Who's maintaining it now?

Since William Schelter's passing a group of users and developers has formed to keep Maxima alive and kicking. We are currently in a transitional state, deciding what directions to go in next and seeing what our abilities and resources are. Maxima itself is reasonably feature complete at this stage, with abilities such as symbolic integration, 3D plotting, and an ODE solver, but there is a lot of work yet to be done in terms of bug fixing, cleanup, and documentation. This is not to say there will be no new features, but there is much work to be done before that stage will be reached, and for now new features are not likely to be our focus.



Return to top of page

1.7. Is it free?

Yes. Maxima is distributed under the GNU General Public License, with some export restrictions from the U.S. Department of Energy.



Return to top of page

1.8. What about other symbolic manipulation packages?

There are several, although not all are open-source or otherwise free.

David Holmgren writes: "I've tried [Jacal, Yacas, and Calc] with Windows and Linux. Jacal and Yacas don't have the range of commands that Maxima does, but Calc is a bit more extensive (i.e., has a fairly general integrator)."



Return to top of page


2. Documentation

2.1. Where can I read about it?



Return to top of page

2.2. Why two "Reference Manuals"?

The original Maxima Reference Manual by William Schelter is no longer maintained. Mike Clarkson's manual is not exactly a replacement of WS's manual, but rather, a separate manual prepared by Michael Clarkson for DOE-Macsyma in the past and now adapted to Maxima with a change in the title: DOE-Maxima instead of DOE-Macsyma.



Return to top of page

2.3. What about the page at utexas.edu? It only shows versions up to 5.6.0?

http://www.ma.utexas.edu/maxima.html was William Schelter's old home page and is no longer maintained. It does have some screenshots, however, as well as other useful information.



Return to top of page

2.4. What about Lisp?

Some web sites with good information on Common Lisp:



Return to top of page


3. Installing Maxima

3.1. Where do I get it?
[to be added]

Return to top of page

3.2. What do I need to run it?
[to be added]

Return to top of page

3.3. What Linux Distributions come with Maxima?
Vadim Zhytnikov writes: "AFAIK the only two Linux distros which come with Maxima are:

Return to top of page


4. Lisp

4.1. What LISP implementations will Maxima work with?
clisp, CMUCL and GCL are fully supported by Maxima; previous versions of Maxima only fully supported GCL. Ports to other ANSI lisps should be straightforward and are welcome; please contact the developers if you are interested in working on a port.

Return to top of page

4.2. CLISP
clisp includes GNU readline support, so Maxima will have advanced command-line editing facilities when built with it. Get it from http://clisp.cons.org. Maxima will fail to build with 2.26 because of a bug in clisp. 2.28 and 2.29 are known to work. There are currently unresolved problems with floating point numbers in Maxima with clisp 2.30. 2.29 is recommended.

Return to top of page

4.3. CMUCL
Get it from http://cmucl.cons.org. CMUCL is the fastest option for Maxima on platforms where it is available. Unfortunately, it does not include readline support. However, readline support can be added by wrapping maxima with the ledit executable. See ftp://ftp.inria.fr/INRIA/Projects/cristal/Daniel.de_Rauglaudre/Tools/ for ledit. Maxima will build with CMUCL 18c, but will hang on some run-time operations. 18d is known to work.

Return to top of page

4.4. GCL
Get it at <http://savannah.gnu.org/projects/gcl>. 2.4.4 and 2.5.0 should work. 2.5.0 has not yet been released as of this writing. The cvs version of 2.5.0 has been used to successfully build Maxima. GCL versions starting with 2.4.3 can be built with readline support, so Maxima will have advanced command-line editing facilities when build with it.

Return to top of page


5. Emacs

5.1. How do I enable maxima mode in emacs?
Put something like these in your ~/.emacs:
(setq auto-mode-alist (cons '("\\.max" . maxima-mode) auto-mode-alist))
(setq load-path (cons  "/usr/share/maxima/5.9.0/emacs" load-path ))
(autoload 'maxima "maxima" "Running Maxima interactively" t)
(autoload 'maxima-mode "maxima" "Maxima editing mode" t)
Instead of modifying the load path, you could copy all the .el files from /usr/share/maxima/5.9.0/emacs (or wherever) to a site-lisp directory in your load path.

Return to top of page


6. Bugs and other problems

6.1. Why do trivial bugs still exist on a program this old?

I just submitted a bug on sourceforge and was just wondering, why do trivial bugs still exist on a program this old? These are things my calculator can do right now, while this program has apparently been around for 30+ years.

Answer:

  1. You may have reported something which is not a bug [comment: it wasn't] but represents a misunderstanding of what the program is supposed to do. (This is very common, though it may not apply to your report of course).
  2. The particular feature you exercised was not written 30 years ago, but was written by a user -- much like yourself, perhaps -- and since it was not central to the system's operation, has not been tested. It may have been written in the late 1970s.
  3. Much of this system has not been revised since 1982, so that the last 20 years (when only the commercial version was under development) don't exactly count.
  4. Hopefully the bug will get fixed now that it has been identified.



Return to top of page

6.2. What's the preferred way to report bugs?

Bugs should be entered directly into the bug database at https://sourceforge.net/tracker/?group_id=4933&atid=104933. This is a better way of tracking them than reporting them to the mailing list. If of course you'd like to discuss some issue, then mailing to the list is useful.

The cgi interface to the bug database will allow you to submit files that may be useful in documenting the problem.

A basic bug report includes enough information to reproduce the problem, including the version information given by bug_report().

A fuller, better better bug report includes:

- Stavros Macrakis

Return to top of page

6.3. Transcripts in bug reports

Email and bug reports often include transcripts of Maxima sessions (a good thing). Unfortunately, the layout often gets garbled because Tabs are not treated consistently across mail programs, HTML, etc. Even for mail programs that display tabs correctly, everything gets screwed up as soon as the original mail is indented for quoting (">" at the beginning of the line).

So if you include transcripts in mail or bug reports, please either

Example:

(C47) taylor(erf(x),x,0,5);
					  3		 5
	 (2 SQRT(%PI)) x   (2 SQRT(%PI)) x    SQRT(%PI) x
(D47)/T/ --------------- - ---------------- + ------------ + . . .
	       %PI	        3 %PI		 5 %PI

What that looks like in some mail readers:

                                3          5
         (2 SQRT(%PI)) x (2 SQRT(%PI)) x    SQRT(%PI) x
(D47)/T/ --------------- - ---------------- + ------------ + . . .
               %PI        3 %PI            5 %PI

Same thing after untabify:

(C47) taylor(erf(x),x,0,5);
                                          3              5
         (2 SQRT(%PI)) x   (2 SQRT(%PI)) x    SQRT(%PI) x
(D47)/T/ --------------- - ---------------- + ------------ + . . .
               %PI              3 %PI            5 %PI


Using display2d:false:

(C48) display2d:false;
(D48) FALSE
(C49) d47;
(D49) 2*SQRT(%PI)*x/%PI-2*SQRT(%PI)*x^3/(3*%PI)+SQRT(%PI)*x^5/(5*%PI)



Return to top of page

6.4. What about compilation problems?

Submit a description of the problem to https://sourceforge.net/tracker/?group_id=4933&atid=104933

- Camm Maguire



Return to top of page

6.5. maxima-5.9.0 won't compile with gcl 2.4.0

You need a more recent version of gcl. 2.4.0 is known not to work. 2.4.x for some x works I think. 2.5.x should work too.



Return to top of page


7. Additional Packages

7.1. (Hyper)graphs



Return to top of page


8. Beginner Questions

8.1. inchar and outchar

When I enter this equation:

(C1) eq1:v1=(1/(z-1))*(b1*vin - g1*v2 - c1*fb);
I get an output line entirely different than what I expected

Answer: "c1" is your input statement. Note the input and output line numbers have labels like (C1) and (D1). Try it with another variable name, for example c_1.

Or, you can change the characters used to form the label by setting "inchar" and "outchar":

(C1) inchar; 
(D1)                                        C 
(C2) outchar; 
(D2)                                        D 
(C3) inchar : c_; 
(D3)                                       c_ 
(c_3) outchar : d_; 
(d_3)                                       d_ 
(c_4) 5!; 
(d_4)                                       120 



Return to top of page

8.2. Solving simultaneous equations.

I want to deduce n[v]=2*n-n[c]-2 from

n[e]=1/2*(3*n[v]+n[c])
	and
n-n[e]+n[v]=1
In other words: I want to express n[v] in terms of other variables. But solve does't work this for me. What function should I use?

Answer: You need to solve for the two variables:

(C1) n[e]=1/2*(3*n[v]+n[c]);

                                 3 n  + n
                                    v    C
(D1)                        n  = ---------
                             e       2
(C2) n-n[e]+n[v]=1;

(D2)                       n  + n - n  = 1
                            v        e

(C3) solve([d1,d2],[n[v],n[e]]);

(D3)           [[n  = 2 n - n  - 2, n  = 3 n - n  - 3]]
                  v          C       e          C
Another possibility:
(C1) eliminate([n[e]=1/2*(3*n[v]+n[c]),n-n[e]+n[v]=1],[n[e]]);
(D1) 			     [- n  + 2 n - n  - 2]
				 v	    c
(C2) solve(%,n[v]);
(D2) 			      [n  = 2 n - n  - 2]
				v	   c



Return to top of page

8.3. How to extract a column from a matrix?

For matrix 'm' 'm[i]' is the i-th row of 'm'. Is there any way to get a column? I know about 'col(m,i)' but 'col' returns matrix and it's not possible to assign a value to it. It's convinient to write 'm[i]:[1,2,3]'. Why can't I do that with columns?

Answer: try transposing m then transposing it again.



Return to top of page

8.4. Why doesn't 'return' work in loops?

For example:

(C1) block([],for i:1 thru 5 do return(1), 0);
(D1) 0

Answer: It returned 1 from the for-loop. Then the block returned 0.



Return to top of page

8.5. DESOLVE doesn't work!?

desolve(diff(y(x),x)=(4-2*x)/(3*y^2-5),y(x)) produces the wrong answer.

Answer: As the documentation says, "the functional relationships must be explicitly indicated". That is, for Desolve, you can't write 'diff(y(x),x)=y+x; you must write 'diff(y(x),x)=y(x)+x. As it happens, Desolve can't solve that, but ODE2 can -- though ODE2 takes a different input form (yes, I agree this is annoying and illogical): depends(y,x)$ 'diff(y,x)=y+x. Transcript:

(C1) depends(y,x);
(D1)                               [y(x)]
(C2) 'diff(y,x)=(4-2*x)/(3*y^2-5);
                               dy   4 - 2 x
(D2)                           -- = --------
                               dx      2
                                    3 y  - 5
(C3) ode2(%,y,x);
                            3          2
                           y  - 5 y   x  - 4 x
(D3)                     - -------- = -------- + %C
                              2          2

/* Now let's check the answer */

(C4) diff(d3,x);
                              2 dy     dy
                           3 y  -- - 5 --
                                dx     dx   2 x - 4
(D4)                     - -------------- = -------
                                 2             2
(C5) solve(d4,'diff(y,x));
                              dy     2 x - 4
(D5)                         [-- = - --------]
                              dx        2
                                     3 y  - 5
(C6) subst(d5,d2);
                             2 x - 4    4 - 2 x
(D6)                       - -------- = --------
                                2          2
                             3 y  - 5   3 y  - 5
(C7) ratsimp(lhs(d6)-rhs(d6));
(D7)                                 0



Return to top of page

8.6. Quote needed?

In the DESOLVE example above, if you tell maxima that y depends on x, then you do not need to quote the diff operator. The quote is needed when depends(y,x) is not typed.

Answer: True. In the ODE example, you could omit the Depends and quote the diff, or include the Depends and either quote the diff or not.

The quote is stylistic, emphasizing that you're talking *about* the differential rather than actually carrying out the differentiation.

Of course, the discussion about desolve and ode2 needs to be put in a broader context of "how to solve differential equations". Here, it is just contrasting desolve's approach to dependency (use explicit functions like f(x)) vs. ode2's (declare that y depends on x or simply quote the differentials).



Return to top of page

8.7. Substitution

I have the following function call in a more complicated expression:

erf((((64800 * %i + 64800) * t + 37 * %i + 35)/72))
I have another function acref, which takes 2 arguments, the first is the argument of the error function and the second is a approximation order. I want to substitute the call to acerf in place of erf in my more complicated expression, for example:
acerf((((64800 * %i + 64800) * t + 37 * %i + 35)/72), 2)
Is there a easy way to do this in maxima?

Answer:

matchdeclare(any, true)$
defrule(r1,erf(any), acerf(any,order))$
order:2$

apply1(expression, r1);
or some variation of that.



Return to top of page


9. TeX Output

9.1. How do I customize the Tex output for individual Maxima variables?

Create a file "foo.lisp" (or whatever) with lisp statements like

(defprop $cla "c_{l_\alpha}" texword)
then load it in your script, for example:
(C1) load("foo.lisp");
(D1)                               foo.lisp
(C2) tex(cla);
$$c_{l_alpha}$$
Maxima 5.9.0 and later has a utility function texput that allows you to customize TeX output. Here is the same example as before
(C1) texput(cla, "c_{l_\\alpha}")$ 

(C3) tex(cla); 
$$c_{l_\alpha}$$ 
Notice that here we must use the double slash on alpha to get a single slash on the TeX output.



Return to top of page


Copyright (c) 2003 Judah Milgram. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.

This list of questions and answers was generated by makefaq.