Fundamentals / Numerical mathematics / Nonlinear equations

Existence, brackets and error certificates

Decide whether a scalar balance has a root, isolate it with a sign-changing interval and translate an equation residual into a bound in physical units.

From first principles

Turn a sign change into a location certificate

Suppose \(f\) is continuous on \([a,b]\) and the endpoint values have opposite signs. By the intermediate value theorem at least one zero lies between them. Evaluate the midpoint \(m=(a+b)/2\). If \(f(m)=0\), the equation has been solved. Otherwise exactly one of the two half intervals still has opposite signs at its endpoints. Keep that half and repeat. From an initial width \(w_0=b-a\), the width after \(n\) such updates is

\[\begin{aligned} w_n &= \frac{w_0}{2^n},\\ |m_n-r| &\leq \frac{w_n}{2}=\frac{w_0}{2^{n+1}} \end{aligned}\]

for at least one enclosed root \(r\), where \(m_n\) is the midpoint of the current interval. To target an absolute location error \(\varepsilon>0\), a sufficient number of halvings is

\[n\ge\max\!\left(0,\left\lceil\log_2\frac{w_0}{2\varepsilon}\right\rceil\right).\]

The certificate uses reliable endpoint signs and continuity. A jump can change signs without crossing zero, while a tangential root can exist without changing signs. Monotonicity is optional for existence but can establish that the enclosed root is unique.

Background · Bracket
\[f(a)f(b)<0\]

Continuity is needed to infer a zero between endpoints. A root of even multiplicity may exist without a sign change.

Derivation and applications

Certify the location obtained by intersecting an endpoint secant

