# I need to move all the variables(x,y,z) to one side of an equality for the equation of a plane

I have 5(x-1)-(y+1)-(z+1)==0. If I use FullSimplify on it it returns 5x==7+x+y. This is not what I want: I want it to return 5x-y-z==7.

-
Closely related question: Is is possible to have mathematica move all terms to one side of an equation? –  Jens Jun 1 '12 at 15:45

Try this:

eq = 5 (x - 1) - (y + 1) - (z + 1) == 0
Map[Plus[7, #] &, Expand[eq]]

(*  5 x - y - z == 7  *)

-

The following works nicely:

Block[{cf = CoefficientArrays[#]}, Last[cf].Variables[Subtract @@ #] == -First[cf]] &[
5 (x - 1) - (y + 1) - (z + 1) == 0]

-

One way is

body = 5 (x - 1) - (y + 1) - (z + 1);
(#[[2]].Variables[body] == -1*#[[1]]) &@
Flatten[Normal@CoefficientArrays[{body == 0}, {x, y, z}], 1]


BR

-
expr = 5 (x - 1) - (y + 1) - (z + 1) == 0;