Lesson

Newton–Raphson: Where the Formula Comes From and When It Converges

When the secant method and Newton–Raphson converge, the tangent as a first-order Taylor polynomial, the identity that gives the error of one step, an error bound, the exact order and the higher orders when f″(r)=0, convergence and order of the secant method, and the failures (almost flat slope, a cycle, divergence, a double root).

Last updated:


In the table of the secant method and Newton–Raphson page the error fell from 8.58×10−28.58\times10^{-2} to 2.45×10−32.45\times10^{-3}⁠, then to 2.12×10−62.12\times10^{-6} and 1.60×10−121.60\times10^{-12}⁠:
the number of correct digits almost doubled at every step. Here we check where the formula comes from, what determines the error of one step, when convergence is guaranteed and why, and what happens when the conditions fail.

When the Methods Converge

After the two algorithms of the secant method and Newton–Raphson page we state when each one converges, before any error bound.
The conditions are sufficient and local: they are not necessary (a method can converge without them), and they are not a promise for every starting point.

Newton–Raphson. Let ff be twice continuously differentiable near a simple root rr (that is, f(r)=0f(r)=0 and f′(r)≠0f'(r)\neq0⁠).
A start close enough to rr guarantees convergence. The reason fits in a few lines.
The method is xn+1=N(xn)x_{n+1}=N(x_n) with N(x)=x−f(x)f′(x)N(x)=x-\dfrac{f(x)}{f'(x)}⁠, and

N′(x)=f(x) f′′(x)f′(x)2N'(x)=\frac{f(x)\,f''(x)}{f'(x)^2}

vanishes at rr⁠, because f(r)=0f(r)=0⁠. Since N′N' is continuous near rr⁠, there is a small interval II around rr on which ∣N′∣≤q<1\lvert N'\rvert\le q<1⁠.
For x∈Ix\in I the mean value theorem gives ∣N(x)−r∣=∣N(x)−N(r)∣≤q ∣x−r∣\lvert N(x)-r\rvert=\lvert N(x)-N(r)\rvert\le q\,\lvert x-r\rvert (note that N(r)=rN(r)=r⁠).
So the next point stays in II and the error is multiplied by at most qq in every step:
it shrinks geometrically. How close is “close enough” is made quantitative in the section “When Convergence Is Guaranteed”.

Secant method. The same smoothness and a simple root, but two distinct starting points, both close enough to the root.
Opposite signs are not needed: unlike regula falsi, the root does not have to lie between the two points.

What breaks the conditions:

  • a double root (f′(r)=0f'(r)=0⁠): there is no simple root;
  • a slope close to zero at the start (for the secant method, a chord slope close to zero), which flings the next point far away;
  • a start outside the neighbourhood, where the iteration can cycle or diverge.

The section “Why Newton Fails” shows each of these in numbers, and the example tabs of the explorer on the secant and Newton–Raphson page show three of them in a graph.

The Tangent Is a First-Order Taylor Polynomial

At step nn we replace ff near xnx_n by its first-order approximation, the tangent line:

P(x)=f(xn)+f′(xn) (x−xn)P(x)=f(x_n)+f'(x_n)\,(x-x_n)

This is the Taylor polynomial of degree one of ff around xnx_n⁠.
When the point is 00 it is called a Maclaurin polynomial, like ex≈1+xe^{x}\approx1+x in the glossary.

Derive: find the point xn+1x_{n+1} where the line PP crosses the xx-axis, that is P(xn+1)=0P(x_{n+1})=0⁠.

Solution

f(xn)+f′(xn) (xn+1−xn)=0f(x_n)+f'(x_n)\,(x_{n+1}-x_n)=0 so

xn+1=xn−f(xn)f′(xn)x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}

provided f′(xn)≠0f'(x_n)\neq0⁠. When the slope of the tangent is zero the line is horizontal and has no single crossing point with the axis.
Newton–Raphson solves the approximation P(x)=0P(x)=0 instead of the equation f(x)=0f(x)=0⁠, and replaces the curve by a new tangent again and again.

How Wrong Is One Step

The tangent is close to the curve only near xnx_n⁠. The difference between them is called the Taylor error term (in books: the Taylor remainder; it has nothing to do with the residual δn=∣f(xn)∣\delta_n=\lvert f(x_n)\rvert of the stopping rules), and Taylor’s formula describes it:

Taylor's formula with an error term

If ff is twice differentiable on an interval that contains aa and xx⁠, there is a point ξ\xi (the Greek letter xi) between aa and xx for which

f(x)=f(a)+f′(a) (x−a)+12 f′′(ξ) (x−a)2f(x)=f(a)+f'(a)\,(x-a)+\tfrac12\,f''(\xi)\,(x-a)^2

The first two terms are the Taylor polynomial of degree one, and the last term is the error term.
The exact place of ξ\xi is unknown; we only know that it is between aa and xx⁠.
The formula is proved in calculus, and here we use it without proof.

Why the point ξ\xi exists

Think of f(t)f(t) as the position of a car at time tt⁠, so f′f' is its speed and f′′f'' its acceleration.
The position at time x>ax>a is built from three parts: the position at the start, f(a)f(a)⁠, what the car would cover at the initial speed alone, f′(a) (x−a)f'(a)\,(x-a)⁠, and the contribution of the acceleration.
The fundamental theorem of calculus and one integration by parts give this contribution (for a twice continuously differentiable ff⁠) as

R=∫ax(x−t) f′′(t) dtR=\int_a^x (x-t)\,f''(t)\,dt

so that f(x)=f(a)+f′(a) (x−a)+Rf(x)=f(a)+f'(a)\,(x-a)+R⁠. An acceleration at an early time counts more, because it has longer to act before time xx⁠:
its weight x−tx-t is larger. The weights are non-negative, and ∫ax(x−t) dt=(x−a)22\int_a^x (x-t)\,dt=\dfrac{(x-a)^2}{2}⁠.
Hence

R=(x−a)22⋅(a weighted average of f′′ on [a,x])R=\frac{(x-a)^2}{2}\cdot\bigl(\text{a weighted average of }f''\text{ on }[a,x]\bigr)

A weighted average with non-negative weights lies between the smallest and the largest value of f′′f''⁠.
Since f′′f'' is continuous, the intermediate value theorem says that the average is attained at some point ξ∈[a,x]\xi\in[a,x]⁠.
A constant acceleration f′′(ξ)f''(\xi) would then reproduce exactly the same final position, and this is the term 12f′′(ξ) (x−a)2\tfrac12 f''(\xi)\,(x-a)^2⁠.
(For x<ax<a the argument is the same, read backwards in time.)

The ordinary mean value theorem, applied once, is not enough here:
one needs this weighted form, or two applications of Rolle’s theorem.

Denote by rr the root (f(r)=0f(r)=0⁠) and by en=xn−re_n=x_n-r the error after nn steps.

Derive: substitute a=xna=x_n and x=rx=r in Taylor’s formula, divide by f′(xn)f'(x_n)⁠, and use xn−xn+1=f(xn)f′(xn)x_n-x_{n+1}=\dfrac{f(x_n)}{f'(x_n)}⁠.
What do you get for en+1e_{n+1} in terms of ene_n⁠?

Hint

After the division three terms appear. Two of them together are r−xn+1r-x_{n+1}⁠.

Solution

0=f(xn)+f′(xn) (r−xn)+12f′′(ξn) (r−xn)20=f(x_n)+f'(x_n)\,(r-x_n)+\tfrac12 f''(\xi_n)\,(r-x_n)^2⁠. After dividing by f′(xn)f'(x_n)⁠:

0=f(xn)f′(xn)+(r−xn)+f′′(ξn)2f′(xn) (r−xn)20=\frac{f(x_n)}{f'(x_n)}+(r-x_n)+\frac{f''(\xi_n)}{2f'(x_n)}\,(r-x_n)^2

