# Reducing a multi-variate polynomial to have terms upto certain degree

I have a polynomial in x and y. I want to keep all the terms with (combined) degree 4. Any pointers will be appreciated. Simple tricks for doing the same with univariate polynomial don't seem to work.

• PolynomialReduce[(poly/.Thread[vars->t*vars],t^5][[2]]/.t->1 Feb 7 '14 at 22:53
• @DanielLichtblau - I'd like to understand that but the syntax is a bit off (unbalanced parentheses and PolyReduce wants three args). Can you correct it?.. Feb 7 '14 at 23:41
• note the subject says "up to" while the question says "combined degree 4" .. which do you want? Feb 7 '14 at 23:50
• @george2079 If you remove the lparen and don't worry too much about the missing 3rd argument it should work out better. Feb 8 '14 at 0:08
• Ok.. for those who cant stand the front end sticking a red mark in their code the third arg should be a t .. Feb 10 '14 at 17:25

p = Total@Flatten@Table[ a[i, j] x^i  y^j , {i, 0,5}, {j, 0, 5}]

   Total@Flatten@

Obviously put <=4 in there to keep the lower terms..