({{, (RefLink[Simplify, paclet:ref/Simplify])[expr]
performs a sequence of algebraic and other transformations on expr and returns the simplest form it finds. }, {, (RefLink[Simplify, paclet:ref/Simplify])[expr,assum]
does simplification using assumptions. }})

OpenersNotesSection(Spacer1)Details and Options

(RefLink[Simplify, paclet:ref/Simplify]) tries expanding, factoring, and doing many other transformations on expressions, keeping track of the simplest form obtained.

(RefLink[Simplify, paclet:ref/Simplify]) can be used on equations, inequalities, and domain specifications.

Quantities that appear algebraically in inequalities are always assumed to be real.

(RefLink[FullSimplify, paclet:ref/FullSimplify]) does more extensive simplification than (RefLink[Simplify, paclet:ref/Simplify]).

You can specify default assumptions for (RefLink[Simplify, paclet:ref/Simplify]) using (RefLink[Assuming, paclet:ref/Assuming]).

The following options can be given:

Assumptions can consist of equations, inequalities, domain specifications such as x∈(RefLink[Integers, paclet:ref/Integers]), and logical combinations of these.

With the setting (RefLink[TimeConstraint, paclet:ref/TimeConstraint])->{(Subscript[t, loc]),(Subscript[t, tot])}, at most (Subscript[t, loc]) seconds are spent for any particular transformation, and at most (Subscript[t, tot]) seconds are spent for all transformations before the best result is returned.

OpenersPrimaryExamplesSection(Spacer1)Examples  (25)

OpenersExampleSection0(Spacer1)Basic Examples  (3)

D[Integrate[1/(x^3+1),x],x]

Simplify[%]

Simplify[Sin[x]^2+Cos[x]^2]

(RefLink[Simplify, paclet:ref/Simplify]) can get further if assumptions are made about x:

Simplify[Sqrt[x^2]]

Simplify[Sqrt[x^2],x>0]

Simplify[Sqrt[x^2], Element[x, Reals]]

OpenersExampleSection1(Spacer1)Scope  (4)

Simplify a polynomial:

Simplify[(x-1)(x+1)(x^2+1)+1]

Simplify a rational expression:

Simplify[3/(x+3)+x/(x+3)]

Simplify a trigonometric expression:

Simplify[2Tan[x]/(1+Tan[x]^2)]

Simplify an exponential expression:

Simplify[(E^x-E^-x)/Sinh[x]]

Simplify an equation:

Simplify[2x-4y+6z-10==-8]

Simplify expressions using assumptions:

Simplify[1/Sqrt[x] - Sqrt[1/x], x > 0]

Simplify[Log[x^p],x>0&&Element[p,Reals]]

Simplify[Sin[n Pi], Element[n,Integers]]

Use assumptions to prove inequalities:

Simplify[x^2>3,x>2]

Simplify[Abs[x]<2,x^2+y^2<4]

OpenersExampleSection2(Spacer1)Options  (10)

OpenersExampleSubsection0(Spacer1)Assumptions  (3)

Assumptions can be given both as an argument and as an option value:

Simplify[Cos[k Pi]^m,Element[k,Integers],Assumptions->Mod[m,2]==0]

The default value of the (RefLink[Assumptions, paclet:ref/Assumptions]) option is (RefLink[$Assumptions, paclet:ref/$Assumptions]):

Assuming[x>0,Simplify[Sqrt[x^2]]]

Simplify[Sqrt[x^2]]

When assumptions are given as an argument, (RefLink[$Assumptions, paclet:ref/$Assumptions]) is used as well:

Assuming[x>0,Simplify[Sqrt[x^2 y^2],y<0]]

Specifying assumptions as an option value prevents (RefLink[Simplify, paclet:ref/Simplify]) from using (RefLink[$Assumptions, paclet:ref/$Assumptions]):

Assuming[x>0,Simplify[Sqrt[x^2 y^2],Assumptions->y<0]]

OpenersExampleSubsection1(Spacer1)ComplexityFunction  (2)

The default (RefLink[ComplexityFunction, paclet:ref/ComplexityFunction]) counts the subexpressions and digits of integers:

