I am very new to python, so forgive me if this has a simple fix. I am trying to solve polynomials with complex coefficients using sympy. I find that I get an empty output if k is "too complicated" ... I'm not quite sure how to determine what this means. As a first example, consider this fourth-order polynomial with complex coefficients,
In [424]: solve(k**4+ 2*I,k)
Out[424]:
[-2**(1/4)*sqrt(-sqrt(2)/4 + 1/2) - 2**(1/4)*I*sqrt(sqrt(2)/4 + 1/2),
2**(1/4)*sqrt(-sqrt(2)/4 + 1/2) + 2**(1/4)*I*sqrt(sqrt(2)/4 + 1/2),
-2**(1/4)*sqrt(sqrt(2)/4 + 1/2) + 2**(1/4)*I*sqrt(-sqrt(2)/4 + 1/2),
2**(1/4)*sqrt(sqrt(2)/4 + 1/2) - 2**(1/4)*I*sqrt(-sqrt(2)/4 + 1/2)]
no problem getting the result. I am interested, however, in solving something like
In [427]: solve(k**6 + 3*I*k**5 - 2*k**4 + 9*k**3 - 4*k**2 + k - 1,k)
Out[427]: []
which is much more complicated and returns an empty list. I can, however, solve this using maple, for example. Also note that there are no problems removing complex odds,
In [434]: solve(k**6 + 3*k**5 - 2*k**4 + 9*k**3 - 4*k**2 + k - 1,k)
Out[434]:
[CRootOf(k**6 + 3*k**5 - 2*k**4 + 9*k**3 - 4*k**2 + k - 1, 0),
CRootOf(k**6 + 3*k**5 - 2*k**4 + 9*k**3 - 4*k**2 + k - 1, 1),
CRootOf(k**6 + 3*k**5 - 2*k**4 + 9*k**3 - 4*k**2 + k - 1, 2),
CRootOf(k**6 + 3*k**5 - 2*k**4 + 9*k**3 - 4*k**2 + k - 1, 3),
CRootOf(k**6 + 3*k**5 - 2*k**4 + 9*k**3 - 4*k**2 + k - 1, 4),
CRootOf(k**6 + 3*k**5 - 2*k**4 + 9*k**3 - 4*k**2 + k - 1, 5)]
Elements of the resulting array can be calculated numerically.
, , ? , [427]?
nsolve() , .