Message Boards Message Boards

2
|
5219 Views
|
7 Replies
|
11 Total Likes
View groups...
Share
Share this post:
GROUPS:

Why is Mathematica mis-behaving while finding roots of a simple polynomial?

Hello all,

I have been using Mathematica for solving some of my differential equations. Following is an equation I encountered during one of my computations.
In[30]:= FullSimplify[
Solve[1000 k^3 + (-1800 Sqrt[42] - 30) k^2 + (360 Sqrt[42] +
       13890) k - 270 Sqrt[42] - 767 == 0, k]]

Out[30]= {{k->Root[1000000 #1^6-60000 #1^5-108299100 #1^4+52064600 #1^3+146710920 #1^2-13142460 #1-2473511&,4]},{k->Root[1000000 #1^6-60000 #1^5-108299100 #1^4+52064600 #1^3+146710920 #1^2-13142460 #1-2473511&,6]},{k->Root[1000000 #1^6-60000 #1^5-108299100 #1^4+52064600 #1^3+146710920 #1^2-13142460 #1-2473511&,5]}}
I need the roots of that cubic polynomial and Mathematica can't solve it! If I try without 'FullSimplify' it gives me three complex expressions.
In[31]:= Solve[
1000 k^3 + (-1800 Sqrt[42] - 30) k^2 + (360 Sqrt[42] + 13890) k -
   270 Sqrt[42] - 767 == 0, k]

Out[31]= {{k->1/100 (1+60 Sqrt[42])+(3 (360 Sqrt[42]-34967))/(100 Power[3768349-5038380 Sqrt[42]+10 I Sqrt[893886624605+22661684100 Sqrt[42]], (3)^-1])-1/100 Power[3768349-5038380 Sqrt[42]+10 I Sqrt[893886624605+22661684100 Sqrt[42]], (3)^-1]},{k->1/100 (1+60 Sqrt[42])-(3 (1+I Sqrt[3]) (360 Sqrt[42]-34967))/(200 Power[3768349-5038380 Sqrt[42]+10 I Sqrt[893886624605+22661684100 Sqrt[42]], (3)^-1])+1/200 (1-I Sqrt[3]) Power[3768349-5038380 Sqrt[42]+10 I Sqrt[893886624605+22661684100 Sqrt[42]], (3)^-1]},{k->1/100 (1+60 Sqrt[42])-(3 (1-I Sqrt[3]) (360 Sqrt[42]-34967))/(200 Power[3768349-5038380 Sqrt[42]+10 I Sqrt[893886624605+22661684100 Sqrt[42]], (3)^-1])+1/200 (1+I Sqrt[3]) Power[3768349-5038380 Sqrt[42]+10 I Sqrt[893886624605+22661684100 Sqrt[42]], (3)^-1]}}
 While I gave same expression to Matlab it gave me three real roots within fraction of second and one of the root is my expected correct answer.

Now I am new to Mathematica so I don't know is the way Mathematica functions or am I missing something?
If I am missing something and Mathematica can really solve this equation then I would want to know how?
POSTED BY: Prasiddh TRIVEDI
7 Replies
a) Prasiddh asked,
   Wouldn't Mathematica use that Cubics formula by default when it detects a cubic equation? If not then this option can be really useful.

The solutions for cubic and quartic equations can be Huge.  Most of the time, most Mathematica users don't want to see the whole thing.
If you need the full symbolic solutions, they can be saved in a variable and not printed.
fss = Solve[..., Cubics->True, Quartics->True];
The semicolon at the end prevents the output from going into the notebook window.


b) Usually, new topics are better placed in new threads.  That way the new topic gets more attention
than if it is just another reply to a long thread.

c) Can we make assumptions about the parameters?  For example, are the x's, y's, z's, and ?'s all real?
POSTED BY: Bruce Miller
Thank you everyone for your enthusiastic responces.

@Shengui
I read abot the "Root Object" and yes, I understand now that it is indeed a very nice way of representation. It's just different from the way we are used to see things.
@Vitaliy
Unfortunately I live behind a university proxy/firewall and Mathematica is unable to access Wolfram Alpha!
@Bruce
Wouldn't Mathematica use that Cubics formula by default when it detects a cubic equation? If not then this option can be really useful.

