# Truncating out higher order polynomials in series of fractions

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?

• 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_] :=
FromCoefficientRules[
Cases[CoefficientRules[exp, vars], HoldPattern[pattern]], vars]


Example:

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