extended "coeff()" function



You already know that coeff(expression,var,n) doesn't work unless "expression" is expanded, which is ok, although minorly irritating.

But it would be nice if coeff(expression,x*y,n)=coeff(coeff(expression,x,n),y,n), so that you could pick out the coefficients of (x*y)^n, where n is usually 1.

Thus, if p = x^2 + 2 x y + y^2, coeff(p,x*y,1) should be 2.  (It currently returns 0.)