Module

for

Horner's Method

     

Evaluation of a Polynomial
    
    Let the polynomial [Graphics:Images/HornerMod_gr_1.gif] of degree n have coefficients [Graphics:Images/HornerMod_gr_2.gif].  Then [Graphics:Images/HornerMod_gr_3.gif] has the familiar form  

        [Graphics:Images/HornerMod_gr_4.gif]

Horner's method (or synthetic division) is a technique for evaluating polynomials.  It can be thought of as nested multiplication.  For example, the fifth-degree polynomial

        [Graphics:Images/HornerMod_gr_5.gif]

can be written in the "nested multiplication" form

        [Graphics:Images/HornerMod_gr_6.gif].  

Exploration

 

Theorem (Horner's Method for Polynomial Evaluation)  Assume that

(1)        [Graphics:Images/HornerMod_gr_21.gif]

and   [Graphics:Images/HornerMod_gr_22.gif]  is a number for which [Graphics:Images/HornerMod_gr_23.gif] is to be evaluated.  Then [Graphics:Images/HornerMod_gr_24.gif] can be computed recursively as follows.  

(2)        Set   [Graphics:Images/HornerMod_gr_25.gif],  
    and
             [Graphics:Images/HornerMod_gr_26.gif]    for    [Graphics:Images/HornerMod_gr_27.gif].  

Then    [Graphics:Images/HornerMod_gr_28.gif].  

Moreover, the coefficients  [Graphics:Images/HornerMod_gr_29.gif]  can be used to construct  [Graphics:Images/HornerMod_gr_30.gif]  and  [Graphics:Images/HornerMod_gr_31.gif]

(3)        [Graphics:Images/HornerMod_gr_32.gif]  
    and    
(4)        [Graphics:Images/HornerMod_gr_33.gif],  

where  [Graphics:Images/HornerMod_gr_34.gif]  is the quotient polynomial of degree  n-1  and  [Graphics:Images/HornerMod_gr_35.gif]  is the remainder.  

Proof  Horner's Method  Horner's Method  

 

Example 1.  Use synthetic division (Horner's method) to find [Graphics:Images/HornerMod_gr_36.gif] for the polynomial
        [Graphics:Images/HornerMod_gr_37.gif].  
Solution 1.

 

Heuristics
    
    In the days when "hand computations" were necessary, the Horner tableau (or table) was used.  The coefficients  [Graphics:Images/HornerMod_gr_50.gif]  of the polynomial are entered on the first row in descending order, the second row is reserved for the intermediate computation step  ([Graphics:Images/HornerMod_gr_51.gif])  and the bottom row contains the coefficients  [Graphics:Images/HornerMod_gr_52.gif]  and  [Graphics:Images/HornerMod_gr_53.gif].

 

[Graphics:Images/HornerMod_gr_54.gif]

 

 

Example 2.  Use the "Horner tableau" to find [Graphics:Images/HornerMod_gr_55.gif] for the polynomial
        [Graphics:Images/HornerMod_gr_56.gif].  
Solution 2.

 

Lemma (Horner's Method for Derivatives)  Assume that

        [Graphics:Images/HornerMod_gr_74.gif]  

and [Graphics:Images/HornerMod_gr_75.gif] is a number for which [Graphics:Images/HornerMod_gr_76.gif] and  [Graphics:Images/HornerMod_gr_77.gif] are to be evaluated.  We have already seen that [Graphics:Images/HornerMod_gr_78.gif] can be computed recursively as follows.  

        [Graphics:Images/HornerMod_gr_79.gif],   and  
        [Graphics:Images/HornerMod_gr_80.gif]    for    [Graphics:Images/HornerMod_gr_81.gif].  

The quotient polynomial [Graphics:Images/HornerMod_gr_82.gif] and remainder [Graphics:Images/HornerMod_gr_83.gif] form the relation
    
        [Graphics:Images/HornerMod_gr_84.gif].  

We can compute [Graphics:Images/HornerMod_gr_85.gif] can be computed recursively as follows.  

(i)        [Graphics:Images/HornerMod_gr_86.gif],    and   
           [Graphics:Images/HornerMod_gr_87.gif]    for    [Graphics:Images/HornerMod_gr_88.gif].  

The quotient polynomial  [Graphics:Images/HornerMod_gr_89.gif]  
and remainder  [Graphics:Images/HornerMod_gr_90.gif]  form the relation

(ii)        [Graphics:Images/HornerMod_gr_91.gif].  

The Horner tableau (or table) was used for computing the coefficients is given below.  

 

[Graphics:Images/HornerMod_gr_92.gif]

Proof  Horner's Method  Horner's Method  

 

Example 3.  Use synthetic division (Horner's method) to find [Graphics:Images/HornerMod_gr_93.gif] for the polynomial
        [Graphics:Images/HornerMod_gr_94.gif].  
Solution 3.

 

Using vector coefficients

    As mentioned above, it is efficient to store the coefficients  [Graphics:Images/HornerMod_gr_109.gif]  of a polynomial  [Graphics:Images/HornerMod_gr_110.gif] of degree n in the vector  [Graphics:Images/HornerMod_gr_111.gif].  Notice that this is a shift of the index for [Graphics:Images/HornerMod_gr_112.gif] and the polynomial  [Graphics:Images/HornerMod_gr_113.gif]  is written in the form  
    
        [Graphics:Images/HornerMod_gr_114.gif].  
        
Given the value  [Graphics:Images/HornerMod_gr_115.gif],  the recursive formulas for computing the coefficients  [Graphics:Images/HornerMod_gr_116.gif]  and [Graphics:Images/HornerMod_gr_117.gif]  of   [Graphics:Images/HornerMod_gr_118.gif] and [Graphics:Images/HornerMod_gr_119.gif], have the new form

        [Graphics:Images/HornerMod_gr_120.gif]    
           [Graphics:Images/HornerMod_gr_121.gif]    for    [Graphics:Images/HornerMod_gr_122.gif].  

        [Graphics:Images/HornerMod_gr_123.gif]    
        [Graphics:Images/HornerMod_gr_124.gif]    for    [Graphics:Images/HornerMod_gr_125.gif].  

Then        [Graphics:Images/HornerMod_gr_126.gif]      

 

Example 4.  Use the Horner's method with vector coefficients to calculate [Graphics:Images/HornerMod_gr_127.gif] and [Graphics:Images/HornerMod_gr_128.gif] for the polynomial
        [Graphics:Images/HornerMod_gr_129.gif].  
Use these values to perform one step in Newton's method for approximating a root using the initial approximation  [Graphics:Images/HornerMod_gr_130.gif].  
Solution 4.

 

Newton-Horner method
    
    Assume that [Graphics:Images/HornerMod_gr_151.gif] is a polynomial of degree [Graphics:Images/HornerMod_gr_152.gif] and there exists a number [Graphics:Images/HornerMod_gr_153.gif], where [Graphics:Images/HornerMod_gr_154.gif].  If   [Graphics:Images/HornerMod_gr_155.gif], then there exists a [Graphics:Images/HornerMod_gr_156.gif] such that the sequence [Graphics:Images/HornerMod_gr_157.gif] defined by the Newton-Raphson iteration formula

        [Graphics:Images/HornerMod_gr_158.gif]    for    [Graphics:Images/HornerMod_gr_159.gif]  

will converge to  r  for any initial approximation  [Graphics:Images/HornerMod_gr_160.gif].  The recursive formulas in the Lemma can be adapted to compute  [Graphics:Images/HornerMod_gr_161.gif]  and  [Graphics:Images/HornerMod_gr_162.gif]  and the resulting Newton-Horner iteration formula looks like

        [Graphics:Images/HornerMod_gr_163.gif]    for    [Graphics:Images/HornerMod_gr_164.gif]  

 

Algorithm (Newton-Horner Iteration).  To find a root of  [Graphics:Images/HornerMod_gr_165.gif]  given an initial approximation  [Graphics:Images/HornerMod_gr_166.gif]  using the iteration  

    [Graphics:Images/HornerMod_gr_167.gif]   for    [Graphics:Images/HornerMod_gr_168.gif].

Computer Programs  Newton-Horner Method  Newton-Horner Method  

Mathematica Subroutine (Newton-Horner Iteration).

[Graphics:Images/HornerMod_gr_169.gif]

Mathematica Subroutine (Newton-Raphson Iteration).

[Graphics:Images/HornerMod_gr_170.gif]

Example 5.  Use the Newton-Horner's subroutine and the starting value [Graphics:Images/HornerMod_gr_171.gif] to find a root of the polynomial
        [Graphics:Images/HornerMod_gr_172.gif].  
Run the Newton-Raphson subroutine and compare the two results (they should be close).
Solution 5.

 

Example 6.  Compare the Horner method and ordinary method of polynomial evaluation for
[Graphics:Images/HornerMod_gr_179.gif]  
Solution 6.

 

Lemma (Horner's Method for Higher Derivatives)  Assume that the coefficients  [Graphics:Images/HornerMod_gr_199.gif]  of a polynomial  [Graphics:Images/HornerMod_gr_200.gif] of degree n are stored in the first row of the matrix  [Graphics:Images/HornerMod_gr_201.gif].  Then the polynomial  [Graphics:Images/HornerMod_gr_202.gif]  can written in the form  
    
        [Graphics:Images/HornerMod_gr_203.gif].  
        
Given the value  [Graphics:Images/HornerMod_gr_204.gif],  the subroutine for computing all the derivatives  [Graphics:Images/HornerMod_gr_205.gif]  is

        [Graphics:Images/HornerMod_gr_206.gif]

    and

        [Graphics:Images/HornerMod_gr_207.gif]    for    [Graphics:Images/HornerMod_gr_208.gif].  

 

Example 7.  Use the Horner's method for higher derivatives to calculate all the derivatives  [Graphics:Images/HornerMod_gr_209.gif]  for the polynomial
        [Graphics:Images/HornerMod_gr_210.gif].  
Solution 7.

 

 

Polynomial Deflation

    Given the polynomial  [Graphics:Images/HornerMod2_gr_1.gif]  in example 5,  the iteration

        [Graphics:Images/HornerMod2_gr_2.gif]

will converge to the root  [Graphics:Images/HornerMod2_gr_3.gif]  of  [Graphics:Images/HornerMod2_gr_4.gif].  The Mathematica command NewtonHorner[3.0,6] produces the above sequence, then the quotient polynomial   [Graphics:Images/HornerMod2_gr_5.gif]  is constructed with the command  [Graphics:Images/HornerMod2_gr_6.gif].  
[Graphics:Images/HornerMod2_gr_7.gif]

[Graphics:Images/HornerMod2_gr_8.gif]

The root stored in the computer is located in the variable  r1.  

[Graphics:Images/HornerMod2_gr_9.gif]
[Graphics:Images/HornerMod2_gr_10.gif]

The coefficients of  Q[x]  printed above have been rounded off.  Actually there is a little bit of round off error in the coefficients forming   [Graphics:Images/HornerMod2_gr_11.gif],  we will have to dig them out to look at them.

[Graphics:Images/HornerMod2_gr_12.gif]

[Graphics:Images/HornerMod2_gr_13.gif]

[Graphics:Images/HornerMod2_gr_14.gif]

[Graphics:Images/HornerMod2_gr_15.gif]

Now we have a computer approximation for the factorization  [Graphics:Images/HornerMod2_gr_16.gif].  

[Graphics:Images/HornerMod2_gr_17.gif]

[Graphics:Images/HornerMod2_gr_18.gif]

We should carry out one more step in the iteration using the command  NewtonHorner[3.0,7]  and get a more accurate calculation for the coefficients of  [Graphics:Images/HornerMod2_gr_19.gif].   When this is done the result will be:

        [Graphics:Images/HornerMod2_gr_20.gif]
    
        [Graphics:Images/HornerMod2_gr_21.gif]

If the other roots of  [Graphics:Images/HornerMod2_gr_22.gif]  are to be found, then they must be the roots of the quotient polynomial  [Graphics:Images/HornerMod2_gr_23.gif].   The polynomial  [Graphics:Images/HornerMod2_gr_24.gif]  is referred to as the deflated polynomial, because its degree is one less than the degree of  [Graphics:Images/HornerMod2_gr_25.gif].  For this example it is possible to factor   [Graphics:Images/HornerMod2_gr_26.gif]  as the product of two quadratic polynomials  [Graphics:Images/HornerMod2_gr_27.gif].  Therefore, [Graphics:Images/HornerMod2_gr_28.gif]  has the factorization
    
        [Graphics:Images/HornerMod2_gr_29.gif],  

and the five roots of    [Graphics:Images/HornerMod2_gr_30.gif]  are  

        [Graphics:Images/HornerMod2_gr_31.gif].  

This can be determined by using Mathematica and the command Factor.

[Graphics:Images/HornerMod2_gr_32.gif]

[Graphics:Images/HornerMod2_gr_33.gif]

This still leaves some unanswered questions that we will answer in other modules.  The quadratic factors can be determined using the Lin-Bairstow method.  Or if one prefers complex arithmetic, then Newton's method can be used.  For example, starting with the imaginary number  [Graphics:Images/HornerMod2_gr_34.gif]  Newton's method will create a complex sequence converging to the complex root  [Graphics:Images/HornerMod2_gr_35.gif]  of  [Graphics:Images/HornerMod2_gr_36.gif].  

[Graphics:Images/HornerMod2_gr_37.gif]


[Graphics:Images/HornerMod2_gr_38.gif]

However, starting with purely imaginary number  [Graphics:Images/HornerMod2_gr_39.gif]  will create a divergent sequence.   

[Graphics:Images/HornerMod2_gr_40.gif]


[Graphics:Images/HornerMod2_gr_41.gif]

For cases involving complex numbers the reader should look at the Lin-Bairstow and the Fundamental Theorem of Algebra modules.   

 

 

Getting Real Roots

    The following example illustrates polynomial deflation and shows that the order in which the roots are located could be important.  In light of example 6 we know that better calculations are made for evaluating [Graphics:Images/HornerMod2_gr_42.gif] when  x  is small.  The Newton-Horner subroutine is modified to terminate early if  [Graphics:Images/HornerMod2_gr_43.gif] evaluates close to zero (when a root is located).

 

Mathematica Subroutine (Newton-Horner Iteration).

[Graphics:Images/HornerMod2_gr_44.gif]

Example 8.  Use the Newton-Horner method and find all the real roots of the polynomial  
[Graphics:Images/HornerMod2_gr_45.gif]  
Solution 8.

 

Research Experience for Undergraduates

Horner's Method  Horner's Method  Internet hyperlinks to web sites and a bibliography of articles.  

 

Download this Mathematica Notebook Horner's Method

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2004