Re: Bug in Solve?
- To: mathgroup at smc.vnet.net
- Subject: [mg102984] Re: Bug in Solve?
- From: Bill Rowe <readnews at sbcglobal.net>
- Date: Thu, 3 Sep 2009 07:10:04 -0400 (EDT)
On 9/2/09 at 4:03 AM, a2mgoog at yahoo.com (tonysin) wrote:
>I have a very simple equation:
>x^3 - 15 x + 2 = 0
>When I plot it in Mathematica 7,
>it gives the expected graph of a cubic, with three real roots near
>-4, 0, and 4.
>When I NSolve it,
>NSolve[f[x] == 0, x]
>it gives
>{{x -> -3.938}, {x -> 0.133492}, {x -> 3.80451}}
>which is exactly what you would expect from the graph.
>But when I Solve it
>Solve[f[x] == 0, x]
>it gives this mess
>{{x -> 5/(-1 + 2 I Sqrt[31])^(1/3) + (-1 + 2 I Sqrt[31])^(
>1/3)}, {x -> -((5 (1 + I Sqrt[3]))/( 2 (-1 + 2 I Sqrt[31])^(1/3))) -
>1/2 (1 - I Sqrt[3]) (-1 + 2 I Sqrt[31])^(1/3)}, {x -> -(( 5 (1 - I
>Sqrt[3]))/(2 (-1 + 2 I Sqrt[31])^(1/3))) - 1/2 (1 + I Sqrt[3]) (-1 +
>2 I Sqrt[31])^(1/3)}}
>I don't know how it looks in your font, but that "I" in each
>solution is the imaginary i. Solve is saying this equation has no
>real roots, even though the graph clearly shows that all three roots
>are real.
No, Solve is giving you an exact solution for all three roots which is also=
real for all three roots.
If you do
In[11]:= Solve[f[x] == 0, x] // FullSimplify // N
you get
Out[11]= {{x->3.80451},{x->-3.938},{x->0.133492}}
demonstrates all three roots are real and Solve gets the same result as NSo=
lve