Try it yourself:


Expand algebraic expressions

expand rewrites an algebraic expression by multiplying out products and powers. It turns a compact form such as (x + 2) * (x - 2) into x^2 - 4, which can be easier to compare, differentiate, or collect into a polynomial.

When expansion helps

Expansion exposes individual terms. This is useful before applying derivative, comparing formulas with symbolicEqual, or solving a polynomial. It is the opposite direction from collecting a polynomial into factors; simplify can choose other reductions.

Use with care

Expansion can make a readable expression much larger, particularly for high powers or products of many sums. Keep a factored form when it better shows roots or avoids numerical cancellation. Expand symbolic expressions rather than expecting it to evaluate unknown names; use evaluate after assigning values. Check parentheses and operator precedence before expanding.

Try Expand in Calcul.io

Start with one of the editable examples above, then replace its arguments with your own values. Keeping the function on a separate calculator line makes the input and result easy to compare. For a longer workflow, assign the result to a variable or reference that line in the next expression.

Check the shown signature before adding optional arguments, and use the related-function links to compare operations with similar purposes.

All functions