2

I need to simplify a long expression with a denominator in the form of a+b. To keep it simple, let me replace the long expression with a short example:

(e*a + e*b + c + f)/(a + b) // FullSimplify

(c + (a + b) e + f)/(a + b)

This is not a simple form. I'd like to see things like

(e*a + e*b + c + d)/(a + b) // FullSimplify

(c + d)/(a + b) + e

But unfortunately, if I replace the d with f, the simplification does not work.

Is there a universal way to make FullSimplify work even harder? By universal I mean I could have simply replaced d into f. Or I can Collect coefficients of e. However, in a long expression it is quite hard to make change to all different terms. Also, considering the real expression is long and has a lot of variables, considering permutations of all variables would be exponentially expensive in computation time.

Yi Wang
  • 7,347
  • 4
  • 28
  • 38

1 Answers1

6

Convert the denominator to a single variable, FullSimplify, and then restore the original denominator.

expr = (e*a + e*b + c + f)/(a + b);

((expr /. a -> z - b) // FullSimplify) /. z -> a + b

e + (c + f)/(a + b)

Bob Hanlon
  • 157,611
  • 7
  • 77
  • 198