About 50,000 people read my article 3 awesome free Math programs. Chances are that at least some of them downloaded and installed Maxima. If you are one of them but are not acquainted with CAS (Computer Algebra System) software, Maxima may appear very complicated and difficult to use, even for the resolution of simple high school or calculus problems. This doesn’t have to be the case though, whether you are looking for more math resources to use in your career or a student in an online bachelor’s degree in math looking for homework help, Maxima is very friendly and this 10 minute tutorial will get you started right away. Once you’ve got the first steps down, you can always look up the specific function that you need, or learn more from Maxima’s official manual. Alternatively, you can use the question mark followed by a string to obtain in-line documentation (e.g. ? integrate). This tutorial takes a practical approach, where simple examples are given to show you how to compute common tasks. Of course this is just the tip of the iceberg. Maxima is so much more than this, but scratching even just the surface should be enough to get you going. In the end you are only investing 10 minutes.
You can use Maxima as a fast and reliable calculator whose precision is arbitrary within the limits of your PC’s hardware. Maxima expects you to enter one or more commands and expressions separated by a semicolon character (;), just like you would do in many programming languages.
(%i1) 9+7;
(%o1)
(%i2) -17*19;
(%o2)
(%i3) 10/2;
(%o3)
Maxima allows you to refer to the latest result through the % character, and to any previous input or output by its respective prompted %i (input) or %o (output). For example:
(%i4) % - 10;
(%o4)
(%i5) %o1 * 3;
(%o5) 
For the sake of simplicity, from now on we will omit the numbered input and output prompts produced by Maxima’s console, and indicate the output with a => sign. When the numerator and denominator are both integers, a reduced fraction or an integer value is returned. These can be evaluated in floating point by using the float function (or bfloat for big floating point numbers):
8/2;
=>
8/2.0;
=>
2/6;
=>
float(1/3);
=>
1/3.0;
=>
26/4;
=>
float(26/4);
=>
As mentioned above, big numbers are not an issue:
13^26;
=>
13.0^26
=>
30!;
=>
float((7/3)^35);
=>
Here is a list of common constants in Maxima, which you should be aware of:

)
)
)
)We can use some of these along with common functions:
sin(%pi/2) + cos(%pi/3);
=>
tan(%pi/3) * cot(%pi/3);
=>
float(sec(%pi/3) + csc(%pi/3));
=>
sqrt(81);
=>
log(%e);
=>
Variables can be assigned through a colon ‘:’ and functions through ‘:=’. The following code shows how to use them:
a:7; b:8;
=>
=>
sqrt(a^2+b^2);
=>
f(x):= x^2 -x + 1;
=>
f(3);
=>
f(a);
=>
f(b);
=> 
Please note that Maxima only offers the natural logarithm function log. log10 is not available by default but you can define it yourself as shown below:
log10(x):= log(x)/log(10);
=>
log10(10)
=> 
factor enables us to find the prime factorization of a number:
factor(30!);
=>
We can also factor polynomials:
factor(x^2 + x -6);
=>
And expand them:
expand((x+3)^4);
=>
Simplify rational expressions:
ratsimp((x^2-1)/(x+1));
=>
And simplify trigonometric expressions:
trigsimp(2*cos(x)^2 + sin(x)^2);
=>
Similarly, we can expand trigonometric expressions:
trigexpand(sin(2*x)+cos(2*x));
=> 
Please note that Maxima won’t accept 2x as a product, it requires you to explicitly specify 2*x. If you wish to obtain the TeX representation of a given expression, you can use the tex function:
tex(%);
=> $$-\sin ^2x+2\,\cos x\,\sin x+\cos ^2x$$
We can easily solve equations and systems of equations through the function solve:
solve(x^2-4,x);
=>
%[2]
=>
solve(x^3=1,x);
=>
trigsimp(solve([cos(x)^2-x=2-sin(x)^2], [x]));
=>
solve([x - 2*y = 14, x + 3*y = 9],[x,y]);
=>
Maxima enables us to plot 2D and 3D graphics, and even multiple functions in the same chart. The functions plot2d and plot3d are quite straightforward as you can see below. The second (and in the case of plot3d, the third) parameter, is just the range of values for x (and y) that define what portion of the chart gets plotted.
plot2d(x^2-x+3,[x,-10,10]);

plot2d([x^2, x^3, x^4 -x +1] ,[x,-10,10]);

