TL;DR
Many problems ask for a number where a function equals zero. Newton-Raphson solves them (finding such an is called finding a root of ) by starting from a rough guess, drawing the tangent line to the curve at that guess, and moving to the point where the tangent crosses zero. Repeating this step usually closes in on the root very quickly, often doubling the number of correct digits each time.
The method needs only the function and its derivative, so it works on equations that have no neat formula. It sits behind many routines that compute square roots, reciprocals and the solutions of nonlinear equations in engineering and finance.
Where you'll see it: in the solvers inside scientific calculators and numerical libraries, in the inner loop of finding an interest rate that matches a bond price, and in the training of some models that need a second-order step.
Intuition
Follow the slope down to zero
Suppose you want the point where a curve crosses the horizontal axis, and you can see only where you are. Stand at a guess on the curve. The slope there tells you which way the curve is heading. If you assume the curve keeps that slope, you can draw a straight line, the tangent, and ask where that line hits zero. That crossing is usually closer to the true crossing than your guess was.
Move to that new point, draw the tangent again, and repeat. Each line is a better local picture of the curve, so the guesses home in on the root. The method is just this picture written as a rule.
Why the tangent and not something else
A straight line is the simplest curve to solve. The tangent line is the straight line that matches the function's value and slope at one point. Near that point, the tangent is a very good stand-in for the curve, and the error it introduces shrinks as you get closer. That is why the method is accurate once the guesses are already near the root.
- f(x) = x² − 2
- tangent at x = 1
The math
The update rule
To solve with differentiable, start from a guess and compute
Here is the guess at step , is the function's value there, and is its derivative, the slope of the tangent line.
Derive it directly from the tangent. The tangent to at is the line
Set and solve for . Subtracting from both sides and dividing by gives . That is the next guess, . The formula fails only when , because then the tangent is flat and never crosses zero (unless it lies on the axis).
Why it converges fast
Near a simple root , where and , the error obeys, roughly,
This is called quadratic convergence. If the error is , the next error is around . The number of correct digits roughly doubles each step. This is far faster than methods that shrink the error by a fixed fraction each step, such as bisection, which gains about one binary digit per step.
The catch is the word "near". Far from the root, the tangent can point the wrong way, and the iteration may wander off or cycle. Good starting guesses matter.
flowchart LR
A[Start with guess x0] --> B[Compute f of x and f prime of x]
B --> C[Update x to x minus f over f prime]
C --> D{Close enough to zero?}
D -- no --> B
D -- yes --> E[Stop: x is the root]
Worked examples
Find by solving . Here , so the update is . Start at .
- and , so .
- and , so .
- and , so .
- The true value is . After three steps the error is about .
Interpretation: starting with one correct digit (1.0 vs 1.41), three steps gave about six correct digits. The number of correct digits roughly doubled at each step.
Solve . Here . Start at .
- and , so .
- and , so .
- and , so .
- The root is , so is already correct to six decimals.
Interpretation: three steps were enough to reach six decimal places. A bisection search on the same interval would need about 20 steps for the same accuracy.
Chip designers often compute with only multiplication and subtraction. Apply Newton-Raphson to , which has its root at . Since , the update simplifies to
Take , so the target is , and start at .
- .
- .
- .
Interpretation: the update uses only multiplication and subtraction, which is why hardware and software use this form for division. Notice how the correct digits roughly double: after two steps the guess (0.1417) matched the true value 0.142857 to about two digits, and after three steps (0.14285) to about five.
Tradeoffs and failure modes
Newton-Raphson is fast when it works, and it can fail in predictable ways.
| Situation | What goes wrong | Better choice |
|---|---|---|
| The starting guess is far from the root | The tangent may point away, and the iterates can diverge | Start with a few bisection steps (halving an interval that contains the root) to bracket the root, then switch |
| The derivative is zero or nearly zero at an iterate | The update divides by a tiny number and jumps far away | Use a damped step, or a method that does not need the derivative, such as the secant method (which replaces the tangent by a line through the last two guesses) |
| The root is repeated (the function touches zero without crossing) | Convergence drops from quadratic to linear | Solve for a modified function such as , or accept slower steps |
| The derivative is hard to compute | The method needs more work per step than it saves | Use a numerical derivative or the secant method |
| The function is not smooth | The tangent does not describe the curve | Use a bracketing method such as bisection |
Even well-behaved functions can cycle. Take with . Here and , so . Then and , so again. The iteration bounces between 0 and 1 forever. The fix is a different starting point, not more steps.
The method also says nothing by itself about whether a root exists. Always check the residual and stop when it is small enough for your purpose.
History
The idea of improving a guess with a linear correction is very old. Babylonian and Greek methods for square roots used the same principle, and Heron of Alexandria described one in the first century. Isaac Newton developed a general version in the late 1660s and 1670s, using it to solve polynomial equations, and his method was published in the early 1700s. Joseph Raphson gave a simpler, more algorithmic presentation in 1690, which is why the method carries both names. Thomas Simpson later extended it to systems of equations in 1740. The method caught on because it is fast, general and simple to program, and because the tangent-line picture makes it easy to understand.
Recap
Newton-Raphson solves by repeatedly moving to where the tangent line at the current guess crosses zero. Its update comes from that single line, and near a simple root the error roughly squares at each step. Its weaknesses are bad starting points, flat slopes and cycles. The same idea, applied to a function's slope instead of its zero, is the basis of gradient-based optimisation, and the tangent is the first term of a Taylor series.
Check yourself
QuestionApply one Newton-Raphson step to starting at . What is ?Show answer
and . So . The true root is , so one step has already brought the guess within about 0.014.
QuestionWhy does the update fail when ?Show answer
The update divides by , which is then undefined. Geometrically, the tangent is horizontal, so it never crosses zero unless it lies on the axis, and there is no unique next guess.
QuestionIn Example 2, why would a bisection method need many more steps than Newton-Raphson to match the accuracy of the final guess?Show answer
Bisection (repeatedly halving an interval known to contain the root) halves the interval each step, gaining roughly one binary digit per step. Newton-Raphson roughly doubles the number of correct digits per step once it is near the root. So for the same number of digits, bisection needs many more steps.
QuestionWhy is the starting point a poor choice for ?Show answer
At the derivative is and the tangent is steep and sends the next guess to , which in turn sends the iteration back to . The iteration cycles and never converges. A starting point nearer the real root, where the tangent is a better picture of the curve, avoids this.
Sources
- Newton's method (Wikipedia): https://en.wikipedia.org/wiki/Newton%27s_method
- Root-finding algorithm (Wikipedia): https://en.wikipedia.org/wiki/Root-finding_algorithm