why solve failed? my error or solve error?

1 次查看(过去 30 天)
I used command solve but recently I had a new equation:
f1=cos(x)*(2*x)^(1/2) + sin(x)/(2*x)^(1/2);
I used solve, but the ans was wrong, then I used Newton method an check the answers were ok
ans =
1.8366
ans =
4.8158
used solve:
>> syms x
>> f1=cos(x)*(2*x)^(1/2) + sin(x)/(2*x)^(1/2);
>> sf1=solve(f1,x)
sf1 =
-227.76766260117050148062548433664
the ans obvisuly was wrong
why solve failed? was my method or command solve?

回答(2 个)

Jan
Jan 2015-4-6
The result is obviously correct. Simply try it:
x = -227.76766260117050148062548433664
cos(x)*sqrt(2*x) + sin(x)/sqrt(2*x)
The result is -2.6466e-013i, which is correct inside the expected precision.

Star Strider
Star Strider 2015-4-6
There are infinitely many real and imaginary roots:
figure(1)
ezplot(real(f1), [-100 100]*pi)
hold on
ezplot(imag(f1), [-100 100]*pi)
hold off

类别

Help CenterFile Exchange 中查找有关 Mathematics 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by