我在Maxima中有一个函数,我要区分然后尝试查找为零的值。但是,当我使用solve()时,没有得到解决方案。为什么会这样,我该如何解决?
(%i1) f(x):=(-5*(x^4+5*x^3-3*x))/(x^2+1);
(%o1) f(x):=((-5)*(x^4+5*x^3+(-3)*x))/(x^2+1)
(%i2) df(x):=''(diff(f(x), x));
(%o2) df(x):=(10*x*(x^4+5*x^3-3*x))/(x^2+1)^2-(5*(4*x^3+15*x^2-3))/(x^2+1)
(%i3) solve(df(x), x);
(%o3) [0=2*x^5+5*x^4+4*x^3+18*x^2-3]
solve
功能不太强;有很多无法解决的问题。正在开发更强大的版本。同时,请尝试附加软件包to_poly_solve
。这是我得到的:
(%i1) df(x) := (10*x*(x^4+5*x^3-3*x))/(x^2+1)^2-(5*(4*x^3+15*x^2-3))/(x^2+1) $
(%i2) load (to_poly_solve) $
(%i3) to_poly_solve (df(x), x);
(%o3) %union([x = - 2.872468527640942], [x = - 0.4194144025323134],
[x = 0.3836388367122223], [x = 0.2041221431132173 - 1.789901606296292 %i],
[x = 1.789901606296292 %i + 0.2041221431132173])
[可能有点令人惊讶的是,to_poly_solve
返回了数值解而不是精确解或符号解。追踪allroots
显示to_poly_solve
构造了一个五次方程,并将其推到allroots
。由于一般五次方程组都没有根部解,即使在特殊情况下它也可能很杂乱,因此无论如何都具有数字解可能是最有用的。
尝试plot2d(df(x), [x, -3, 1])
可视化上面返回的真实根。