Maxima Primer

Maxima is a computer program for doing mathematics calculations, symbolic manipulations, numerical computations and graphics. Procedures can be programmed and then run by Maxima to do complex tasks. Much of the syntax for other languages such as Maple was copied from Maxima. Full documentation is available.

To do basic operations, a line is typed, followed by a semicolon, and then entered. For example,
integrate(1/(1+x^3),x) evaluates to Result. You may double click the above formula, and the integral will be substituted.

Here are some examples from basic calculus. To have Maxima evaluate the derivative of the function below, click on this line.
diff(cos(x),x); returns RESULT.

Maxima can calculate indefinite integrals.

Also, limits can be evaluated as x goes to infinity:
limit( (2*x+1)/(3*x+2), x,inf ); produces RESULT

limit( sin(3*x)/x, x,0); evaluates to RESULT

Maxima can perform calculations to arbitrary precision. The following example computes Pi to one hundred decimal places.
block([FPPREC:100],bfloat(%pi)) yields RESULT if we took sin of this we would get 0 to to within 100 decimal places..

block([FPPREC:100],sin(bfloat(%pi))) gives RESULT

Maxima can solve equations. Click this line to solve the system.
solve([x+y+z=5,3*x-5*y=10,y+2*z=3],[x,y,z]); returns RESULT

solve(x^2-5*x+6 =0,x); produces RESULT

Linear Algebra

For example, matrices can be entered and manipulated. Click these two lines.
A:matrix([1,2],[3,4]); gives RESULT

B:matrix([1,1],[1,1]); gives RESULT

The matrices can then be added, for example:
A + B ; returns the sum RESULT ...and multiplied.
A . B ; gives the productRESULT
A^^-1 evaluates to the inverse: RESULT

determinant(matrix([a,b],[c,d])) gives RESULT

Let v represent a set of points in 3 space

v: [[1.214124, 0.000000, 1.589309], [0.375185, 1.154701, 1.589309], [-0.982247, 0.713644, 1.589309], [-0.982247, -0.713644, 1.589309], [0.375185, -1.154701, 1.589309], [1.964494, 0.000000, 0.375185], [0.607062, 1.868345, 0.375185]];
Then we could have some pentagons whose vertices are among the above, name the first vertex uses points [1,2,3,4,5], the second has vertices the 1,2,..6 'th points in the above list..
vertices:[[1,2,3,4,5],[1,2,3,5,6],[7,5,2,3,1]]
The center of mass of one face is
sum(v[vertices[1][i]],i,1,5) gives
Result
center_of_mass:create_list(sum(v[u[i]],i,1,5),u,vertices) gives result

Procedures ---------- For more complex tasks, procedures can be written and run by Maxima. For example, the famous Fibonacci numbers are defined recursively. Here is a Maxima procedure for calculating the Fibonacci sequence. Click on the region to enter it.

Fib[0] : 0; Fib[1] : 1; Fib[n] := Fib[n-1] + Fib[n-2]; Then the procedure can be called. fib[8]; gives 21

Maxima can solve ODEs analytically and numerically. Click the following line for an example of an analytic solution.

ode2('diff(y,x)+3*x*y = sin(x)/x, y,x) returns Result
ode2('diff(y,x) -y = 1, y,x) returns
- X X Y = (%C - %E ) %E

ode2('diff(y,x,2) - y = 1, y,x) gives RESULT

Maxima has 2D and 3D graphics capability. It can do graphic tasks from elementary like the following.
plot2d(sin(x),[x,0,2*%Pi])

Defining a Function

The standard form is

f(3) gives F(3)

f(x):=x+2

now f(3) gives 5

Local variables:

The