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
- 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.
- 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:
- 18 – (-5);
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:
- %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.
Maxima has also mathematical constants stored in the program. So computations like pi*r*2 is possible.
inf and minf for
In Maxima Tutorial 2, we will discuss how to use Maxima to help us perform symbolic manipulations.