ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 05 Jun 2013 17:57:36 -0500Turning an expression into a multivariate polynomial?http://ask.sagemath.org/question/10198/turning-an-expression-into-a-multivariate-polynomial/Suppose I have the expression
-a^3x^2 - a^2xy^2 + axy + bx^2 + 2bxy + xy^2
I want to turn this into a polynomial in x and y:
(1-a^2)xy^2+(a+2*b)xy+(b-a^3)x^2
so that I can then extract the coefficients (by setting x=1, y=1 in the list of operands of the new expression). How do I tell Sage which of the four variables will be the polynomial variables?AlasdairWed, 05 Jun 2013 17:57:36 -0500http://ask.sagemath.org/question/10198/