Polynomials are stored in Maxima either in General Form or as Canonical
Rational Expressions (CRE) form. The latter is a standard form, and is
used internally by operations such as factor
, ratsimp
, and
so on.
Canonical Rational Expressions constitute a kind of representation
which is especially suitable for expanded polynomials and rational
functions (as well as for partially factored polynomials and rational
functions when ratfac
is set to true
). In this CRE form an
ordering of variables (from most to least main) is assumed for each
expression.
Polynomials are represented recursively by a list consisting of the main
variable followed by a series of pairs of expressions, one for each term
of the polynomial. The first member of each pair is the exponent of the
main variable in that term and the second member is the coefficient of
that term which could be a number or a polynomial in another variable
again represented in this form. Thus the principal part of the CRE form
of 3*x^2-1
is (X 2 3 0 -1)
and that of 2*x*y+x-3
is (Y 1 (X 1 2) 0 (X 1 1 0 -3))
assuming y
is the main
variable, and is (X 1 (Y 1 2 0 1) 0 -3)
assuming x
is the
main variable. "Main"-ness is usually determined by reverse alphabetical
order.
The "variables" of a CRE expression needn’t be atomic. In fact any
subexpression whose main operator is not +
, -
, *
,
/
or ^
with integer power will be considered a "variable"
of the expression (in CRE form) in which it occurs. For example the CRE
variables of the expression x+sin(x+1)+2*sqrt(x)+1
are x
,
sqrt(X)
, and sin(x+1)
. If the user does not specify an
ordering of variables by using the ratvars
function Maxima will
choose an alphabetic one.
In general, CRE’s represent rational expressions, that is, ratios of
polynomials, where the numerator and denominator have no common factors,
and the denominator is positive. The internal form is essentially a pair
of polynomials (the numerator and denominator) preceded by the variable
ordering list. If an expression to be displayed is in CRE form or if it
contains any subexpressions in CRE form, the symbol /R/
will follow the
line label.
See the rat
function for converting an expression to CRE form.
An extended CRE form is used for the representation of Taylor
series. The notion of a rational expression is extended so that the
exponents of the variables can be positive or negative rational numbers
rather than just positive integers and the coefficients can themselves
be rational expressions as described above rather than just polynomials.
These are represented internally by a recursive polynomial form which is
similar to and is a generalization of CRE form, but carries additional
information such as the degree of truncation. As with CRE form, the
symbol /T/
follows the line label of such expressions.