Mathematics/Lessons/Numerical Methods/The Newton–Raphson Method
Pure · Numerical Methods · Year 2

The Newton–Raphson Method

Follow the tangent line down to the x-axis, and land closer to the root than where you started.

10 min read 4 worked examples

Deriving the formula

Fixed-point iteration needs a rearrangement, and not every rearrangement converges. The Newton–Raphson method takes a different, more direct route to a root of $f(x)=0$: at each estimate, follow the tangent line to $y=f(x)$ down to where it crosses the x-axis, and treat that crossing point as the next, usually better, estimate.

ProofDeriving $x_{n+1}$ from the tangent at $x_n$
1
At the point $(x_n,f(x_n))$ on the curve, the tangent line has gradient $f'(x_n)$.
The gradient of the tangent at any point equals the derivative there.
2
The tangent line's equation is $y-f(x_n)=f'(x_n)(x-x_n)$.
Standard point-gradient form of a line, using the point (xₙ, f(xₙ)) and gradient f'(xₙ).
3
Let $x_{n+1}$ be where this tangent crosses the x-axis, i.e. where $y=0$: $0-f(x_n)=f'(x_n)(x_{n+1}-x_n)$.
Substitute $y=0$ and $x=x_{n+1}$ into the tangent's equation.
4
$-f(x_n)=f'(x_n)x_{n+1}-f'(x_n)x_n \Rightarrow f'(x_n)x_{n+1}=f'(x_n)x_n-f(x_n)$.
Expand and rearrange to isolate the term containing $x_{n+1}$.
5
Dividing by $f'(x_n)$ (valid provided $f'(x_n)\ne0$): $x_{n+1}=x_n-\dfrac{f(x_n)}{f'(x_n)}$.
Isolate $x_{n+1}$ completely — the Newton–Raphson formula.
▪ proven
$x_{n+1}=x_n-\dfrac{f(x_n)}{f'(x_n)}$

Geometric interpretation

Starting from an estimate $x_n$, the method draws the tangent to $y=f(x)$ at $(x_n,f(x_n))$ and follows it down to where it crosses the x-axis — that crossing point becomes the new, usually more accurate, estimate $x_{n+1}$. Unlike fixed-point iteration, there's no rearrangement to choose: the formula only needs $f(x)$ and $f'(x)$, and it typically homes in on the root far faster.

A cubic curve y = f(x) rising left to right. A point on the curve is marked at xn below the x-axis, and the orange tangent line to the curve at that point is drawn, extending up to where it crosses the x-axis at a new point labelled xn+1, which lies closer to where the curve itself crosses the x-axis.
The tangent to y = f(x) at (xₙ, f(xₙ)) crosses the x-axis at xₙ₊₁ — usually a closer approximation to the root than xₙ was.

When the method fails

Newton–Raphson usually converges fast, but it can fail or behave badly in certain situations — most commonly when the gradient $f'(x_n)$ is zero or very close to zero.

Near a turning point

If $x_n$ is close to a turning point of $f$, then $f'(x_n)\approx0$, making the tangent line almost horizontal. Dividing by a near-zero $f'(x_n)$ in the formula produces a huge jump, sending $x_{n+1}$ far away from the root — sometimes even further away than $x_n$ was, or into a completely different part of the curve where a different root (or no root) lies nearby.

Why this happens geometrically

An almost-horizontal tangent line travels a very long way before it reaches the x-axis — so the crossing point $x_{n+1}$ can land far from where the tangent was drawn. In the worst case, if $f'(x_n)=0$ exactly, the tangent is perfectly horizontal and never crosses the x-axis at all, so $x_{n+1}$ is undefined and the formula breaks down completely.

Because of this, it's good practice to choose a starting value $x_0$ reasonably close to the root and away from any turning points, and to sanity-check that successive iterates are actually converging rather than jumping erratically.

Worked example 1

One iteration of Newton–Raphson
Use one application of the Newton–Raphson method with $x_0=1$ to find $x_1$ for $f(x)=x^3+3x-6$.
MethodApply the formula directly
1
$f'(x)=3x^2+3$.
Differentiate f(x) to find the gradient function.
2
$f(1)=(1)^3+3(1)-6=1+3-6=-2$. $f'(1)=3(1)+3=6$.
Evaluate f and f' at x₀ = 1.
3
$x_1=x_0-\dfrac{f(x_0)}{f'(x_0)}=1-\dfrac{-2}{6}=1+0.3333=1.3333$.
Substitute into the Newton–Raphson formula.
▪ solved

Worked example 2

Iterating to a required accuracy
Continuing from Example 1, find $x_2$ and $x_3$, and state the root of $x^3+3x-6=0$ correct to 3 decimal places.
MethodRepeat the Newton–Raphson formula
1
$f(1.3333)=(1.3333)^3+3(1.3333)-6=2.3704+4-6=0.3704$. $f'(1.3333)=3(1.3333)^2+3=8.3333$.
Evaluate f and f' at x₁ = 1.3333.
2
$x_2=1.3333-\dfrac{0.3704}{8.3333}=1.3333-0.0444=1.2889$.
Apply the formula again.
3
$f(1.2889)=(1.2889)^3+3(1.2889)-6\approx0.0102$. $f'(1.2889)=3(1.2889)^2+3\approx7.9834$.
Evaluate f and f' at x₂.
4
$x_3=1.2889-\dfrac{0.0102}{7.9834}\approx1.2879$.
Apply the formula a third time.
5
$x_2$ and $x_3$ agree to 3 d.p. ($1.288$), so the root is $x\approx1.288$ (3 d.p.).
Convergence is confirmed once successive iterates agree to the required accuracy.
▪ solved
Fast convergence

Just three iterations pinned the root down to 3 decimal places — markedly faster than the fixed-point iterations from the previous lesson, which needed several more steps for comparable accuracy. This rapid convergence is Newton–Raphson's main advantage.

Worked example 3

A starting value that fails, at a turning point
$f(x)=x^3-12x+7$ has a turning point at $x=2$. Show that applying Newton–Raphson with $x_0=2$ fails, and explain why.
MethodAttempt the formula and identify the failure
1
$f'(x)=3x^2-12$.
Differentiate f(x).
2
$f'(2)=3(2)^2-12=12-12=0$.
Evaluate the gradient at x₀ = 2.
3
The Newton–Raphson formula requires dividing by $f'(x_0)=0$, which is undefined.
Division by zero means x₁ cannot be calculated at all.
4
This happens because $x=2$ is exactly a turning point of $f$: the tangent there is horizontal, so it never meets the x-axis, and the method has no way to produce a next estimate.
Confirms this is the "turning point" failure mode described earlier in the lesson.
▪ fails
Choosing a better starting value

Starting instead at $x_0=1.5$ (away from the turning point) gives $f'(1.5)=3(1.5)^2-12=-5.25\ne0$, a well-defined, non-zero gradient — so the iteration proceeds normally from there. Whenever $f'(x_0)$ is zero or suspiciously small, the fix is simply to pick a different, nearby starting value.

Worked example 4

Applying Newton–Raphson in a real context · Challenge
The temperature of a metal casting during controlled cooling, in °C, $t$ hours after cooling begins, is modelled by $\theta(t)=25+60e^{-0.2t}-3t$ for $0\le t\le10$. Use Newton–Raphson with $t_0=2$ to find, correct to 3 decimal places, the time at which the casting reaches $40°C$.
MethodApply Newton–Raphson to θ(t) − 40 = 0, iterating until convergence
1
Let $f(t)=\theta(t)-40=-15+60e^{-0.2t}-3t$. Then $f'(t)=-12e^{-0.2t}-3$.
Subtract the target temperature to get an equation f(t) = 0, then differentiate.
2
$f(2)=-15+60e^{-0.4}-6=-15+40.219-6=19.219$. $f'(2)=-12e^{-0.4}-3=-11.044$.
Evaluate f and f' at t₀ = 2 (hours).
3
$t_1=2-\dfrac{19.219}{-11.044}=2+1.7402=3.7402$.
Apply the Newton–Raphson formula.
4
$f(3.7402)\approx1.113$, $f'(3.7402)\approx-8.657$. $t_2=3.7402-\dfrac{1.113}{-8.657}=3.9287$.
Evaluate f and f' at t₁, then apply the formula again.
5
A further iteration gives $t_3\approx3.995$, and successive iterates then agree to 3 d.p.: the casting reaches $40°C$ at $t\approx3.995$ hours.
Successive iterates are converging rapidly to the same value.
▪ solved
Look deeper

Here $f'(t)=-12e^{-0.2t}-3$ stays comfortably negative throughout $0\le t\le10$ (it never approaches zero, since both terms are negative), so the tangent is never close to horizontal and Newton–Raphson converges reliably however far the starting value is from the true root — exactly the opposite of Example 3's failure case. Checking that $f'$ stays well away from zero across the model's domain is a useful sanity check before trusting a numerical answer in context.

Common mistake

Forgetting to recompute both $f(x_n)$ and $f'(x_n)$ at the new value of $x_n$ before each iteration — reusing an old derivative value produces completely incorrect iterates. Also common: not checking whether $f'(x_n)$ is small before dividing, which can silently produce a wildly inaccurate next estimate without any error being raised.

Check yourself

Use Newton–Raphson with $x_0=1$ to find $x_1$ and $x_2$ for $f(x)=x^3+x-4$, giving answers to 4 decimal places.
(Hint: find f'(x) first, then apply the formula twice.)

Method
1
$f'(x)=3x^2+1$. $f(1)=1+1-4=-2$. $f'(1)=3+1=4$.
Differentiate, then evaluate f and f' at x₀ = 1.
2
$x_1=1-\dfrac{-2}{4}=1.5$.
Apply the formula.
3
$f(1.5)=3.375+1.5-4=0.875$. $f'(1.5)=3(2.25)+1=7.75$.
Evaluate f and f' at x₁.
4
$x_2=1.5-\dfrac{0.875}{7.75}=1.5-0.1129=1.3871$.
Apply the formula again.
▪ solved