Fundamentals / Numerical mathematics / Nonlinear equations

Polynomial roots and coefficient sensitivity

Evaluate a polynomial and its derivative in one sweep, then estimate how far a coefficient error can move a simple root.

From first principles

Derive the change in a simple root from coefficient errors

Let \(p(x)=\sum_{j=0}^n a_j x^j\) have a simple real or complex root \(r\), meaning \(p'(r)\ne0\). Change the coefficients by small amounts \(\delta a_j\), and suppose the root changes continuously to \(r+\delta r\). Keeping first-order terms in the perturbed root equation gives

\[0\simeq p(r)+p'(r)\delta r+\sum_{j=0}^n\delta a_jr^j,\]
\[\delta r\simeq-\frac{\sum_j\delta a_jr^j}{p'(r)} .\]

For a factored polynomial the derivative at a simple root has a direct interpretation,

\[p'(r_i)=a_n\prod_{j\ne i}(r_i-r_j).\]

Nearby roots can make this derivative small and the inferred root sensitive to modest coefficient uncertainty. The relation is a local estimate, with coefficient sizes and variable units affecting what counts as a small perturbation. At an exactly repeated root the derivative vanishes and the first-order expression cannot be used.

Derivation and applications

Measure a computed polynomial root against its coefficient budget

A raw polynomial residual can be changed by multiplying every coefficient by the same constant. A more informative diagnostic asks how much the specified coefficients must change to make the reported root exact. Consider a polynomial \(p(x)=\sum_{j=0}^na_jx^j\), a trial real root \(z\), and admissible coefficient changes \(|\delta a_j|\le\eta w_j\), with nonnegative weights \(w_j\) chosen from measurement tolerances. Requiring \(z\) to solve the perturbed equation gives

\[\sum_j\delta a_j z^j=-p(z),\qquad |p(z)|\le\eta\sum_jw_j|z|^j .\]

For real data and real trial root, each term can be aligned in sign against the residual. If the denominator is positive, scaling those aligned perturbations simultaneously attains equality. The smallest admissible coefficient multiplier is therefore

\[\eta_*=\frac{|p(z)|}{\sum_jw_j|z|^j}.\]

A zero weight freezes the corresponding coefficient; taking \(w_j=|a_j|\) tests componentwise relative backward error. To compare this diagnostic with a forward root error, linearize about the trial value provided \(p'(z)\ne0\) and higher terms are small,

\[r-z\simeq-\frac{p(z)}{p'(z)} .\]

A small coefficient backward error and large root displacement can coexist near a multiple root. Conversely, an accurately approximated location can appear to have a large raw residual when all coefficients carry a large common scale. This sign construction must be reconsidered if a complex trial root is tested using only real coefficient perturbations.

Worked example

Compute a scale-invariant certificate for a trial root

For \(p(x)=x^2-3x+2\), take \(z=1.01\) and \(w_j=|a_j|\). The residual is \(-0.0099\); the denominator is

\[1.0201+3.03+2=6.0501.\]

The backward error is \(0.00164\), despite the \(0.010\) location error relative to the root at one. Multiplying the polynomial and all its weights by 1000 leaves the ratio unchanged.

Second application

Test which coefficient is actually uncertain

For a different polynomial \(p(x)=x^2-4\), suppose only the constant term can be adjusted, with tolerance \(0.020\). The trial \(z=2.01\) gives \(p(z)=0.0401\). Its required tolerance multiplier is \(0.0401/0.020=2.005\), so it falls outside the specified data envelope. Indeed the constant would have to move from \(-4\) to \(-4.0401\), which directly checks the diagnostic.

A root belongs to a set of coefficients

Write \(p(x)=a_nx^n+\cdots+a_0\) and suppose a simple real root \(r\) satisfies \(p'(r)\ne0\). Perturb the coefficients and write the displaced root as \(r+\delta r\). Keeping first-order terms in the equation gives

\[p'(r)\delta r+\sum_{j=0}^n\delta a_j r^j=0.\]

Consequently the effect of a given coefficient error depends on both the slope at the root and the size of the corresponding power. An evaluation routine can be backward accurate and still return an uncertain root when the input coefficients are insufficiently precise.

For \(p=(x-1)(x-1.01)=x^2-2.01x+1.01\), the derivative at 1 is \(-0.01\). Increasing the constant coefficient by \(10^{-6}\) moves this root upward by approximately \(10^{-4}\). The exact perturbation is easier to see by completing the square:

\[p=(x-1.005)^2-0.000025.\]

The new lower root is \(1.005-\sqrt{0.000024}\approx1.00010102\). The first-order estimate captures the direction and scale. A coefficient change of \(0.000025\) merges the roots; a larger upward change removes both real roots.

Carry derivative information through Horner evaluation

Collect the polynomial as a sequence of nested multiply-add operations starting with \(b=a_n\). Appending the next coefficient replaces \(b\) by \(xb+a_j\). Differentiating that operation shows that a derivative accumulator \(d\) must be replaced by \(xd+b\), where \(b\) is its old value. Starting \(d=0\) and updating it before updating \(b\) yields \(p(x)\) and \(p'(x)\) without forming high powers. For \(x^3-3x+1\) at \(x=2\), the successive values of \(b\) are \(1,2,1,3\) and the derivative accumulator ends at 9. A Newton step gives \(2-3/9=5/3\).

Operation count alone says little about cancellation: near a root, large terms can subtract to produce a tiny value. A scale for the accumulated terms is \(s(x)=\sum|a_j||x|^j\), also computable by a Horner sweep. Reporting \(|p(x)|/s(x)\) when the denominator is nonzero measures how small a relative componentwise coefficient change could explain that residual. Dividing by the slope provides an approximate forward correction for a simple isolated root.

The cost of removing a root

Dividing the polynomial by \(x-\hat r\) after locating one root reduces subsequent work. Synthetic division leaves a remainder \(p(\hat r)\). Discarding it changes the equations for every remaining root. In the close-pair example, using \(\hat r=1.001\) produces quotient \(x-1.009\) and remainder \(-0.000009\). The remaining estimate shifts by the same 0.001 magnitude. Recheck candidate roots against the original polynomial; where coefficients represent uncertain measurements, a range of compatible roots can communicate more information than many printed digits.

Choose a formula by the size of the root

For \(x^2-10^8x+1=0\), the usual formula for the small root subtracts two numbers close to \(10^8\). Rounding in their last digits can dominate the small difference. Compute the large root instead by adding the positive square root and dividing by two. The product of the two roots is one, so the small root follows as its reciprocal, approximately \(10^{-8}\). This change removes a source of arithmetic cancellation. Whether the underlying coefficients determine the desired root accurately can then be assessed separately using the derivative-based sensitivity formula.

Count real roots before iterating on their locations

A sign change between two endpoints certifies an odd number of crossings for a polynomial when all roots in the interval are simple. It does not show whether the number is one or three. A Sturm sequence begins with the polynomial \(p_0\) and its derivative \(p_1\), then repeatedly sets \(p_{j+1}\) to the negative remainder from dividing \(p_{j-1}\) by \(p_j\), stopping at a constant for a square-free polynomial. For a real test value \(x\), count sign changes in the sequence of evaluated values, skipping zero entries. The decrease in this count between two nonroot endpoints equals the number of distinct roots between them.

The signs can change count only when some sequence member crosses zero. For an intermediate member, the remainder relation at its zero makes its two neighbours opposite in sign; the sign-change count across that triple is one on both sides. At a simple zero of the original polynomial, the next member is its nonzero derivative. Immediately to the left the polynomial has opposite sign to its derivative, and immediately to the right it has the same sign. The count therefore decreases by exactly one. These observations explain why the negative remainder sign and the assumption on multiple roots matter.

Isolate three roots of a cubic without choosing Newton starts

Take \(p=x^3-3x+1\) and \(p'=3x^2-3\). Dividing the cubic by the derivative leaves remainder \(-2x+1\), so use \(p_2=2x-1\). The remainder of \(p'\) on division by \(p_2\) equals its value at \(x=1/2\), namely \(-9/4\), producing final positive constant \(9/4\). At \(x=-2\) the signs are \((-,+,-,+)\), giving three variations. At \(x=2\) all entries are positive and the count is zero. The cubic therefore has exactly three roots in \((-2,2)\), a more informative conclusion than the change of sign of \(p\) alone.

At \(x=-1\), the sequence is positive, zero, negative, positive; ignoring the zero gives two variations. At zero its signs are \((+,-,-,+)\), also two. At \(x=1\) the signs are negative, zero, positive, positive, giving one variation. It follows that \((-2,-1)\), \((0,1)\) and \((1,2)\) each contain a single root, whereas \((-1,0)\) contains none. Bisection or safeguarded Newton can now refine each isolating interval without ambiguity about missing another real root.

For a polynomial represented by rounded measured coefficients, this count addresses the specific polynomial actually supplied. Near a repeated root, small coefficient changes can alter the number of real roots. Exact rational arithmetic or certified sign enclosures may be needed if sequence values are close to zero; evaluating a delicate remainder sequence with ordinary rounding cannot by itself certify the sign variations of the intended polynomial.

As a check on isolation, the candidate intervals account for all three roots allowed by the degree. Further sign-preserving splits in the empty interval can never uncover a real root there. This accounting reduces the risk of reporting the same attractive Newton root twice while missing a separate crossing.

Compare a simple and a repeated root under coefficient error

Start with a polynomial whose target root is at one. In both examples subtract the same small positive constant \(\delta\); select the perturbed root above one. Use a rationalised expression for the simple-root displacement to avoid subtracting close floating-point numbers.

Compare a simple and a repeated root under coefficient error. Horizontal axis: Magnitude of constant-coefficient perturbation. Vertical axis: Displacement of root near one. Data follow the figure.
At a coefficient change of 10⁻⁶ the double-root displacement is 10⁻³, while the simple-root displacement is about 5×10⁻⁷. A tiny polynomial residual is particularly weak evidence about location near a multiple root.
Read values from the plot
Displacement of root near one at selected values of Magnitude of constant-coefficient perturbation.
Magnitude of constant-coefficient perturbationDouble root, (x−1)² = δSimple root, (x−1)(x+1) = δ
1e−93.1623e−55e−10
1e−70.000316235e−8
1e−50.00316235e−6
0.0010.0316230.00049988
0.10.316230.048809

Download all 241 plotted samples (CSV)

Change parameters · Compare a simple and a repeated root under coefficient error

Change one input at a time and compare the recalculated curves with the argument above. The browser evaluates this small model locally; the accompanying numerical values state its assumptions and reference checks. Reset restores the reference inputs, and the data can be downloaded as CSV.

Study the full derivation

Count enclosed zeros with a contour before locating them · Nonlinear systems and iterative methods

A complex residual may have several nearby zeros whose Newton basins are hard to distinguish. Use the argument principle to count them, contour moments to estimate their locations and an independent perturbation test to certify a root cluster.