Simplify[100 Log[2]]

(RefLink[LeafCount, paclet:ref/LeafCount]) counts only the number of subexpressions:

Simplify[100 Log[2],ComplexityFunction->LeafCount]

With the default (RefLink[ComplexityFunction, paclet:ref/ComplexityFunction]), (RefLink[Abs, paclet:ref/Abs])[x] is simpler than the (RefLink[FullForm, paclet:ref/FullForm]) of -x:

Simplify[Abs[x],x<0]

Map[FullForm,{Abs[x],-x}]

This complexity function makes (RefLink[Abs, paclet:ref/Abs]) more expensive than (RefLink[Times, paclet:ref/Times]):

f[e_]:=100Count[e,_Abs,{0,Infinity}]+LeafCount[e]

Simplify[Abs[x],x<0,ComplexityFunction->f]

OpenersExampleSubsection2(Spacer1)ExcludedForms  (1)

This gives no simplification:

Simplify[(x-1)(x+1)(x^2+1)(x-2)^10]

Excluding transformations of (x-2)^10 allows (RefLink[Simplify, paclet:ref/Simplify]) to expand the remaining terms:

Simplify[(x-1)(x+1)(x^2+1)(x-2)^10,ExcludedForms->{(_Plus)^_}]

OpenersExampleSubsection3(Spacer1)TimeConstraint  (2)

This takes a long time, due to trigonometric expansion, but does not yield a simplification:

Simplify[2Sin[10x+11y+12z]Cos[10x+10y+10t]]//Timing

Use (RefLink[TimeConstraint, paclet:ref/TimeConstraint]) to limit the time spent on any single transformation:

Simplify[2Sin[10x+11y+12z]Cos[10x+10y+10t],TimeConstraint->1]//Timing

A similar example, where the transformation yields a simplification:

Simplify[2Sin[10x+11y+12z]Cos[10x+10y+10z]]//Timing

In this case, setting (RefLink[TimeConstraint, paclet:ref/TimeConstraint]) prevents some simplification:

Simplify[2Sin[10x+11y+12z]Cos[10x+10y+10z],TimeConstraint->1]//Timing

OpenersExampleSubsection4(Spacer1)TransformationFunctions  (1)

Here (RefLink[Simplify, paclet:ref/Simplify]) uses t as the only transformation:

t[e_]:=PolynomialReduce[e,{s^2+c^2-1},{c,s}][[2]]

Simplify[(c^3-s^3)^2-(s^3+c^3)^2,TransformationFunctions->{t}]

Here (RefLink[Simplify, paclet:ref/Simplify]) uses both t and all built-in transformations:

Simplify[(c^3-s^3)^2-(s^3+c^3)^2,TransformationFunctions->{Automatic,t}]

OpenersExampleSubsection5(Spacer1)Trig  (1)

By default, (RefLink[Simplify, paclet:ref/Simplify]) uses trigonometric identities:

Simplify[4Sin[x]^2Cos[x]^2+4Sin[x]Cos[x]+1]

With (RefLink[Trig, paclet:ref/Trig])->(RefLink[False, paclet:ref/False]), (RefLink[Simplify, paclet:ref/Simplify]) does not use trigonometric identities:

Simplify[4Sin[x]^2Cos[x]^2+4Sin[x]Cos[x]+1,Trig->False]

OpenersExampleSection3(Spacer1)Applications  (4)

Prove that a solution satisfies its equations:

Solve[x^2+x+1==0,x]

x^2+x+1==0/.%//Simplify

DSolve[y''[x]+y[x]==Exp[x],y,x]

y''[x]+y[x]==Exp[x]/.First[%]//Simplify

RSolve[y[k+2]+y[k]==2^k,y,k]

y[k+2]+y[k]==2^k/.First[%]//Simplify

Show that the arithmetic mean is larger than the geometric one:

Simplify[(x + y)/2 >= Sqrt[x y], x >= 0 && y >= 0]

This applies Fermat's little theorem:

Simplify[Mod[a^p,p],a∈Integers&&p∈Primes]

