Question: How do I extract specific terms from multivariate polynomials?

Hello everyone. I want to know how I can extract terms from a multivariate polynomial with the following 2 conditions:

  1. It should have the lowest sum of the degree of x and of y; and
  2. deg(x) - deg(y) should be either 0 or -1.

For instance, if I've f(x) = 100x^2y^2 + 35yx + 45x, I want an output of 35yx (not 45x; even though degree sum is 1, less than 2).

On the other hand, if I've g(x) = 13x^2y^2 + xy^2 + 2yx^2, I want an output of xy^2 (not yx^2 also).

Please Wait...