1.4.4 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.
Simplify writes in factored form.
In:= Simplify[x^2 + 2x + 1]
Simplify leaves in expanded form, since for this expression, the factored form is larger.
In:= Simplify[x^10 - 1]
You can often use Simplify to "clean up" complicated expressions that you get as the results of computations.
Here is the integral of . Integrals are discussed in more detail in Section 1.5.3.
In:= Integrate[1/(x^4-1), x]
Differentiating the result from Integrate should give back your original expression. In this case, as is common, you get a more complicated version of the expression.
In:= D[%, x]
Simplify succeeds in getting back the original, more simple, form of the expression.
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.
FullSimplify tries a much wider range of transformations, involving not only algebraic functions, but also many other kinds of functions.
Simplify does nothing to this expression.
In:= Simplify[Gamma[x] Gamma[1 - x]]
FullSimplify, however, transforms it to a simpler form.
In:= FullSimplify[Gamma[x] Gamma[1 - x]]
For fairly small expressions, 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, 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.
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 FullSimplify. For simple algebraic calculations, therefore, you may often find it convenient to apply Simplify quite routinely to your results.
In more complicated calculations, however, even Simplify, let alone 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.