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.

Project and documentation links

The Help menu in Xmaxima gives you access to the following documents:

Getting started

To do basic operations, a line is typed, followed by a semicolon, and then entered. This can be done in the window above. Alternately you may edit the blue portions in this buffer, and click on them, to see the result evaluated above and/or inserted in this window, depending on what was specified in the html source for this file. For example clicking below

You may double click the above formula, and the integral will be substituted into the Maxima evaluation in the other window. There are examples which you may also look at 3d plotting If you wish to have your plots appear in a separate window, go to the preferences button under file, and select separate. You may also go to the netmath page to see some more capabilities.

Here are some examples from basic calculus. To have Maxima evaluate the derivative of the function below, click on this line.

Maxima can calculate indefinite integrals.

Maxima can perform calculations to arbitrary precision. The following example computes Pi to one hundred decimal places.

Linear Algebra

For example, matrices can be entered and manipulated. Click these two lines.

Then the procedure can be called. Fib[8]; gives 21

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

Defining a Function

The standard form is

Local variables:

The block construct lets us introduce local variables, and also lets us have a sequence of statements:

block([v1:val1,v2:val2,v3,v4:val4],stmt1,stmt2,... stmtn)
the value is the value of the last statement. During the execution the variables v1,v2,... will have the values indicated. If no value is given for v3 then it will just evaluate to itself:

Thus if we set v3 globally to be 7,

An example in a function: Using for:

a for loop always returns 'done as its value. To get the value you want add the w.

The function describe(s) returns documentation on all functions whose names include the string s. For example, if the string is "log",
describe("log");all prints this output