TITLE: Quick doubt on converting a decimal to a fraction
QUESTION [12 upvotes]: I'm trying to solve a problem that requires me to find the roots of the equation
$$-x^4+10x^2-x-20=0$$
By making use of Newton's method, symbolab's equation calculator has found one root to be 

$x\approx -2.79129... : x=-\frac{\sqrt{21}+1}{2}$

My question is pretty basic, actually: how did they convert the decimal number on the left to the neat faction on the right? I couldn't get to it the way I've learned to convert decimals. Thanks very much in advance.

REPLY [4 votes]: Bit late; I would emphasize that we can factor the polynomial ourselves, and this one is not difficult. We check that there are no rational roots. After that, we need only try integer constants $a,b,c,d$ with
$$ (x^2 + ax + b)(x^2 + cx + d) = x^4 + (a+c)x^3 + \cdots  $$
Since we are trying to get $x^4 - 10 x^2 + x + 20,$ we see that $c+a = 0.$
$$ (x^2 + ax + b)(x^2 -ax + d) = x^4 + (b+d - a^2)x^2 + a(d-b)x + bd.  $$ 
From $a(d-b)= 1$ we have $a = \pm 1.$ Both work, they just switch $b,d.$
First, $a=1$ gives
$$ (x^2 + x + b)(x^2 -x + d) = x^4 + (b+d - 1)x^2 + (d-b)x + bd,  $$
so $b+d = -9, d - b = 1.$ Then $2d = -8,$ $d= -4,$ $b=-5,$ and we check
$$ (x^2 + x -5)(x^2 -x -4) = x^4 -10 x^2 + x + 20.  $$
Repeat:  YOU CAN DO THIS