Prove commutativity from Wolfram's minimal axiom for Boolean algebra:

Simplify[f[a,b]==f[b,a],ForAll[{p,q,r},f[f[f[p,q],r],f[p,f[f[p,r],p]]]==r]]

OpenersExampleSection4(Spacer1)Properties & Relations  (2)

Use (RefLink[Assuming, paclet:ref/Assuming]) to propagate assumptions:

Assuming[x > 0, Simplify[Sqrt[x^2]]]

Use (RefLink[FullSimplify, paclet:ref/FullSimplify]) to simplify expressions involving special functions:

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

FullSimplify[%]

OpenersExampleSection5(Spacer1)Possible Issues  (2)

The Wolfram Language evaluates zero times a symbolic expression to zero:

0 symbolic

This happens even if the symbolic expression is always infinite:

hiddenzero=x^2+2x+1-(x+1)^2;

0/hiddenzero

Because of this, results of simplification of expressions with singularities are uncertain:

anotherhiddenzero=Sin[x]^2+Cos[x]^2-1;

betterhiddenzero=Gamma[x+1]-x Gamma[x];

Map[Simplify,{hiddenzero/anotherhiddenzero,anotherhiddenzero/hiddenzero,hiddenzero/betterhiddenzero,betterhiddenzero/hiddenzero}]

In this case, (RefLink[FullSimplify, paclet:ref/FullSimplify]) recognizes the zero:

FullSimplify[betterhiddenzero]

Results of simplification may depend on the names of symbols:

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

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

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[FullSimplify, paclet:ref/FullSimplify])  ▪  (RefLink[Refine, paclet:ref/Refine])  ▪  (RefLink[Factor, paclet:ref/Factor])  ▪  (RefLink[Expand, paclet:ref/Expand])  ▪  (RefLink[TrigExpand, paclet:ref/TrigExpand])  ▪  (RefLink[PowerExpand, paclet:ref/PowerExpand])  ▪  (RefLink[ComplexExpand, paclet:ref/ComplexExpand])  ▪  (RefLink[PiecewiseExpand, paclet:ref/PiecewiseExpand])  ▪  (RefLink[Element, paclet:ref/Element])  ▪  (RefLink[FunctionExpand, paclet:ref/FunctionExpand])  ▪  (RefLink[Reduce, paclet:ref/Reduce])  ▪  (RefLink[Assuming, paclet:ref/Assuming])  ▪  (RefLink[TrigReduce, paclet:ref/TrigReduce])  ▪  (RefLink[TrigFactor, paclet:ref/TrigFactor])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Simplifying Algebraic Expressions, paclet:tutorial/SimplifyingAlgebraicExpressions])}, {▪(RefLinkPlain[Simplifying with Assumptions, paclet:tutorial/SimplifyingWithAssumptions])}, {▪(RefLinkPlain[Simplification, paclet:tutorial/Simplification])}, {▪(RefLinkPlain[Putting Expressions into Different Forms, paclet:tutorial/PuttingExpressionsIntoDifferentForms])}, {▪(RefLinkPlain[Using Assumptions, paclet:tutorial/UsingAssumptions])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Formula Manipulation, paclet:guide/FormulaManipulation])}, {▪(RefLinkPlain[Manipulating Equations, paclet:guide/ManipulatingEquations])}, {▪(RefLinkPlain[Algebraic Transformations, paclet:guide/AlgebraicTransformations])}, {▪(RefLinkPlain[Assumptions and Domains, paclet:guide/AssumptionsAndDomains])}})}})

({{(Spacer1), ({{(Spacer1)Related Links}, {(Spacer1)▪(RefLinkPlain[(Spacer1)Implementation notes: Algebra and Calculus, paclet:tutorial/SomeNotesOnInternalImplementation#20945])}, {(WebLink[DocumentationFooterIconsRelatedLinks-NKS.png(Spacer1)NKS|Online, http://www.wolframscience.com/nksonline/index/search.cgi?SearchIndex=Simplify]) ((WebLink[A New Kind of Science, http://www.wolframscience.com/nksonline/]))}})}})