Newton's Method
Finding roots of equations by following tangent lines downhill.
On this page
The problem of root-finding#
Equations of the form appear everywhere in science and engineering. Finding the angle at which a projectile hits a target. Determining when supply equals demand in an economic model. Solving the implicit equations that arise in thermodynamics, orbital mechanics, and structural engineering.
Some equations have algebraic solutions: the quadratic formula solves . Abel and Galois proved in the 19th century that no general formula exists for degree 5 and above. For transcendental equations like , algebra is simply off the table.
Newton's method (also called the Newton-Raphson method) solves this class of problem numerically — finding roots to any desired precision through geometric iteration.
The geometric idea#
Imagine the graph of . You want to find where it crosses zero. Start at some initial guess . Draw the tangent line to the curve at the point . The tangent line will cross zero at some point — and that is typically much closer to the true root than was.
Repeat. Draw the tangent at , find where it hits zero, call that . Under the right conditions, each iteration dramatically narrows the error.
The formula for the tangent line through with slope is:
Setting and solving for the zero crossing:
This is Newton's method: a single, elegant recurrence.
Choose a function and starting point. Watch the tangent lines track toward the root. Try starting near a local extremum — where — and watch the method fail: the tangent is nearly horizontal and the next guess shoots far away.
Quadratic convergence#
The reason Newton's method is so valued is not just that it converges — it's how fast it converges. Near a simple root (where ), the method converges quadratically:
Each iteration squares the error. If you have 1 correct decimal place, the next iteration gives 2, then 4, then 8, then 16. Starting from a decent guess, ten iterations routinely give full double-precision accuracy (about 15 decimal places).
The chart plots the error on a logarithmic scale as each method hunts for . Bisection (the safe, halve-the-interval approach) drops in a straight line — one extra correct bit per step. Newton's line bends downward, its slope doubling every iteration: that's quadratic convergence, the correct digits doubling rather than incrementing. By the time bisection has clawed out a handful of digits, Newton has already hit the floating-point floor.
This is why Newton's method is the workhorse behind many numerical algorithms. The square root function in your computer is often computed via Newton's method applied to (finding the positive root of ):
This is the Babylonian method, known since antiquity, and it's exactly Newton's method in disguise.
When it fails#
Newton's method is powerful but not foolproof. Three classic failure modes:
Stationary points: If or very small, the tangent is nearly horizontal and is far away. The method diverges.
Wrong basin: The method converges to the wrong root if the starting point is in the wrong "basin of attraction." For with three roots, the basins partition the real line in complex, fractal-like ways.
Cycles: For some functions and starting points, the sequence cycles without converging. The canonical example is starting at for , where each step moves further from zero.
Complex roots: If has real coefficients but only complex roots, Newton's method on the real line will wander without converging. Starting with a complex initial guess allows it to converge to complex roots.
Practical improvements#
For production numerical software, pure Newton's method is often enhanced:
Bracketing + bisection: If you know the root lies in (because changes sign there), you can use Newton steps when they stay inside the bracket and fall back to bisection when they don't. This hybrid (Brent's method) combines Newton's speed with bisection's robustness.
Damping: In high-dimensional systems (where ), a pure Newton step can overshoot. Damped Newton methods take a fraction of the Newton step, choosing to ensure .
Quasi-Newton methods: Computing (or the Jacobian in higher dimensions) can be expensive. Quasi-Newton methods like BFGS approximate the derivative using information from previous steps, achieving superlinear convergence without requiring exact derivatives.
Newton's method in machine learning#
The backpropagation algorithm used to train neural networks is a first-order method — it only uses gradient information, not second-order curvature. Newton's method suggests a better approach: use the Hessian (matrix of second derivatives) to account for curvature, potentially converging faster.
- Newton's method finds roots of by repeatedly following the tangent line to where it crosses zero: .
- It converges quadratically near a simple root — the number of correct digits roughly doubles each step, vastly outpacing bisection's linear gain.
- The ancient Babylonian square-root rule is just Newton's method applied to .
- It can fail: near-zero derivatives fling the guess away, the wrong basin attracts the wrong root, and some setups cycle forever.
- Production solvers pair it with safeguards (bracketing/bisection, damping, quasi-Newton) to keep its speed without its fragility.
In practice, the Hessian of a large neural network has billions of entries and is expensive to compute and invert. Quasi-Newton approximations (L-BFGS) are used for smaller networks. The Adam optimizer, dominant in deep learning, can be understood as an adaptive approximation to Newton's method that avoids explicitly computing second derivatives.
The 17th-century geometry of following tangent lines to a zero crossing remains at the heart of 21st-century machine learning.
Share this article