I wrote something like below,  it seems to do what I want - though not sure 
if it's correct or not.

def simplify_common_factors_(p):
    common_factors = [f**occurences for (f,occurences) in p.factor_list()
                      if f.number_of_operands()==0]
    rs = p.divide_both_sides(prod(common_factors))
    rs = rs.expand()
    return rs


sage:  simplify_common_factors_(3*x^2*y*z + x*y*z + y*z == 0)
3*x^2 + x + 1 == 0

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to