Newton-Raphson method

Newton-Raphson method

Spec 9.3 · Edexcel A-Level Maths: Revision notes

Studying this course? Keep your progress in one place.

Key facts

  • Newton-Raphson: xn+1=xn−f(xn)f′(xn)x_{n+1}=x_n-\dfrac{f(x_n)}{f'(x_n)} (in the formulae booklet).
  • Find f′f', substitute carefully and keep full calculator accuracy.
  • xn+1x_{n+1} is the xx-intercept of the tangent to y=f(x)y=f(x) at xnx_n.
  • It fails when f′(xn)f'(x_n) is zero or small, can cycle, or can find a different root.
  • Locate the root first by a sign change and start close to it.

The Newton-Raphson formula

Subtract f(xn)f′(xn)\frac{f(x_n)}{f'(x_n)} from the current estimate xnx_n.

The Newton-Raphson method uses a tangent to improve an estimate xnx_n of a root of f(x)=0f(x)=0. You must find f′f', substitute carefully and keep full accuracy until the end.

If f(xn)<0f(x_n)<0 and f′(xn)>0f'(x_n)>0 the correction is subtracted, so the estimate increases.

0.511.522.533.54−8−6−4−2246810xyxₙ = 3xₙ₊₁ ≈ 2.667y = f(x)tangent at xₙ
The tangent at xₙ crosses the x-axis closer to the root. Shown for f(x) = x² − 7 with xₙ = 3: the tangent is y = 6x − 16, which crosses at xₙ₊₁ ≈ 2.667
  • xn+1x_{n+1}xn−f(xn)f′(xn)x_n-\dfrac{f(x_n)}{f'(x_n)}

Worked example

Use x0=2x_0=2 for f(x)=x3−2x−5f(x)=x^3-2x-5.

f(x)=x2−7f(x)=x^2-7, x0=3x_0=3. What is x1x_1?

Worked examples

Differentiate, substitute, and simplify where you can.

For f(x)=ex−3xf(x)=\mathrm{e}^x-3x, f′(x)=ex−3f'(x)=\mathrm{e}^x-3, and x0=0.5x_0=0.5 gives x1=0.6101x_1=0.6101, x2=0.6190x_2=0.6190.

For f(x)=x2−7f(x)=x^2-7, f′(x)=2xf'(x)=2x, so the formula simplifies. Newton-Raphson is a recurrence relation xn+1=g(xn)x_{n+1}=g(x_n) with g(x)=x−f(x)f′(x)g(x)=x-\frac{f(x)}{f'(x)}, and it usually converges faster than a simple rearrangement.

0.20.40.60.811.21.41.61.82−2−1123xyx₀ = 0.5root ≈ 0.619y = eˣ − 3x
f(x) = eˣ − 3x has a root near 0.619; starting at x₀ = 0.5 the iteration homes in on it
  • f(x)=x2−7f(x)=x^2-7xn+1=12(xn+7xn)x_{n+1}=\tfrac12\left(x_n+\dfrac{7}{x_n}\right)

For f(x)=ex−3xf(x)=\mathrm{e}^x-3x, what is f′(x)f'(x)?

Geometry: tangents

xn+1x_{n+1} is where the tangent at xnx_n meets the xx-axis.

The tangent to y=f(x)y=f(x) at xnx_n has equation y−f(xn)=f′(xn)(x−xn)y-f(x_n)=f'(x_n)(x-x_n). Setting y=0y=0 gives x=xn−f(xn)f′(xn)=xn+1x=x_n-\frac{f(x_n)}{f'(x_n)}=x_{n+1}.

If the curve stays close to its tangent between xnx_n and the root, xn+1x_{n+1} is much closer to the root.

0.511.522.533.54−8−6−4−2246810xy(3, 2)x₁ = 8/3y = x² − 7tangent: y = 6x − 16
The tangent to y = x² − 7 at x = 3 meets the x-axis at x₁ = 8/3.

Where does the tangent at x=3x=3 to y=x2−7y=x^2-7 cross the xx-axis?

When the method fails

It fails when f′(xn)f'(x_n) is zero or small, can cycle, or can land on a different root.

  • f′(xn)=0f'(x_n)=0: the tangent is horizontal. For f(x)=ex−3xf(x)=\mathrm{e}^x-3x, f′(ln⁡3)=0f'(\ln3)=0, so x0=ln⁡3x_0=\ln3 gives no x1x_1.
  • f′(xn)f'(x_n) small: the tangent meets the axis far away. For x3−2x+2x^3-2x+2, f′(0.8)=−0.08f'(0.8)=-0.08 gives x1=12.2x_1=12.2.
  • A cycle: for the same ff, x0=0x_0=0 gives x1=1x_1=1, x2=0x_2=0, and so on.
  • A start near another root finds that root.
−0.50.511.522.5−2−11234xyx = ln 3, f′ = 0y = eˣ − 3x
The minimum of eˣ − 3x is at x = ln 3, where the tangent is horizontal.

Newton-Raphson is used with x0x_0 at a stationary point of ff. What happens?

Try an exam question

f(x)=x3+x−5f(x)=x^3+x-5. Use the Newton-Raphson method once, with x0=1.5x_0=1.5, to find x1x_1 to 3 decimal places.

[3 marks]

That's the notes covered.

Carry on to the next subtopic.

Try a question

Which formula gives xn+1x_{n+1} in terms of xnx_n?

1 mark, marked against the mark scheme

Revision notes