Function reference · Math

expand

Expands an expression algebraically.

expand distributes products over sums, expands supported integer powers, and recursively expands algebraic structure. It is useful when a multiplied or powered form needs to be rewritten as an explicit sum of terms.

Expansion does not mean numerical evaluation; symbols and supported functions remain symbolic.

Examples

These examples use Nerdamer Notation.

Expand a binomial power exactly.

expand((x+1)^3)
// → 1+3*x+3*x^2+x^3

Distribute a symbolic product and collect the result.

expand((x+y)*(x-y))
// → x^2-y^2

Interfaces

The same operation is available through the interfaces below.

Nerdamer Notation · nerdamer API

Nerdamer Notation

Use this form inside input passed to nerdamer(...).

expand(arg1)

nerdamer.expand

Call the operation through the default nerdamer import.

nerdamer.expand(x: Expression): Expression

Parameters

NameTypeDescription
xExpression—

Returns

Expression

Browse the nerdamer API →

← Back to Function reference