Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to get all (numerical) solutions of an equation?

Mathematica's NSolve can produce all roots of a polynomial equation, like this:

sage: mathematica('NSolve[9*x^6 + 4*x^4 + 3*x^3 + x - 17 == 0,  x]')
{{x -> -1.1030150726298147}, 
  {x -> -0.49110203599909275 - 0.9883314953720708*I}, 
  {x -> -0.49110203599909275 + 0.9883314953720708*I}, 
  {x -> 0.5426095723140001 - 1.0543115206871092*I}, 
  {x -> 0.5426095723140001 + 1.0543115206871092*I}, {x -> 1.}}

OTOH, Sage's solve gives just one real solution:

sage: solve(9*x^6 + 4*x^4 + 3*x^3 + x - 17 == 0,  x)
 [x == 1, 0 == 9*x^5 + 9*x^4 + 13*x^3 + 16*x^2 + 16*x + 17]

Is there a simple way to get all solutions?