Unexpected result on solving some inequality in Matlab symbolic computation

为君一笑 提交于 2020-01-05 04:09:27

问题


Please consider this example. I would like to solve x^3 - 2x > 0. I try the following commands:

syms x;
f = @(x) x^3-2*x;
solve(f(x)>0,x)

and Matlab returns this

ans = solve([0.0 < x^3 - 2.0*x], [x])

which is not what I expect. Therefore I use

solve(f(x)+x>x,x)

which returns

ans = Dom::Interval(2^(1/2), Inf) Dom::Interval(-2^(1/2), 0)

Can someone explain that why solve works successfully only in the second case?


回答1:


Try adding the Real option to solve:

solve(f(x)>0,x,'Real',1)

ans =

 Dom::Interval(2^(1/2), Inf)
 Dom::Interval(-2^(1/2), 0)


来源:https://stackoverflow.com/questions/23811199/unexpected-result-on-solving-some-inequality-in-matlab-symbolic-computation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!