Newton-Raphson Method

Numerical Methods

Source inspiration: (Mathew 2000-2019).

Animations

Each animation below shows the tangent-line diagram for the Newton-Raphson method. At each iterate \(x_n\), a tangent line to \(f(x)\) is drawn; its x-intercept gives \(x_{n+1} = x_n - \tfrac{f(x_n)}{f'(x_n)}\). The sequence of tangent lines traces the convergence (or divergence) toward a root.

Julia source scripts that generated these animations are linked under each case.

Case 1 — Quadratic convergence, \(f(x) = 3e^x - 4\cos(x)\), \(x_0 = 1.0\)

Behavior: A single real root exists near \(x^* \approx 0.2910\). Starting at \(x_0 = 1.0\), each tangent line rapidly overshoots then undershoots before converging — illustrating the quadratic convergence rate typical of Newton-Raphson near a simple root.

Julia source

Newton-Raphson tangent-line animation on f(x)=3eˣ−4cos(x): rapid convergence from x₀=1.0 to the root at x≈0.291

Case 2 — Linear convergence (double root), \(f(x) = (1-5x)^2\), \(x_0 = 1.0\)

Behavior: A double root at \(x^* = 0.2\). Because \(f'(x^*) = 0\), the standard convergence proof breaks down and Newton-Raphson degrades to linear convergence — each step roughly halves the error rather than squaring it.

Julia source

Newton-Raphson tangent-line animation on f(x)=(1−5x)²: slow linear convergence to the double root at x=0.2

Case 3 — Convergent near inflection point, \(f(x) = \arctan(x)\), \(x_0 = 1.35\)

Behavior: The only root is \(x^* = 0\). For \(f(x) = \arctan(x)\), Newton-Raphson converges only when \(|x_0| < x_c \approx 1.3917\). Starting at \(x_0 = 1.35\) (just inside the convergence radius), the method converges but requires several oscillating steps before settling in.

Julia source

Newton-Raphson tangent-line animation on f(x)=arctan(x): convergent case starting just inside the critical radius at x₀=1.35

Case 4 — No real root (cycling / divergence), \(f(x) = x^3 - x + 3\), \(x_0 = 0.0\)

Behavior: \(f(x) = x^3 - x + 3\) has no real roots (its minimum value is above zero). Starting at \(x_0 = 0\), the tangent lines chase an intercept that does not exist, and the iterates cycle or diverge — a cautionary example showing Newton-Raphson can fail completely when no root exists.

Julia source

Newton-Raphson tangent-line animation on f(x)=x³−x+3: divergent cycling behavior when no real root exists, starting at x₀=0

Case 5 — Convergence with vanishing derivative, \(f(x) = xe^{-x}\), \(x_0 = 2.0\)

Behavior: The only root is \(x^* = 0\). For large \(x\), \(f'(x) = (1-x)e^{-x}\) is small and negative, so early tangent lines produce large jumps leftward. Convergence is eventual but the steeply angled early tangent lines demonstrate the effect of a nearly-flat curve far from the root.

Julia source

Newton-Raphson tangent-line animation on f(x)=x·e⁻ˣ: large initial steps from x₀=2.0 before converging to the root at x=0

Case 6 — Divergent, \(f(x) = \arctan(x)\), \(x_0 = 1.4\)

Behavior: Same function as Case 3 but starting at \(x_0 = 1.4\) — just outside the critical convergence radius \(x_c \approx 1.3917\). The iterates do not converge to the root; they escape toward larger \(|x|\), illustrating the sensitivity of Newton-Raphson to the choice of starting point for flat-tailed functions.

Julia source

Newton-Raphson tangent-line animation on f(x)=arctan(x): divergent case starting just outside the critical radius at x₀=1.4

References

Mathew, John H. 2000-2019. Numerical Analysis - Numerical Methods Modules. https://web.archive.org/web/20190808102217/http://mathfaculty.fullerton.edu/mathews/n2003/NumericalUndergradMod.html.