Now, I am not sure whether I should continue discussion in this thread or create seperate threads for my next question. Let me contnue discussion here.
If someone suggest for seperate thread I will.

Now assume that following variable contains one of the three roots of a symbolic cubic polynomial, I have taken the one root which is my probable result.
 x3prob = ((1 - I Sqrt[3]) (z10^2 +
        2 y10 \[Gamma]1) \[Gamma]2^5 \[Gamma]1^7 + (1 +
        I Sqrt[3]) (3 y10 z10 \[Gamma]2^6 \[Gamma]4^2 \[Gamma]1^11 +
        z10^3 \[Gamma]2^6 \[Gamma]4^2 \[Gamma]1^10 +
        2 y10 \[Gamma]2^5 Sqrt[\[Gamma]1^3 (z10^2 +
            2 y10 \[Gamma]1) \[Gamma]2] \[Gamma]4^2 \[Gamma]1^10 -
        2 y10 \[Gamma]2^7 Sqrt[\[Gamma]1^3 (z10^2 +
            2 y10 \[Gamma]1) \[Gamma]2] \[Gamma]1^10 +
        z10^2 \[Gamma]2^5 Sqrt[\[Gamma]1^3 (z10^2 +
           2 y10 \[Gamma]1) \[Gamma]2] \[Gamma]4^2 \[Gamma]1^9 -
       z10^2 \[Gamma]2^7 Sqrt[\[Gamma]1^3 (z10^2 +
           2 y10 \[Gamma]1) \[Gamma]2] \[Gamma]1^9 +
       Sqrt[\[Gamma]1^18 \[Gamma]2^10 ((\[Gamma]1 \[Gamma]2 \
\[Gamma]4^2 z10^3 +
            Sqrt[\[Gamma]1^3 (z10^2 +
                2 y10 \[Gamma]1) \[Gamma]2] (\[Gamma]4^2 - \
\[Gamma]2^2) z10^2 + 3 y10 \[Gamma]1^2 \[Gamma]2 \[Gamma]4^2 z10 -
            2 y10 \[Gamma]1 Sqrt[\[Gamma]1^3 (z10^2 +
                2 y10 \[Gamma]1) \[Gamma]2] (\[Gamma]2 - \[Gamma]4) (\
\[Gamma]2 + \[Gamma]4))^2 - \[Gamma]1^3 (z10^2 +
             2 y10 \[Gamma]1)^3 \[Gamma]2^5)])^(
     2/3))/(2 \[Gamma]1^4 \[Gamma]2^2 (3 y10 z10 \[Gamma]2^6 \
\[Gamma]4^2 \[Gamma]1^11 +
       z10^3 \[Gamma]2^6 \[Gamma]4^2 \[Gamma]1^10 +
       2 y10 \[Gamma]2^5 Sqrt[\[Gamma]1^3 (z10^2 +
           2 y10 \[Gamma]1) \[Gamma]2] \[Gamma]4^2 \[Gamma]1^10 -
       2 y10 \[Gamma]2^7 Sqrt[\[Gamma]1^3 (z10^2 +
           2 y10 \[Gamma]1) \[Gamma]2] \[Gamma]1^10 +
       z10^2 \[Gamma]2^5 Sqrt[\[Gamma]1^3 (z10^2 +
           2 y10 \[Gamma]1) \[Gamma]2] \[Gamma]4^2 \[Gamma]1^9 -
       z10^2 \[Gamma]2^7 Sqrt[\[Gamma]1^3 (z10^2 +
           2 y10 \[Gamma]1) \[Gamma]2] \[Gamma]1^9 +
       Sqrt[\[Gamma]1^18 \[Gamma]2^10 ((\[Gamma]1 \[Gamma]2 \
\[Gamma]4^2 z10^3 +
            Sqrt[\[Gamma]1^3 (z10^2 +
                2 y10 \[Gamma]1) \[Gamma]2] (\[Gamma]4^2 - \
\[Gamma]2^2) z10^2 + 3 y10 \[Gamma]1^2 \[Gamma]2 \[Gamma]4^2 z10 -
            2 y10 \[Gamma]1 Sqrt[\[Gamma]1^3 (z10^2 +
                2 y10 \[Gamma]1) \[Gamma]2] (\[Gamma]2 - \[Gamma]4) (\
\[Gamma]2 + \[Gamma]4))^2 - \[Gamma]1^3 (z10^2 +
             2 y10 \[Gamma]1)^3 \[Gamma]2^5)])^(1/3))
