# Maxima Tutorial 1: Numerical Computation

Maxima is free a computer algebra system capable of a variety of computations. It can manipulate symbolic and numerical expressions, as well as  perform differentiation and integration.  It can also manipulate Taylor series, Laplace transforms, ordinary differential equations, systems of linear equations, polynomials, and sets, lists, vectors, matrices, and tensors. Maxima can perform high-precision computations as well as plot two and three-dimensional graphs.  In this tutorial, we are going to learn how to use Maxima to perform basic numerical computations.

Figure 1 - The Maxima Command LIne

To perform simple numeric computations, we need to open the Command line Maxima as shown in Figure 1. The Command line Maxima is similar to the DOS-prompt as shown below.  We just have to type the expression, the press the ENTER key.

Figure 2 - The Maxima Command Line Window

1. To add 12 and 15, type the following 12 + 15; and press the ENTER key on your keyboard. Note that each computation, command or expression ends in a semi-colon. The (%i1) text means first user input and the (%o1) means first output. After pressing the ENTER key, your first output should be 27.
2. Maxima is capable of computing a wide variety of operations.  It can compute very large or small numbers as well as perform many functions. Type the following and press ENTER after each expression:
1. 18 – (-5);
2. -15*34;
3. 18/2;
4. 12^39;
5. sqrt(3);

After typing sqrt(3) and pressing the ENTER key, your screen would look like the one shown below. Notice that what when we typed sqrt(3), the output is also sqrt(3). That is because, Maxima also accepts expressions like fractions and radicals without simplifying them. To simplify an expression into a decimal number, we need the float command. The float command converts fractions, radical expressions and other expressions to decimal numbers.

Figure 3 - Maxima accepts fractions and irrational numbers without convering them to decimal numbers.

Therefore, we need to “float” sqrt(3); to do this type float(sqrt(3)); and press the ENTER key. Then type the following:

1. float(log(5));
2. float(15^20);
3. %o6 +  %o7;

Figure 4 - Maxima can handle very large numbers as shown above.

Note that the output of float(15^20) is in different form that that of 12^39. The output in of in (%o8) means

3.3252567300596506 x 1023

We can also perform operations of previous inputs and outputs by typing their corresponding prompts.  The command %o6 +  %o7; added the value in output 6 and output 7.

Mathematical Constants

Maxima has also mathematical constants stored in the program. So computations like pi*r*2 is possible.

%e $\approx 2.71828$

%pi  $\approx 3.14159$

%phi  $= \frac{1+\sqrt 5}{2}$

%i   $= \sqrt {-1}$

inf  $\infty$ and minf  for  $- \infty$

In Maxima Tutorial 2, we will discuss how to use Maxima to help us perform symbolic manipulations.