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

I have taken sequential partial derivatives of a two variable polynomial fraction, resulting in a very long series of polynomials of form:

C*x^i*y^j/(some product series of (1-x^k*y)^n)

What I wish to do is a series of basic truncations. First, I eliminate all polynomials that have x^i*y^j with i or j > 4 in the numerator. I keep looking over the documentation and StackExchange and cannot find anything that works for me.

I am open to suggestions.

Edit: Thus far, I have merely sorted the long series, and picked out the valid fractions starting from the bottom. What is the solution that uses Mathematica functions?

share|improve this question
Without a complete, even if simpler, example to work with, perhaps this is will work: Replace[expr, term_ /; MemberQ[Numerator[term], (x | y)^i_ /; i > 4] -> 0, 1]?? It assumes the expression for your rational function has been expanded in the way you describe. Please clarify whether this is right or wrong. – Michael E2 Jul 11 '14 at 1:06
PolynomialReduce is a good function for this type of thing. – Daniel Lichtblau Jul 11 '14 at 14:12

I post this as a way to handle polynomials that could be modified to suit your needs:

func[exp_, vars_, pattern_] := 
  Cases[CoefficientRules[exp, vars], HoldPattern[pattern]], vars]


expr = (1 - x^2 y)^10;
Column[{Expand@expr, func[expr, {x, y}, Rule[{_?(# > 4 &), _}, _]]}, 
 Frame -> All]

enter image description here

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.