FullSimplify fails with simple assumptions

I have a list of relations of the form

x[1] x[2] + y[1] y[2] - z[1] z[2] == 0


and I want Mathematica to simplify certain expressions using these relations. I have been using FullSimplify with assumptions, and I have found that it doesn't work occasionally. For example:

FullSimplify[(a b - e f)/c, Assumptions -> {a b + c d - e f == 0}]


works just fine, and gives the correct answer -d, but for some reason

FullSimplify[(c d - e f)/a, Assumptions -> {a b + c d - e f == 0}]


returns (c d - e f)/a. Any idea why this happens and how to make sure that Mathematica recognizes the second example as -b?

• I'd say that Reduce is more appropriate for this sort of thing. For example: Reduce[(c d - e f)/a == y && a b + c d - e f == 0] Sep 24 '21 at 9:51

It is recommended to act another way around. For example, below I use the equation a b + c d - e f == 0 to express one or another parameter in order to then substitute it to the expression under simplification:

sol1 = Solve[a b + c d - e f == 0, c][[1, 1]]
sol2 = Solve[a b + c d - e f == 0, a][[1, 1]]
sol3 = Solve[a b + c d - e f == 0, d][[1, 1]]

(*  c -> (-a b + e f)/d

a -> (-c d + e f)/b

d -> (-a b + e f)/c   *)


Then let us substitute successively these three solutions into the expression under simplification:

Simplify[(c d - e f)/a /. sol1]
Simplify[(c d - e f)/a /. sol2]
Simplify[(c d - e f)/a /. sol3]

(*  -b

-b

-b  *)


Each of these ways is one step longer than your approach with the equation, but they are safer.

As a minor note: FullSimplify is not necessary here. Simplify is enough.

Have fun!