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:

(%i12) (x + 2*y)^4;
					   4
(%o12) 				  (2 y + x)
(%i13) expand(%);
		       4	 3	 2  2	   3	  4
(%o13) 		   16 y  + 32 x y  + 24 x  y  + 8 x  y + x
(%i14) factor(%);
					   4
(%o14) 				  (2 y + x)

Maxima can compute derivatives:

(%i15) diff(sin(x)*cos(x), x);
				  2	    2
(%o15) 			       cos (x) - sin (x)
(%i16) trigsimp(%);
				      2
(%o16) 				 2 cos (x) - 1
(%i17) diff(%, x);
(%o17) 			       - 4 cos(x) sin(x)
(%i18) diff( sin(x)*cos(x), x, 2);
(%o18) 			       - 4 cos(x) sin(x)

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

(%i19) trigreduce (sin(x)^5);
		       sin(5 x) - 5 sin(3 x) + 10 sin(x)
(%o19) 		       ---------------------------------
				      16

Maxima can compute indefinite integrals:

 integrate((x + 1)/(x^3 - 8), x);
					  2 x + 2
		     2		    atan(---------)
		log(x  + 2 x + 4)	 2 sqrt(3)    log(x - 2)
      	      - ----------------- + --------------- + ----------
			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:

assume(m>4);

		    [m > 4]

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
      	     --------- + ------------- + ------------- + ---------
	       m + 4	     m + 3	     m + 2	   m + 1

diff(%, x);

		3  m + 3        2  m + 2      2	   m + 1    3  m
       	       b  x      + 3 a b  x      + 3 a  b x      + a  x

factor(%);

				  m	     3
       				 x  (b x + a)


Contents