Controlling the Expansion of Expressions
Date: 2020-10-07 18:10:00

Up | Next | Tail

### 9.1 Controlling the Expansion of Expressions

The switch EXP controls the expansion of expressions. If it is oﬀ, no expansion of powers or products of expressions occurs. Users should note however that in this case results come out in a normal but not necessarily canonical form. This means that zero expressions simplify to zero, but that two equivalent expressions need not necessarily simplify to the same form.

Example: With EXP on, the two expressions

(a+b)*(a+2*b)

and

a^2+3*a*b+2*b^2

will both simplify to the latter form. With EXP oﬀ, they would remain unchanged, unless the complete factoring (ALLFAC) option were in force. EXP is normally on.

Several operators that expect a polynomial as an argument behave diﬀerently when EXP is oﬀ, since there is often only one term at the top level. For example, with EXP oﬀ

length((a+b+c)^3/(c+d));

returns the value 1.

Up | Next | Front