This week we’ll look at Maxima, a computer algebra software (CAS) program. From the website:
Maxima is a system for the manipulation of symbolic and numerical expressions, including differentiation, integration, Taylor series, Laplace transforms, ordinary differential equations, systems of linear equations, polynomials, and sets, lists, vectors, matrices, and tensors…Maxima can plot functions and data in two and three dimensions.
It has many of the same functions and capabilities as Maple and Mathematica and costs several hundred dollars less.
Maxima has an interesting history. It began life in the late 1960s at MIT, when it was known as Macsyma. It continued development at MIT, with funding from the Department of Energy, and was renamed DOE-Macsyma. In 1982 a commercial version of Macsyma was spawned (or “forked”), and was maintained until 1999. In 1998, the maintainer of the original Macsyma, William Schelter, received permission from the DoE to release the code for the non-commercial version under the GNU General Public License (GPL). Schelter maintained the program, now called Maxima, until his death in 2001. Since then, Maxima has retained a large community of users who continue to maintain and improve the program.
If you’ve used other CAS programs, Maxima’s syntax will feel very familiar (especially if you’ve used Maple). For example, to integrate cos(x):
(%i1) integrate(cos(x),x); (%o1) sin(x)
Or you can compute definite integrals:
(%i2) integrate(cos(x),x,0,%pi/3); sqrt(3) (%o2) ------- 2
You can also plot with the built-in interface to gnuplot (click for full size):
You can even solve equations:
(%i2) solve([x+y+z=5,3*x-5*y=10,y+2*z=3],[x,y,z]); 45 1 19 (%o2) [[x = --, y = --, z = --]] 13 13 13
Maxima handles many operations quite easily, once you learn the commands. The documentation available on the website (in both html and pdf formats, and in numerous languages) is great, with lots of examples to get you started. The output isn’t pretty, although if you spend the time to configure Maxima to run in GNU Emacs (with Imaxima mode) or GNU TeXmacs, you can get it to look very nice indeed.
In addition to being free and open source, Maxima compiles on most systems (Windows, Mac, Linux, etc.), so you can run it on just about anything (anyone still using an Amiga?). Give it a try if you need a little help with those matrix products, or if you need to solve a differential equation numerically, and you don’t have access to Maple or Mathematica.