First time here? Check out the FAQ!
answered 2011-10-10 07:35:52 +0100
Here are two helpful functions:
sage: var('x,y,z') (x, y, z) sage: expr=x^2*y+2*x*y*z+54*z-3*x*z sage: expr.collect(x) x^2*y + (2*y*z - 3*z)*x + 54*z sage: expr.coefficients(x) [[54*z, 0], [2*y*z - 3*z, 1], [y, 2]]