Problem with solve

Problem with solve - Messages

#1 Posted: 6/18/2011 9:01:27 AM
Abhi

Abhi

0 likes in 4 posts.

Group: User

Hi,

I've found what looks like a bug in solve(). Could anyone please help?

Thanks in advance,

Abhi

#2 Posted: 6/18/2011 10:40:07 AM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Hello,

There is already mentioned few times about solving equations with solve() and roots().
The solve() function has a searching algorithm trying to find all the real roots in the given range, and it can fail like most of the numerical procedures. It is advisable to use 4 arguments solve(). The default range is set by default to [-20,20] - Tools|Options|Calculation|Roots range - where it is not suitable in some cases (like in yours)

In your case:
[MATH=eng]a←1[/MATH][MATH=eng]b←263.84[/MATH][MATH=eng]c←-61463[/MATH]
[MATH=eng]f(x)←a*x^2+b*x+c[/MATH]
[MATH=eng]solve(f(x),x,-450,150)=#@#[/MATH]
solve() will probabely fail. Therefore, you can try to find the roots one by one:
[MATH=eng]solve(f(x),x,-500,-300)=-412.7507[/MATH]
[MATH=eng]solve(f(x),x,100,200)=148.9107[/MATH]
or using roots()
[MATH=eng]roots(f(_x),_x,-400)=-412.7507[/MATH]
[MATH=eng]roots(f(_x),_x,150)=148.9107[/MATH]

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#3 Posted: 6/19/2011 10:02:07 AM
Abhi

Abhi

0 likes in 4 posts.

Group: User

OK, got it.

Thanks
  • New Posts New Posts
  • No New Posts No New Posts