Simplifying Algebraic Expressions

There are many situations where you want to write a particular algebraic expression in the simplest possible form. Although it is difficult to know exactly what one means in all cases by the "simplest form", a worthwhile practical procedure is to look at many different forms of an expression, and pick out the one that involves the smallest number of parts.

Simplifying algebraic expressions.

(RefLink[Simplify, paclet:ref/Simplify]) writes (x^2)+2x+1 in factored form:

Simplify[x^2+2x+1]

(RefLink[Simplify, paclet:ref/Simplify]) leaves (x^10)-1 in expanded form, since for this expression, the factored form is larger:

Simplify[x^10-1]

You can often use (RefLink[Simplify, paclet:ref/Simplify]) to "clean up" complicated expressions that you get as the results of computations.

Here is the integral of 1/((x^4)-1). Integrals are discussed in more detail in "Integration":

Integrate[1/(x^4-1),x]

Differentiating the result from (RefLink[Integrate, paclet:ref/Integrate]) should give back your original expression. In this case, as is common, you get a more complicated version of the expression:

D[%,x]

(RefLink[Simplify, paclet:ref/Simplify]) succeeds in getting back the original, simpler, form of the expression:

Simplify[%]

(RefLink[Simplify, paclet:ref/Simplify]) is set up to try various standard algebraic transformations on the expressions you give. Sometimes, however, it can take more sophisticated transformations to make progress in finding the simplest form of an expression.

(RefLink[FullSimplify, paclet:ref/FullSimplify]) tries a much wider range of transformations, involving not only algebraic functions, but also many other kinds of functions.

(RefLink[Simplify, paclet:ref/Simplify]) does nothing to this expression:

Simplify[Gamma[x] Gamma[1-x]]

(RefLink[FullSimplify, paclet:ref/FullSimplify]), however, transforms it to a simpler form:

FullSimplify[Gamma[x] Gamma[1-x]]

For fairly small expressions, (RefLink[FullSimplify, paclet:ref/FullSimplify]) will often succeed in making some remarkable simplifications. But for larger expressions, it can become unmanageably slow.

The reason for this is that to do its job, (RefLink[FullSimplify, paclet:ref/FullSimplify]) effectively has to try combining every part of an expression with every other, and for large expressions the number of cases that it has to consider can be astronomically large.

(RefLink[Simplify, paclet:ref/Simplify]) also has a difficult task to do, but it is set up to avoid some of the most time-consuming transformations that are tried by (RefLink[FullSimplify, paclet:ref/FullSimplify]). For simple algebraic calculations, therefore, you may often find it convenient to apply (RefLink[Simplify, paclet:ref/Simplify]) quite routinely to your results.

In more complicated calculations, however, even (RefLink[Simplify, paclet:ref/Simplify]), let alone (RefLink[FullSimplify, paclet:ref/FullSimplify]), may end up needing to try a very large number of different forms, and therefore taking a long time. In such cases, you typically need to do more controlled simplification, and use your knowledge of the form you want to get to guide the process.

Some transformations used by (RefLink[Simplify, paclet:ref/Simplify]) and (RefLink[FullSimplify, paclet:ref/FullSimplify]), for instance reduction with respect to equational assumptions, need to pick an order of variables. Therefore, results of simplification may depend on the names of symbols.

Reduction with respect to the equational assumption using the variable order (a,b) leads to a simplification:

FullSimplify[(1-a^2)/b^2,a^2+b^2==1]

With the variable order (b,c), the expression is not simplified:

FullSimplify[(1-c^2)/b^2,c^2+b^2==1]