Newton-Raphson Method
A powerful root-finding algorithm that uses the first derivative (the tangent line) to iteratively converge upon a root. Discovered by Isaac Newton and formalized by Joseph Raphson, it exhibits quadratic convergence—meaning the number of correct digits roughly doubles with every iteration, provided the initial guess is sufficiently close.
Historical Context
The Newton-Raphson method, named after Isaac Newton and Joseph Raphson, revolutionized root-finding in the 17th century. While iterative methods like the Babylonian method for square roots had existed for millennia, Newton provided the first generalizable framework to solve polynomial equations using the burgeoning tools of calculus.
In his 1669 tract De analysi per aequationes numero terminorum infinitas (published much later), Newton outlined his technique, though he originally presented it algebraically using power series rather than geometrically. It was Joseph Raphson who, in 1690, formalized the method by pulling out the derivative term explicitly, turning it into the concise recurrence relation that we use today.
What makes this generalization so profound is its direct connection to antiquity. The Babylonian method—developed millennia earlier through geometric intuition—is actually just a special case of the Newton-Raphson method applied to the function . While ancient scholars relied on the intuitive process of averaging the sides of a rectangle to approximate a square, Newton and Raphson provided the universal calculus-based proof for why such geometric heuristics worked so flawlessly, expanding the technique from simple quadratics to any differentiable function.
Geometric Foundation: The Tangent Line
Tangent Intersection
Geometric View
Convergence Plot
Error Bound |x_n+1 - x_n|
Current State
No active state.
Algorithm
while |x_n+1 - x_n| > ε:if f'(x_n) == 0: breakx_n+1 = x_n - f(x_n) / f'(x_n)x_n = x_n+1return x_n
Why it works
The Newton-Raphson method uses linear approximation to find roots. By computing the tangent line to the function at the current guess , we follow this tangent down to the x-axis to find our next guess . Geometrically, we are asking: 'Where does the linear approximation of the curve cross zero?' When the initial guess is close enough to a simple root, the number of correct digits roughly doubles with every step, a property known as quadratic convergence.
Mathematically, it is derived from the first-order Taylor expansion:
Setting and solving for gives the iteration formula:
Where Newton's Method Fails
Unlike bracketing methods which are guaranteed to converge, open methods like Newton-Raphson can fail spectacularly depending on the initial guess and the shape of the function.
- Division by Zero: If the derivative evaluates to exactly zero (e.g., at a local minimum), the tangent line is horizontal and never intersects the x-axis, causing the algorithm to crash.
- Runaway (Divergence): For functions with inflection points near the root (like ), the tangent slope can be so shallow that each subsequent guess is thrown further away from the root towards infinity.
- Cycles: The sequence of guesses can become trapped in an infinite loop, oscillating back and forth between two or more values without ever approaching the root.
- Multiple Roots: At roots where the function is perfectly tangent to the x-axis (both and ), the method loses its incredible speed and crawls at a sluggish linear convergence rate.
Select any of these scenarios from the 'Failure Modes' group in the top dropdown to see them in action.
The algorithm that generalized 3,500 years of intuition. Now write it.
Newton-Raphson is elegant but brittle. Here's how to implement the core algorithm, connect it to its ancient Babylonian roots, and experience its failure modes firsthand.