Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

This question already has an answer here:

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

share|improve this question

marked as duplicate by Kuba, Artes, Yves Klett, rm -rf Sep 18 '13 at 12:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1  
Use Chop on the results form Solve. –  Kuba Sep 18 '13 at 6:28
    
@Kuba: it doesn't make any difference –  Loi.Luu Sep 18 '13 at 6:39
2  
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. –  Kuba Sep 18 '13 at 6:55
2  
Also, to give you refference to the answer, please take a look at difference between Solve and Reduce –  Kuba Sep 18 '13 at 6:59
1  
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? :) –  Kuba Sep 18 '13 at 7:42
show 2 more comments

Browse other questions tagged or ask your own question.