I'm having trouble setting a pattern for simplifying a complex expression. I've distilled the question down to the simplest case where Mathematica seems to fail.
I set up a simple rule based on a pattern:
simpRule = a b v___ - c d v___ -> e v
which works on the direct case
a b - c d /. simpRule
e
but fails if I simply add a minus sign.
-a b + c d /. simpRule
-a b + c d
How do I go about writing a more robust rule? Or perhaps there's a better way to go about performing simplifications of this sort?
Thanks, Keith
Subtract[a b something, c d something]
to be replaced bye*something
, or do you need something more general? In any event, there is the built-in functionFactor[]
which might be apropos... $\endgroup$InputForm[]
to whatever output Mathematica spits back. $\endgroup$