I have the following question.
An expression, which I want to simplify contains several subexpressions which appear quite frequently all over the place. To optimize simplification I would like to use abbreviations for some of them. Is there any way to do it in a "smart" way, i.e. to account for subexpressions which differ only by sign/multiplication by a number or a variable? Here is an example to illustrate what I mean.
For example, the adverted subexpression is:
-a^2 + b^2/(c^2 - d^2)
and I want to use variable A1 everywhere instead it:
-a^2 + b^2/(c^2 - d^2) -> A1
Now, I want Mathematica to substitute the expressions which are essentially equal to this one, but are simply written in another form like:
-a^2 - b^2/(d^2 - c^2) -a^2 + (-b^2/(d^2 - c^2))
Also it would be great to use this rule for expressions like
-2*a^2 + 2*b^2/(c^2 - d^2) (*2*A1*)
a^2 - b^2/(c^2 - d^2) (*-A1*)
-x*a^2 + x*b^2/(c^2 - d^2) (*x*A1*)
Is there a way to do it?