To see if it really is my desired root, I need to check its real and imaginary parts, but when I use the command "Re" and "Im", I get same thing back.
 In[38]:= Re[x3prob]
 
 Out[38]= 1/2 Re(((1-I Sqrt[3]) \[Gamma]1^7 \[Gamma]2^5 (2 \[Gamma]1 y10+z10^2)+(1+I Sqrt[3]) (-2 \[Gamma]1^10 \[Gamma]2^7 y10 Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]+2 \[Gamma]1^10 \[Gamma]2^5 \[Gamma]4^2 y10 Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]-\[Gamma]1^9 \[Gamma]2^7 z10^2 Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]+\[Gamma]1^9 \[Gamma]2^5 \[Gamma]4^2 z10^2 Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]+Sqrt[\[Gamma]1^18 \[Gamma]2^10 ((z10^2 (\[Gamma]4^2-\[Gamma]2^2) Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]-2 \[Gamma]1 y10 (\[Gamma]2-\[Gamma]4) (\[Gamma]2+\[Gamma]4) Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]+3 \[Gamma]1^2 \[Gamma]2 \[Gamma]4^2 y10 z10+\[Gamma]1 \[Gamma]2 \[Gamma]4^2 z10^3)^2-\[Gamma]1^3 \[Gamma]2^5 (2 \[Gamma]1 y10+z10^2)^3)]+3 \[Gamma]1^11 \[Gamma]2^6 \[Gamma]4^2 y10 z10+\[Gamma]1^10 \[Gamma]2^6 \[Gamma]4^2 z10^3)^(2/3))/(\[Gamma]1^4 \[Gamma]2^2 (-2 \[Gamma]1^10 \[Gamma]2^7 y10 Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]+2 \[Gamma]1^10 \[Gamma]2^5 \[Gamma]4^2 y10 Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]-\[Gamma]1^9 \[Gamma]2^7 z10^2 Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]+\[Gamma]1^9 \[Gamma]2^5 \[Gamma]4^2 z10^2 Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]+Sqrt[\[Gamma]1^18 \[Gamma]2^10 ((z10^2 (\[Gamma]4^2-\[Gamma]2^2) Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]-2 \[Gamma]1 y10 (\[Gamma]2-\[Gamma]4) (\[Gamma]2+\[Gamma]4) Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]+3 \[Gamma]1^2 \[Gamma]2 \[Gamma]4^2 y10 z10+\[Gamma]1 \[Gamma]2 \[Gamma]4^2 z10^3)^2-\[Gamma]1^3 \[Gamma]2^5 (2 \[Gamma]1 y10+z10^2)^3)]+3 \[Gamma]1^11 \[Gamma]2^6 \[Gamma]4^2 y10 z10+\[Gamma]1^10 \[Gamma]2^6 \[Gamma]4^2 z10^3)^(1/3)))
 
 In[43]:= Im[x3prob]
 
 Out[43]= 1/2 Im(((1-I Sqrt[3]) \[Gamma]1^7 \[Gamma]2^5 (2 \[Gamma]1 y10+z10^2)+(1+I Sqrt[3]) (-2 \[Gamma]1^10 \[Gamma]2^7 y10 Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]+2 \[Gamma]1^10 \[Gamma]2^5 \[Gamma]4^2 y10 Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]-\[Gamma]1^9 \[Gamma]2^7 z10^2 Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]+\[Gamma]1^9 \[Gamma]2^5 \[Gamma]4^2 z10^2 Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]+Sqrt[\[Gamma]1^18 \[Gamma]2^10 ((z10^2 (\[Gamma]4^2-\[Gamma]2^2) Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]-2 \[Gamma]1 y10 (\[Gamma]2-\[Gamma]4) (\[Gamma]2+\[Gamma]4) Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]+3 \[Gamma]1^2 \[Gamma]2 \[Gamma]4^2 y10 z10+\[Gamma]1 \[Gamma]2 \[Gamma]4^2 z10^3)^2-\[Gamma]1^3 \[Gamma]2^5 (2 \[Gamma]1 y10+z10^2)^3)]+3 \[Gamma]1^11 \[Gamma]2^6 \[Gamma]4^2 y10 z10+\[Gamma]1^10 \[Gamma]2^6 \[Gamma]4^2 z10^3)^(2/3))/(\[Gamma]1^4 \[Gamma]2^2 (-2 \[Gamma]1^10 \[Gamma]2^7 y10 Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]+2 \[Gamma]1^10 \[Gamma]2^5 \[Gamma]4^2 y10 Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]-\[Gamma]1^9 \[Gamma]2^7 z10^2 Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]+\[Gamma]1^9 \[Gamma]2^5 \[Gamma]4^2 z10^2 Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]+Sqrt[\[Gamma]1^18 \[Gamma]2^10 ((z10^2 (\[Gamma]4^2-\[Gamma]2^2) Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]-2 \[Gamma]1 y10 (\[Gamma]2-\[Gamma]4) (\[Gamma]2+\[Gamma]4) Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]+3 \[Gamma]1^2 \[Gamma]2 \[Gamma]4^2 y10 z10+\[Gamma]1 \[Gamma]2 \[Gamma]4^2 z10^3)^2-\[Gamma]1^3 \[Gamma]2^5 (2 \[Gamma]1 y10+z10^2)^3)]+3 \[Gamma]1^11 \[Gamma]2^6 \[Gamma]4^2 y10 z10+\[Gamma]1^10 \[Gamma]2^6 \[Gamma]4^2 z10^3)^(1/3)))In[38]:= Re[x3prob]
 
 Out[38]= 1/2 Re(((1-I Sqrt[3]) \[Gamma]1^7 \[Gamma]2^5 (2 \[Gamma]1 y10+z10^2)+(1+I Sqrt[3]) (-2 \[Gamma]1^10 \[Gamma]2^7 y10 Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]+2 \[Gamma]1^10 \[Gamma]2^5 \[Gamma]4^2 y10 Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]-\[Gamma]1^9 \[Gamma]2^7 z10^2 Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]+\[Gamma]1^9 \[Gamma]2^5 \[Gamma]4^2 z10^2 Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]+Sqrt[\[Gamma]1^18 \[Gamma]2^10 ((z10^2 (\[Gamma]4^2-\[Gamma]2^2) Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]-2 \[Gamma]1 y10 (\[Gamma]2-\[Gamma]4) (\[Gamma]2+\[Gamma]4) Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]+3 \[Gamma]1^2 \[Gamma]2 \[Gamma]4^2 y10 z10+\[Gamma]1 \[Gamma]2 \[Gamma]4^2 z10^3)^2-\[Gamma]1^3 \[Gamma]2^5 (2 \[Gamma]1 y10+z10^2)^3)]+3 \[Gamma]1^11 \[Gamma]2^6 \[Gamma]4^2 y10 z10+\[Gamma]1^10 \[Gamma]2^6 \[Gamma]4^2 z10^3)^(2/3))/(\[Gamma]1^4 \[Gamma]2^2 (-2 \[Gamma]1^10 \[Gamma]2^7 y10 Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]+2 \[Gamma]1^10 \[Gamma]2^5 \[Gamma]4^2 y10 Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]-\[Gamma]1^9 \[Gamma]2^7 z10^2 Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]+\[Gamma]1^9 \[Gamma]2^5 \[Gamma]4^2 z10^2 Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]+Sqrt[\[Gamma]1^18 \[Gamma]2^10 ((z10^2 (\[Gamma]4^2-\[Gamma]2^2) Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]-2 \[Gamma]1 y10 (\[Gamma]2-\[Gamma]4) (\[Gamma]2+\[Gamma]4) Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]+3 \[Gamma]1^2 \[Gamma]2 \[Gamma]4^2 y10 z10+\[Gamma]1 \[Gamma]2 \[Gamma]4^2 z10^3)^2-\[Gamma]1^3 \[Gamma]2^5 (2 \[Gamma]1 y10+z10^2)^3)]+3 \[Gamma]1^11 \[Gamma]2^6 \[Gamma]4^2 y10 z10+\[Gamma]1^10 \[Gamma]2^6 \[Gamma]4^2 z10^3)^(1/3)))

