In this tutorial, we shall discuss how to use the free Computer Algebra System (CAS) maxima from TeXmacs. It should be valid for TeXmacs-1.0.5 and maxima-5.9.2.
Now we shall start one of the versions of maxima installed:
If you click the icon looking like “?” on the toolbar, TeXmacs will show the maxima manual:
It is convenient to clone the window:
In the other window, you can read the manual. Blue texts are hyperlink; clicking them displays the corresponding sections of the manual.
Everything is ready for doing calculations. Usual methematical notations can be used for input expressions to a large extent. Don't forget to use * for multiplication; it is not visible, just produces a little space. Powers are produced using the toolbar or ^; fractions – by the toolbar or A-f; square roots – by the toolbar or A-s; large (automatically resizable) brackets – by A-( (note that with our settings this produces both the opening bracket and the closing one, and the cursor is left between them). You can use greek letters. For example, α can be produced via the toolbar, by H-a (see help for the meaning of the modifier hyper), or by a tab. Γ means the Γ-function; π means ... what would you think? ... π; γ means the Euler constant; ζ means the Riemann ζ-function.
The integral sign is produced via the toolbar or by S-F5 I. If it has limits, it means a definite integral, otherwise indefinite. Then you write your integrand, then a space, the differential sign (produced by d tab tab), a space, and your integration variable. The form of the result often depends on parameters; in such cases, maxima asks questions. If you don't want such interactive queries, you can provide the relevant information beforehand.
You can select some (part of) an output field with the mouse:
Then click on an input line, and click with the middle mouse button. The selected expression is inserted. You can edit it and execute.
It is also possible to go to an earlier input line, edit it and press enter. The old output below this line will be replaced by the new one. This is very useful during the first stage of your work, when you investigate various possible approaches. Using this method too often leads to a spaghetti-like set of input and output lines, which is difficult to understand; it is even difficult to reproduce your calculation later.
Here are some definite integrals. The base of natural logarithms ⅇ is produced via the toolbar or by e tab tab, and the infinity symbol – via the toolbar or by @ @.
Sums are similar to integrals. In addition to sums with a lower limit and an upper one, maxima understands sums with a lower limit like n∈[a,b,c], where the symbol ∈ is produced by \ i n enter. Products are also similar. Binomial coefficients are produced by \ b i n o m enter. They look like matrices, but differ from them! Therefore, don't try to create them via the toolbar menu for matrices and other kinds of tables.
Note a subtle point: the integral sign (or the sum or product sign) is
considered as a kind of an “opening bracket”, and there is
the corresponding “closing bracket”, which is invisible,
but it shows where your integral ends. You can see it in the
Maxima understands matrices and determinants. They are produced via the toolbar. New columns and rows are inserted by A-right, A-left, A-down, A-up. The imaginary unit ⅈ is produced via the toolbar or by i tab tab.
Naturally, this explanation text can be as long as you need, and it can contain mathematical formulae.
And here is a determinant.
Maxima can solve equations and systems of equations. It returns the list of solutions.
Here we define and plot the function f ( x , y ) =
The plot appears in a separate gnuplot window:
Here we define a recursive function and trace its execution.
A sub-session appears; you can edit its title:
You can work within this sub-session; it has its own current input line.
If you dowble-click on the left bar of the sub-session, it gets folded:
Now only its title is visible. This is convenient for long sub-calculations of your project: you can fold them all, and see only the skeleton of your calculation. Sub-sessions can be nested. You can unfold them by double-clicking once more.
Finally, we quit maxima:
All output lines disappear.
It suffices to press enter on an input line, and maxima will be re-started. The results will be produced in the presence of your audience, just by pressing enter many times.
Of course, you can save your work as a .tm file. Next time you start TeXmacs to edit this file, just press enter at the first input line to re-start maxima.