Question: Symbolic cut-off of high-order terms

Hi! I have a variable polynomial expression and I want to cut off all the terms of order 3 and more, for every product of variables.

For example consider the polynomial P = x + y + a*x^2 + b*x^3 + c*x*y + d*x^2*y + e*x*y^2 + y^2, I want an operation who returns me a*x^2 + c*x*y + y^2

(terms for which the sum of exponents in x and y exceeds or less two are being deleted)

Is it possible?

 

Please Wait...