I'm using isympy from a recent anaconda3 installation. I find that factor is introducing a spurious factor of 0.25.
If I run this: from sympy import * a,b,c,d,x,y = symbols('a,b,c,d,x,y') y = a + 0.25*b**2 + 1.0*b*c*x + 1.0*c**2*x**2 print('factor') print(factor(y-a)) print('expand') print(expand(y-a)) print('factor difference') print(simplify(y-a-factor(y-a))) print('expand difference') print(simplify(y-a-expand(y-a))) then I get this: factor 1.0*(0.25*b + 0.5*c*x)**2 expand 0.25*b**2 + 1.0*b*c*x + 1.0*c**2*x**2 factor difference 0.1875*b**2 + 0.75*b*c*x + 0.75*c**2*x**2 expand difference 0 -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscr...@googlegroups.com. To post to this group, send email to sympy@googlegroups.com. Visit this group at https://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/0a8bd7a6-eedb-4584-a7a0-eba64d8ec8e5%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.