I would like to make a single replacement rule that disregards the sign. I have the following expression:
cond = -((-(2 + s^2) (E2 (x1 - x2) + E1 (x2 - x3)) + Sqrt[(2 + s^2)^2 (E2 (x1 - x2) + E1 (x2 - x3))^2 - 32 E1 E2 s^2 (x1 - x2) (x2 - x3)])/((2 + s^2) (E2 (x1 - x2) + E1 (x2 - x3)) + Sqrt[(2 + s^2)^2 (E2 (x1 - x2) + E1 (x2 - x3))^2 - 32 E1 E2 s^2 (x1 - x2) (x2 - x3)]))
I would like to simplify this expression, but if I make a replacement rule like
cond/.{x2-x1 -> l1}
this does nothing because it doesn't realize that x1-x2 = -l1. Is there a way to solve this?
x1 -> x2 - l1? – J. M.'s missing motivation May 23 '17 at 08:14ReplaceAllisn't meant to work for math formulas this way. Solve/Eliminate/Reduce etc are. Or you can usex1 -> x2 - l1to overcome Replacement limitations. For general approach check the link, have you? hard to say without examples, all problems of the same 'class' should be solvable by a solution that works for one of them. – Kuba May 23 '17 at 09:14Solve/Eliminate/Reducecan do. – Kuba May 23 '17 at 09:24