Horner's Method of Synthetic Division
Polynomial division with remainder is a building block for many important algebraic algorithms. Horner's method of synthetic division
provides an efficient means of computing such quotients and remainders.
Given polynomials and in indeterminate , we will compute polynomials
(the quotient) and (the remainder) such that where either or the degree of is smaller than the degree of .
Specifically, the Horner's method table is created as follows:
- List the coefficients of along the top row. These are listed from the leading coefficient down to the trailing coefficient.
- Place 's leading coefficient to the left of 's leading coefficient. [The first row is now completed.]
- Negate the remaining coefficients of and list them (vertically) below 's leading coefficient. [The first column is now completed.]
- Draw a vertical line to the right of the 's data. Draw a horizontal line well below this data. [Note: It is possible to have more rows than the number of coefficients of . Also, it is possible to have less (non-empty) rows than than the number of 's coefficients.]
- In the next (uncompleted) column, sum up the entries in that column and divide by 's leading coefficient. Place this number below the horizontal line at the bottom of that column. [This column is now completed.]
- Take the number we just computed and multiply it by each of the negated coefficients of (this is all of the coefficients of except for the leading coefficient). Place these values in the next available (uncompleted) row. Starting in the next available uncompleted column. [Now this row is completed.]
- This process should continue until our multiples fill a row to its end.
- The remaining entries (below the horizontal line) at the bottom of uncompleted columns are computed by summing the entries in the column above. [This finishes the table.]
The bottom of the table just below the horizontal line is a list of coefficients of the quotient and remainder. The first numbers are the coefficients of the quotient (listed from leading to trailing coefficient) and the remaining numbers are the coefficients of the remainder (also listed from top to bottom).
Note: The polynomials can have coefficients in Sage's "symbolic ring" (i.e. SR). So coefficients such as "1+sqrt(2)" and "5+3*i" are allowed. The Sage code tries to clean up inputs (Ex: It changes (x-1)(x-2) to (x-1)*(x-2) and 3x to 3*x), but it cannot anticipate all syntax errors. As warning, check how your input was interpreted. It may also mis-correct certain inputs.
The computation above is powered by SageMath. The Sage code is embedded in this webpage's html file.
To view the code instruct your browser to show you this page's source.
For example, in Chrome, right-click and choose "View page source".
Wikipedia entry for Horner's method.