This page is a short introduction to numeric and symbolic mathematics in Maxima on FreeBSD.

What is Maxima?

Maxima is an interactive environment for numeric and symbolic mathematics. It does differentiation, integration and solutions of equations. It plots 2 and 3 dimensional graphics.

# pkg install maxima

Plotting with Maxima.

Plot 2 sin waves, which is from -2π to 2π.

$ maxima
(%i1) plot2d( sin(x), [ x, -2*%pi, 2*%pi ] );
(%i2) quit();

Functions, solving and differentiating with Maxima.

Define 2 functions y1 and y2. Plot their intersection. Solve their intersection for x. Differentiate them.

$ maxima
(%i1) y1(x) := 2*x+1;
(%o1) y1(x) := 2 x + 1
(%i2) y2(x) := -x+4;
(%o2) y2(x) := - x + 4
(%i3) plot2d( [ y1(x), y2(x) ], [ x, -5, 5 ] );
(%i4) solve( y1(x) = y2(x), x );
(%o4) [x = 1]
(%i5) diff( [ y1(x), y2(x) ], x );
(%o5) [2, - 1]
(%i6) quit();

Define 2 functions y1 and y2, where y2 is of 2nd order. Set decimal precision. Solve their intersections and display in decimal number. Differentiate y2. Reference the result with % and evaluate it for x at -1. Plot their intersections.

$ maxima
(%i1) y1(x) := 2*x-9;
(%o1) y1(x) := 2 x - 9
(%i2) y2(x) := -2*x^2-x+15;
2
(%o2) y2(x) := - 2 x - x + 15
(%i3) fpprintprec: 2;
(%o3) 2
(%i4) float(solve( y1(x) = y2(x), x ));
(%o4) [x = - 4.3, x = 2.8]
(%i5) diff( y2(x), x );
(%o5) - 4 x - 1
(%i6) ev( %, x=-1 );
(%o6) 3
(%i7) plot2d( [ y1(x), y2(x) ], [ x, -5, 5 ] );
(%i8) quit();