Are you thinking of something like this? >>> def efactor(e, I=None): ... r = roots(e) ... rad = set().union(*[i.atoms(Pow) for i in r]) ... if I: ... rad.add(I) ... return factor(e, extension=rad) ... >>> efactor(x**4+1) (x**2 - sqrt(2)*x + 1)*(x**2 + sqrt(2)*x + 1)
>>> print filldedent(efactor(x**4 + 1, I)) (x - sqrt(2)/2 - sqrt(2)*I/2)*(x - sqrt(2)/2 + sqrt(2)*I/2)*(x + sqrt(2)/2 - sqrt(2)*I/2)*(x + sqrt(2)/2 + sqrt(2)*I/2) -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/7033916c-da49-4d24-8651-024516099f30%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
