|   | 1 |  initial version  | 
Here's my solution in the end:
Convert equation to symbolic form. Make it homogenous. Then use the expr.coefficient(), expr.coefficients() and expr.monomials() methods.
 Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.
 
                
                Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.