Previous: Error Handling Up: Helpful Hints to MAXIMA Programmers Next: Installing a New Module for MAXIMA
MAXIMA has a polynomial and rational function package which defines many useful operations on polynomials and rational functions of one or more variables. This package uses a different data representation than the general representation. This representation known as the Canonical Rational Expression is more suitable for polynomials and rational functions. The top-level function to put an expression into internal rational form is
rat(expr);
For example, the rational form of
is
((mrat simp ($x) (g00018)) (g00018 3 7 2 5 0 -19) . 1)A rational form has the following parts:
The numerator and denominator are in polynomial representation. The header is a list whose last two items are a list of variables and a corresponding list of internally generated symbols. In the above example the variable list is ($x) and the generated symbols list is (G00018). For implementational reasons, CRE forms use internally generated symbols instead of the user-supplied variables in the data structure.
As another example, the polynomial
has the following rational form.
((mrat simp ($x $y) (g00019 g00018)) (g00018 2 1 1 (g00019 1 2) 0 (g00019 2 1)) . 1)
Thus, a multivariate polynomial is represented as a polynomial in the first variable (g00018) with coefficients represented as polynomials in the other variables. This understanding of how polynomial and rational functions are represented does not mean that we should write code depending on their exact structure. On the contrary, it is advisable to use the system supplied manipulation functions described below.
___________________________________________________