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.

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
1  
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 at 1:06
    
PolynomialReduce is a good function for this type of thing. –  Daniel Lichtblau Jul 11 at 14:12

1 Answer 1

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]

enter image description here

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.