The given f(xn)f′(xn)=xn−xn+1\dfrac{f(x_n)}{f'(x_n)}=x_n-x_{n+1} yields f(xn)f′(xn)+(r−xn)=r−xn+1\dfrac{f(x_n)}{f'(x_n)}+(r-x_n)=r-x_{n+1}⁠, and (r−xn)2=en2(r-x_n)^2=e_n^2⁠. So 0=−en+1+f′′(ξn)2f′(xn) en20=-e_{n+1}+\dfrac{f''(\xi_n)}{2f'(x_n)}\,e_n^2⁠, that is:

en+1=f′′(ξn)2 f′(xn)  en2e_{n+1}=\frac{f''(\xi_n)}{2\,f'(x_n)}\;e_n^{2}

The new error is a coefficient times the square of the previous one, so the convergence is quadratic.
The coefficient Cn=f′′(ξn)2f′(xn)C_n=\dfrac{f''(\xi_n)}{2f'(x_n)} is not one fixed number: it depends on nn⁠, because xnx_n and ξn\xi_n change from step to step.
But ξn\xi_n lies between xnx_n and the root rr⁠, and xn→rx_n\to r⁠, so near the root the coefficient approaches one number, f′′(r)2f′(r)\dfrac{f''(r)}{2f'(r)}⁠.
“Constant” here means that the coefficient stays between two fixed numbers and tends to a limit.

Example: x2−2x^2-2

For f(x)=x2−2f(x)=x^2-2 the identity is exact, with no ξ\xi⁠: en+1=en22xne_{n+1}=\dfrac{e_n^2}{2x_n}⁠. From x0=1.5x_0=1.5 and the root r=2r=\sqrt2⁠:

nnxnx_nene_nen+1/en2e_{n+1}/e_n^2
01.5000000000008.58×10−28.58\times10^{-2}0.3333
11.4166666666672.45×10−32.45\times10^{-3}0.3529
21.4142156862752.12×10−62.12\times10^{-6}0.3536
31.4142135623751.60×10−121.60\times10^{-12}

The ratio approaches f′′(r)2f′(r)=22⋅22=0.3536\dfrac{f''(r)}{2f'(r)}=\dfrac{2}{2\cdot2\sqrt2}=0.3536⁠.

An Error Bound

The identity en+1=f′′(ξn)2f′(xn) en2e_{n+1}=\dfrac{f''(\xi_n)}{2f'(x_n)}\,e_n^2 is exact, but we cannot compute with it:
ξn\xi_n is unknown, and xnx_n changes from step to step. So instead of the exact value of the coefficient we look for a bound on it:
one number KK that fits all the steps and that can be computed in advance from the function alone.

To bound a fraction we bound the numerator from above and the denominator from below:
the largest possible fraction is the largest numerator divided by the smallest denominator.
Suppose there is an interval II that contains the root and all the points xnx_n (and so also ξn\xi_n⁠, which lies between them and the root), and on which two conditions hold:

  • ∣f′′(x)∣≤M\lvert f''(x)\rvert\le M⁠: the curvature is bounded. This bounds the numerator, ∣f′′(ξn)∣≤M\lvert f''(\xi_n)\rvert\le M⁠, without knowing where ξn\xi_n is.
  • ∣f′(x)∣≥m>0\lvert f'(x)\rvert\ge m>0⁠: the slope stays away from zero. This bounds the denominator from below, ∣f′(xn)∣≥m\lvert f'(x_n)\rvert\ge m⁠, and avoids dividing by a tiny number. This is exactly the situation of a nearly flat tangent that flings the next point far away.

Hence ∣f′′(ξn)2f′(xn)∣≤M2m\left\lvert\dfrac{f''(\xi_n)}{2f'(x_n)}\right\rvert\le\dfrac{M}{2m}⁠, that is:

∣en+1∣≤K en2,K=M2m\lvert e_{n+1}\rvert\le K\,e_n^{2},\qquad K=\frac{M}{2m}

For x2−2x^2-2 on [1,2][1,2]⁠: f′(x)=2x≥2f'(x)=2x\ge2 so m=2m=2⁠, f′′(x)=2f''(x)=2 so M=2M=2 and K=12K=\tfrac12⁠.
The bound Ken2K e_n^2 against the actual next error:

nnK en2K\,e_n^2 (the bound)en+1e_{n+1} (actual)
03.68×10−33.68\times10^{-3}2.45×10−32.45\times10^{-3}
13.01×10−63.01\times10^{-6}2.12×10−62.12\times10^{-6}
22.26×10−122.26\times10^{-12}1.60×10−121.60\times10^{-12}

The bound holds in every row and is close to the actual error, because the actual constant 0.3540.354 is close to K=0.5K=0.5⁠.

Procedure: how to bound Newton’s error

  1. Choose an interval. Choose a radius ρ\rho and an interval I=[r−ρ, r+ρ]I=[r-\rho,\,r+\rho] around the root (rr is estimated in advance, for example from a bracket), so that x0x_0 is inside it.
  2. Find MM⁠. The largest value of ∣f′′∣\lvert f''\rvert on II (check the ends and the points where f(3)=0f^{(3)}=0⁠).
  3. Find mm⁠. The smallest value of ∣f′∣\lvert f'\rvert on II⁠, and make sure that m>0m>0⁠, that is, that f′f' does not vanish on the interval.
  4. Compute K=M2mK=\dfrac{M}{2m} and check that Kρ<1K\rho<1⁠.
  5. Conclude. If the check passed, every xnx_n stays in II⁠, and ∣en+1∣≤K en2\lvert e_{n+1}\rvert\le K\,e_n^2⁠, so ∣en∣≤1K(K∣e0∣)2n\lvert e_n\rvert\le\dfrac1K\bigl(K\lvert e_0\rvert\bigr)^{2^n}⁠.
  6. If the check failed, reduce ρ\rho (so mm grows or MM shrinks) or go back to a method with a bracket.

For x2−2x^2-2 with ρ=0.4\rho=0.4⁠: M=2M=2⁠, m≈2.03m\approx2.03⁠, K≈0.493K\approx0.493 and Kρ≈0.197<1K\rho\approx0.197<1⁠, so the bound holds.

When Convergence Is Guaranteed

The bound ∣en+1∣≤Ken2\lvert e_{n+1}\rvert\le K e_n^2 guarantees that the error shrinks in a step only when K∣en∣<1K\lvert e_n\rvert<1⁠, and then ∣en+1∣<∣en∣\lvert e_{n+1}\rvert<\lvert e_n\rvert⁠.
This gives the condition, and “close enough” gets a numerical meaning:
a distance smaller than 1K\dfrac1K⁠.

Claim (local convergence). Let I=[r−ρ, r+ρ]I=[r-\rho,\,r+\rho] be an interval on which ∣f′∣≥m>0\lvert f'\rvert\ge m>0 and ∣f′′∣≤M\lvert f''\rvert\le M⁠, with Kρ<1K\rho<1 for K=M2mK=\dfrac{M}{2m}⁠.
If x0∈Ix_0\in I⁠, then every xnx_n belongs to II and:

∣en∣≤1K (K∣e0∣)2n→n→∞0\lvert e_n\rvert\le\frac1K\,\bigl(K\lvert e_0\rvert\bigr)^{2^n}\xrightarrow[n\to\infty]{}0
Proof

Denote qn=K∣en∣q_n=K\lvert e_n\rvert⁠. Suppose xn∈Ix_n\in I⁠, that is ∣en∣≤ρ\lvert e_n\rvert\le\rho⁠. Then f′(xn)≠0f'(x_n)\neq0 and the Newton step is defined, and the bound gives ∣en+1∣≤Ken2=qn ∣en∣\lvert e_{n+1}\rvert\le K e_n^2=q_n\,\lvert e_n\rvert⁠.
Since qn≤Kρ<1q_n\le K\rho<1⁠, we get ∣en+1∣<∣en∣≤ρ\lvert e_{n+1}\rvert<\lvert e_n\rvert\le\rho⁠, so xn+1∈Ix_{n+1}\in I⁠. By induction all the points are in II⁠.

Multiplying the bound by KK gives qn+1≤qn2q_{n+1}\le q_n^2⁠, and by induction qn≤q0 2nq_n\le q_0^{\,2^n}⁠.
Since q0≤Kρ<1q_0\le K\rho<1⁠, the power q0 2nq_0^{\,2^n} tends to 00⁠, and dividing by KK gives the claim.

Why does this mean that the number of digits doubles at every step?
qn+1≤qn2q_{n+1}\le q_n^2 says that −log⁡10qn+1≥2 (−log⁡10qn)-\log_{10}q_{n+1}\ge2\,(-\log_{10}q_n)⁠: the number of correct digits, relative to 1K\dfrac1K⁠, at least doubles in a step.

Example: x2−2x^2-2 from 1.51.5

Choose ρ=0.4\rho=0.4 and I=[r−0.4, r+0.4]I=[r-0.4,\,r+0.4]⁠. The left end is r−0.4≈1.014r-0.4\approx1.014⁠, so m=2 (r−0.4)≈2.03m=2\,(r-0.4)\approx2.03 and M=2M=2⁠, K≈0.493K\approx0.493 and Kρ≈0.197<1K\rho\approx0.197<1⁠.
The claim applies to every start in II⁠, and x0=1.5x_0=1.5 is inside it, with K∣e0∣≈0.0423K\lvert e_0\rvert\approx0.0423⁠.
The bound 1K(K∣e0∣)2n\dfrac1K(K\lvert e_0\rvert)^{2^n} gives 8.58×10−28.58\times10^{-2}⁠, 3.63×10−33.63\times10^{-3}⁠, 6.49×10−66.49\times10^{-6} and 2.08×10−112.08\times10^{-11} for n=0,1,2,3n=0,1,2,3⁠, above the errors in the table above.

A Condition That Holds From Any Start on the Right Side

The local condition has a drawback: you need to know mm and MM and the distance of the start.
Another condition guarantees convergence without bounds, when the shape of ff is convenient.

Claim (convergence from any start on the right side). Let ff be twice continuously differentiable on [a,b][a,b] with f(a) f(b)<0f(a)\,f(b)<0⁠, and suppose that f′f' and f′′f'' do not change sign on the interval and f′≠0f'\neq0 on it.
Then ff has a unique root rr in the interval, and for every x0∈[a,b]x_0\in[a,b] with f(x0) f′′(x0)>0f(x_0)\,f''(x_0)>0 Newton’s method converges to rr⁠.

Proof

We prove the case f′>0f'>0 and f′′≥0f''\ge0 on the interval: ff is increasing and convex.
The other three cases follow by replacing ff with −f-f or substituting x↦−xx\mapsto-x⁠.
Since ff is increasing and f(a) f(b)<0f(a)\,f(b)<0⁠, there is a unique root rr⁠, and the condition f(x0) f′′(x0)>0f(x_0)\,f''(x_0)>0 says f(x0)>0f(x_0)>0⁠, that is x0>rx_0>r⁠.

From the identity en+1=f′′(ξn)2f′(xn) en2≥0e_{n+1}=\dfrac{f''(\xi_n)}{2f'(x_n)}\,e_n^2\ge0 we get xn+1≥rx_{n+1}\ge r for every nn⁠. When the point is to the right of the root, f(xn)≥0f(x_n)\ge0 and f′(xn)>0f'(x_n)>0⁠, so xn+1=xn−f(xn)f′(xn)≤xnx_{n+1}=x_n-\dfrac{f(x_n)}{f'(x_n)}\le x_n⁠.
The sequence is decreasing and bounded below by rr⁠, so it converges to a limit L≥rL\ge r in the interval.
Passing to the limit in xn+1=xn−f(xn)f′(xn)x_{n+1}=x_n-\dfrac{f(x_n)}{f'(x_n)}⁠, with ff and f′f' continuous and f′(L)≠0f'(L)\neq0⁠, gives f(L)f′(L)=0\dfrac{f(L)}{f'(L)}=0⁠, that is f(L)=0f(L)=0⁠.
The root is unique, so L=rL=r⁠.

In the example x2−2x^2-2 on [1,2][1,2]⁠: f(1)=−1f(1)=-1⁠, f(2)=2f(2)=2⁠, f′=2x>0f'=2x>0 and f′′=2>0f''=2>0⁠.
The start x0=2x_0=2 satisfies f f′′>0f\,f''>0⁠, and the sequence decreases to the root:
22⁠, 1.51.5⁠, 1.416671.41667⁠, 1.414221.41422⁠, 1.41421356241.4142135624⁠. From x0=1x_0=1 the condition does not hold, but the first step lands at 1.51.5⁠, to the right of the root, because the identity always gives e1≥0e_1\ge0⁠.

The Exact Order of Convergence

Near a simple root (f′(r)≠0f'(r)\neq0⁠) there are three separate facts, and so far we have proved two of them:

  1. Convergence: xn→rx_n\to r (in the sections “When Convergence Is Guaranteed” and “A Condition That Holds From Any Start on the Right Side”).
  2. A quadratic bound: ∣en+1∣≤K en2\lvert e_{n+1}\rvert\le K\,e_n^2 (in the section “An Error Bound”).
  3. The exact order: the limit of ∣en+1∣∣en∣2\dfrac{\lvert e_{n+1}\rvert}{\lvert e_n\rvert^2}⁠.

The bound says that the error shrinks at least like a square, and does not rule out a faster decrease.
The order of convergence is defined by the limit of the ratio, not by a bound on it.
Here en=xn−re_n=x_n-r is the signed error and ∣en∣\lvert e_n\rvert is the absolute error; in a square there is no difference, en2=∣en∣2e_n^2=\lvert e_n\rvert^2⁠.

Claim (the order of Newton’s method). Let ff be twice continuously differentiable in a neighborhood of a root rr with f′(r)≠0f'(r)\neq0⁠, and suppose that Newton’s sequence satisfies xn→rx_n\to r and xn≠rx_n\neq r for every nn (the method does not land exactly on the root and stop).
Then

lim⁡n→∞en+1en2=f′′(r)2f′(r),lim⁡n→∞∣en+1∣∣en∣2=∣f′′(r)2f′(r)∣\lim_{n\to\infty}\frac{e_{n+1}}{e_n^{2}}=\frac{f''(r)}{2f'(r)}, \qquad \lim_{n\to\infty}\frac{\lvert e_{n+1}\rvert}{\lvert e_n\rvert^{2}}=\left\lvert\frac{f''(r)}{2f'(r)}\right\rvert

When f′′(r)≠0f''(r)\neq0 the limit is positive and finite, and the order of convergence is exactly 22⁠.

Proof

Since xn→rx_n\to r⁠, from some nn on all the points lie in a neighborhood where ff is twice continuously differentiable and f′≠0f'\neq0 (the derivative is continuous and f′(r)≠0f'(r)\neq0⁠).
There the identity from the section “How Wrong Is One Step” holds, and since en≠0e_n\neq0 we may divide it by en2e_n^2⁠:

en+1en2=f′′(ξn)2f′(xn)\frac{e_{n+1}}{e_n^{2}}=\frac{f''(\xi_n)}{2f'(x_n)}

for some ξn\xi_n between xnx_n and rr⁠.

  • ξn→r\xi_n\to r⁠. The point ξn\xi_n lies between xnx_n and rr⁠, so 0≤∣ξn−r∣≤∣en∣0\le\lvert\xi_n-r\rvert\le\lvert e_n\rvert⁠. The right side tends to 00⁠, and by the squeeze theorem ∣ξn−r∣→0\lvert\xi_n-r\rvert\to0 too.
  • Continuity. f′′f'' is continuous, so f′′(ξn)→f′′(r)f''(\xi_n)\to f''(r)⁠; f′f' is continuous, so f′(xn)→f′(r)f'(x_n)\to f'(r)⁠.
  • Limit of a quotient. The denominator tends to 2f′(r)≠02f'(r)\neq0⁠, so the quotient tends to f′′(r)2f′(r)\dfrac{f''(r)}{2f'(r)}⁠. The absolute value is a continuous function, so the ratio of the absolute errors also tends to the absolute value of the limit.

The paragraph after the identity said that the coefficient CnC_n approaches f′′(r)2f′(r)\dfrac{f''(r)}{2f'(r)}⁠; this is the proof.
The sections above gave a bound on the ratio, and this claim gives its limit.
For x2−2x^2-2 from 1.51.5 the ratios in the table of the section “How Wrong Is One Step” are 0.33330.3333⁠, 0.35290.3529 and 0.35360.3536⁠:
they are not only below the bound K=0.5K=0.5⁠, they tend to f′′(r)2f′(r)=122≈0.3536\dfrac{f''(r)}{2f'(r)}=\dfrac{1}{2\sqrt2}\approx0.3536⁠.
Here f′′(r)=2≠0f''(r)=2\neq0⁠, so the order is exactly 22⁠.

When f′′(r)=0f''(r)=0⁠: Higher Orders

If f′′(r)=0f''(r)=0 the limit of the previous section is 00⁠: the ratio ∣en+1∣∣en∣2\dfrac{\lvert e_{n+1}\rvert}{\lvert e_n\rvert^2} tends to zero, and the error shrinks faster than a square.
To find out how fast, we look for the first derivative above f′f' that does not vanish at the root.

Claim (higher order). Let p≥2p\ge2 be an integer, let ff be pp times continuously differentiable in a neighborhood of a root rr⁠, and suppose

f′(r)≠0,f′′(r)=f′′′(r)=⋯=f(p−1)(r)=0,f(p)(r)≠0f'(r)\neq0,\qquad f''(r)=f'''(r)=\cdots=f^{(p-1)}(r)=0,\qquad f^{(p)}(r)\neq0

(for p=2p=2 no derivative vanishes, and this is the case of the previous section).
If Newton’s sequence satisfies xn→rx_n\to r and xn≠rx_n\neq r for every nn⁠, then

lim⁡n→∞en+1enp=(p−1) f(p)(r)p! f′(r)≠0\lim_{n\to\infty}\frac{e_{n+1}}{e_n^{p}}=\frac{(p-1)\,f^{(p)}(r)}{p!\,f'(r)}\neq0

so ∣en+1∣∣en∣p\dfrac{\lvert e_{n+1}\rvert}{\lvert e_n\rvert^{p}} tends to the absolute value of the limit, and the order of convergence is exactly pp⁠.
For p=2p=2 the limit is f′′(r)2f′(r)\dfrac{f''(r)}{2f'(r)}⁠, as in the previous section, and for p=3p=3 it is 2f′′′(r)3! f′(r)=f′′′(r)3f′(r)\dfrac{2f'''(r)}{3!\,f'(r)}=\dfrac{f'''(r)}{3f'(r)}⁠.

Proof

We use Taylor’s formula in Lagrange form around rr with more terms, and write e=en=xn−re=e_n=x_n-r⁠.

The function. The Taylor polynomial of degree p−1p-1 of ff around rr is just f′(r) ef'(r)\,e⁠, because f(r)=0f(r)=0 and the derivatives of orders 22 to p−1p-1 vanish.
So, for some ηn\eta_n between xnx_n and rr⁠:

f(xn)=f′(r) e+f(p)(ηn)p! epf(x_n)=f'(r)\,e+\frac{f^{(p)}(\eta_n)}{p!}\,e^{p}

The derivative. The same formula for f′f' with a polynomial of degree p−2p-2⁠:
the derivatives of f′f' of orders 11 to p−2p-2 at the root are f′′(r),…,f(p−1)(r)f''(r),\dots,f^{(p-1)}(r)⁠, all zero.
So, for some θn\theta_n between xnx_n and rr⁠:

f′(xn)=f′(r)+f(p)(θn)(p−1)! ep−1f'(x_n)=f'(r)+\frac{f^{(p)}(\theta_n)}{(p-1)!}\,e^{p-1}

The step. In terms of errors, Newton’s step is

en+1=xn+1−r=e−f(xn)f′(xn)=e f′(xn)−f(xn)f′(xn)e_{n+1}=x_{n+1}-r=e-\frac{f(x_n)}{f'(x_n)}=\frac{e\,f'(x_n)-f(x_n)}{f'(x_n)}

In the numerator the term f′(r) ef'(r)\,e cancels:

e f′(xn)−f(xn)=(f(p)(θn)(p−1)!−f(p)(ηn)p!) epe\,f'(x_n)-f(x_n)=\Bigl(\frac{f^{(p)}(\theta_n)}{(p-1)!}-\frac{f^{(p)}(\eta_n)}{p!}\Bigr)\,e^{p}

The limit. Divide by ep≠0e^p\neq0⁠:

en+1enp=1f′(xn)(f(p)(θn)(p−1)!−f(p)(ηn)p!)\frac{e_{n+1}}{e_n^{p}}=\frac{1}{f'(x_n)}\Bigl(\frac{f^{(p)}(\theta_n)}{(p-1)!}-\frac{f^{(p)}(\eta_n)}{p!}\Bigr)

As in the previous section, ηn→r\eta_n\to r and θn→r\theta_n\to r by the squeeze theorem, and f(p)f^{(p)} and f′f' are continuous.
So the limit is

f(p)(r)f′(r)(1(p−1)!−1p!)=f(p)(r)f′(r)⋅p−1p!\frac{f^{(p)}(r)}{f'(r)}\Bigl(\frac{1}{(p-1)!}-\frac{1}{p!}\Bigr)=\frac{f^{(p)}(r)}{f'(r)}\cdot\frac{p-1}{p!}

because 1(p−1)!=pp!\dfrac{1}{(p-1)!}=\dfrac{p}{p!}⁠.

The intuition. The closer ff is to a straight line near the root, the more accurate the tangent:
when the derivatives of orders 22 to p−1p-1 vanish, the gap between ff and its tangent at rr is of order epe^p rather than e2e^2⁠.
A linear function with nonzero slope is its own tangent, and Newton solves it in one step.
But all derivatives of order 22 and higher vanishing at one point does not by itself make ff a straight line without an extra assumption (for example that ff equals its Taylor series around rr⁠), so the claim is stated only for a finite pp⁠.

Example: x+xpx+x^p

For f(x)=x+xpf(x)=x+x^p the root is r=0r=0⁠, with f′(0)=1f'(0)=1⁠, f(k)(0)=0f^{(k)}(0)=0 for 2≤k≤p−12\le k\le p-1 and f(p)(0)=p!f^{(p)}(0)=p!⁠.
By the claim, en+1enp→(p−1) p!p!⋅1=p−1\dfrac{e_{n+1}}{e_n^p}\to\dfrac{(p-1)\,p!}{p!\cdot1}=p-1⁠.

Work it out: write Newton’s step for f(x)=x+xpf(x)=x+x^p as a single fraction.
Then, for p=3p=3⁠, compute x1x_1 from x0=0.1x_0=0.1 and the ratio e1e03\dfrac{e_1}{e_0^3}⁠.

Solution

f′(x)=1+p xp−1f'(x)=1+p\,x^{p-1}⁠, so

xn+1=xn−xn+xnp1+p xnp−1=xn+p xnp−xn−xnp1+p xnp−1=(p−1) xnp1+p xnp−1x_{n+1}=x_n-\frac{x_n+x_n^p}{1+p\,x_n^{p-1}}=\frac{x_n+p\,x_n^p-x_n-x_n^p}{1+p\,x_n^{p-1}}=\frac{(p-1)\,x_n^p}{1+p\,x_n^{p-1}}

For p=3p=3 and x0=0.1x_0=0.1⁠:

x1=2⋅0.0011+3⋅0.01=0.0021.03=1515≈1.942×10−3x_1=\frac{2\cdot0.001}{1+3\cdot0.01}=\frac{0.002}{1.03}=\frac{1}{515}\approx1.942\times10^{-3}

The root is 00⁠, so en=xne_n=x_n and e1e03=21.03≈1.942\dfrac{e_1}{e_0^3}=\dfrac{2}{1.03}\approx1.942⁠. In general en+1enp=p−11+p xnp−1\dfrac{e_{n+1}}{e_n^p}=\dfrac{p-1}{1+p\,x_n^{p-1}}⁠, and since xn→0x_n\to0 the ratio tends to p−1p-1⁠.

From x0=0.1x_0=0.1⁠, the errors after three steps:

ppe1e_1e2e_2e3e_3
28.333×10−38.333\times10^{-3}6.831×10−56.831\times10^{-5}4.665×10−94.665\times10^{-9}
31.942×10−31.942\times10^{-3}1.464×10−81.464\times10^{-8}6.278×10−246.278\times10^{-24}
42.988×10−42.988\times10^{-4}2.392×10−142.392\times10^{-14}9.813×10−559.813\times10^{-55}
53.998×10−53.998\times10^{-5}4.086×10−224.086\times10^{-22}4.554×10−1074.554\times10^{-107}

The ratios en+1enp\dfrac{e_{n+1}}{e_n^p} tend to p−1p-1⁠:

ppe1/e0pe_1/e_0^pe2/e1pe_2/e_1^pe3/e2pe_3/e_2^p
20.83330.98360.9999
31.94172.00002.0000
42.98803.00003.0000
53.99804.00004.0000

The number of correct digits grows roughly pp-fold at each step:
for p=5p=5 the exponent of the error goes from −22-22 to −107-107⁠, roughly 55-fold.
These errors are far below the floor of double precision. In double precision the step xn−f(xn)f′(xn)x_n-\dfrac{f(x_n)}{f'(x_n)} subtracts two close numbers (catastrophic cancellation), and the result is accurate only to about 10−1610^{-16} relative to xnx_n⁠:
for p=5p=5 the second step already gives exactly 00⁠. So the tables were computed in exact arithmetic with fractions.

Why Newton Fails

Every failure breaks one of the conditions of the local convergence claim (in the section “When Convergence Is Guaranteed”):
a slope that stays away from zero (m>0m>0⁠), an interval on which f′′f'' is bounded, or a start that is close enough.
The table summarizes four cases. The first three are tabs in the explorer of the secant method and Newton–Raphson page:
“Newton from far”, “Newton cycles” and “Newton diverges”.

CaseWhat happensWhat is broken
An almost zero slopeA far jumpmm small, KK large
A cycle (x3−2x+2x^3-2x+2 from 0)Returns to earlier pointsf′f' vanishes on the way, f′′f'' changes sign
arctan⁡\arctan from 1.61.6Moving away from the rootA start above the threshold, f′f' decays
x2x^2 at a double rootLinear convergencef′(r)=0f'(r)=0

An almost zero slope

For f(x)=x2−2f(x)=x^2-2 from x0=0.01x_0=0.01 the slope is f′(0.01)=0.02f'(0.01)=0.02⁠, and the first step jumps to 0.01+2−0.00010.02=100.0050.01+\dfrac{2-0.0001}{0.02}=100.005⁠.
From there Newton returns slowly, roughly halving the distance at each step, so it takes 11 steps to an error of 10−1010^{-10}⁠, against 3 steps from 1.51.5⁠.

The reason: when the slope is small, mm is small and K=M2mK=\dfrac{M}{2m} is large, so the range ∣e0∣<1K\lvert e_0\rvert<\dfrac1K that the claim requires is very small.

The values and the count

The next values are 50.01250.012⁠, 25.02625.026⁠, 12.55312.553⁠, 6.3566.356⁠, 3.3353.335⁠, 1.9681.968⁠.
The count of 11 steps measures the true error. The explorer’s stopping rule checks both the step and ∣f∣|f|⁠, so it needs one more step:
12 against 4.

A cycle

For f(x)=x3−2x+2f(x)=x^3-2x+2 the real root is r≈−1.769r\approx-1.769⁠. From x0=0x_0=0 Newton jumps to x1=1x_1=1⁠, and from there back to x2=0x_2=0⁠, and so on forever:
the tangent at each of the two points leads to the other.

The reason: between the start and the root f′(x)=3x2−2f'(x)=3x^2-2 vanishes (at x=−2/3≈−0.816x=-\sqrt{2/3}\approx-0.816⁠), so there is no m>0m>0 and the local claim is empty.
f′′(x)=6xf''(x)=6x also changes sign, so the global condition does not hold.

The computation of the two steps

At x0=0x_0=0⁠: f(0)=2f(0)=2 and f′(0)=−2f'(0)=-2⁠, so x1=0−2−2=1x_1=0-\dfrac{2}{-2}=1⁠. At 11⁠: f(1)=1f(1)=1 and f′(1)=1f'(1)=1⁠, so x2=1−11=0x_2=1-\dfrac11=0⁠.

Divergence

For f(x)=arctan⁡xf(x)=\arctan x the root is 00 and the step is xn+1=xn−(1+xn2)arctan⁡xnx_{n+1}=x_n-(1+x_n^2)\arctan x_n⁠. There is a threshold:
below it the sequence converges, for example from 1.31.3⁠, and above it the sequence moves away, and from 1.61.6 we get −2.003-2.003⁠, 3.5513.551⁠, −14.09-14.09⁠, 285.2285.2⁠.

The reason: the derivative 11+x2\dfrac1{1+x^2} becomes small as we move away from the root, so mm is small on a long interval, and f′′f'' changes sign at 00⁠.

Where the threshold is

The threshold x∗≈1.3917x^*\approx1.3917 is the solution of (1+x2)arctan⁡x=2x(1+x^2)\arctan x=2x⁠. Then x1=−x∗x_1=-x^* and the sequence jumps between x∗x^* and −x∗-x^*⁠.

A double root

When f′(r)=0f'(r)=0 the derivative vanishes exactly at the root, so on every interval that contains it there is no m>0m>0⁠.

Work it out: for f(x)=x2f(x)=x^2 the root is 00⁠. Write Newton’s step, compute x1,x2,x3x_1,x_2,x_3 from x0=1x_0=1⁠, and check what happens to the ratio of consecutive errors.
Is the convergence quadratic?

Solution

xn+1=xn−xn22xn=xn2x_{n+1}=x_n-\dfrac{x_n^2}{2x_n}=\dfrac{x_n}{2}⁠. From 11 we get 0.50.5⁠, 0.250.25⁠, 0.1250.125⁠, and the error is halved at each step, that is, en+1en=12\dfrac{e_{n+1}}{e_n}=\dfrac12⁠.
The convergence is linear, not quadratic.

When to Stop

In a computation we do not know ene_n⁠, only the step εn=∣xn−xn−1∣\varepsilon_n=\lvert x_n-x_{n-1}\rvert and the residual δn=∣f(xn)∣\delta_n=\lvert f(x_n)\rvert⁠, which are the stopping rules of the course.
Two estimates connect them to the error:

  • By the residual. By the mean value theorem f(xn)=f(xn)−f(r)=f′(η) enf(x_n)=f(x_n)-f(r)=f'(\eta)\,e_n for some η\eta between xnx_n and rr⁠, so ∣en∣≤∣f(xn)∣m\lvert e_n\rvert\le\dfrac{\lvert f(x_n)\rvert}{m}⁠. When the slope is small, a small residual does not guarantee a small error.
  • By the step. Suppose K∣en−1∣≤12K\lvert e_{n-1}\rvert\le\tfrac12⁠. Then εn≥∣en−1∣−∣en∣≥∣en−1∣ (1−K∣en−1∣)≥12∣en−1∣\varepsilon_n\ge\lvert e_{n-1}\rvert-\lvert e_n\rvert\ge\lvert e_{n-1}\rvert\,(1-K\lvert e_{n-1}\rvert)\ge\tfrac12\lvert e_{n-1}\rvert⁠, that is ∣en−1∣≤2εn\lvert e_{n-1}\rvert\le2\varepsilon_n⁠, and from the bound ∣en∣≤K en−12\lvert e_n\rvert\le K\,e_{n-1}^2 we get ∣en∣≤4K εn2\lvert e_n\rvert\le4K\,\varepsilon_n^2⁠.

For x2−2x^2-2 from 1.51.5⁠: ε2=∣x2−x1∣=2.45×10−3\varepsilon_2=\lvert x_2-x_1\rvert=2.45\times10^{-3}⁠, and the bound 4Kε22=1.2×10−54K\varepsilon_2^2=1.2\times10^{-5} against the actual error e2=2.1×10−6e_2=2.1\times10^{-6}⁠.
After a step of 2.45×10−32.45\times10^{-3} the error of the new approximation is far smaller than the step, because it is about the square of the step.

The Secant Method: Convergence and Order

In the secant method the step xn+1=xn−f(xn) xn−xn−1f(xn)−f(xn−1)x_{n+1}=x_n-f(x_n)\,\dfrac{x_n-x_{n-1}}{f(x_n)-f(x_{n-1})} uses the two latest points.
We assume, as for Newton, that rr is a simple root (f′(r)≠0f'(r)\neq0⁠) and that ff is twice continuously differentiable near it.
The error ek=xk−re_k=x_k-r is a signed error: positive to the right of the root and negative to its left.
When only the size matters we write ∣ek∣\lvert e_k\rvert⁠.

The Error in One Step

Write fk=f(xk)f_k=f(x_k) and bring the step to a common denominator:

xn+1=xn (fn−fn−1)−fn (xn−xn−1)fn−fn−1x_{n+1}=\frac{x_n\,(f_n-f_{n-1})-f_n\,(x_n-x_{n-1})}{f_n-f_{n-1}}

In the numerator the terms xnfnx_nf_n and −fnxn-f_nx_n cancel, and what remains is:

xn+1=xn−1fn−xnfn−1fn−fn−1x_{n+1}=\frac{x_{n-1}f_n-x_nf_{n-1}}{f_n-f_{n-1}}

Subtract r=r fn−r fn−1fn−fn−1r=\dfrac{r\,f_n-r\,f_{n-1}}{f_n-f_{n-1}} from both sides. The numerator becomes (xn−1−r) fn−(xn−r) fn−1(x_{n-1}-r)\,f_n-(x_n-r)\,f_{n-1}⁠, that is:

en+1=en−1fn−enfn−1fn−fn−1e_{n+1}=\frac{e_{n-1}f_n-e_nf_{n-1}}{f_n-f_{n-1}}

Work it out: for f(x)=x2−2f(x)=x^2-2⁠, substitute into this formula and find en+1e_{n+1} in terms of ene_n⁠, en−1e_{n-1} and the points xn−1,xnx_{n-1},x_n⁠.

Hint

fk=xk2−2=xk2−r2f_k=x_k^2-2=x_k^2-r^2⁠. Factor it.

Solution

fk=(xk−r)(xk+r)=ek (xk+r)f_k=(x_k-r)(x_k+r)=e_k\,(x_k+r)⁠. In the numerator: en−1en (xn+r)−enen−1 (xn−1+r)=en en−1 (xn−xn−1)e_{n-1}e_n\,(x_n+r)-e_ne_{n-1}\,(x_{n-1}+r)=e_n\,e_{n-1}\,(x_n-x_{n-1})⁠. In the denominator: xn2−xn−12=(xn−xn−1)(xn+xn−1)x_n^2-x_{n-1}^2=(x_n-x_{n-1})(x_n+x_{n-1})⁠.
After cancelling xn−xn−1x_n-x_{n-1}⁠:

en+1=en en−1xn−1+xne_{n+1}=\frac{e_n\,e_{n-1}}{x_{n-1}+x_n}

The new error is the product of the two previous errors times a coefficient.
From x0=2x_0=2 and x1=1.5x_1=1.5 the first coefficient is 13.5≈0.2857\tfrac1{3.5}\approx0.2857⁠, and as the points approach 2\sqrt2 it approaches 122≈0.3536\tfrac1{2\sqrt2}\approx0.3536⁠.

The Taylor Approximation

For a general function we expand each fkf_k by Taylor’s formula with an error term around a=ra=r⁠.
Since f(r)=0f(r)=0⁠:

fk=f′(r) ek+12 f′′(ζk) ek2f_k=f'(r)\,e_k+\tfrac12\,f''(\zeta_k)\,e_k^2

where ζk\zeta_k (the Greek letter zeta) is a point between rr and xkx_k⁠.

The numerator. Substitute both expansions. The terms with f′(r)f'(r) are f′(r) en−1en−f′(r) enen−1=0f'(r)\,e_{n-1}e_n-f'(r)\,e_ne_{n-1}=0⁠, and what remains is:

en−1fn−enfn−1=12 en en−1(f′′(ζn) en−f′′(ζn−1) en−1)e_{n-1}f_n-e_nf_{n-1}=\tfrac12\,e_n\,e_{n-1}\bigl(f''(\zeta_n)\,e_n-f''(\zeta_{n-1})\,e_{n-1}\bigr)

The denominator.

fn−fn−1=f′(r) (en−en−1)+12(f′′(ζn) en2−f′′(ζn−1) en−12)f_n-f_{n-1}=f'(r)\,(e_n-e_{n-1})+\tfrac12\bigl(f''(\zeta_n)\,e_n^2-f''(\zeta_{n-1})\,e_{n-1}^2\bigr)

The replacement. When xn−1x_{n-1} and xnx_n are close to the root, so are ζn−1\zeta_{n-1} and ζn\zeta_n⁠, and f′′f'' is continuous.
So we replace f′′(ζn)f''(\zeta_n) and f′′(ζn−1)f''(\zeta_{n-1}) by f′′(r)f''(r)⁠. The numerator becomes 12f′′(r) enen−1 (en−en−1)\tfrac12 f''(r)\,e_ne_{n-1}\,(e_n-e_{n-1})⁠, and the denominator, by en2−en−12=(en−en−1)(en+en−1)e_n^2-e_{n-1}^2=(e_n-e_{n-1})(e_n+e_{n-1})⁠, becomes (en−en−1)(f′(r)+12f′′(r) (en+en−1))(e_n-e_{n-1})\bigl(f'(r)+\tfrac12 f''(r)\,(e_n+e_{n-1})\bigr)⁠.
The factor en−en−1e_n-e_{n-1} is common to both, and we cancel it:

en+1≈12f′′(r) en en−1f′(r)+12f′′(r) (en+en−1)≈C en en−1,C=f′′(r)2f′(r)e_{n+1}\approx\frac{\tfrac12 f''(r)\,e_n\,e_{n-1}}{f'(r)+\tfrac12 f''(r)\,(e_n+e_{n-1})}\approx C\,e_n\,e_{n-1},\qquad C=\frac{f''(r)}{2f'(r)}

The second ≈\approx holds because en+en−1→0e_n+e_{n-1}\to0⁠. The new error is approximately a constant times the product of the two previous errors, not times the square of one error as in Newton.
The constant CC is the same as Newton’s.

For x2−2x^2-2 from x0=2x_0=2 and x1=1.5x_1=1.5 the errors e0,…,e5e_0,\dots,e_5 are 5.858×10−15.858\times10^{-1}⁠, 8.579×10−28.579\times10^{-2}⁠, 1.436×10−21.436\times10^{-2}⁠, 4.206×10−44.206\times10^{-4}⁠, 2.124×10−62.124\times10^{-6} and 3.158×10−103.158\times10^{-10}⁠.
The ratios en+1en en−1\dfrac{e_{n+1}}{e_n\,e_{n-1}} for n=1,2,3,4n=1,2,3,4 are 0.28570.2857⁠, 0.34150.3415⁠, 0.35170.3517 and 0.35350.3535⁠, approaching C=22⋅22≈0.3536C=\dfrac{2}{2\cdot2\sqrt2}\approx0.3536⁠.

What the replacement neglects, and when the cancellation is allowed

Let τn\tau_n be the larger of ∣f′′(ζn)−f′′(r)∣\lvert f''(\zeta_n)-f''(r)\rvert and ∣f′′(ζn−1)−f′′(r)∣\lvert f''(\zeta_{n-1})-f''(r)\rvert⁠. The replacement changes the bracket in the numerator by αn=(f′′(ζn)−f′′(r))en−(f′′(ζn−1)−f′′(r))en−1\alpha_n=\bigl(f''(\zeta_n)-f''(r)\bigr)e_n-\bigl(f''(\zeta_{n-1})-f''(r)\bigr)e_{n-1} and the bracket in the denominator by βn=(f′′(ζn)−f′′(r))en2−(f′′(ζn−1)−f′′(r))en−12\beta_n=\bigl(f''(\zeta_n)-f''(r)\bigr)e_n^2-\bigl(f''(\zeta_{n-1})-f''(r)\bigr)e_{n-1}^2⁠, so

∣αn∣≤τn(∣en∣+∣en−1∣),∣βn∣≤τn(∣en∣+∣en−1∣)2\lvert\alpha_n\rvert\le\tau_n\bigl(\lvert e_n\rvert+\lvert e_{n-1}\rvert\bigr),\qquad\lvert\beta_n\rvert\le\tau_n\bigl(\lvert e_n\rvert+\lvert e_{n-1}\rvert\bigr)^2

Dividing the numerator and the denominator by 12 (en−en−1)\tfrac12\,(e_n-e_{n-1}) gives an exact equality, without ≈\approx⁠:

en+1en en−1=f′′(r)+αnen−en−12f′(r)+f′′(r) (en+en−1)+βnen−en−1\frac{e_{n+1}}{e_n\,e_{n-1}}=\frac{f''(r)+\dfrac{\alpha_n}{e_n-e_{n-1}}}{2f'(r)+f''(r)\,(e_n+e_{n-1})+\dfrac{\beta_n}{e_n-e_{n-1}}}

When xn→rx_n\to r⁠, also ζn→r\zeta_n\to r⁠, so τn→0\tau_n\to0 because f′′f'' is continuous.
But αn\alpha_n and βn\beta_n are small relative to ∣en∣+∣en−1∣\lvert e_n\rvert+\lvert e_{n-1}\rvert⁠, and we divide them by en−en−1e_n-e_{n-1}⁠.
So the cancellation is justified when the ratio λn=∣en∣+∣en−1∣∣en−en−1∣\lambda_n=\dfrac{\lvert e_n\rvert+\lvert e_{n-1}\rvert}{\lvert e_n-e_{n-1}\rvert} stays bounded.
Then ∣αnen−en−1∣≤τnλn→0\left\lvert\dfrac{\alpha_n}{e_n-e_{n-1}}\right\rvert\le\tau_n\lambda_n\to0 and ∣βnen−en−1∣≤τnλn(∣en∣+∣en−1∣)→0\left\lvert\dfrac{\beta_n}{e_n-e_{n-1}}\right\rvert\le\tau_n\lambda_n\bigl(\lvert e_n\rvert+\lvert e_{n-1}\rvert\bigr)\to0⁠, and the ratio tends to f′′(r)2f′(r)=C\dfrac{f''(r)}{2f'(r)}=C⁠.

The ratio λn\lambda_n is bounded when the error shrinks at every step by at least a fixed factor:
if ∣en∣≤q ∣en−1∣\lvert e_n\rvert\le q\,\lvert e_{n-1}\rvert with q<1q<1⁠, then ∣en−en−1∣≥(1−q) ∣en−1∣\lvert e_n-e_{n-1}\rvert\ge(1-q)\,\lvert e_{n-1}\rvert and ∣en∣+∣en−1∣≤(1+q) ∣en−1∣\lvert e_n\rvert+\lvert e_{n-1}\rvert\le(1+q)\,\lvert e_{n-1}\rvert⁠, so λn≤1+q1−q\lambda_n\le\dfrac{1+q}{1-q}⁠. This is what the claim in the subsection “Bound and Convergence” guarantees.
When two consecutive errors are almost equal, en−en−1e_n-e_{n-1} is very small and the neglected terms can be larger than it.
The exact identity in that subsection needs no such assumption.

Bound and Convergence

To prove that the method converges we need an exact identity, without ≈\approx⁠.
Rolle’s theorem, applied twice, gives it:

en+1=Kn en en−1,Kn=f′′(ξn)2 sne_{n+1}=K_n\,e_n\,e_{n-1},\qquad K_n=\frac{f''(\xi_n)}{2\,s_n}

Here sn=fn−fn−1xn−xn−1s_n=\dfrac{f_n-f_{n-1}}{x_n-x_{n-1}} is the slope of the secant line, and ξn\xi_n is a point in the smallest interval that contains xn−1x_{n-1}⁠, xnx_n and rr⁠.
By the mean value theorem sn=f′(ηn)s_n=f'(\eta_n) for some ηn\eta_n between xn−1x_{n-1} and xnx_n⁠.
For x2−2x^2-2 this is the formula from the exercise: f′′=2f''=2 and sn=xn−1+xns_n=x_{n-1}+x_n⁠.

Proof: the exact identity by Rolle's theorem

Rolle’s theorem (from calculus): if a differentiable function takes the same value at two points, its derivative vanishes at some point between them.
Let LL be the line through (xn−1,fn−1)(x_{n-1},f_{n-1}) and (xn,fn)(x_n,f_n)⁠, and assume that rr differs from both points.
Otherwise fn−1=0f_{n-1}=0 or fn=0f_n=0⁠, the step gives xn+1=rx_{n+1}=r⁠, and both sides of the identity are zero.

  1. An auxiliary function. Define g(x)=f(x)−L(x)−κ (x−xn−1)(x−xn)g(x)=f(x)-L(x)-\kappa\,(x-x_{n-1})(x-x_n)⁠, and choose the number κ\kappa (the Greek letter kappa) so that g(r)=0g(r)=0⁠. This is possible because (r−xn−1)(r−xn)≠0(r-x_{n-1})(r-x_n)\neq0⁠. The line LL passes through both points, so also g(xn−1)=0g(x_{n-1})=0 and g(xn)=0g(x_n)=0⁠: gg has three distinct zeros.
  2. Rolle twice. Between any two neighbouring zeros of gg there is, by Rolle’s theorem, a zero of g′g'⁠, so g′g' has two distinct zeros. Between them there is a zero of g′′g''⁠: a point ξn\xi_n in the smallest interval that contains xn−1x_{n-1}⁠, xnx_n and rr⁠.
  3. Finding κ\kappa⁠. LL is a line, so L′′=0L''=0⁠, and the second derivative of (x−xn−1)(x−xn)(x-x_{n-1})(x-x_n) is 22⁠. So g′′(x)=f′′(x)−2κg''(x)=f''(x)-2\kappa⁠, and g′′(ξn)=0g''(\xi_n)=0 gives κ=12f′′(ξn)\kappa=\tfrac12 f''(\xi_n)⁠. From g(r)=0g(r)=0 we get f(r)−L(r)=12f′′(ξn) (r−xn−1)(r−xn)f(r)-L(r)=\tfrac12 f''(\xi_n)\,(r-x_{n-1})(r-x_n)⁠.
  4. To errors. f(r)=0f(r)=0 and (r−xn−1)(r−xn)=en−1 en(r-x_{n-1})(r-x_n)=e_{n-1}\,e_n⁠, so −L(r)=12f′′(ξn) en−1en-L(r)=\tfrac12 f''(\xi_n)\,e_{n-1}e_n⁠.
  5. The point xn+1x_{n+1}⁠. The point xn+1x_{n+1} is where LL crosses the axis, L(xn+1)=0L(x_{n+1})=0⁠, and LL is a line with slope sns_n⁠. So L(r)=L(r)−L(xn+1)=sn (r−xn+1)=−sn en+1L(r)=L(r)-L(x_{n+1})=s_n\,(r-x_{n+1})=-s_n\,e_{n+1}⁠.
  6. Comparison. From the last two items sn en+1=12f′′(ξn) en−1ens_n\,e_{n+1}=\tfrac12 f''(\xi_n)\,e_{n-1}e_n⁠. When f′f' does not vanish between xn−1x_{n-1} and xnx_n⁠, sn=f′(ηn)≠0s_n=f'(\eta_n)\neq0⁠, and dividing by sns_n gives the identity.

Claim (local convergence of the secant method). Let I=[r−ρ, r+ρ]I=[r-\rho,\,r+\rho] be an interval on which ∣f′∣≥m>0\lvert f'\rvert\ge m>0 and ∣f′′∣≤M\lvert f''\rvert\le M⁠.
Denote K=M2mK=\dfrac{M}{2m} (the same KK as in Newton’s bound) and q=Kρq=K\rho⁠, and assume q<1q<1⁠.
If x0≠x1x_0\neq x_1 both lie in II⁠, then every xnx_n belongs to II⁠, every step is defined until the root is reached exactly (and then we stop), and:

∣en+1∣≤K ∣en∣ ∣en−1∣≤q ∣en∣\lvert e_{n+1}\rvert\le K\,\lvert e_n\rvert\,\lvert e_{n-1}\rvert\le q\,\lvert e_n\rvert

Hence ∣en∣≤q n−1∣e1∣\lvert e_n\rvert\le q^{\,n-1}\lvert e_1\rvert for every n≥1n\ge1⁠, and the errors tend to 00 at least as fast as a geometric sequence with ratio qq⁠.

The claim requires two distinct starts close enough to the root, and does not require the root to lie between them.
These are sufficient, local conditions: they are not necessary, and they say nothing about a distant start.
For x2−2x^2-2 the method converges to 2\sqrt2 also from x0=10x_0=10 and x1=9x_1=9⁠, although every interval [r−ρ, r+ρ][r-\rho,\,r+\rho] around the root that contains 1010 also contains 00⁠, where f′=0f'=0⁠.
A double root (f′(r)=0f'(r)=0⁠) does not satisfy the condition m>0m>0 on any interval around it.

For x2−2x^2-2 with ρ=0.6\rho=0.6⁠: m=2 (r−0.6)≈1.628m=2\,(r-0.6)\approx1.628⁠, M=2M=2⁠, K≈0.614K\approx0.614 and q≈0.368<1q\approx0.368<1⁠. The starts x0=2x_0=2 and x1=1.5x_1=1.5 are inside II (∣e0∣≈0.586\lvert e_0\rvert\approx0.586⁠), so every error is smaller than the previous one by at least the factor 0.3680.368⁠.
In fact ∣e2∣/∣e1∣≈0.167\lvert e_2\rvert/\lvert e_1\rvert\approx0.167⁠, and the next ratios are smaller still.

Proof: the approximations stay in the interval and the errors shrink

By induction on n≥1n\ge1⁠. The hypothesis: xn−1x_{n-1} and xnx_n are in II⁠, distinct, and neither of them is rr (otherwise the root is found and we stop).
For n=1n=1 this is the assumption of the claim.

  1. The step is defined. By the mean value theorem sn=f′(ηn)s_n=f'(\eta_n) with ηn\eta_n between xn−1x_{n-1} and xnx_n⁠, that is in II⁠. So ∣sn∣≥m>0\lvert s_n\rvert\ge m>0⁠, that is fn≠fn−1f_n\neq f_{n-1}⁠.
  2. The bound. ξn\xi_n lies in the smallest interval that contains xn−1x_{n-1}⁠, xnx_n and rr⁠, all of which are in II⁠, so ∣f′′(ξn)∣≤M\lvert f''(\xi_n)\rvert\le M⁠. From the identity: ∣en+1∣=∣f′′(ξn)∣2∣sn∣ ∣en∣ ∣en−1∣≤K ∣en∣ ∣en−1∣\lvert e_{n+1}\rvert=\dfrac{\lvert f''(\xi_n)\rvert}{2\lvert s_n\rvert}\,\lvert e_n\rvert\,\lvert e_{n-1}\rvert\le K\,\lvert e_n\rvert\,\lvert e_{n-1}\rvert⁠.
  3. The new approximation is in the interval. ∣en−1∣≤ρ\lvert e_{n-1}\rvert\le\rho⁠, so ∣en+1∣≤Kρ ∣en∣=q ∣en∣<∣en∣≤ρ\lvert e_{n+1}\rvert\le K\rho\,\lvert e_n\rvert=q\,\lvert e_n\rvert<\lvert e_n\rvert\le\rho⁠, that is xn+1∈Ix_{n+1}\in I⁠.
  4. The points are distinct. By item 3 ∣en+1∣<∣en∣\lvert e_{n+1}\rvert<\lvert e_n\rvert⁠, so xn+1≠xnx_{n+1}\neq x_n⁠. If xn+1=rx_{n+1}=r the root is found; otherwise the hypothesis holds for n+1n+1⁠.

By item 3 ∣en+1∣≤q ∣en∣\lvert e_{n+1}\rvert\le q\,\lvert e_n\rvert for every n≥1n\ge1⁠, and by induction ∣en∣≤q n−1∣e1∣\lvert e_n\rvert\le q^{\,n-1}\lvert e_1\rvert⁠.

The Order of Convergence

Claim (the order). Denote φ=1+52≈1.618\varphi=\dfrac{1+\sqrt5}{2}\approx1.618 (the golden ratio). Assume that xn→rx_n\to r⁠, that xn≠rx_n\neq r for every nn⁠, and that f′′(r)≠0f''(r)\neq0⁠.
Then

lim⁡n→∞en+1en en−1=C=f′′(r)2f′(r)\lim_{n\to\infty}\frac{e_{n+1}}{e_n\,e_{n-1}}=C=\frac{f''(r)}{2f'(r)}

and also:

lim⁡n→∞∣en+1∣∣en∣φ=∣C∣φ−1\lim_{n\to\infty}\frac{\lvert e_{n+1}\rvert}{\lvert e_n\rvert^{\varphi}}=\lvert C\rvert^{\varphi-1}

That is, the order of convergence of the secant method is φ\varphi⁠:
the number of correct digits grows by a factor of about 1.6181.618 at each step, against a factor of 22 for Newton.

Where does φ\varphi come from? If ∣en+1∣≈A ∣en∣p\lvert e_{n+1}\rvert\approx A\,\lvert e_n\rvert^{p} for every nn⁠, then also ∣en∣≈A ∣en−1∣p\lvert e_n\rvert\approx A\,\lvert e_{n-1}\rvert^{p}⁠.
Substitute both into ∣en+1∣≈∣C∣ ∣en∣ ∣en−1∣\lvert e_{n+1}\rvert\approx\lvert C\rvert\,\lvert e_n\rvert\,\lvert e_{n-1}\rvert⁠: the left side gives the power ∣en−1∣p2\lvert e_{n-1}\rvert^{p^2}⁠, and the right side ∣en−1∣p+1\lvert e_{n-1}\rvert^{p+1}⁠.
Matching the powers gives p2=p+1p^2=p+1⁠, whose positive solution is φ\varphi⁠.
This matching of powers assumes in advance that the ratio ∣en+1∣/∣en∣p\lvert e_{n+1}\rvert/\lvert e_n\rvert^{p} approaches a constant, so it does not prove that the limit exists.
The proof in the next block makes no such assumption.

For x2−2x^2-2 from 22 and 1.51.5 the ratios ∣en+1∣/∣en∣φ\lvert e_{n+1}\rvert/\lvert e_n\rvert^{\varphi} for n=1,…,6n=1,\dots,6 are 0.7640.764⁠, 0.4030.403⁠, 0.6160.616⁠, 0.4770.477⁠, 0.5590.559 and 0.5070.507⁠:
they oscillate around ∣C∣φ−1≈0.526\lvert C\rvert^{\varphi-1}\approx0.526 and approach it. We computed e7≈2.6×10−26e_7\approx2.6\times10^{-26} with hundreds of digits, because it is far below machine precision.

Proof: the limit and the golden-ratio order
  1. The limit of KnK_n⁠. Since f′(r)≠0f'(r)\neq0 and f′f'⁠, f′′f'' are continuous, there is an interval II around rr as in the local convergence claim, and from some index on xn−1x_{n-1} and xnx_n lie in it. From there the identity en+1=Kn en en−1e_{n+1}=K_n\,e_n\,e_{n-1} holds, with Kn=f′′(ξn)2f′(ηn)K_n=\dfrac{f''(\xi_n)}{2f'(\eta_n)}⁠. Both ends of the smallest interval that contains xn−1x_{n-1}⁠, xnx_n and rr tend to rr⁠, so by the squeeze theorem ξn→r\xi_n\to r and ηn→r\eta_n\to r⁠. By continuity of f′′f'' and f′f' we get Kn→f′′(r)2f′(r)=CK_n\to\dfrac{f''(r)}{2f'(r)}=C⁠. Also Kn≠0K_n\neq0⁠, because en+1≠0e_{n+1}\neq0⁠.
  2. Logarithms. Let cn=∣C∣ ∣en∣>0c_n=\lvert C\rvert\,\lvert e_n\rvert>0 and un=−ln⁡cnu_n=-\ln c_n⁠. Multiplying the identity by ∣C∣\lvert C\rvert gives cn+1=∣Kn∣∣C∣ cn cn−1c_{n+1}=\dfrac{\lvert K_n\rvert}{\lvert C\rvert}\,c_n\,c_{n-1}⁠, and after taking logarithms un+1=un+un−1+dnu_{n+1}=u_n+u_{n-1}+d_n with dn=−ln⁡∣Kn∣∣C∣→0d_n=-\ln\dfrac{\lvert K_n\rvert}{\lvert C\rvert}\to0⁠. The value unu_n is large when the error is small, and up to a constant it is the number of correct digits.
  3. Fibonacci. Without dnd_n this is the Fibonacci recurrence tn+1=tn+tn−1t_{n+1}=t_n+t_{n-1}⁠. Substituting tn=pnt_n=p^n gives p2=p+1p^2=p+1⁠, whose roots are φ=1+52\varphi=\tfrac{1+\sqrt5}{2} and ψ=1−52≈−0.618\psi=\tfrac{1-\sqrt5}{2}\approx-0.618⁠, and the solutions are Aφn+BψnA\varphi^n+B\psi^n⁠. Note that φ+ψ=1\varphi+\psi=1 and φψ=−1\varphi\psi=-1⁠.
  4. The deviation from growth by φ\varphi⁠. Let vn=un+1−φ unv_n=u_{n+1}-\varphi\,u_n⁠. By 1−φ=ψ1-\varphi=\psi and −ψφ=1-\psi\varphi=1⁠: vn=ψ un+un−1+dn=ψ (un−φ un−1)+dn=ψ vn−1+dnv_n=\psi\,u_n+u_{n-1}+d_n=\psi\,(u_n-\varphi\,u_{n-1})+d_n=\psi\,v_{n-1}+d_n⁠.
  5. The deviation tends to 00⁠. Let ϵ>0\epsilon>0 and NN be such that ∣dk∣≤ϵ\lvert d_k\rvert\le\epsilon for every k>Nk>N⁠. Unrolling the recurrence gives vn=ψ n−NvN+∑j=0n−N−1ψ jdn−jv_n=\psi^{\,n-N}v_N+\sum_{j=0}^{n-N-1}\psi^{\,j}d_{n-j}⁠, so ∣vn∣≤∣ψ∣ n−N∣vN∣+ϵ∑j=0∞∣ψ∣ j\lvert v_n\rvert\le\lvert\psi\rvert^{\,n-N}\lvert v_N\rvert+\epsilon\sum_{j=0}^{\infty}\lvert\psi\rvert^{\,j}⁠, where ∑j=0∞∣ψ∣ j=1+∣ψ∣+∣ψ∣2+⋯=11−∣ψ∣\sum_{j=0}^{\infty}\lvert\psi\rvert^{\,j}=1+\lvert\psi\rvert+\lvert\psi\rvert^{2}+\cdots=\dfrac{1}{1-\lvert\psi\rvert}⁠, because ∣ψ∣<1\lvert\psi\rvert<1⁠. The first term tends to 00⁠, so for every large enough nn⁠, ∣vn∣≤ϵ+ϵ1−∣ψ∣\lvert v_n\rvert\le\epsilon+\dfrac{\epsilon}{1-\lvert\psi\rvert}⁠. This holds for every ϵ>0\epsilon>0⁠, so vn→0v_n\to0⁠.
  6. Conclusion. vn=−ln⁡cn+1+φln⁡cn=−ln⁡cn+1cnφ→0v_n=-\ln c_{n+1}+\varphi\ln c_n=-\ln\dfrac{c_{n+1}}{c_n^{\varphi}}\to0⁠, so cn+1cnφ=∣C∣1−φ ∣en+1∣∣en∣φ→1\dfrac{c_{n+1}}{c_n^{\varphi}}=\lvert C\rvert^{1-\varphi}\,\dfrac{\lvert e_{n+1}\rvert}{\lvert e_n\rvert^{\varphi}}\to1⁠, which is the claim. Moreover un+1un=φ+vnun→φ\dfrac{u_{n+1}}{u_n}=\varphi+\dfrac{v_n}{u_n}\to\varphi⁠, because un→∞u_n\to\infty⁠: the number of digits grows by a factor of about φ\varphi⁠.

The recurrence vn=ψ vn−1+dnv_n=\psi\,v_{n-1}+d_n explains the oscillation in the numbers for x2−2x^2-2⁠:
the deviations alternate in sign and shrink at each step by a factor of about ∣ψ∣≈0.618\lvert\psi\rvert\approx0.618⁠.
In the example the ratios vn/vn−1v_n/v_{n-1} are −0.711-0.711⁠, −0.598-0.598⁠, −0.619-0.619 and −0.618-0.618⁠.
Another proof of the order, with a different tool, is on the secant method and Newton–Raphson page.

Takeaways

  • The tangent is the Taylor polynomial of degree one, and Newton solves it instead of the equation.
  • The Taylor error term gives the identity en+1=f′′(ξn)2f′(xn)en2e_{n+1}=\dfrac{f''(\xi_n)}{2f'(x_n)}e_n^2⁠, and so the bound ∣en+1∣≤Ken2\lvert e_{n+1}\rvert\le K e_n^2 with K=M2mK=\dfrac{M}{2m}⁠.
  • The condition K∣e0∣<1K\lvert e_0\rvert<1 guarantees quadratic convergence, because qn=K∣en∣q_n=K\lvert e_n\rvert satisfies qn+1≤qn2q_{n+1}\le q_n^2⁠. Another condition, derivatives that do not change sign and a start on the right side, guarantees monotone convergence.
  • Every failure breaks a condition: a slope close to zero, a start far from the root, a sign change of the derivatives, or a double root.
  • A small residual (δn\delta_n⁠) is not a small error when the slope is small.

Keep Learning:

The Newton–Raphson and secant practice practices the steps by hand and in code, and fixed-point iteration and IQI show Newton as a special case of an iteration with g′(x∗)=0g'(x^*)=0⁠.