0
$\begingroup$

When I request with Reduce, Mathematica returns:

In[13]:= N[Reduce[X^3-26X+1 == 0,X, Reals]]                                     
Out[13]= X == -5.11814 || X == 0.0384637 || X == 5.07968

However, when I request with Solve, it returns three complex roots

In[15]:= N[Solve[X^3-26X+1 == 0,X]]                                             
                                                            -16
Out[15]= {{X -> 5.07968 + 0. I}, {X -> 0.0384637 + 4.44089 10    I}, 
                            -16
{X -> -5.11814 - 4.44089 10    I}}

I think the different here is the Reals field. However, I'm confused about the correctness of result. Which one should I follow when I want to solve the equations.

Thanks

$\endgroup$
7
  • 1
    $\begingroup$ Use Chop on the results form Solve. $\endgroup$
    – Kuba
    Sep 18, 2013 at 6:28
  • $\begingroup$ @Kuba: it doesn't make any difference $\endgroup$
    – Loi.Luu
    Sep 18, 2013 at 6:39
  • 2
    $\begingroup$ X /. N[Solve[X^3 - 26 X + 1 == 0, X]] // Chop -> {5.07968, 0.0384637, -5.11814} which is the same result as from Reduce. $\endgroup$
    – Kuba
    Sep 18, 2013 at 6:55
  • 2
    $\begingroup$ Also, to give you refference to the answer, please take a look at difference between Solve and Reduce $\endgroup$
    – Kuba
    Sep 18, 2013 at 6:59
  • 1
    $\begingroup$ You'd better use what fits your needs :) In this particular case you can see that the result is the same. In other it can be different as described in the link I've provided. If one was absolutelly better than another what would be the purpose of the other existance? :) $\endgroup$
    – Kuba
    Sep 18, 2013 at 7:42

0

Browse other questions tagged or ask your own question.