Today I learned that Horner method not only computes the value of a polynomial $\displaystyle f(x)$ at a given point $\displaystyle x=a$ but also gives the ratio and the remainder of $\displaystyle f(x)$ and $\displaystyle x-a$.

Let $\displaystyle f_1(x)=2x^4-9x^3+4x^2+21x-18$. We can guess that $\displaystyle x_1=1$ is a root. (See below about how to make an educated guess.) Dividing $\displaystyle f_1(x)$ by $\displaystyle x-1$ gives $\displaystyle f_2(x)=2x^3-7x^2-3x+18$. (Instead of describing this division, I'll describe the next one.) Again by guessing, $\displaystyle x_2=2$ is a root of $\displaystyle f_2(x)$.

To divide $\displaystyle f_2(x)$ by $\displaystyle x-2$, make a table with three rows. The first row consists of the coefficients of $\displaystyle f_2$. The first element of the second row is 0. The third row is the sum of the first two. Therefore, the first element of the third row is 2.

Code:

2 -7 -3 18
0 4 -6 -18
2 -3 -9 0

The second and each subsequent element of the second row is $\displaystyle x_2=2$ times the element of the third row immediately to the left. So, 4 = 2 * 2, -6 = 2 * (-3), and -18 = 2 * (-9). One computes the second and third row simultaneously left to right. The result indicates that the ratio is the polynomial $\displaystyle f_3(x)=2x^2-3x-9$ and the remainder is 0. Now, $\displaystyle f_3(x)=0$ is a quadratic equation.

To make an educated guess about the roots, one can use the rational root theorem. It says that if a rational number $\displaystyle p/q$ (in the lowest terms) is a root of $\displaystyle f(x)$, then $\displaystyle p$ divides the constant term of $\displaystyle f(x)$ and $\displaystyle q$ divides the leading coefficient. So, for $\displaystyle f_2(x)$, all *rational* roots are among $\displaystyle \pm1, \pm2, \pm 3, \pm 6, \pm 9, \pm 18, \pm 1/2, \pm 3/2, \pm 9/2$. Note that the theorem says nothing about irrational roots.