## Name:

expand expands polynomial subexpressions

## Usage:

expand(function) : function -> function

## Parameters:

• function represents a function

## Description:

• expand(function) expands all polynomial subexpressions in function function as far as possible. Factors of sums are multiplied out, power operators with constant positive integer exponents are replaced by multiplications and divisions are multiplied out, i.e. denomiators are brought at the most interior point of expressions.

## Example 1:

> print(expand(x^3));
x * x * x

## Example 2:

> print(expand((x + 2)^3 + 2 * x));
8 + 12 * x + 6 * x * x + x * x * x + 2 * x

## Example 3:

> print(expand(exp((x + (x + 3))^5)));
exp(243 + 405 * x + 270 * x * x + 90 * x * x * x + 15 * x * x * x * x + x * x * x * x * x + x * 405 + 108 * x * 5 * x + 54 * x * x * 5 * x + 12 * x * x * x * 5 * x + x * x * x * x * 5 * x + x * x * 270 + 27 * x * x * x * 10 + 9 * x * x * x * x * 10 + x * x * x * x * x * 10 + x * x * x * 90 + 6 * x * x * x * x * 10 + x * x * x * x * x * 10 + x * x * x * x * 5 * x + 15 * x * x * x * x + x * x * x * x * x)