Uni-Sine
MathematicsCalculus

The Newton-Raphson method

The Newton-Raphson method finds an approximate root of an equation f(x) = 0 by repeating one formula: xn+1 = xn − f(xn) ÷ f′(xn). Start from a guess x₀ near the root, put it into the formula to get x₁, put x₁ in to get x₂, and so on. Each step slides down the tangent to the curve to where it crosses the x-axis, and close to a root the number of correct digits roughly doubles each time. For example, starting at x₀ = 2 for x² − 5 = 0 gives 2.25, then 2.2361, then 2.2360680, which is √5.

The Newton-Raphson formula

x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}The Newton-Raphson iteration for solving f(x) = 0
SymbolMeaning
x<sub>n</sub>The current approximation
x<sub>n+1</sub>The next, better approximation
f(x<sub>n</sub>)The value of the function at x<sub>n</sub>
f′(x<sub>n</sub>)The gradient (derivative) at x<sub>n</sub>

The equation must be rearranged to the form f(x) = 0 first. AQA's AS and A-level formulae booklet gives the formula, and Pearson Edexcel's A-level specification asks students to solve equations using the Newton-Raphson method and to understand how it can fail.

Why the Newton-Raphson method works

At the point (xn, f(xn)) on the curve y = f(x), draw the tangent. Its gradient is f′(xn). Follow the tangent down to the x-axis: it meets it at xn+1. The gradient of the tangent is the rise over the run:

f'(x_n) = \frac{f(x_n) - 0}{x_n - x_{n+1}}

Rearranging for xn+1 gives the formula. Near a root, the curve is almost straight, so the tangent lands very close to where the curve itself crosses the axis.

y = { x}^{3}-2 x-5
0.20.40.60.811.21.41.61.822.22.42.62.83-10-55101520start x₀ = 2root ≈ 2.0946
Drag to pan, scroll to zoom. x from 0 to 3, y from -10.5 to 20.4.

Here x is the input and y = x³ − 2x − 5. The curve crosses the x-axis just above 2. The tangent at x₀ = 2, where f(2) = −1 and f′(2) = 10, hits the axis at 2 − (−1) ÷ 10 = 2.1, already very close to the root.

How to use the Newton-Raphson method

  1. Rearrange the equation into the form f(x) = 0.
  2. Differentiate to find f′(x).
  3. Choose a starting value x₀ close to the root, for example from a graph or a change of sign.
  4. Work out x₁ = x₀ − f(x₀) ÷ f′(x₀).
  5. Repeat with x₁, x₂, ... until the values agree to the accuracy you need.
  6. If the question asks, prove the accuracy with a change of sign.

On a calculator, type the starting value and press =, then type the formula using Ans in place of xn. Each press of = gives the next iteration.

Newton-Raphson worked examples

Example 1: finding √5

Use the Newton-Raphson method with x₀ = 2 to find √5.

√5 is the positive root of f(x) = x² − 5, with f′(x) = 2x. So:

x_{n+1} = x_n - \frac{x_n^2 - 5}{2x_n}
nx<sub>n</sub>
02
12.25
22.2361111
32.2360680
42.2360680

The value has stopped changing to 7 decimal places, so √5 ≈ 2.2360680. Three steps were enough.

Example 2: a cubic with no exact root

Solve x³ − 2x − 5 = 0, starting from x₀ = 2.

f(x) = x³ − 2x − 5 and f′(x) = 3x² − 2.

  • x₁ = 2 − (−1) ÷ 10 = 2.1
  • x₂ = 2.1 − 0.061 ÷ 11.23 = 2.0945681
  • x₃ = 2.0945515
  • x₄ = 2.0945515

The root is x = 2.0945515 to 7 decimal places.

Example 3: an equation with eˣ

Find the root of eˣ = 3 − x, starting from x₀ = 1.

Rearrange to f(x) = eˣ + x − 3 = 0, so f′(x) = eˣ + 1.

x_1 = 1 - \frac{e^1 + 1 - 3}{e^1 + 1} = 1 - \frac{0.71828}{3.71828} = 0.806824

Then x₂ = 0.792135, x₃ = 0.792060 and x₄ = 0.792060. The root is x = 0.79206 to 5 decimal places.

Example 4: proving the accuracy

Show that the root of x³ − 2x − 5 = 0 is 2.095 to 3 decimal places.

Check the values either side, at 2.0945 and 2.0955:

  • f(2.0945) = −0.00057, which is negative
  • f(2.0955) = 0.01059, which is positive

The sign changes and f is continuous, so there is a root between 2.0945 and 2.0955, and every number in that interval rounds to 2.095.

Here is a quick check.

practice
Pick an answer, then check it.
For f(x) = x² − 10, what is x₁ if x₀ = 3?

When the Newton-Raphson method fails

