Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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)) + ...
--------------------------
            xyz

to

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

? 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
2  
Will Apart do what you want? –  murray Apr 30 at 14:17

1 Answer 1

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);
Apart[eqn]

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

Your Answer

 
discard

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.