Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any way to track how Mathematica actually performs Simplify, so that we can see what those "Automatic" transformation functions it applies are and how it works with assumptions?

For example,

Simplify[Sin[x]^2 + Cos[x]^2, ComplexityFunction -> ((Print[#]; LeafCount[#]) &)]

will output


Is there a way to see what Mathematica does between these steps?

share|improve this question
@Nasser: Is there a way to filter it? I tried TableForm[ Trace[Simplify[Sqrt[x^2], x \[Element] Integers], TraceInternal -> True]], and it output far too much output to read ... – Noon Silk Feb 23 '13 at 4:58
@NoonSilk. Trace takes a second argument that allows filtering. See this [documentation[( entry – m_goldberg Feb 23 '13 at 5:07
Sorry, I should've worded my point better - even filtering won't help the problem I observed with the example I posted. Note that the problem is that one entry in the table is exceedingly long. – Noon Silk Feb 23 '13 at 6:59
up vote 7 down vote accepted

As Nasser stated in his comment,

TableForm[Trace[Simplify[Sqrt[x^2], x ∈ Integers], TraceInternal -> True]]

will provide you the information you seek. Most of the very long output you encountered comes from Mathematica loading packages needed to carry out the simplification. If you evaluate

TableForm[Trace[Simplify[Sqrt[x^2], x ∈ Integers], TraceInternal -> True]]

a second time, the packages will be already loaded -- the output will still be messy but the Trace results will print in their entirety.

share|improve this answer
thanks for the answer and the editing. Could you give some hint about how to interpret the trace result? And do you know some resources that discuss how MMA do the simplification? For example, from the trace result, I can see that it uses some numerical functions, but how does it sample the numerical parameter space and how it is sure the sample is large enough? – user0501 Feb 24 '13 at 16:08
@user6048. Sorry, I don't have the expertise to answer you new questions. They are good questions, but they shouldn't be asked in a comment. I suggest you post some new questions to get the answers. – m_goldberg Feb 25 '13 at 3:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.