Function Repository Resource:

SimplificationExplorer

Source Notebook

Display an interface to explore simplifications of an expression

Contributed by: Lou D'Andria

ResourceFunction["SimplificationExplorer"][expr]

displays an interface for exploring simplifications of the given expression.

Details and Options

ResourceFunction["SimplificationExplorer"][expr] attempts to transform expr via a collection of built-in one-argument functions, including Expand, Factor, Together, Apart, TrigReduce, TrigToExp, RootReduce, Simplify, and others from the Algebraic Manipulation palette and elsewhere.
Available simplifications are ordered by LeafCount.
After choosing a simplification by clicking a function name, the ResourceFunction["SimplificationExplorer"] interface shows the resulting expression, along with additional simplifications for that expression, and so on.
The Undo button will undo simplifications up to a particular point in the chain of chosen simplifications.
The Rollup button replaces the interface with an input for generating the current simplification.
Evaluating a ResourceFunction["SimplificationExplorer"] interface cell will return a list containing the starting expression and the currently chosen chain of simplifications.
The following options can be given:
DisplayFunctionIdentitya function to apply to every prospective simplification before displaying it
"RevisitExpressions"Falsewhether to show simplifications that leave the current expression unchanged
"ShowUsage"Falsewhether to show usage information for each chosen simplification
"SimplificationFunctions"Automaticthe list of functions which are tried for every step in the chain of simplifications
TimeConstraint2how many seconds to allow for each attempted simplification
The default setting of"RevisitExpressions"False will hide simplifications in each step that leave the expression unchanged in that step.
"RevisitExpressions"None will hide simplifications that have appeared anywhere in the currently chosen chain of simplifications.
"SimplificationFunctions"{f1,f2,} will only attempt to simplify expr with the given functions.
"SimplificationFunctions"{Automatic,f1,f2,} will use the fi functions in addition to functions in the default list.
By default, ResourceFunction["SimplificationExplorer"] works on held or inactivate expressions via ReleaseHold and Activate respectively.

Examples

Basic Examples (4) 

Browse available simplifications for a given expression:

In[1]:=
ResourceFunction["SimplificationExplorer"][(Cos[\[Theta]] + 1)^3]
Out[1]=

Select a particular simplification to continue the exploration:

In[2]:=
ResourceFunction["SimplificationExplorer"][(Cos[\[Theta]] + 1)^3]
Out[2]=

Explore simplifications for a logarithmic expression:

In[3]:=
ResourceFunction["SimplificationExplorer"][
 Log[z + Sqrt[z + 1] Sqrt[z - 1]]]
Out[3]=

View simplifications for a list of expressions:

In[4]:=
ResourceFunction["SimplificationExplorer"][Sin[Range[5]]]
Out[4]=

Scope (3) 

FunctionExpand is among the default simplification functions:

