REDUCE

9.1 Controlling the Expansion of Expressions

The switch EXP controls the expansion of expressions. If it is off, 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 off, 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 differently when EXP is off, since there is often only one term at the top level. For example, with EXP off

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

returns the value 1.