f(x,y):= sin(x) + cos(y);
plot3d(f(x,y), [x,-5,5], [y,-5,5]);

limit((1+1/x)^x,x,inf);
=> %
limit(sin(x)/x,x,0);
=>
limit(2*(x^2-4)/(x-2),x,2);
=>
limit(log(x),x,0,plus);
=>
limit(sqrt(-x)/x,x,0,minus);
=>
diff(sin(x), x);
=>
diff(x^x, x);
=>
We can calculate higher order derivatives by passing the order as an optional number to the diff function:
diff(tan(x), x, 4);
=>
Maxima offers several types of integration. To symbolically solve indefinite integrals use integrate:
integrate(1/x, x);
=>
For definite integration, just specify the limits of integrations as the two last parameters:
integrate(x+2/(x -3), x, 0,1);
=>
integrate(%e^(-x^2),x,minf,inf);
=>
If the function integrate is unable to calculate an integral, you can do a numerical approximation through one of the methods available (e.g. romberg):
romberg(cos(sin(x+1)), x, 0, 1);
=> 0.57591750059682
sum and product are two functions for summation and product calculation. The simpsum option simplifies the sum whenever possible. Notice how the product can be use to define your own version of the factorial function as well.
sum(k, k, 1, n);
=>
sum(k, k, 1, n), simpsum;
=>
sum(1/k^4, k, 1, inf), simpsum;
=>
fact(n):=product(k, k, 1, n);
=>
fact(10);
=>
Series expansions can be calculated through the taylor method (the last parameter specifies the depth), or through the method powerseries:
niceindices(powerseries(%e^x, x, 0));
=>
taylor(%e^x, x, 0, 5);
=>
The trunc method along with plot2d is used when taylor’s output needs to be plotted (to deal with the
in taylor’s output):
plot2d([trunc(%), %e^x], [x,-5,5]);

I hope you’ll find this useful and that it will help you get started with Maxima. CAS can be powerful tools and if you are willing to learn how to use them properly, you will soon discover that it was time well invested.
Hi
I’m alex..I write because I knew Maxima last year and using there in linux, it’s amazing!!!..But now I want install Maxima in WinXP (for work) and I fail the configuration because there is a problem with a socket!!!
How Can I do?
thanks (Sorry for my English)!!!
Bie!!!
Hi –
Don’t forget to check out the best Maxima tutorial IMHO:
http://www.csulb.edu/~woollett/
Cheers!
How do you gracefully exit the maxima program? exit; and quit; don’t work. I tried ? quit and did get out via a stack overflow
but surely there is some way out other than crashing???
Larry, quit(); will exit maxima.
I exit maxima with Ctrl-D.
HI ,I just want to ask how can i use maxima to compute and draw the graph of complex numbers.
I’m trying Maxima now, after closing my sage session. I ran into trouble using sage to define a symbolic sum e.g. you want to define a function like:
f(x) = sum(i, i, 1, x);
apparently sage cannot do that at this point in the development. It was disappointing that sage couldn’t do this (or if it is possible to do this I couldn’t figure it out after an hour of trying).
sage is actually the first hit after a google search for “sage”, so it is still popular, and maybe it’ll improve by leaps and bounds, but at least after the first ten minutes I have a better feeling about Maxima.
when I was searching for a way to solve my problem I found this thread, which indicates
that this functionality is on the way for the sage:
http://groups.google.com/group/sage-support/browse_thread/thread/cf9cb4e92ce3bc04/f5e41d8aa31294e4?lnk=gst&q=sum#f5e41d8aa31294e4
it seems to me that sage is more of an interface to or a concatenation of a lot of other programs (latex, r, maxima, python etc., and also commercial programs like mathematica, matlab). I guess one has to ask whether when doing a task it is better to use sage as a single command center, or to just use that program directly.
When I try your example:
trigsimp(2*cos(x)^2 + sin(x)^2);
I get
=> \displaystyle \cos(x)^2+1
instead of
=> \displaystyle \cos ^2x+1
You forget one, but very important thing: how to run – Ctrl+R
It really easy, but it was a problem for me.
Very nice tutorial introduction! Highly recommended first intro to Maxima.
I’ve put together a selection of the Maxima resources that I’ve found most useful over the years, including a succinct instruction cheatsheet, a guide to programming subroutines/scripts, and a Mathematica-Maxima syntax conversion chart.
They’re available here:
http://mathscitech.org/articles/maxima
Enjoy!