First time poster. I have a basic question about 'Simplify'.

I am encountering a problem when trying to simplify some algebraic expressions, where I find an unexpected behaviour of the 'Simplify' function. I am using Mathematica 13.3 on Windows.

Consider the following problem: we have a somewhat complicated expression expr depending on many variables, and we have a system of equations eqs that these variables satisfy. We then want to simplify expr using eqs, by calling


Unfortunately, this does not seem to always give the desired result... Here is the simplest example in which I managed to produce a puzzling (to me) behaviour of 'Simplify'. Consider the following expression and equations:

expr = 2 + k[1, 1, 1, 0];
eqs1 = k[1, 1, 1, 0] == u[2, 0];
eqs2 = k[1, 1, 1, 0] == x;
Simplify[expr, eqs1]
Simplify[expr, eqs2]

where I am considering k[1,1,1,0], u[2,0], and x as some coefficients in a more complicated expression. When I run the above code, it returns


It's like Mathematica has decided that u[2,0] is simpler than k[1,1,1,0], while x is more complicated, and I can't understand why. I have tried using some other simple ComplexityFunction, as well as 'FullSimplify', but I keep finding the same behaviour. Hence my question: is there a way to force Simplify to consider x to be simpler than the other object k[1,1,1,0]?

P.s. I realise that this simple example could be solved by using a rule, rather than asking Simplify to handle the renaming of the variables. However, I am interested in a situation where I have a large set of variables and equations, and using a rule in that case seems to me to be more complicated...

  • 1
    $\begingroup$ Not sure why it does not work, nor why this does: eqs2 = k[1, 1, 1, 0] == Unevaluated@x. $\endgroup$
    – Goofy
    Commented Mar 27 at 23:38
  • 1
    $\begingroup$ I think you should perhaps look into Eliminate rather than Simplify. It may be a more appropriate tool for the task. $\endgroup$
    – MarcoB
    Commented Mar 28 at 1:11
  • $\begingroup$ expr /. Rule @@ eqs2 $\endgroup$
    – Bob Hanlon
    Commented Mar 28 at 2:24
  • $\begingroup$ You defined expr and then referenced exp. Your code would not execute as written. $\endgroup$
    – Ghoster
    Commented Mar 28 at 5:55
  • $\begingroup$ @Ghoster thank you, I corrected the typo. $\endgroup$ Commented Mar 28 at 12:15


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.