Skip to main content

algebraic manipulation - Is it possible to have Mathematica move all terms to one side of an inequality?



I have an inequality expression that I would like to express in terms of the relation of the parameters to zero. More simply, I want to have mathematica move all the terms to one side of the inequality so that it is expressed as $x - y \geq 0$. Currently it is expressed as $x \geq y$. The expressions inside $x$ and $y$ are much more complex, of course.


Is this possible? It seems I need to provide some assumptions about the relations between variables, but it isn't clear to me how to do this.



Answer



Are you looking for Subtract?


eq=x>=y
Subtract@@eq>=0

gives:



x-y>=0




Edit


If one wants a function, which keeps the order sign and adds the 0, one may use:


oneSide=(Head[#][Subtract@@#,0]&)

and call e.g. eq//oneSide


Comments