Transforming Algebraic Expressions

There are often many different ways to write the same algebraic expression. As one example, the expression (((1+x))^2) can be written as 1+2x+(x^2). The Wolfram System provides a large collection of functions for converting between different forms of algebraic expressions.

Two common functions for transforming algebraic expressions.

(RefLink[Expand, paclet:ref/Expand]) gives the "expanded form", with products and powers multiplied out:

Expand[(1+x)^2]

(RefLink[Factor, paclet:ref/Factor]) recovers the original form:

Factor[%]

It is easy to generate complicated expressions with (RefLink[Expand, paclet:ref/Expand]):

Expand[(1+x+3 y)^4]

(RefLink[Factor, paclet:ref/Factor]) often gives you simpler expressions:

Factor[%]

There are some cases, though, where (RefLink[Factor, paclet:ref/Factor]) can give you more complicated expressions:

Factor[x^10-1]

In this case, (RefLink[Expand, paclet:ref/Expand]) gives the "simpler" form:

Expand[%]