A sign bracket guarantees an enclosed root. If derivatives are also bounded, its endpoint secant can produce a sharper certified location without a sequence of additional function evaluations. Assume \(f\in C^2[a,b]\), opposite endpoint signs, \(|f'|\ge m>0\), and \(|f''|\le M\). The derivative cannot change sign on the interval, so there is exactly one root \(r\). Form the line joining the endpoint values and solve it for zero,

\[s=a-\frac{f(a)(b-a)}{f(b)-f(a)},\qquad a<s<b .\]

The line vanishes at \(s\), so the true residual there is exactly the error made by interpolating \(f\) by that line. The two-node interpolation remainder and the mean value theorem applied between \(s\) and \(r\) give successively

\[|f(s)|\le\tfrac12 M(s-a)(b-s),\qquad |f(s)|=|f'(\zeta)|\,|s-r|\ge m|s-r| .\]

Combining the inequalities gives a certified enclosure centred on the proposed root approximation,

\[|s-r|\le\frac{M}{2m}(s-a)(b-s)\le\frac{M}{8m}(b-a)^2 .\]

Intersect this enclosure with the original bracket to retain both guarantees. The constants must hold over the whole interval; an observed derivative at one point supplies neither bound by itself. When the function is linear the curvature bound vanishes and the secant solves the problem exactly.

Worked example

Enclose a square root from two evaluations

For \(f(x)=x^2-2\) on \([1.4,1.5]\), the endpoint values are \(-0.04\) and \(0.25\). The secant gives \(s=1.4137931\). Since \(M=2\) and \(m=2.8\), the sharper bound is

\[(s-1.4)(1.5-s)/2.8=0.000425.\]

The true root \(1.4142136\) indeed differs by \(0.0004205\), and the location guarantee is much tighter than half the original width.

Second application

Determine the bracket width needed for a certificate

Another calibration guarantees \(m=4\) and \(M=3\) throughout the working interval. To certify secant location error \(10^{-4}\), the uniform width criterion gives

\[b-a\le\sqrt{8(4)10^{-4}/3}=0.0327.\]

Starting at width \(0.20\), three bisections give \(0.025\). Its worst secant error is then at most \(3(0.025)^2/32=5.86\times10^{-5}\).

OneSimulation laboratory

Locate the root of an implicit cooling step

Start from this chapter. Use the previous temperature and the ambient temperature as candidate endpoints. Check the residual signs before comparing the numerical solution of the implicit stage.

Compare recorded OneSimulation runs on this page. To test your own inputs, download the Python model and run the model in an activated OneSimulation environment.

The downloadable model takes one backward Euler step with \(C=2\) J/K, \(A=0.3\) m², emissivity 0.5 and a test radiation constant of 0.02 W/(m²·K⁴), giving \(\beta=0.0015\) K⁻³s⁻¹. Its output substitutes the returned temperature into the residual independently. Predict which edit changes the root. Download the Python experiment · OneSimulation implicit cooling comparison.

python nonlinear-equations.py
python nonlinear-equations.py --step 0.05
python nonlinear-equations.py --solver damped
End temperature and discrete residual from a single step.
Step, solverTemperature (K)|F| (K)
1 s, Newton1.97851479065.6 × 10⁻¹⁷
0.05 s, Newton1.99887769133.7 × 10⁻¹⁷
1 s, damped Newton1.97851479065.6 × 10⁻¹⁷
Damping the Newton iteration gives the same converged end temperature at a one-second step. Shortening the step changes the equation and gives a warmer endpoint.
Damping the Newton iteration gives the same converged end temperature at a one-second step. Shortening the step changes the equation and gives a warmer endpoint.

A different step changes both the equation and the observation time. A converged line-search Newton method on the original step recovers the same physical root. To measure time discretisation error, compare solutions on successively finer grids at a common final time.

Change parameters · Change the laboratory inputs

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.

Problem sheet 2 · Distinguish root accuracy from temperature sensitivity

Read the model setup and preparatory problems

A bracket can collapse onto a pole

A measuring circuit returns a signed response as a control coordinate \(x\) traverses the unit interval. Someone proposes logging only the sign and using bisection to locate the point at which the response vanishes. How much can those signs actually certify? Let \(a=\sqrt2/4\). Compare two hypothetical responses \(f(x)=x-a\) and \(g(x)=1/(x-a)\). They have the same sign at every sampled point except the singular coordinate itself. Only the first has a zero. The second is undefined at \(a\) and never vanishes.

Start with endpoints zero and one. On every trial the bisection coordinate, sign decision and resulting interval will be identical for these two responses. This follows by induction: identical current intervals have the same midpoint, the midpoint signs coincide, and the same endpoint is replaced. The shrinking width therefore tracks a crossing in the sign pattern. Continuity on the entire retained interval is the extra information the intermediate value theorem requires to guarantee a zero.

A bounded linear crossing and two disconnected branches of a reciprocal response are shown alongside midpoint residuals and successive bracket widths.Open full-size diagram
Both searches take the same path through parameter space. Their measured response magnitudes evolve in opposite ways. Individual midpoint residuals need not be monotone even though the bracket width always decreases.

Include the amplitude of the response in the notebook's log. At any midpoint \(m\), excluding an exact tie, the product \(|f(m)||g(m)|\) equals one. As the bracket contracts about \(a\), the first magnitude tends to zero and the second grows without bound. If the first residual at a sample is \(2^{-14}\), the reciprocal response there is

\[2^{14}=16384.\]

A software check that accepts only the final width would treat these two very different observations as equally persuasive. A width criterion plus a scaled residual supplies stronger evidence, but finite samples alone cannot establish continuity for a completely unknown device between measurements.

In a physical instrument saturation may hide the growing amplitude. Then inspect the forward model and its domain: a quotient can change sign when its denominator passes through zero. Record the numerator, denominator, clipping events and units separately where possible. Scaling a residual by a quantity that also diverges can disguise the singularity a second time. A well-designed stopping test makes its assumptions about observability explicit.

A discontinuity also has consequences for existence guarantees based on intervals. If a constitutive law supplies an excluded denominator interval or explicitly brackets an undefined point, split the physical domain there before asking a root finder to operate. This small piece of model knowledge is stronger than an arbitrarily long list of sign samples.

Suppose one accepts whenever the bracket width is below \(10^{-5}\). How many halvings suffice on a unit interval, and what follows for the reciprocal model at the midpoint of that final bracket?

Work through the solution

Seventeen halvings make the width \(2^{-17}\simeq7.63\cdot10^{-6}\). Since \(a\) remains in the interval, its distance to the midpoint is at most half the remaining width. Thus the reciprocal response has magnitude at least \(2^{18}\), unless the midpoint exactly hits the undefined point. A tiny horizontal uncertainty has here located a singularity with high precision.

Change parameters · Explore this notebook example

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.

Establish the meaning of a root

A source supplies heat at a known rate, while a cooling surface loses heat at a rate that increases with temperature. A steady state equates the two rates. Writing generation minus loss as \(F(T)\) turns a physical balance into one scalar equation. Before selecting a numerical method, specify an admissible temperature interval and state which assumptions make the relation continuous there. A temperature-dependent material table with a discontinuous switch may require separate treatment of each regime.

If \(F\) is continuous and \(F(a)F(b)<0\), the intermediate value theorem guarantees at least one root in \((a,b)\). It does not count the roots. If \(F'\) has one strict sign throughout, the function is strictly monotonic and the root is unique. An even-multiplicity root can touch zero without changing sign, as \(F(x)=(x-1)^2\) does. Conversely, a sign change across the pole of \(1/x\) guarantees nothing. An interval and its regularity assumptions are part of the mathematical answer.

Evaluate the midpoint \(m=(a+b)/2\). If \(F(m)=0\) the machine has found a zero of its evaluated residual. Otherwise keep the half whose endpoint values have opposite signs. Continuity carries the existence argument through each subdivision. After \(n\) halvings the width is \(2^{-n}(b-a)\), so the midpoint has distance at most \(2^{-(n+1)}(b-a)\) from a root. A predetermined number of evaluations can therefore guarantee a target error in the independent variable even for an unknown local slope.

For \(F(x)=x^3+x-1\) on \([0,1]\), the derivative \(3x^2+1\) is positive, while the endpoints have opposite signs. Test \(0.5\), giving \(-0.375\), and keep \([0.5,1]\). Testing 0.75 gives \(0.171875\), narrowing the bracket to \([0.5,0.75]\). The next midpoint 0.625 gives approximately \(-0.13086\), hence \([0.625,0.75]\). After ten halvings the midpoint is guaranteed within \(1/2048\), independent of how the subsequent signs turn out. A function evaluation whose uncertainty covers zero cannot safely be classified as strictly positive or negative without additional information.

Translate a balance into a physical uncertainty

Let \(r\) be the root and suppose \(|F'|\geq m>0\) on a bracket containing both \(r\) and a candidate \(x\). By the mean value theorem \(F(x)-F(r)=F'(\xi)(x-r)\), so \(|x-r|\leq|F(x)|/m\). For the cubic, \(m=1\) is valid globally, and within \([0.625,0.75]\) the sharper bound \(m=1+3(0.625)^2\) applies. A balance mismatch can thus yield an informative location estimate when the slope is well separated from zero.

Suppose instead the residual of a thermal balance is expressed in watts and its slope is at least 2 W/K. A 0.1 W mismatch guarantees at most 0.05 K error under the exact model. Reporting a temperature tolerance of 0.1 solely from that residual would silently change units. Near a fold the slope can become arbitrarily small, so a tiny mismatch can coexist with substantial uncertainty about the state. In that case report the bracket, measurement uncertainty and nearby alternatives along with the small residual.

Calibrate the stop against a noisy measurement

Suppose temperatures 300 K and 302 K bracket a steady heat balance, and the residual slope is known to exceed 4 W/K. The net power sensor is accurate only to ±0.2 W. A reported mismatch of +0.1 W may have either sign, so it cannot safely choose a half-interval. Its magnitude plus the uncertainty is at most 0.3 W, however. The slope bound then implies distance at most 0.075 K from the exact balance under the model.

This gives two ways to use the same observation. If its error interval excludes zero, the sign can tighten a bracket. If it includes zero, a magnitude bound can still constrain the root location. A stopping rule that requires a residual below the instrument’s resolution might keep iterating without improving the physical estimate. Decide the temperature accuracy of interest first, then choose an appropriate balance test.

Background · What does a sign test mean at an instrument’s resolution?

A calibrated instrument reports residual \(m(x)\) with a guaranteed absolute error at most \(\eta\). A positive report establishes a positive physical residual only if \(m(x)-\eta>0\). A certified bracket therefore uses intervals whose entire sign is known. If an interior interval contains zero, assigning its sign from the midpoint alone can discard the true root.

For a continuously differentiable monotone residual with \(|f'|\geq s>0\) between the candidate and a known root, the mean-value theorem also supplies a distance estimate:

\[|x-x_*|\leq\frac{|m(x)|+\eta}{s}.\]

This estimate explains why requesting more digits from bisection cannot settle a flat, noisy balance. Repeating observations may reduce random error; a guaranteed calibration offset needs independent information.

Preserve a bracket while using slope information

A secant through the two endpoints of a sign-changing bracket usually crosses the axis at a more informative location than the midpoint. For continuous \(f\), opposite signs at \(a,b\) place the linear-interpolant root \(c=[af(b)-bf(a)]/[f(b)-f(a)]\) strictly inside the bracket. Replace whichever endpoint has the same sign as \(f(c)\). This false-position iteration preserves existence just as bisection does. It differs in one significant respect: without a further safeguard, the retained bracket width need not shrink by a prescribed factor.

Suppose \(f\) is strictly increasing and convex and has root \(r\). Its chord lies above the graph. At the chord root \(c\), therefore, \(f(c)\le0\), which places \(c\le r\). Every false-position update may replace the lower endpoint while leaving the upper one fixed. The false-position estimates themselves can still approach the root. But a stopping rule requiring a narrow bracketing interval can then fail to terminate. The distinction separates convergence of a point estimate from convergence of both bounds in a certified interval.

For \(f(x)=x^{10}-1\) on \([0,2]\), the endpoint values are −1 and 1023. The first false-position estimate is \(2/1024=1/512\), with function value indistinguishable from −1 to ordinary displayed precision. The second estimate lies near \(1/512+(2-1/512)/1024\approx0.003904\), although the true root is one. Both steps satisfy the strict interior condition; neither meaningfully resolves the enormous function variation near the right endpoint. Bisection happens to land exactly on the root here, making the consequences of this imbalance especially easy to measure.

One safeguard accepts a secant candidate only if it lies in the central half of the current bracket. Otherwise it takes the midpoint. With exact reliable signs, accepting any point between the one-quarter and three-quarter positions guarantees the retained width is at most three quarters of its old value. A midpoint fallback cuts it in half. Thus after \(k\) accepted or fallback steps the bracket width is bounded by \((3/4)^k(b-a)\), whether or not the slope model reflects the underlying function.

To test the policy away from this exact midpoint coincidence, shift the equation to \(x^{10}-1.1=0\) on the same interval. The initial chord estimate becomes \(2(1.1)/1024\), below the central half, so the method takes one and obtains residual −0.1. The next bracket is \([1,2]\), immediately discarding the whole range of tiny false-position candidates. A steeply varying function still calls for careful arithmetic in forming the chord, especially if endpoint values approach overflow. If field measurements cannot determine the sign at an accepted point, none of these purely geometric safeguards certifies which side to retain.

The shifted root is \(1.1^{1/10}\approx1.00958\), so the first midpoint is already close despite keeping a relatively wide bracket. This again separates observed point accuracy from the available certificate. Subsequent safeguarded steps can tighten the certificate without relying on advance knowledge of this exact value.

Compare a midpoint’s actual error with its certificate

Bracket the positive root of \(x^3-2\) on [1,2]. At each step record both the midpoint’s distance to the analytic cube root and the half-width of the current sign-changing interval. Only the latter is known in a general application.

Compare a midpoint’s actual error with its certificate. Horizontal axis: Bisection step, starting at zero. Vertical axis: Absolute root error. Data follow the figure.
The half-width halves at every update. The actual error can rise after a lucky midpoint; selecting the smallest observed residual from a few iterates is a different stopping rule from certifying an interval.
Read values from the plot
Absolute root error at selected values of Bisection step, starting at zero.
Bisection step, starting at zeroCertified half-widthActual midpoint error
00.50.24008
30.06250.052579
60.00781250.0021085
100.000488280.00033286
136.1035e−52.7681e−5

Download all 14 plotted samples (CSV)

Change parameters · Compare a midpoint’s actual error with its certificate

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.