Math ClubMath Club
v1 · padrão canônico

Lesson 69 — Newton-Raphson Method

The iteration $x_{n+1} = x_n - f(x_n)/f'(x_n)$ for finding roots. Quadratic convergence, failures, basins of attraction.

Used in: Year 2 of program (age 17) · Equivalent Japanese Math III (numerical methods) · Equivalent German Klasse 12 LK (Numerik)

xn+1=xnf(xn)f(xn)x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}
Choose your door

Rigorous notation, full derivation, hypotheses

Definition, Derivation, and Convergence

The Newton-Raphson Iteration

"Newton's Method is a technique to approximate the solution of f(x)=0f(x) = 0. It works when one can perform repeated evaluations of ff and ff', making it ideal for functions like polynomials, exponentials, and trigonometric functions." — APEX Calculus, §4.4

Derivation via Linear Approximation (1st Order Taylor)

If rr is a root of ff and xnx_n is close to rr, by the Taylor expansion:

0=f(r)f(xn)+f(xn)(rxn).0 = f(r) \approx f(x_n) + f'(x_n)(r - x_n).

Solving for rr: rxnf(xn)/f(xn)=xn+1r \approx x_n - f(x_n)/f'(x_n) = x_{n+1}. The iteration defines the next estimate as the zero of the linear approximation.

xy(xn,f(xn))(x_n, f(x_n))xn+1x_{n+1}xnx_nrry=f(x)y = f(x)tangent at xnx_n

The tangent at (xn,f(xn))(x_n, f(x_n)) intersects the x-axis at xn+1x_{n+1}, always closer to the root rr (blue filled dot) — provided x0x_0 is sufficiently close.

Theorem of Local Convergence

Proof (sketch). Let en=xnre_n = x_n - r. Taylor expansion of ff around rr:

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

for some ξn\xi_n between xnx_n and rr. From the iteration, xn+1r=xnf(xn)/f(xn)rx_{n+1} - r = x_n - f(x_n)/f'(x_n) - r. Substituting and simplifying:

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

