Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What ComplexityFunction (or other technique) can I use to have Mathematica pull things out of fractions?

I have a rational function of several variables and I'd like to have Math'ca simplify, e.g.,

x(... + y(... + wz)) + ...


x(... + y(...)) + ....
---------------------- + w

? I've already told it that the relevant variables (in the denominator) are nonzero.

I was thinking of counting complexity as LeafCount plus the LeafCount of numerators, but I'm not sure how to do that.

share|improve this question
Will Apart do what you want? – murray Apr 30 '14 at 14:17
up vote 3 down vote accepted

Murray's suggestion seems to work fine:

eqn = x (5 + a + y (6 + b + w z))/(x y z);

w + (5 + a + 6 y + b y)/(y z)
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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