Simplification

Simplify[expr]try various algebraic and trigonometric transformations to simplify an expression
FullSimplify[expr]try a much wider range of transformations

Simplifying expressions.

Mathematica does not automatically simplify an algebraic expression like this.
In[1]:=
Click for copyable input
Out[1]=
Simplify performs the simplification.
In[2]:=
Click for copyable input
Out[2]=
Simplify performs standard algebraic and trigonometric simplifications.
In[3]:=
Click for copyable input
Out[3]=
It does not, however, do more sophisticated transformations that involve, for example, special functions.
In[4]:=
Click for copyable input
Out[4]=
FullSimplify does perform such transformations.
In[5]:=
Click for copyable input
Out[5]=
FullSimplify[expr,ExcludedForms->pattern]
try to simplify expr, without touching subexpressions that match pattern

Controlling simplification.

Here is an expression involving trigonometric functions and square roots.
In[6]:=
Click for copyable input
Out[6]=
By default, FullSimplify will try to simplify everything.
In[7]:=
Click for copyable input
Out[7]=
This makes FullSimplify avoid simplifying the square roots.
In[8]:=
Click for copyable input
Out[8]=
FullSimplify[expr,TimeConstraint->t]
try to simplify expr, working for at most t seconds on each transformation
FullSimplify[expr,TransformationFunctions->{f1,f2,...}]
use only the functions in trying to transform parts of expr
FullSimplify[expr,TransformationFunctions->{Automatic,f1,f2,...}]
use built-in transformations as well as the
Simplify[expr,ComplexityFunction->c] and FullSimplify[expr,ComplexityFunction->c]
simplify using c to determine what form is considered simplest

Further control of simplification.

In both Simplify and FullSimplify there is always an issue of what counts as the "simplest" form of an expression. You can use the option ComplexityFunction->c to provide a function to determine this. The function will be applied to each candidate form of the expression, and the one that gives the smallest numerical value will be considered simplest.

With its default definition of simplicity, Simplify leaves this unchanged.
In[9]:=
Click for copyable input
Out[9]=
This now tries to minimize the number of elements in the expression.
In[10]:=
Click for copyable input
Out[10]=
New to Mathematica? Find your learning path »
Have a question? Ask support »