# Maxima

Maxima is on open source computer algebra system, similar to Mathematica. It is available for GNU/Linux, MacOS X and Windows.

### installation on a GNU/Linux system

There should be pre-compiled pacakages available for most distributions. For example in Debian-based distributions such as Ubuntu install the maxima and maxima-share packages by typing

```sudo apt-get install maxima maxima-share
```

### sample usage

```expand((x+y+z)^4);
integrate(1/(1+x^3),x);
```

### tensor manipulation

The ctensor module is useful for tensor manipulation (in Ubuntu GNU/Linux this is included in the maxima-share package).

Sample usage:

```load(ctensor);
dim: 5;
ct_coords: [t,rho,chi1,chi2,chi3];
lg: matrix([-(R^2)*(cosh(rho)^2),0,0,0,0],[0,R^2,0,0,0],[0,0,(R^2)*(sinh(rho)^2),0,0],[0,0,0,(R^2)*(sinh(rho)^2)*sin(chi1)^2,0],[0,0,0,0,(R^2)*(sinh(rho)^2)*(sin(chi1)^2)*(sin(chi2)^2)]);
cmetric();
ug;
christof(mcs);
ricci(true);
scurvature();
trigsimp(%);
```

This finds the Christoffel symbols, the Ricci tensor and the Ricci curvature scalar of the 5-dimensional Anti de Sitter spacetime metric.

### plotting with Maxima

Maxima integrates well with gnuplot to provide graph plotting. (Note that in Ubuntu GNU/Linux you need the addition package gnuplot-x11 to use gnuplot's full graphical output.)

A selection of examples:

```plot2d(sin(x),[x,0,10]);
plot2d([parametric, (1+cos(t))*cos(t), (1+cos(t))*sin(t), [t,-%pi,%pi], [nticks,80]],[x, -1,2]);
plot3d (atan (-x^2 + y^3/4), [x, -4, 4], [y, -4, 4], [grid, 50, 50]);
```

For more examples see Maxima manual: plotting.

### integration with GNU Emacs

There is a Maxima-mode for GNU Emacs. For Ubuntu GNU/Linux simply install the maxima-emacs package. So that GNU Emacs knows to use this mode when you edit files with the .max extension, add the following lines to your .emacs file in your home directory:

```(setq auto-mode-alist (cons '("\\.max" . maxima-mode) auto-mode-alist))