In[43]:= Im[x3prob]

Out[43]= 1/2 Im(((1-I Sqrt[3]) \[Gamma]1^7 \[Gamma]2^5 (2 \[Gamma]1 y10+z10^2)+(1+I Sqrt[3]) (-2 \[Gamma]1^10 \[Gamma]2^7 y10 Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]+2 \[Gamma]1^10 \[Gamma]2^5 \[Gamma]4^2 y10 Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]-\[Gamma]1^9 \[Gamma]2^7 z10^2 Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]+\[Gamma]1^9 \[Gamma]2^5 \[Gamma]4^2 z10^2 Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]+Sqrt[\[Gamma]1^18 \[Gamma]2^10 ((z10^2 (\[Gamma]4^2-\[Gamma]2^2) Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]-2 \[Gamma]1 y10 (\[Gamma]2-\[Gamma]4) (\[Gamma]2+\[Gamma]4) Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]+3 \[Gamma]1^2 \[Gamma]2 \[Gamma]4^2 y10 z10+\[Gamma]1 \[Gamma]2 \[Gamma]4^2 z10^3)^2-\[Gamma]1^3 \[Gamma]2^5 (2 \[Gamma]1 y10+z10^2)^3)]+3 \[Gamma]1^11 \[Gamma]2^6 \[Gamma]4^2 y10 z10+\[Gamma]1^10 \[Gamma]2^6 \[Gamma]4^2 z10^3)^(2/3))/(\[Gamma]1^4 \[Gamma]2^2 (-2 \[Gamma]1^10 \[Gamma]2^7 y10 Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]+2 \[Gamma]1^10 \[Gamma]2^5 \[Gamma]4^2 y10 Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]-\[Gamma]1^9 \[Gamma]2^7 z10^2 Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]+\[Gamma]1^9 \[Gamma]2^5 \[Gamma]4^2 z10^2 Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]+Sqrt[\[Gamma]1^18 \[Gamma]2^10 ((z10^2 (\[Gamma]4^2-\[Gamma]2^2) Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]-2 \[Gamma]1 y10 (\[Gamma]2-\[Gamma]4) (\[Gamma]2+\[Gamma]4) Sqrt[\[Gamma]1^3 \[Gamma]2 (2 \[Gamma]1 y10+z10^2)]+3 \[Gamma]1^2 \[Gamma]2 \[Gamma]4^2 y10 z10+\[Gamma]1 \[Gamma]2 \[Gamma]4^2 z10^3)^2-\[Gamma]1^3 \[Gamma]2^5 (2 \[Gamma]1 y10+z10^2)^3)]+3 \[Gamma]1^11 \[Gamma]2^6 \[Gamma]4^2 y10 z10+\[Gamma]1^10 \[Gamma]2^6 \[Gamma]4^2 z10^3)^(1/3)))
What should I do to get the symbolic expressions of real and imaginary parts of that root?
Finally I will find the real and imaginary parts of all roots and from that I can comment about which roots I am supposed to discard.
In fact this cubic equation is in time so non-real roots are to be discarded, also negative real roots are also to be discarded, etc.
POSTED BY: Prasiddh TRIVEDI
If your goal is floating-point results anyway, NSolve is quicker.
In[1]:= NSolve[ 1000 k^3 + (-1800 Sqrt[42] - 30) k^2 + (360 Sqrt[42] + 13890) k - 270 Sqrt[42] - 767 == 0, k]

