Newton's method: fast, until it isn't
The question
Newton's method follows tangent lines toward a root of x³ − 2x + 2. From which starts does it get there, and from which never?
Move the start yourself; the page draws every step.
- 1 SeeHunt for starts that make Newton fail.
- 2 TryPredict the speed at other roots.
- 3 ProveBuild the error bound, line by line.
- 4 ApplyProblems to check yourself.
Before you start · 3 quick checks on tangent lines, bisection and derivatives, about 3 min
Two ideas before you start
2 ideasFollow the tangent down to the axis
Figure: the parabola y = x² − 2, its tangent line at x₀ and the point x₁ where the tangent meets the axis. It needs JavaScript.
Step: x₁ = 2 − 2/4 = 1.5
Here f(x) = x² − 2. Newton's method replaces the curve by its tangent line at the current guess and moves to where that line meets the axis. Then it repeats from the new point.
Exact definition
One step. Let \(f\) be differentiable, and let \(x_k\) be a number with \(f'(x_k) \ne 0\). The tangent line at \(x_k\) is \(y = f(x_k) + f'(x_k)(x - x_k)\). It meets the axis \(y = 0\) at
\[x_{k+1} = x_k - \frac{f(x_k)}{f'(x_k)}.\]Newton's method. Start at a number \(x_0\), and repeat the step for \(k = 0, 1, 2, \dots\) as long as \(f'(x_k) \ne 0\). The map \(N(x) = x - f(x)/f'(x)\) is the Newton map, so \(x_{k+1} = N(x_k)\). A root \(r\) of \(f\) with \(f'(r) \ne 0\) satisfies \(N(r) = r\), so the method stays at such a root once it lands on it.
Count the correct decimal places
Figure: the parabola near √2, a dotted line at √2, a dashed line at the guess x, and a shaded band of numbers within 0.5 × 10⁻ᵈ of √2. It needs JavaScript.
x = 1.4: |x − √2| ≈ 0.0142
1 correct decimal place: |x − √2| ≤ 0.5 × 10⁻¹, but not ≤ 0.5 × 10⁻².
The error of a guess x is its distance to the root. This page counts x as having d correct decimal places when that distance is at most 0.5 × 10⁻ᵈ. Each tap zooms in on the shaded band of such numbers.
Exact definition
Error. For a guess \(x_k\) of a root \(r\), the error is \(e_k = x_k - r\), and its size is \(|e_k|\).
Correct decimal places. On this page, \(x_k\) has \(d\) correct decimal places when \(d\) is the largest whole number \(d \ge 0\) with \(|e_k| \le 0.5 \times 10^{-d}\). If \(|e_k| \gt 0.5\), the count is 0.
Fine print: names and scope
Newton's method is also called the Newton–Raphson method. This page treats one equation \(f(x) = 0\) in one unknown. For a system of equations the same idea uses the matrix of partial derivatives in place of \(f'\); that version is not treated here.
The method needs the derivative \(f'\), but no bracket: unlike bisection, nothing keeps the iterates close to a root.
Hunt for starts that make Newton fail
- Set the start x₀ with the slider, in steps of 0.05 from −3 to 3.
- The figure draws the first Newton steps from x₀, and the table lists the iterates with their errors.
- Reach the four goals. Each goal sets its function; the two buttons switch the function when you explore on your own.
| k | xk | |xk − r| | Places |
|---|
How the page decides
The page runs up to 50 Newton steps from \(x_0\) and stops at the first of these events. Root: an iterate within \(10^{-12}\) of the root. Trapped (only for \(x^3 - 2x + 2\)): an iterate lands in a small interval from which, as the summary after the goals proves, Newton can never reach the root. Run off: an iterate larger than \(10^6\) in size. If none happens in 50 steps, the page gives no verdict.
For \(x^3 - 2x + 2\) the page computes with 100 decimal digits, because a start that wanders for many steps would otherwise end with iterates whose last digits depend on rounding. For \(\arctan x\) it uses floating point, with a series for the step near 0. A summary of why each verdict holds opens after the four goals.
Count the digits at other roots
A prediction first. The explorer below it opens once it is answered.
The explorer and its goals open after you answer the prediction.
Explorer: three roots, one start
Choose a function and a start \(x_0\). The table shows six Newton steps, the error \(e_k = x_k - r\) and the ratio \(e_k/e_{k-1}\) of each error to the one before.
| k | xk | ek | ek/ek−1 |
|---|
Goals
A simple root. For \(f(x) = x^2 - 2\) one step gives exactly
\[\begin{aligned} e_{k+1} &= \frac{x_k^2 + 2}{2x_k} - \sqrt{2} \\ &= \frac{(x_k - \sqrt{2})^2}{2x_k} = \frac{e_k^2}{2x_k}, \end{aligned}\]so the ratio \(e_{k+1}/e_k = e_k/(2x_k)\) itself tends to 0 as \(x_k \to \sqrt{2}\), unlike the fixed ratios below.
Repeated roots. For \(f(x) = (x - 1)^m\) with a whole number \(m \ge 2\) and \(x \ne 1\),
\[\begin{aligned} N(x) &= x - \frac{(x - 1)^m}{m(x - 1)^{m-1}} \\ &= x - \frac{x - 1}{m}, \end{aligned}\]so
\[e_{k+1} = \Bigl(1 - \frac{1}{m}\Bigr)e_k.\]The ratio is fixed: \(\tfrac{1}{2}\) for the double root and \(\tfrac{2}{3}\) for the triple root, however close the start is. That is linear convergence, like bisection, and slower for larger \(m\).
One more function
| k | xk |
|---|
Why the error is squared
Assumptions. \(f\) is twice continuously differentiable on \(I = [r - \delta, r + \delta]\) with \(\delta \gt 0\), and \(f(r) = 0\). There are numbers \(m \gt 0\) and \(M \gt 0\) with \(|f'(x)| \ge m\) and \(|f''(x)| \le M\) for every \(x\) in \(I\). Let \(C = M/(2m)\).
Conclusion. If \(x_0\) lies in \(I\) and \(C|x_0 - r| \lt \tfrac{1}{2}\), then every Newton iterate \(x_k\) is defined and lies in \(I\), and the errors \(e_k = x_k - r\) satisfy
\[|e_{k+1}| \le Ce_k^2\]for every \(k \ge 0\). In particular \(C|e_k| \le (C|e_0|)^{2^k}\), so \(x_k \to r\).
When it applies. If \(f\) is twice continuously differentiable near a root \(r\) with \(f'(r) \ne 0\), such \(\delta\), \(m\) and \(M\) exist: by continuity \(|f'(x)| \ge \tfrac{1}{2}|f'(r)|\) on a short enough interval around \(r\), and \(|f''|\) is bounded there. So every start close enough to a simple root gets this speed.
Facts the proof uses.
- Taylor's theorem with the Lagrange remainder, from the lesson on Taylor polynomials: for \(a\) and \(x\) in \(I\) there is a \(\xi\) between \(a\) and \(x\) with \[\begin{aligned} f(x) &= f(a) + f'(a)(x - a) \\ &\quad + \tfrac{1}{2}f''(\xi)(x - a)^2; \end{aligned}\]
- \(f'\) is continuous and never 0 on \(I\), so it keeps one sign there; then \(f\) is strictly monotone on \(I\), and \(r\) is its only root in \(I\);
- ordinary algebra and the rules for absolute values.
Fix a step \(k\) with \(x_k\) in \(I\) and \(C|e_k| \lt \tfrac{1}{2}\). If \(e_k = 0\), then \(x_k = r\), \(f(x_k) = 0\) and \(x_{k+1} = r\), so the bound holds. From here on \(e_k \ne 0\). Then \(f(x_k) \ne 0\), since \(r\) is the only root in \(I\), and \(f'(x_k) \ne 0\), since \(|f'(x_k)| \ge m\).
Each option is one step about this \(k\). Pick the one that is true for every function and every \(x_k\) the setup allows, with \(e_k \ne 0\) and \(C|e_k| \lt \tfrac{1}{2}\).
- Digits double. Line 5 gives \(C|e_{k+1}| \le (C|e_k|)^2\) at every step, so \(C|e_k| \le (C|e_0|)^{2^k}\). If \(C|e_k| \le 10^{-j}\), then \(C|e_{k+1}| \le 10^{-2j}\): the exponent in this bound at least doubles at each step, so the correct decimal places of \(x_k\) roughly double once \(e_k\) is small.
- The exact constant. Line 3 gives \(e_{k+1}/e_k^2 = f''(\xi_k)/(2f'(x_k))\) whenever \(e_k \ne 0\). As \(x_k \to r\), \(\xi_k \to r\) too, so the ratio tends to \(f''(r)/(2f'(r))\). When \(f''(r) = 0\), as for \(\arctan x\) at 0, the error shrinks even faster than squaring.
- Where the assumptions fail. At a double root \(f'(r) = 0\), so no \(m \gt 0\) works next to \(r\); stage 2 showed the speed drop to halving. For \(\sqrt[3]{x}\), \(f\) is not differentiable at the root. And a start with \(C|e_0| \ge \tfrac{1}{2}\) is not covered at all: stage 1 showed what can happen then.
Problems
Each problem has hints and a full solution. Exact answers can be typed as a decimal or a fraction.
Related: numerical integration is another place where the error of a method shrinks like a power, there of the grid spacing; floating point explains why a computed root can only be as accurate as the arithmetic.
Further reading
- R. L. Burden and J. D. Faires, Numerical Analysis, chapter 2, “Solutions of Equations in One Variable,” on Newton's method and its order of convergence.
- E. Süli and D. F. Mayers, An Introduction to Numerical Analysis (Cambridge University Press, 2003), chapter 1, “Solution of equations by iteration.”
- C. T. Kelley, Solving Nonlinear Equations with Newton's Method (SIAM, 2003), chapter 1, on local convergence and its assumptions.