呼啦一阵风
使用sympy库进行方程计算In[1]:fromsympyimport*In[2]:x=symbols('x')In[3]:solve(Eq(x**5+2*x**4+3*x**3-x**2-3*x-1,0),x)Out[3]:[CRootOf(x**5+2*x**4+3*x**3-x**2-3*x-1,0),CRootOf(x**5+2*x**4+3*x**3-x**2-3*x-1,1),CRootOf(x**5+2*x**4+3*x**3-x**2-3*x-1,2),CRootOf(x**5+2*x**4+3*x**3-x**2-3*x-1,3),CRootOf(x**5+2*x**4+3*x**3-x**2-3*x-1,4)]In[5]:R=solve(Eq(x**5+2*x**4+3*x**3-x**2-3*x-1,0),x)In[6]:[N(solution)forsolutioninR]Out[6]:[0.933791433341506,-0.557328385553605-0.0683867345066456*I,-0.557328385553605+0.0683867345066456*I,-0.909567331117148-1.60288306941394*I,-0.909567331117148+1.60288306941394*I]