In[5]:=
ResourceFunction["SimplificationExplorer"][
\!\(\*SuperscriptBox[\(Zeta\), 
TagBox[
RowBox[{"(", 
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[-1, 4]]
Out[5]=

Evaluate a SimplificationExplorer interface to extract a list containing the currently chosen chain of simplifications:

In[6]:=
ResourceFunction["SimplificationExplorer"][Sin[3]]
In[7]:=
\!\(
TagBox[
DynamicModuleBox[{$CellContext`originalexpr$$ = Hold[
Sin[3]], $CellContext`chosenexprs$$ = {
Hold[(1 + 2 Cos[2]) Sin[1]], 
Hold[3 Cos[1]^2 Sin[1] - Sin[
       1]^3]}, $CellContext`chosenfuncs$$ = {TrigFactor, TrigExpand}, $CellContext`simplificationFunctions$$ = {Expand, ExpandNumerator, ExpandDenominator, ExpandAll, Factor, Together, Apart, Cancel, PiecewiseExpand, TrigExpand, TrigFactor, TrigReduce, ExpToTrig, TrigToExp, PowerExpand, ComplexExpand, FunctionExpand, RootReduce, Simplify, FullSimplify, Activate, ReleaseHold}, $CellContext`timeConstraint$$ = 2, $CellContext`displayFunction$$ = Identity, $CellContext`revisit$$ = False, $CellContext`showUsage$$ = False}, 
InterpretationBox[
DynamicBox[ToBoxes[
If[DownValues[$CellContext`simplificationDisplay] === {}, 
Framed["This interface requires a WFR that's not yet loaded.", BaseStyle -> "ControlStyle", FrameMargins -> 10, FrameStyle -> LightGray], 
$CellContext`simplificationDisplay[
        1, $CellContext`originalexpr$$, $CellContext`chosenexprs$$, $CellContext`chosenfuncs$$, $CellContext`simplificationFunctions$$, $CellContext`timeConstraint$$, $CellContext`displayFunction$$, $CellContext`revisit$$, $CellContext`showUsage$$]], StandardForm],
BaseStyle->{LightDarkAutoColorRules -> <|"AllColors" -> True|>},
ImageSizeCache->{294.74609375, {14.048828125, 18.701171875}},
SynchronousUpdating->False],
Prepend[
Replace[
Transpose[{$CellContext`chosenfuncs$$, $CellContext`chosenexprs$$}], {
Pattern[$CellContext`f, 
Blank[]], 
Hold[
Pattern[$CellContext`e, 
Blank[]]]} :> ($CellContext`f :> $CellContext`e), {1}], 
Replace[$CellContext`originalexpr$$, Hold[
Pattern[$CellContext`e, 
Blank[]]] :> ("StartingExpression" :> $CellContext`e)]]],
DynamicModuleValues:>{}],
Setting[#, {0}]& ]\)
Out[7]=

SimplificationExplorer will indicate when none of the simplification functions have found new expressions:

In[8]:=
ResourceFunction["SimplificationExplorer"][2 + 2]
Out[8]=

Options (10) 

DisplayFunction (2) 

Shorten the display of the suggested simplifications:

In[9]:=
ResourceFunction["SimplificationExplorer"][Hold[\!\(
\*SubscriptBox[\(\[PartialD]\), \(x\)]\((\[Integral]
\*SuperscriptBox[\(x\), \(a\)]\ 
\*SuperscriptBox[\(b\), \(x\)]\ Log[x] \[DifferentialD]x)\)\)], DisplayFunction -> (Short[#, 3] &)]
Out[9]=

Style the simplifications:

In[10]:=
ResourceFunction["SimplificationExplorer"][Hold[\!\(
\*SubscriptBox[\(\[PartialD]\), \(x\)]\((\[Integral]
\*SuperscriptBox[\(x\), \(a\)]\ 
\*SuperscriptBox[\(b\), \(x\)]\ Log[x] \[DifferentialD]x)\)\)], DisplayFunction -> (Style[#, Magnification -> 0.75] &)]
Out[10]=

RevisitExpressions (3) 

By default, SimplificationExplorer hides any simplifications that leave an expression unchanged in that step:

In[11]:=
ResourceFunction["SimplificationExplorer"][Cos[x]]
Out[11]=

"RevisitExpressions"True shows all simplifications, even those that revisit previous expressions:

In[12]:=
ResourceFunction["SimplificationExplorer"][Cos[x], "RevisitExpressions" -> True]
Out[12]=

"RevisitExpressions"None will hide any simplification that revisits any expression in the current chain of simplifications, which prevents looping back to previous simplifications, or to the original expression:

In[13]:=
ResourceFunction["SimplificationExplorer"][Cos[x], "RevisitExpressions" -> None]
Out[13]=

ShowUsage (1) 

Show usage information for each chosen simplification:

In[14]:=
ResourceFunction["SimplificationExplorer"][Cos[x], "ShowUsage" -> True]
Out[14]=

SimplificationFunctions (2) 

Add a resource function to the default set of simplification functions:

In[15]:=
ResourceFunction[
 "SimplificationExplorer"][(1/1296) (
  19 (-8 + 3 Sqrt[3]) Log[3] + 8 Log[7 - 4 Sqrt[3]] + 360 Sqrt[3] Log[
    4 - 2 Sqrt[3]] + 12 Log[2 - Sqrt[3]] - 780 Sqrt[3]
    Log[-1 + Sqrt[3]] + 308 Log[
    2 + Sqrt[3]] + 304 Log[-3 + 2 Sqrt[3]] + 6 Sqrt[3] (
    8 + 5 Log[-6 + 4 Sqrt[3]])), "SimplificationFunctions" -> {Automatic, ResourceFunction["LogSimplify"]}, "ShowUsage" -> True]
Out[15]=

Restrict the simplifications to a given set of functions:

In[16]:=
ResourceFunction["SimplificationExplorer"][Cos[x], "SimplificationFunctions" -> {TrigToExp, ExpToTrig, Simplify, FullSimplify}]
Out[16]=

TimeConstraint (2) 

Each simplification is only allowed a couple seconds by default:

In[17]:=
ResourceFunction["SimplificationExplorer"][(Cos[x] + 1)^2, "SimplificationFunctions" -> {Expand, (Pause[5]; TrigExpand[#]) &}]
Out[17]=

Use the TimeConstraint option to allow simplifications more time:

In[18]:=
ResourceFunction["SimplificationExplorer"][(Cos[x] + 1)^2, "SimplificationFunctions" -> {Expand, (Pause[5]; TrigReduce[#]) &}, TimeConstraint -> 6]
Out[18]=

Properties and Relations (3) 

Use TraditionalForm to see traditional mathematical notation for the simplifications:

In[19]:=
ResourceFunction[
  "SimplificationExplorer"][(Cos[\[Theta]] + 1)^3] // TraditionalForm
Out[19]=

ReleaseHold is among the default simplification functions:

In[20]:=
ResourceFunction["SimplificationExplorer"][Hold[Cos[x]]]
Out[20]=

Activate is among the default simplification functions:

In[21]:=
ResourceFunction["SimplificationExplorer"][
 Inactivate[\[Integral]1/(1 - x^5) \[DifferentialD]x]]
Out[21]=

Possible Issues (2) 

PowerExpand and ComplexExpand make assumptions that may not be true in general:

In[22]:=
ResourceFunction["SimplificationExplorer"][Sqrt[x^3] + Gamma[z]]
Out[22]=

Many simplifications will result in expressions with a larger LeafCount or ByteCount than the original expression:

In[23]:=
ResourceFunction["SimplificationExplorer"][Cos[x]]
Out[23]=

Neat Examples (1) 

View an explorer in a dedicated window:

In[24]:=
CreateDocument[
 ResourceFunction["SimplificationExplorer"][(Cos[\[Theta]] + 1)^3, "ShowUsage" -> True] // TraditionalForm, Magnification -> 1.25, Deployed -> True]
Out[24]=

Requirements

Wolfram Language 13.0 (December 2021) or above

Version History

  • 1.0.0 – 19 September 2025

Related Resources

License Information