0
$\begingroup$

I have trouble understanding Root in Mathematica.

For instance:

Solve[x^5 + 2 x + 1 == 0, x]

gives me a strange solution that I don't quite understand. Any help would be highly appreciated.

$\endgroup$
1

1 Answer 1

2
$\begingroup$

An expression like:

Root[1 + 2*#1 + #1^5 & , 1, 0]

is simply an exact representation of an algebraic number. Radicals like Sqrt[2] are more familiar, but cannot express every algebraic number.

You can treat such things pretty much as any other exact representation of a number in Mathematica. You can get numeric approximations using N[]. However, Mathematica is a bit less eager to automatically reduce expressions containing these: arithmetic on these is much more expensive than adding 2+2. But you can say "pretty please" with RootReduce[].

Once you're used to these, they are liberating. Problems unsolvable with the traditional algebra of radicals gain solutions.

$\endgroup$
6
  • $\begingroup$ I see. In essence, it's saying "I have no clue how to solve this system, but if the solution would exist, it would be the nth root of the expression". is that correct ? $\endgroup$
    – james
    Commented Mar 26, 2020 at 17:38
  • 1
    $\begingroup$ @james - No, it is saying it knows exactly how to solve this problem and the solution is the Root expression. Because it knows the exact solution, you can specify any desired working precision with N, e.g., N[#, 100]& $\endgroup$
    – Bob Hanlon
    Commented Mar 26, 2020 at 17:51
  • $\begingroup$ @james - Look at poly = x^5 + 2 x + 1; sol = Solve[poly == 0, x]; Table[poly /. (sol // N[#, wp] &), {wp, 50, 110, 20}] $\endgroup$
    – Bob Hanlon
    Commented Mar 26, 2020 at 18:05
  • $\begingroup$ @james: Algebraic numbers represented as Root expressions are well-defined numbers, just like Sqrt[2] is. $\endgroup$
    – John Doty
    Commented Mar 26, 2020 at 19:45
  • 1
    $\begingroup$ @james: It's like Sqrt[2]: if you want an approximate numeric representation, you need an algorithm. But yes, there is the issue that the algorithms for approximating Root objects are more complex and less well known. So, if you need approximate numeric representation, use Mathematica to obtain it. $\endgroup$
    – John Doty
    Commented Mar 26, 2020 at 23:52

Not the answer you're looking for? Browse other questions tagged or ask your own question.