A13 · Lesson 8 · Roots of polynomials
Horner's rule, deflation, companion matrices and how sensitive roots are
Polynomials are everywhere in engineering: characteristic equations, filter denominators, the transfer functions of every linear circuit. Finding their roots looks like a special case of lessons 4 to 7, and the methods do carry over, with some twists. A polynomial can be evaluated together with its derivative in one cheap pass. Once a root is found it can be divided out. All the roots can be found at once as the eigenvalues of a matrix. And the roots of a polynomial written out in expanded form can be wildly sensitive to its coefficients, which is why filters are built from small sections instead of one big polynomial.
- The crosses are the roots of : the polynomial with roots at −1 to −8, with ε added to its coefficient, which is 36.
- Raise ε a little. At ε = 0.0005, a change of 0.0014% in that coefficient, the roots at −6 and −7 have already met and split into a complex pair, and the root at −8 has moved to −8.16.
- The roots near −1 hardly move: their sensitivity grows with the size of the root raised to the power of the perturbed term.
Predict
A polynomial's coefficients are rounded to 16 significant digits. Its roots are then computed exactly. How many digits of the roots are correct?
It depends entirely on the polynomial. A well-separated root of a small polynomial keeps nearly all its digits. Clustered or repeated roots, or roots of a high-degree polynomial in expanded form, can lose most of them: Wilkinson's famous example, , has roots that turn complex when one coefficient changes in its tenth digit. That's conditioning, a property of the problem, so no root-finder can fix it.
Name it
Horner's rule
Evaluate as : n multiplications and n additions. Running a second Horner pass on the intermediate values gives in another 2n operations, so a Newton step costs about 4n.
Deflation
The intermediate Horner values are the coefficients of the quotient: . When r is a root, has the remaining roots, so you can find them one by one. Rounding errors build up as you go, so deflate out small roots first and then polish each root with a Newton step on the original p.
All roots at once
- Companion matrix. The roots of are the eigenvalues of the matrix with first row and ones just below the diagonal.
np.rootsworks this way, with the QR algorithm. - Durand–Kerner and Aberth iterate all n approximations together: is Durand–Kerner. Aberth's refinement converges cubically and is what the platform's own s-plane view uses.
Sensitivity
If coefficient changes by δ, a simple root r moves by about
Large roots, high powers and small (roots close together) all make it big. A root of multiplicity m moves by about , far more than δ.
Worked example
Evaluate and at x = 3 with Horner's rule.
Show the solution
- First pass, for . so .
- Second pass on , for . so .
- Check.
- A Newton step from 3.
Answer and , so a Newton step from 3 goes to 2.75.
Worked example
is a root of . Deflate it and find the other roots.
Show the solution
- Horner at 1. and the remainder is .
- The quotient. It is whose roots are 2 and 3.
- With computed roots. Roots that carry small errors leave those errors in the quotient. Polishing each root found from a quotient with one or two Newton steps on the original cubic removes that accumulated error.
Answer the quotient is , so the other roots are 2 and 3.
Worked example
The polynomial has 36 as its coefficient. How far does the root at −8 move if that coefficient becomes 36.0005?
Show the solution
- The derivative at the root.
- The first-order estimate. With :
- The actual roots. Computing the roots directly gives −8.16, and the roots at −6 and −7 have collided and left the real axis as .
- How sensitive that is. A relative change of in one coefficient moved the root at −8 by 2% and the roots at −6 and −7 by about 10%.
- What filter designers do. That's why an eighth-order filter is built as four second-order sections, each with well-conditioned roots, instead of from its expanded polynomial.
Answer the first-order estimate moves the root by −0.21; it actually moves to −8.16, and the roots at −6 and −7 become .
Check
Evaluate at x = 2 with Horner's rule.
Check
What is for at x = −1.5, from the second Horner pass?
Check
The constant term of changes by 0.001. About how far does the root at 2 move?
Check
The monic cubic with roots −1, −3 and −2 has a companion matrix. What is that matrix's trace?
Check
has its constant term changed by 0.0001. About how far do its roots move from 1?
Check
Newton's method approaches a root of multiplicity 5.
(a)
By what factor does each step shrink the error?
(b)
What multiple of the step restores quadratic convergence?
Check
Why are high-order digital and analog filters built as cascades of second-order sections?
Check
Newton's method on .
Step 1
What is p(x), in Horner's nested form?
Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.
Step 2
What is the Newton step's new x?
Check
Find all three roots of at once with the Durand–Kerner iteration , starting from , k = 0, 1, 2, for 100 sweeps (update all three from the old values each sweep). Set roots to their sorted real parts.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Explain why
Why does a root of multiplicity m move by about when a coefficient changes by δ?
Near a root r of multiplicity m, the polynomial behaves like : it's extremely flat, since its first m − 1 derivatives vanish there. Adding δ to a coefficient adds roughly a constant δ near r, so the new roots satisfy , which puts them at distance from r, spread around a circle. For a simple root that distance is proportional to δ, but for a double root it's : a perturbation of moves a double root by about . The flatter the polynomial at its root, the less information its values carry about where the root is.
Practice
Keep practicing
9 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.