As xnrx_n \to r, ξnr\xi_n \to r and f(xn)f(r)0f'(x_n) \to f'(r) \neq 0, hence en+1/en2f(r)/(2f(r))=C|e_{n+1}|/|e_n|^2 \to |f''(r)|/(2|f'(r)|) = C. \square

Pathologies and Failures

Solved Examples

Exercise list

32 exercises · 8 with worked solution (25%)

12 8 5 3 4
  1. Ex. 69.1

    f(x)=x22f(x) = x^2 - 2, x0=1x_0 = 1. Apply 3 iterations of Newton-Raphson. Compare with 2=1.41421356\sqrt{2} = 1.41421356\ldots

  2. Ex. 69.2

    f(x)=x25f(x) = x^2 - 5, x0=2x_0 = 2. Apply 3 iterations to estimate 5\sqrt{5}.

  3. Ex. 69.3Answer key

    f(x)=x32f(x) = x^3 - 2, x0=1x_0 = 1. Apply 3 iterations to estimate 23\sqrt[3]{2}.

  4. Ex. 69.4

    f(x)=cosxxf(x) = \cos x - x, x0=1x_0 = 1. Apply 3 iterations to estimate the fixed point of cos\cos.

  5. Ex. 69.5

    f(x)=ex2f(x) = e^x - 2, x0=1x_0 = 1. Apply 3 iterations to estimate ln2\ln 2.

  6. Ex. 69.6

    f(x)=xlnx1f(x) = x \ln x - 1, x0=2x_0 = 2. Approximate the root to 4 decimal places.

  7. Ex. 69.7

    f(x)=sinxf(x) = \sin x, x0=3x_0 = 3. Numerically show that the iterations converge to π\pi.

  8. Ex. 69.8

    f(x)=x3x1f(x) = x^3 - x - 1, x0=1.5x_0 = 1.5. Approximate the real root (plastic constant 1.3247\approx 1.3247).

  9. Ex. 69.9

    f(x)=x2x1f(x) = x^2 - x - 1, x0=1.5x_0 = 1.5. Approximate the golden ratio ϕ=(1+5)/2\phi = (1 + \sqrt{5})/2.

  10. Ex. 69.10Answer key

    f(x)=tanxxf(x) = \tan x - x, x0=4.5x_0 = 4.5. Approximate the smallest positive root greater than π\pi.

  11. Ex. 69.11

    Show that Heron's formula xn+1=(xn+a/xn)/2x_{n+1} = (x_n + a/x_n)/2 for calculating a\sqrt{a} is exactly Newton-Raphson applied to f(x)=x2af(x) = x^2 - a.

  12. Ex. 69.12

    Generalize: what is the Newton iteration for calculating an\sqrt[n]{a}? Apply for n=3n = 3, a=8a = 8, x0=2x_0 = 2 (2 steps).

  13. Ex. 69.13

    Show that xn+1=xn(2axn)x_{n+1} = x_n(2 - ax_n) calculates 1/a1/a via Newton without any division operations. Apply for a=7a = 7, x0=0.1x_0 = 0.1 (3 steps).

  14. Ex. 69.14

    Minimize g(x)=x44x+1g(x) = x^4 - 4x + 1 by applying Newton-Raphson to g(x)=0g'(x) = 0, with x0=1.5x_0 = 1.5.

  15. Ex. 69.15

    Cash flows: -1000, 300, 400, 500 (years 0, 1, 2, 3). The IRR rr is the root of f(r)=1000+300/(1+r)+400/(1+r)2+500/(1+r)3=0f(r) = -1000 + 300/(1+r) + 400/(1+r)^2 + 500/(1+r)^3 = 0. Use Newton with r0=0.15r_0 = 0.15.

  16. Ex. 69.16

    In Black-Scholes, given the market price VmktV_{\text{mkt}} of an option, explain how to use Newton-Raphson to find the implied volatility σ\sigma. What is the role of vega in the iteration?

  17. Ex. 69.17

    In the van der Waals equation (P+a/V2)(Vb)=RT(P + a/V^2)(V - b) = RT, given PP, TT (and gas constants), use Newton to find the molar volume VV. Sketch the iteration.

  18. Ex. 69.18Answer key

    Kepler's equation: EesinE=ME - e \sin E = M. For e=0.3e = 0.3 (eccentricity) and M=1M = 1 rad (mean anomaly), use Newton with E0=1E_0 = 1 to find the eccentric anomaly EE (4 iterations).

  19. Ex. 69.19

    What behavior can Newton-Raphson exhibit when the initial guess x0x_0 is far from the root?

  20. Ex. 69.20Answer key

    What is the most robust stopping criterion for Newton-Raphson?

  21. Ex. 69.21

    Show that Newton-Raphson with f(x)=x32x+2f(x) = x^3 - 2x + 2 and x0=0x_0 = 0 cycles indefinitely between 00 and 11.

  22. Ex. 69.22

    f(x)=x2f(x) = x^2 (double root at x=0x = 0), x0=1x_0 = 1. Show that Newton-Raphson converges only linearly, with ratio 1/21/2.

  23. Ex. 69.23Answer key

    f(x)=x1/3f(x) = x^{1/3} has a root at x=0x = 0 but f(0)f'(0) does not exist. What happens with Newton-Raphson? Calculate 4 iterations starting from x0=1x_0 = 1.

  24. Ex. 69.24

    Apply the secant method (x0=1x_0 = 1, x1=2x_1 = 2) to f(x)=x22f(x) = x^2 - 2 for 4 iterations. Compare with Newton (exercise 69.1).

  25. Ex. 69.25

    f(x)=x33x+1f(x) = x^3 - 3x + 1 has 3 real roots. Apply Newton with x0=2x_0 = 2, then with x0=2x_0 = -2, then with x0=0.5x_0 = 0.5. Which root does each guess find?

  26. Ex. 69.26Answer key

    Modified Newton for a double root: xn+1=xn2f(xn)/f(xn)x_{n+1} = x_n - 2f(x_n)/f'(x_n). Apply to f(x)=(x1)2f(x) = (x-1)^2, starting from x0=3x_0 = 3. Compare with the standard iteration.

  27. Ex. 69.27

    Newton for optimization: show that applying Newton to g(x)=0g'(x) = 0 to minimize gg is equivalent to standard Newton with f=gf = g'. Apply to minimize g(x)=ex3xg(x) = e^x - 3x with x0=0x_0 = 0.

  28. Ex. 69.28

    For f(z)=z31f(z) = z^3 - 1 in the complex plane, qualitatively describe the 3 Newton basins. On the real line, which root do x0=2x_0 = 2 and x0=0.5x_0 = -0.5 reach?

  29. Ex. 69.29

    Prove the quadratic convergence of Newton-Raphson via Taylor expansion of order 2. Identify the constant C=f(r)/(2f(r))C = |f''(r)|/(2|f'(r)|).

  30. Ex. 69.30Answer key

    Prove: if ff is convex increasing with a simple root rr and x0>rx_0 > r with f(x0)>0f(x_0) > 0, Newton-Raphson converges to rr.

  31. Ex. 69.31Answer key

    Generalize Newton-Raphson to f:RnRn\vec{f}: \mathbb{R}^n \to \mathbb{R}^n. Write the linear system to be solved at each step and identify the role of the Jacobian JJ.

  32. Ex. 69.32

    Show that Heron's iteration xn+1=(xn+a/xn)/2x_{n+1} = (x_n + a/x_n)/2 converges quadratically to a\sqrt{a} for any x0>0x_0 > 0.

Sources

  • APEX Calculus — Hartman, Heinold, Siemers, Chalishajar · CC-BY-NC. Primary Source — §4.4 Newton's Method.
  • OpenStax Calculus Volume 1 — Strang, Herman et al. · CC-BY-NC-SA. §4.9 Newton's Method. Applied exercises (IRR, systems).
  • REAMAT — Numerical Calculus (Python) — UFRGS Reamat Collaborative · CC-BY-SA. Chap. 3 Zeros of functions. Python implementations, error analysis, secant method.

Updated on 2024-05-15 · Author(s): Clube da Matemática

Found an error? Open an issue on GitHub or submit a PR — open source forever.