Out[1]= {{k -> 0.177507}, {k -> 1.40156}, {k -> 10.1163}}

If you want the exact forms instead of Root objects, the options Cubics and Quartics will be useful.
 In[1]:= Solve[1000 k^3 + (-1800 Sqrt[42] - 30) k^2 + (360 Sqrt[42] + 13890) k -
 270 Sqrt[42] - 767 == 0, k, Cubics -> True]
 
 Out[1]=
 {{k -> (1/100)*(1 + 60*Sqrt[42]) - (3*(-34967 + 360*Sqrt[42]))/
 (100*(-3768349 + 5038380*Sqrt[42] +
 10*I*Sqrt[893886624605 + 22661684100*Sqrt[42]])^(1/3)) +
 (1/100)*(-3768349 + 5038380*Sqrt[42] +
 10*I*Sqrt[893886624605 + 22661684100*Sqrt[42]])^(1/3)},
{k -> (1/100)*(1 + 60*Sqrt[42]) + (3*(1 + I*Sqrt[3])*(-34967 + 360*Sqrt[42]))/
(200*(-3768349 + 5038380*Sqrt[42] +
10*I*Sqrt[893886624605 + 22661684100*Sqrt[42]])^(1/3)) -
(1/200)*(1 - I*Sqrt[3])*(-3768349 + 5038380*Sqrt[42] +
10*I*Sqrt[893886624605 + 22661684100*Sqrt[42]])^(1/3)},
{k -> (1/100)*(1 + 60*Sqrt[42]) + (3*(1 - I*Sqrt[3])*(-34967 + 360*Sqrt[42]))/
(200*(-3768349 + 5038380*Sqrt[42] +
10*I*Sqrt[893886624605 + 22661684100*Sqrt[42]])^(1/3)) -
(1/200)*(1 + I*Sqrt[3])*(-3768349 + 5038380*Sqrt[42] +
10*I*Sqrt[893886624605 + 22661684100*Sqrt[42]])^(1/3)}}
POSTED BY: Bruce Miller
For very quick results you could also just use free-from input in Mathematica. Also notice magical step-by-step button - try clicking it for very detailed solution ;)

