exp SciMax Toolbox expandwrt

SciMax Toolbox >> expand

expand

Maxima Function

Calling Sequence

expand (expr)
expand(expr,p,n)

Description

Expand expression expr. Products of sums and exponentiated sums are multiplied out, numerators of rational expressions which are sums are split into their respective terms, and multiplication (commutative and non-commutative) are distributed over addition at all levels of expr.

For polynomials one should usually use ratexpand which uses a more efficient algorithm.

maxnegex and maxposex control the maximum negative and positive exponents, respectively, which will expand.

expand (expr, p, n) expands expr, using p for maxposex and n for maxnegex. This is useful in order to expand part but not all of an expression.

expon - the exponent of the largest negative power which is automatically expanded (independent of calls to expand). For example if expon is 4 then (x+1)^(-5) will not be automatically expanded.

expop - the highest positive exponent which is automatically expanded. Thus (x+1)^3, when typed, will be automatically expanded only if expop is greater than or equal to 3. If it is desired to have (x+1)^n expanded where n is greater than expop then executing expand ((x+1)^n) will work only if maxposex is not less than n.

The expand flag used with ev causes expansion.

The file simplification/facexp.mac

contains several related functions (in particular facsum, factorfacsum and collectterms, which are autoloaded) and variables (nextlayerfactor and facsum_combine) that provide the user with the ability to structure expressions by controlled expansion.

Brief function descriptions are available in simplification/facexp.usg. A demo is available by doing demo("facexp").

exp SciMax Toolbox expandwrt