# FullSimplify output depends on symbol name

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 *)

• Can reproduce. It seems to have something to do with the symbol sorting that Mathematica does for Plus and Times. – Sjoerd Smit Sep 26 at 9:11
• Please don't use the bugs tag when posting new questions. See the tag description for why. – Szabolcs Sep 26 at 9:18
• 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. – Szabolcs Sep 26 at 9:19
• How to work around it? This example is trivial but the behaviour is sometimes very inconvenient. – Øistein Sep 26 at 9:22
• 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. – Szabolcs Sep 26 at 9:24