I am new to Mathematica and I have what I am sure is a basic question, which I unfortunately have not been able to figure out. I am trying to keep terms in a polynomial that are of the same degree only. For example, if I have a polynomial in the variables x
and y
like the following
poly = ax^2*y - bx*y - cx*y^2 + dx + ey
what could I do to extract, for example, only the terms of third order, i.e the terms
ax^2*y-cx*y^2
ax
is a distinct entity froma x
; if you want to multiply different variables, separate them with a space or explicitly use an asterisk. $\endgroup$CoefficientList
and then take out the elements you want, e.g. by usingIntegerPartitions
but I'm sure there are better methods. $\endgroup$