POSTED BY: Vitaliy Kaurov
Mathematica by default generates this "Root" object for you, which is very flexible and powerful expression. It can easily handle the polynomial equations with symbolic coefficients such as 
{Root[a #^2 + b # + c &, 1], Root[a #^2 + b # + c &, 2]}
would be the roots for the quadratic equation. If you want to specify a set of parameters, you can use the Rule function to get the exact  value
% /. {a -> 1, b -> -3, c -> 2}
The result is 
{1,2}
POSTED BY: Shenghui Yang
Are you just looking for a simple machine precision numerical answer?
If so, you can use N[some_expression] to get that:
In[1]:= Solve[
   1000 k^3 + (-1800 Sqrt[42] - 30) k^2 + (360 Sqrt[42] + 13890) k -
     270 Sqrt[42] - 767 == 0, k] // N // Chop

Out[1]= {{k -> 10.116264271431698}, {k -> 0.17750734789554512}, {k -> 1.4015616378069056}}
(I also applied Chop to remove the near-zero imaginary part)

http://reference.wolfram.com/mathematica/ref/N.html
http://reference.wolfram.com/mathematica/ref/Chop.html
http://reference.wolfram.com/mathematica/ref/Postfix.html
POSTED BY: Arnoud Buzing
Aah, the "Machine Precision Numerical Value", that's the language I need to learn. 

Thank you very much Arnoud, it answers my 'this' question completely. Also it was quite informative to read the references of N, Chop and Postfix.
I knew Mathematica could do better than Matlab, just didn't know how! 1.4015 is the answer I was looking for.

Actually this question was a simplified version of actual problem I am trying solve which invloves symbolic cubic equation.
I was not able to advance through it, so I tried to see if substituting numerical values makes sense. 
Let me try to solve my problem again, if not I will ask the big question.

I am glad that I have come to the right place!
POSTED BY: Prasiddh TRIVEDI
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract