Root-Finding Algorithms
00 · Symbol Glossary
A number satisfying . The algorithms of this chapter build a sequence meant to converge to some . A root is simple when is differentiable there and .
A closed interval on which a continuous changes sign, so the intermediate-value theorem supplies at least one root inside. Bisection replaces the bracket by one of its halves and never lets the sign change escape.
A rewriting of as "the number equals its own image under ." The associated iteration is the map . Different rewritings of the same equation are different maps.
A number such that for all in the interval under study. When , is a contraction: it pulls points closer together by at least the factor .
The next guess is the place where the tangent line to at crosses the horizontal axis. Calculus 05 drew that tangent. This chapter studies the speed of the resulting sequence, and the ways the step can fail.
The error has order with asymptotic constant when with . Order is linear convergence and then requires . Order is quadratic convergence.
How far still sits from . A small residual is one of three stopping tests in this chapter. It measures the equation, which is a different number from the distance .
The positive integer such that with continuous and . Simple roots have . For the Newton map converges more slowly, at linear rate for a pure power.
01 · Solving a Continuous Equation
The problem of this chapter is: given a continuous real function , find a number with
Polynomials of degree four or less have radical formulas, and a few transcendental equations can be rearranged by hand. Most equations that arise from a derivative set to zero, from a balance of two smooth quantities, or from matching a model to a number, do not. The useful substitute for a closed form is a sequence together with a theorem that says what the sequence converges to, how fast, and from which starting values.
Every method below is an iterative map. A rule produces the next object from the previous one: a new number , or a new bracket from an old bracket. The mathematical questions are always the same. Does the sequence stay defined? Does it converge? Is the limit a root? How small is after steps, and which hypotheses does that bound use?
Existence is settled before any map is chosen. The intermediate-value theorem says that if is continuous on a closed bounded interval and and have opposite signs, then at least one root lies in . That sign condition is written . Continuity is part of the hypothesis. On , the jump that equals for and for changes sign and never hits .
Suppose is differentiable at . The root is simple when and . It has multiplicity when can be factored as with continuous at and . A simple root crosses or touches the axis with nonzero slope. A multiple root has a horizontal tangent.
Plain language: a simple root is a meeting with the axis that still has a tilt. Just to one side the graph is positive and just to the other it is negative, because the slope at the meeting is not zero. A multiple root is a flatter meeting: the graph touches the axis with a horizontal tangent, and the sign need not change at all.
02 · Bisection and a Guaranteed Bracket
Bisection turns the intermediate-value theorem into a sequence of brackets whose lengths form a geometric sequence.
Let be continuous on with . Set and . Given a bracket on which changes sign, let be its midpoint.
- If , then is a root and the construction stops.
- If , the next bracket is .
- Otherwise , and the next bracket is .
Plain language: start with an interval whose ends give opposite signs, so a root is trapped inside. Cut the interval in half, keep the half whose ends still give opposite signs, and throw the other half away. The trapped root stays inside, and the interval that holds it is half as long.
Bisection is repeatedly halving a bracket that still holds the root. The midpoint is a sign test, not the answer. Whichever half still changes sign becomes the next bracket, and the root cannot slip out of it.
The endpoints stay ordered, , and the length is exactly
Each step replaces one endpoint by the midpoint, so is increasing and bounded above, and is decreasing and bounded below. A monotone bounded sequence of real numbers converges. The two limits agree, because the gap between and tends to . Call the common limit . Then lies in every bracket.
While the construction has not already stopped on an exact root, . Continuity sends and both to , so the products tend to . The limit of negative numbers is at most , and a square that is at most is . Hence .
Plain language: the two endpoints march toward each other, the gap between them is cut in half at every step, and they meet at one number. The signs stayed opposite the whole way, so that meeting point has to be a root.
The nested brackets pick out one root of on the original interval. If has several roots in , the signs at the midpoints decide which one remains. The midpoint and the root are both inside , so
This is an upper bound that holds at every step, with no extra hypothesis on . To force the bound under a prescribed tolerance , choose so that , that is
That integer is known before the first midpoint is computed. The hypotheses are the continuity of and one sign change, both checkable at the start.
A positive sequence converges linearly with rate when for every , or more generally when . The bisection bound has rate : each step buys exactly one factor of two, which is about extra decimal digits.
Plain language: a bound converges linearly when each new allowance is a fixed fraction of the previous one. For bisection that fraction is one half. The guarantee gets steadily tighter — about three tenths of a new decimal digit each step — and the count of steps is known before any midpoint is computed.
Section 04 measures the error itself. For bisection that ratio need not tend to : the root can sit anywhere inside the current bracket, so a midpoint can land almost on it and the next midpoint can miss by nearly the whole half-length. The quantity that is guaranteed to halve is the bound.
Here , , and . The length starts at .
The signs send the bracket through , then , and then , of length . The bound of this section gives . The actual gap is about , which sits inside the bound, as a bound requires. The same formula drops below at : the bound is then , and is still too large.
Take on . A root sits at , and . Every midpoint test is looking for a sign change that the bracket does not contain in its endpoint values. The procedure as stated never begins.
Why it breaks: the intermediate-value theorem was used in the form "opposite signs, hence a root." The converse is false. A continuous function can touch zero and stay non-negative, and a bracket can hide two roots, or a double root, behind endpoints of equal sign. Squaring a simple factor produces exactly this touch.
Consequence: bisection is a method for a bracket you already hold, not a search of the whole line. Producing the first sign change is a separate step. If does not change sign on any interval you are willing to try, this chapter's guarantee is silent, and a multiple root is a typical reason.
03 · Fixed-Point Iteration and Contractions
Suppose a root of is rewritten as a number that leaves fixed.
A fixed point of is a number with . Fixed-point iteration from a start is the sequence
If the sequence converges to and is continuous at , then . Continuity lets the limit pass inside : the limit of is , and it is also the limit of , which is .
Plain language: a fixed point is a number that leaves where it is. Iteration feeds each output straight back in as the next input. If the numbers settle and does not jump at the settling point, that point is a fixed point: the output of the limit and the limit of the outputs are the same number.
A fixed point is where the graph of crosses the diagonal . Convergence belongs to the chosen . One equation has many rewritings.
The positive root of is , and satisfies . Three continuous rearrangements are
each defined near , with the square root the non-negative one. Differentiating and using gives
The first two derivatives are strictly smaller than in absolute value. The third is strictly larger than . Starting at , the map produces , then , then , walking toward . The map produces , , , , , and then values alternating near and . Both maps were built from the same equation. Only the first stays with the root.
A function on an interval satisfies a Lipschitz condition with constant when
If , then is a contraction on . If is differentiable on and for every , the mean-value theorem supplies the Lipschitz condition: for some between and , so the absolute value is at most .
Plain language: a Lipschitz condition caps how far apart the outputs of can be. They stretch by at most a fixed factor times the gap between the inputs. When , is a contraction: every pair of points on the interval is pulled strictly closer, and the same factor works everywhere on that interval.
A contraction is a map that always pulls points closer. The distance between and is at most times the distance between and , with . Continuity only keeps nearby points nearby. A contraction shortens every gap by one uniform factor.
Let send a closed bounded interval into itself, and let be a contraction on with constant .
The image condition keeps every iterate inside : if , then , and so on. The contraction turns one step into the next,
For , the telescope from to is a piece of a geometric series:
The right-hand side tends to as , uniformly in . A sequence of real numbers whose gaps from index onward are dominated by a convergent geometric series converges to some limit . The limit lies in because the interval is closed. Lipschitz continuity gives , so . The left side is , whose limit is . Therefore . If as well, then , so and .
The same geometric estimate yields the rate. By induction , and the latest step controls the unknown gap:
Plain language: if a contraction sends a closed interval into itself, repeated application is squeezed toward a single point inside that interval, and that point is the only number the map leaves fixed. The latest step already reports the remaining gap: it is at most times the size of that step.
For on both hypotheses hold. The map is decreasing from to , so the image sits inside , and on . The theorem supplies a unique fixed point in , namely , and a geometric rate .
Suppose is continuous, , and . Choose with . Continuity of gives a small closed interval about on which . On that interval , so sends into itself. The Banach theorem on says that every start in converges to . If instead , no such exists on any neighborhood, and starts other than itself are pushed away at the first step: the mean-value theorem gives . The borderline is not covered by either conclusion.
The map has fixed point , because is for . From the start the iteration is and never approaches .
Why it breaks: and , so the strict contraction test fails at the root itself. On the interval the map does send the interval to itself, but the best Lipschitz constant is , from . The Banach hypothesis is false, and the iteration has a second orbit, the two-cycle, that the fixed-point theorem says nothing to prevent.
Consequence: algebra can exhibit a fixed point while the iteration diverges, cycles, or converges to a different fixed point of the same . The derivative, or a Lipschitz constant on a stated interval, is the part of the work that decides which.
One more identity is worth having before Newton's method, because Newton is a fixed-point map with a special derivative. If is continuous at a fixed point and the iteration converges to it, then
for some between and , by the mean-value theorem. Whenever , the errors form a linear sequence with rate . Whenever , that rate is : the error shrinks faster than every linear rate. Newton's method is built so that this second case happens at a simple root.
04 · Order of Convergence
Let and suppose for every , with . The convergence has order and asymptotic constant when
Order is linear convergence, and it describes a sequence that actually tends to zero only when . Order is quadratic convergence. The convergence is superlinear when , which holds for every order .
Plain language: the order is a report on how the error shrinks each step. Order multiplies the error by roughly the same factor every time, and the error actually tends to zero only when that factor is smaller than . Order squares the error, up to the constant , so once the miss is a small fraction the number of correct digits roughly doubles.
Order of convergence describes how the error shrinks each step. Linear convergence trims a fixed share of whatever error remains. Quadratic convergence replaces the error by something on the scale of its square: a miss of a thousandth can become a miss of about a millionth. The asymptotic constant is the multiplier in front of that shrinkage once the guesses are close.
Linear convergence multiplies the error by about the same factor each step, so the number of correct digits grows by a fixed amount. Quadratic convergence squares the error, up to , and once the error is below that roughly doubles the number of correct digits. The fixed-point identity of Section 03 is the order statement for a map with : the order is and . If and is continuous, one more term of Taylor's theorem raises the order. Then , so and
provided the limit on the right is positive. The order is then exactly . If that second derivative also vanishes, the order is higher still. Newton's method is the systematic way to choose a whose first derivative vanishes at the root.
05 · Newton's Method and Quadratic Convergence
Calculus 05 already drew the picture. The tangent line to at a guess is . Setting and solving for produces the next guess, provided the tangent is not horizontal.
For differentiable and ,
Equivalently, with the Newton map , defined wherever .
Plain language: at the current guess, draw the line that grazes the graph, and follow that line until it hits the horizontal axis. The hitting point is the next guess. In numbers, that is the current guess minus the height divided by the slope .
Newton's method follows the tangent until it hits the axis. For one step the curve is replaced by the straight line that matches its height and its slope at . Where that line meets is . A horizontal tangent never meets the axis, so the step has nowhere to land.
The derivative of this particular explains the speed. Where is differentiable and nonzero,
At a simple root the factor is zero and the denominator is not, so . Section 04 then predicts quadratic convergence as soon as is continuous near , which for this follows from being three times continuously differentiable, or by the direct Taylor argument below, which needs only two continuous derivatives.
Assume , , and continuous on a neighborhood of . Taylor expansion with remainder, centered at a current guess near , gives a point between and such that
For near , continuity of and keep . Dividing by and rearranging gives
On a small enough neighborhood one has and , so with . Choose the neighborhood also small enough that throughout it, and start with inside it. Then , so the iterates stay inside the neighborhood and . Once the error tends to zero, and , and
whenever . That limit is the asymptotic constant. If happens to vanish, the order is higher than and the same proof still gives convergence.
Plain language: near a simple root the tangent is a faithful stand-in for the graph, and the leftover miss is proportional to the square of the current miss. Each successful step therefore squares the error. The correct digits start to double once the guess is close enough to stay in that neighborhood.
Let , so and . From ,
Because is the constant , the error identity is exact: . Thus and . With the absolute errors are about , , , and . The asymptotic constant equals , and the third ratio has already met it.
The update divides by . Calculus 05 recorded at : there and , so the Newton formula asks for a division by zero.
Why it breaks: the tangent line at is horizontal, and a horizontal line at height does not meet the axis. There is no next real iterate. A horizontal tangent at the root itself is the multiple-root case of Section 08: the formula is undefined at , and where it is defined the order drops from to .
Consequence: before a Newton step is legal, has to be checked nonzero. A simple root guarantees that only in a neighborhood of , not at every guess on the line.
Let . Then . Starting at ,
The iteration alternates forever. Neither value is a root: and .
Why it breaks: the quadratic-convergence theorem is a statement about starts inside some neighborhood of a simple root. It is silent about a start outside every such neighborhood. Here the Newton map sends to and to , a periodic orbit of period . Along that orbit is and , both nonzero, so every individual step is defined. Defined steps can still form a cycle.
Consequence: a derivative that never vanishes is not a convergence proof. Newton needs a start already close to a simple root, or some other structure that forces the iterates into that neighborhood. When that structure is absent, the sequence may cycle or march to infinity. Bisection, given a genuine bracket, cannot cycle. The price of its guarantee is the linear bound of Section 02.
06 · The Secant Method
Newton's step uses the slope of a tangent. Replacing that slope by the slope of the chord through the two latest guesses removes the need to differentiate .
From two starts and with ,
The fraction is the reciprocal of the difference quotient , which approximates . The formula is the Newton update with that approximation in place of .
Plain language: draw the straight line through the two latest guesses instead of the tangent, and take the place where that chord hits the axis. The slope of the chord stands in for , so the derivative is never required. If the two function values agree, the chord is horizontal and there is no next guess.
If , the chord is horizontal and the next guess is undefined. Nothing in the formula forces to lie between and , so the method does not maintain a sign-change bracket.
The order is derived from a two-step error relation. Under the same smoothness used for Newton, a simple root, and starts close enough to it, the chord error satisfies
The constant is the Newton constant. The product of two successive errors, rather than the square of one, is the footprint of a chord: each new error is proportional to both previous errors. To read an order off this relation, look for and such that . Then . Substitute into :
The power of has to be zero, otherwise the ratio tends to or to and cannot tend to a positive finite limit. Hence , so and
Under the standard hypotheses — continuous, a simple root, and both starts close enough that the denominators stay nonzero — the secant method therefore converges superlinearly, of order equal to the golden ratio, strictly between the linear bound of bisection and the quadratic rate of Newton.
Take , , , so and . The chord through those two guesses meets the axis at ; the next chord, through and , meets it at :
The errors against are about at and about at . The drop is faster than halving and slower than the Newton drop from to in Section 05, which is the order sitting between and .
Apply the bracket-preserving chord to on . The first point is , where is negative, so the new bracket is . The next point is , where is again negative, so the bracket is . The right endpoint is still .
Why it breaks: is strictly convex, so on an interval where it changes sign the chord lies above the graph. The chord's root therefore lies to the left of , the new function value is negative, and the positive endpoint is never the one replaced. Every later bracket has the form with increasing toward and the right end frozen.
Consequence: keeping the bracket restores a guarantee of convergence and gives up the golden-ratio order. With one end frozen, the errors behave linearly. The secant method of the definition above does not freeze an endpoint, and it also does not promise to stay inside . A chord is not a bracket unless the update says so.
07 · When to Stop
For a tolerance , and a current pair of iterates,
- Residual test: .
- Absolute step test: .
- Relative step test: , used when is bounded away from zero.
Plain language: three different questions can stop the iteration. The residual asks whether the equation is already nearly true. The absolute step asks whether the latest move was tiny on its own. The relative step asks whether that move is tiny compared with the size of the guess. A yes to one of them is not, by itself, a certificate that the guess sits within of the root.
The residual asks how nearly the equation holds. The step tests ask how much the map is still moving. For a contraction, the Banach bound of Section 03 converts a step into a root error: . A step smaller than does not mean a root error smaller than unless is taken into account. If , that factor is , and the step is already a faithful stand-in for the error. If , the factor is , and a tiny step can hide a large remaining gap.
The residual is converted by the mean-value theorem. If and exists between and , then for some , so
A small residual certifies a small root error when is bounded below by a comfortable positive number near the root. A flat graph, tiny, turns a modest residual into a large uncertainty in . A steep graph does the reverse: the residual can still look large when is already close to .
For at , the residual is and the root error is . The residual is one hundred times smaller than the error. For at , the residual is and the root error is . The residual is one thousand times larger than the error. In the first case a residual tolerance of accepts a guess that is still a tenth away from the root. In the second, a residual tolerance of rejects a guess that is already accurate to a thousandth.
Chapter 01 measured rounding by machine epsilon: a computed value of agrees with the mathematical value only up to a small multiple of that epsilon, the multiple depending on how is built from arithmetic operations. A residual test with many times smaller than the rounding error in is comparing the iteration with digits the evaluation does not contain. Likewise, once drops to a few units in the last place of , further steps are changes the number system cannot represent. The conditioning relation above says how that rounding enters the root. An error of size about machine epsilon in the value of is consistent with an error of size about machine epsilon divided by in the root. A simple root with a very small derivative is an ill-conditioned root: the iteration can be exactly the Newton map and the computed can still be uncertain in digits that the stopping test appears to have settled.
Reading the residual and the step together uses both identities. A residual that shrinks while the step stays large fits a flat graph. A step that shrinks while the residual stays large fits a steep graph, or a stalled orbit such as the two-cycle of Section 05, where the step is eventually and the residual is or .
08 · Multiple Roots
Suppose with , smooth, and . Then . The Newton update divides by a derivative that vanishes at the root, so the theorem of Section 05 does not apply. The iteration can still converge. The order drops.
For a pure power and ,
so the Newton map simplifies to and . The error is exactly linear:
The rate lies in . A double root has rate , and a triple root has rate . The Newton derivative equals that rate, so the convergence is linear.
Let . For the update is , so . From the iterates are , , , , and the errors are , , , , . Each error is half the one before it, matching . At the residual is , while the root error is . The residual is the square of the error, so it understates the distance to the root, in line with the flat-graph warning of Section 07.
If the multiplicity is known, the modified update multiplies the correction by . On a pure power that modified map hits in a single step. For a general factor the same multiple restores and, with it, quadratic convergence. When is unknown, the quotient has a simple root at for a pure power, since , and Newton's method applied to falls back under the theorem of Section 05. Either repair uses extra knowledge or an extra derivative. Neither is free, and both exist because the unmodified rate is the generic price of a horizontal tangent at the root.
09 · Exercises
Keep the half on which the function values at the endpoints have opposite signs. The midpoint error after steps is at most on a bracket of length . Compare with .
(a) and . The midpoint has , so the bracket becomes . The midpoint has , so the bracket becomes . The midpoint has , so the bracket becomes . (b) The third midpoint is , taken from a bracket of length , so . (c) The midpoint bound is . This drops below when , since and . The smallest such is .
Let . Then is continuous, , and . (a) Carry out three bisection steps from , and record the bracket after each step. (b) Bound the distance from the third midpoint to a root. (c) Find the smallest index such that the bound on is below , where is the first midpoint.
On , cosine is decreasing and positive. A bound on is a Lipschitz constant, by the mean-value theorem. The a posteriori factor is times the latest step, with .
(a) Cosine decreases on , from to . Since , the image is . And on the interval, so . (b) The Banach theorem gives a unique fixed point in , and every start in the interval converges to it. (c) and . The step is . With , the bound is .
Let on the interval , with in radians. (a) Show that maps the interval into itself and is a contraction with constant . (b) Conclude that the equation has a unique solution in , and that iteration from any start in the interval converges to it. (c) From , compute and , and write the a posteriori bound on .
The Newton correction for is . Because is constant, . The asymptotic constant is . The update at divides by .
(a) . Then . Then . (b) Here , so and . The limit constant is . The ratios and are the exact finite- values , and they approach as approaches . (c) , so . The Newton update divides by and is undefined. The tangent to at is the horizontal line , which does not meet the axis.
Let and . (a) Compute the first three Newton iterates as exact fractions. (b) Show that and , and compare these with . (c) Explain why the iteration is undefined at the start .
For and , the quotient equals . The modified correction multiplies that quotient by . Compare with directly from the halved errors.
(a) , so for one has and . Hence . (b) The error is multiplied by at every step, so . The order is and the asymptotic constant is . (c) From the next two iterates are and . The true error is , while the residual is . The residual is smaller than the root error. A residual test alone would describe this guess as twice as accurate as it is, which is the flat-graph gap of a multiple root: . (d) The modified update subtracts , so it returns from every .
Let . (a) Show that Newton's method gives whenever . (b) Deduce the order and the asymptotic constant. (c) Starting from , compute and , and say what the comparison means for a residual test. (d) Show that the modified update reaches the root in one step.
10 · Chapter Summary
| Object | What the theorem uses |
|---|---|
| Sign-change bracket | Continuous with ; bisection keeps one root and halves the bound |
| Bisection bound | , linear with rate |
| Fixed-point map | ; the limit is a fixed point when is continuous |
| Contraction | and Lipschitz constant ; unique fixed point, geometric rate |
| Local test | attracts nearby starts; repels them |
| Order | ; linear means and needs |
| Newton | Tangent step; simple root and continuous give quadratic convergence, constant |
| Secant | Chord through the last two guesses; order near a simple root |
| Stopping | Residual, absolute step, relative step; relates the first to the error |
| Rounding | A residual at the scale of the rounding noise in , or a step at the last place of , has left exact arithmetic |
| Multiple root | Newton on is linear with rate ; the factor restores the quadratic case |
Next: Chapter 03 — Polynomial Interpolation, which builds the polynomial that matches prescribed values at prescribed nodes, and the error formula that measures how far that polynomial sits from the function it is standing in for.