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
Eventually I posted the same question on MathGroup and received an answer which I think is superior to the one I posted before. I thought I should add it here.
As before, this is not strictly a replacement rule, instead it uses Mathematica's
PolynomialReduce[], but it seems to be quite robust and if people come across this question they should be aware of this solution.