On this page
Before you start
This page is easier if you are comfortable with:
What Newton–Raphson means
Draw the tangent to the curve at x n and see where it meets the x -axis; that point is x n + 1 . The tangent has gradient f ′ ( x n ) (see the tangent at a point ), and setting its equation y = f ( x n ) + f ′ ( x n ) ( x − x n ) to zero gives the formula. A starting value can be found from a change of sign.
Convergence is very fast: the number of correct digits roughly doubles each step, as explained in Newton's quadratic convergence . For f ( x ) = x 2 − 2 with x 0 = 1.5 : x 1 = 1.41667 , x 2 = 1.41422 . It fails when f ′ ( x n ) = 0 , or when the start is far from the root. It is a special case of fixed-point iteration with g ( x ) = x − f / f ′ .
The method needs derivatives, so see the derivative of a power and the second derivative for the shape. Without a derivative, use the secant method . The same idea in optimisation is Newton's method for optimisation .
What is it used for? Newton–Raphson follows the tangent down to the axis. Each step roughly doubles the number of correct digits.
Finding square roots and other roots on computers. Solving equations in engineering software. Optimisation, using the derivative.
How to use newton–raphson
Write f ( x ) and f ′ ( x ) . Choose a starting value x 0 near the root. Compute x 1 = x 0 − f ′ ( x 0 ) f ( x 0 ) , and repeat. Stop when successive values agree to the required accuracy.
Graph The tangent to y = x² − 2 at x = 1.5 meets the axis at 1.4167 x0 = 1.5 x1 = 1.4167 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 2.2 -2 -1 0 1 2 3 The tangent to y = x² − 2 at x = 1.5 meets the axis at 1.4167 x y y = x² − 2 tangent at x = 1.5 Graph with x from 0 to 2.2 and y from -2 to 3. Shows the curve y = x² − 2; the curve tangent at x = 1.5; point x0 = 1.5 at (1.5, 0.25); point x1 = 1.4167 at (1.4167, 0). The tangent crosses the axis very close to the true root √2 = 1.4142.
Worked examples
These examples are worked by hand, step by step, so you can compare your own working.
Example 1: square root of 2 Use Newton–Raphson on f ( x ) = x 2 − 2 from x 0 = 1.5 to find x 1 and x 2 .
Worked example
Answer
x 2 ≈ 1.41422 x_2\approx1.41422 x 2 ≈ 1.41422 x₁
1.5 − 3 0.25 = 1.41667
x₂
1.41667 − 2.83333 0.006944 = 1.41422
Example 2: a cubic Use Newton–Raphson on f ( x ) = x 3 − x − 2 from x 0 = 1.5 to find x 1 .
Worked example
Answer
x 1 ≈ 1.52174 x_1\approx1.52174 x 1 ≈ 1.52174 f and f'
f ( 1.5 ) = − 0.125 , f ′ ( 1.5 ) = 3 ( 2.25 ) − 1 = 5.75
x₁
1.5 + 5.75 0.125 = 1.52174
Example 3: cos x = x Use Newton–Raphson on f ( x ) = cos x − x from x 0 = 1 to find x 1 .
Worked example
Answer
x 1 ≈ 0.75036 x_1\approx0.75036 x 1 ≈ 0.75036 f and f'
f ( 1 ) = − 0.45970 , f ′ ( 1 ) = − sin 1 − 1 = − 1.84147
x₁
1 − − 1.84147 − 0.45970 = 0.75036
Special cases
A few situations come up again and again. Knowing them saves time and helps you spot answers that cannot be right.
f = x² − 2, x₀ = 1 x₁ = 1 − (−1)/2
1.5.
x₂ 1.5 − 0.25/3
1.4167.
f = x³ − x − 1, x₀ = 1.5 1.5 − 0.875/5.75
1.3478.
f = x² − 5, x₀ = 2 2 − (−1)/4
2.25.
Word problems
xₙ₊₁ = xₙ − f(xₙ)/f′(xₙ). It converges quickly (roughly doubling the correct digits) when started near a simple root, but can fail where f′ ≈ 0.
x² − 2 x₀ = 1: f = −1, f′ = 2.
1 + 0.5 Check: ✓ 1.5
Second step x₁ = 1.5: f = 0.25, f′ = 3.
1.5 − 0.0833 Check: ✓ 1.4167
Cubic Higher x³ − x − 1, x₀ = 1.5.
1.5 − 0.875/5.75 Check: ✓ 1.3478
x² − 5 Higher x₀ = 2.
2 + 0.25 Check: ✓ 2.25
Common mistakes
Forgetting f′ xₙ − f(xₙ) ✗
divide by f′(xₙ) ✓
Tangent.
Start at a stationary point works ✗
f′ = 0 fails ✓
Division by zero.
Sign slip xₙ + f/f′ ✗
xₙ − f/f′ ✓
Minus.
Degrees mixed ✗
radians ✓
Units.
Exam tips
xₙ₊₁ = xₙ − f/f′.
Start near the root.
Avoid f′ = 0.
Quadratic convergence.
Tangent intercept.
Practice questions
Try each one on paper, then open the answer. Use the solver above to see the full working.
1. x₁ for x² − 3, x₀ = 2 Foundation 1.75
2. x₁ for x² − 10, x₀ = 3 Foundation 3.1667
3. x₁ for x³ − 2, x₀ = 1 Foundation 1.3333
4. x₁ for x² − 2, x₀ = 2 Higher 1.5
5. x₁ for cos x − x, x₀ = 1 to 4 d.p. Higher 0.7504
6. x₁ for e^x − 3, x₀ = 1 to 4 d.p. Higher 1.1036
Practice generator Unlimited fresh questions with instant marking. Choose a level, work it out on paper, then type your answer.
Foundation Higher Mixed New question
Solve: …
The practice generator needs JavaScript.
Key terms
Newton–Raphson method Tangent-based iteration. Tangent Line of slope f′. Quadratic convergence Digits double. Starting value x₀. Derivative f′ Slope. Simple root f′ ≠ 0 there.
Frequently asked questions
What is the Newton–Raphson formula? xₙ₊₁ = xₙ − f(xₙ)/f′(xₙ).
Where does it come from? The x-intercept of the tangent.
When does it fail? Where f′ is 0 or the start is poor.
How fast is it? Quadratically.
Which page covers first-order integrating factors? first-order linear integrating factor .
Which page covers fixed-point iteration? fixed-point iteration.