go to www.bildungsgueter.de table of contents

A First Look at Maxima


Maxima can be used as a powerful calucator:

144*17 - 9;
 2439

Maxima can compute with very large numbers. The following expample computes the 25th power of 144:

144^25;

910043815000214977332758527534256632492715260325658624

This is more than a pocket calculator can do!

Now we compute the 25th root of that result:

 %^(1/25);

The percent sign is a special variable, its value is always the last result. The arrow is the exponentiation operator. In our input we have to use some elementary mathematical knowledge: We write the root as a power with a fractional exponent. We obtain this answer:

144

But computer algebra is more than just computation with numbers. It is computation with symbols.

Let us play with a polynomial in two variables:

(%i1) (x + 2*y)^4;

                                           4
(%o1)                             (x + 2 y)

(%i2) expand(%);

                       4         3       2  2      3      4
(%o2)              16 y  + 32 x y  + 24 x  y  + 8 x  y + x

(%i3) factor(%);

                                           4
(%o3)                             (x + 2 y)

Explanations to this session:


Maxima can compute derivatives:

(%i4) diff(sin(x)*cos(x), x);

                                  2         2
(%o4)                          cos (x) - sin (x)

(%i5) trigsimp(%);

                                      2
(%o5)                            2 cos (x) - 1

(%i6) diff(%, x);

(%o6)                          - 4 cos(x) sin(x)

(%i7) diff(sin(x)*cos(x), x, 2);

(%o7)                          - 4 cos(x) sin(x)

Explanations to this session:


As mentioned, Maxima provides serveral function to rewrite trigonometric and hyperbolic expressions in different ways.

Maxima can rewrite trigonometric expressions in a canonical form, namely as finite Fourier sums:

(%i8) trigreduce(sin(x)^5);

                       10 sin(x) - 5 sin(3 x) + sin(5 x)
(%o8)                  ---------------------------------
                                      16

Maxima can compute indefinite integrals:

(%i10) integrate((x + 1)/(x^3 - 8), x);

                                           2 + 2 x
                     2               atan(---------)
                log(x  + 2 x + 4)         2 sqrt(3)    log(x - 2)
(%o10)       (- -----------------) + --------------- + ----------
                        8               4 sqrt(3)          4

Here is a longer example that shows that Maxima can compute quite complicated integrals and can also often reconstruct the given integrand:

(%i11) assume(m > 4);

(%o11)                              [m > 4]

(%i12) integrate(x^m*(a + b*x)^3, x);

              3  m + 4        2  m + 3      2    m + 2    3  m + 1
             b  x        3 a b  x        3 a  b x        a  x
(%o12)       --------- + ------------- + ------------- + ---------
               m + 4         m + 3           m + 2         m + 1

(%i13) diff(%, x);

                3  m + 3        2  m + 2      2    m + 1    3  m
(%o13)         b  x      + 3 a b  x      + 3 a  b x      + a  x

(%i14) factor(%);

                                  m          3
(%o14)                           x  (a + b x)

Maxima can do a lot of other things, some of which are shown in greater detail in other sections of this tutorial.


table of contents