문제

I can't figure out how to factor an polynomial expression to its complex roots.

>>> from sympy import *
>>> s = symbol('s')
>>> factor(s**2+1)
 2
s  + 1
도움이 되었습니까?

해결책

You need to add I as an algebraic extension:

In [2]: factor(x**2 + 1, extension=[I])
Out[2]: (x - ⅈ)⋅(x + ⅈ)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top