Pearson Edexcel's specification asks students to understand the method's working in geometrical terms, so they understand its failure near points where the gradient is small.

  • At a stationary point, f′(xn) = 0. The tangent is horizontal and never meets the x-axis, and the formula divides by zero.
  • Near a stationary point, the tangent is almost flat, so it meets the axis far away. For x³ − 2x − 5, there is a turning point at x = 0.816. Starting at x₀ = 0.8, where f′(0.8) = −0.08, gives x₁ = 0.8 − (−6.088) ÷ (−0.08) = −75.3, nowhere near the root.
  • A poor starting value can lead to a different root from the one you wanted, or to values that bounce around without settling.
  • A discontinuity, such as in tan x or 1 ÷ x, can make the method jump across a gap where there is no root at all.

The fix is usually a better starting value: sketch the graph, or use a change of sign to find an interval containing the root, and start inside it. The Derivative Calculator finds f′(x) with each rule shown, and the Custom Graph plots f(x) so you can see where the roots are before you start.

Try it

Derivative Calculator

Differentiate any function and see each rule applied

Go to its page

Newton-Raphson and other numerical methods

At A-level, Newton-Raphson sits alongside two other ways of locating roots:

MethodHow it worksNotes
Change of signIf f(a) and f(b) have opposite signs and f is continuous, there is a root between a and bUsed to find an interval and to prove accuracy
Fixed-point iterationRearrange f(x) = 0 into x = g(x), then use x<sub>n+1</sub> = g(x<sub>n</sub>)Shown with cobweb and staircase diagrams; may not converge
Newton-RaphsonFollow tangents: x<sub>n+1</sub> = x<sub>n</sub> − f(x<sub>n</sub>) ÷ f′(x<sub>n</sub>)Usually very fast; needs f′(x); fails where f′ is near 0

Common mistakes

  • Not rearranging to f(x) = 0. For eˣ = 3 − x, f(x) is eˣ + x − 3, not eˣ.
  • Differentiating wrongly. Check f′(x) before you start: every iteration depends on it.
  • Calculator in degrees for trig functions. Newton-Raphson with sin or cos needs radians.
  • Rounding between steps. Keep full calculator values and round only the final answer.
  • Stopping too early. Two successive values must agree to the required accuracy, and a change of sign proves it.

Newton-Raphson questions with answers

1. Write down the Newton-Raphson formula.
xn+1 = xn − f(xn) ÷ f′(xn)
2. Use one iteration with x₀ = 2 to estimate the cube root of 7.
f(x) = x³ − 7, f′(x) = 3x².
x₁ = 2 − (8 − 7) ÷ 12 = 1.9167
3. Why can't x₀ = 0 be used for f(x) = x² − 5?
f′(0) = 0, so the formula would divide by zero. The tangent at x = 0 is horizontal.
4. Give the iteration formula for f(x) = x² − 10, and find √10 to 4 decimal places from x₀ = 3.
xn+1 = xn − (xn² − 10) ÷ 2xn.
x₁ = 3.16667, x₂ = 3.16228, so √10 ≈ 3.1623
5. How do you show a root is correct to a given number of decimal places?
Evaluate f at the upper and lower bounds of the rounded value. A change of sign shows the root lies between them.

Practise calculus in a short timed paper

The daily papers don't set the Newton-Raphson method itself, but A-level Maths: Calculus gives you a short timed paper every day, with 8 questions worth 25 to 35 marks, on the differentiation every Newton-Raphson step depends on.

Paper resets in

Common questions

What is the Newton-Raphson method?
A numerical method for finding roots of f(x) = 0. It repeatedly follows the tangent to the curve down to the x-axis, using xn+1 = xn − f(xn) ÷ f′(xn).
What is the Newton-Raphson formula?
xn+1 = xn − f(xn) ÷ f′(xn).
Is the Newton-Raphson formula in the formula booklet?
In AQA's AS and A-level formulae booklet, yes. Check your own board's booklet.
Why does the Newton-Raphson method fail?
It fails where f′(x) is zero or very small, because the tangent is flat and meets the x-axis far away or not at all. A bad starting value can also lead to the wrong root.
Is Newton's method the same as Newton-Raphson?
Yes. Both names refer to the same iteration.
How fast is the Newton-Raphson method?
Very fast near a simple root: the number of correct digits roughly doubles each step, as in the √5 example, where three steps gave 7 decimal places.

Revision cards

Say the answer first, then flip the card to check it.

Where to go next

  • Solve it

    Derivative Calculator

    Differentiate any function and see each rule applied

    Open the tool
  • Test it

    A-level Maths: Calculus

    A new exam-style paper every day, with instant marking and a mark scheme

    Start today's paper
Read next
Maths · AlgebraIteration in maths: solving equations by iterationHow to solve equations by iteration: change of sign, rearranging to x = g(x), using x(n+1) = g(x(n)), cobweb diagrams and Newton-Raphson, with examples.