2
$\begingroup$

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.

$\endgroup$
1

1 Answer 1

6
$\begingroup$

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)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.