# expand() Function & Examples

Use the expand() math function in Calcul.io. Review its syntax, edit working examples, understand the result, and explore related math functions.

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](https://calcul.io/function/derivative/index.md), comparing formulas with [symbolicEqual](https://calcul.io/function/symbolicEqual/index.md), or solving a polynomial. It is the opposite direction from collecting a polynomial into factors; [simplify](https://calcul.io/function/simplify/index.md) 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](https://calcul.io/function/evaluate/index.md) after assigning values. Check parentheses and operator precedence before expanding.

[All functions](https://calcul.io/functions/index.md)
