# How to eliminate == sign from the solution?

I run the Eliminate command on the expression that gave me the symbolic solution like this for example:

a + b == ab - c + d


I assigned the solution to be f = a + b == ab - c + d however I want to get rid of == sign so that I can continue with calculation and f should be : f= a+b-ab+c-d

a+b-ab+c-d


I have tried Normal @ f but no change.

one way might be to make a lhs() and rhs() functions.

ClearAll[a, b, c, d, x, y, lhs, rhs]
lhs[eq_] := eq /. (x_) == (y_) -> x;
rhs[eq_] := eq /. (x_) == (y_) -> y;


Now you can write

eq = a + b == a b - c + d;
f = lhs[eq] - rhs[eq]


This will work only for input of form x==y of course.

a + b == ab - c + d is stored internally as Equal[a + b, ab - c + d].

And what you want instead is Subtract[a + b, ab - c + d].

You can get there by replacing Equal with Subtract by doing this:

f = Apply[Subtract, a + b == ab - c + d]


which gives you a-ab+b+c-d, but that is the same as what you asked for, just with Mathematica sorting the variables into the order it wants.

• Or you can do a similar thing with a replacement rule: a + b == ab - c + d /. Equal -> Subtract – bill s Jun 21 '17 at 3:12
• @bill s I understand completely. I tend to think that novice users might come up to speed a little easier and be a little less confused if we show them Map and Apply and ReplaceAll with [ and ] neatly containing their arguments than if we just give them strings of /@ and @@ and /. and -> that they often don't even know that they can search for in the help system and have no idea what the precedence is. Once they have the functions figured out then they can go wild with abbreviations. – Bill Jun 21 '17 at 3:22