Question: Extract the coefficients of all monomial appears in a multivariate polynomial

How can I extract the coefficients of all monomials in a multivariate polynomial?

For example if f=ax^2+bxy^3+2 then I want

coeff(f,x^2)=a

coeff(f,xy^3)=b

coeff(f,1/2)=4

coeff(f,1/10)=20 and...

Please Wait...