0
$\begingroup$

Using g rather than b as variable name changes output. As far as I know neither b nor g are restricted symbols. Can this be reproduced on other builds? Using Mathematica 12.0.0.0 on a Mac.

Quit[]

FullSimplify[-c d b + a f b]

(* b (-c d + a f)*) 

FullSimplify[-c d g + a f g]

(* -c d g + a f g *)
$\endgroup$
  • 1
    $\begingroup$ Can reproduce. It seems to have something to do with the symbol sorting that Mathematica does for Plus and Times. $\endgroup$ – Sjoerd Smit Sep 26 at 9:11
  • 1
    $\begingroup$ Please don't use the bugs tag when posting new questions. See the tag description for why. $\endgroup$ – Szabolcs Sep 26 at 9:18
  • 2
    $\begingroup$ This is very likely not a bug. Sensitivity to symbol naming is a well-known behaviour stemming from expression canonicalization (what Sjoerd said). Note that FullSimplify does not guarantee a simpler output. It tries a few transformations and if it finds a simpler version, it outputs it. $\endgroup$ – Szabolcs Sep 26 at 9:19
  • $\begingroup$ How to work around it? This example is trivial but the behaviour is sometimes very inconvenient. $\endgroup$ – Øistein Sep 26 at 9:22
  • 1
    $\begingroup$ You should include that comment in the question itself, but please try to make it more specific. What exactly do you mean by "working around it"? Can you give representative examples of the expressions you are dealing with? There is not going to be a general method that makes FullSimplify not sensitive to symbol naming, but there may be ways to deal with the specific cases you need. $\endgroup$ – Szabolcs Sep 26 at 9:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.