HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →
Live examsInternational live exams are comingTell us which exam you want first. Timed practice papers are open now.See what is coming →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Space Science and Astronomy
  • Earth and Environmental Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
Numerical Solution of Equations
  1. 1Locating roots and interval bisection
  2. 2Fixed-point iteration
  3. 3The Newton-Raphson method
  1. Mathematics
  2. /Numerical Solution of Equations
  3. /The Newton-Raphson method

Course 34.2·Lesson 3 of 3

The Newton-Raphson method

Newton's method replaces the curve by its tangent at xnx_nxn​ and takes the point where the tangent meets the axis: xn+1=xn−f(xn)f′(xn)x_{n+1} = x_n - \dfrac{f(x_n)}{f'(x_n)}xn+1​=xn​−f′(xn​)f(xn​)​

Lesson 3 of 3Show all lessonsHide
Numerical Solution of Equations
  1. 1Locating roots and interval bisection
  2. 2Fixed-point iteration
  3. 3The Newton-Raphson method

Try the code and the simulations beside the lesson.

What you will be able to do

  • derive Newton's formula from the tangent line and use it;
  • explain why it converges so fast near a simple root;
  • recognise the starting values and the functions for which it fails.

Follow the tangent

Stand on the curve y=f(x)y = f(x)y=f(x) at the point (xn,f(xn))(x_n, f(x_n))(xn​,f(xn​)). Near that point the curve looks like its tangent line. Where does the tangent meet the xxx-axis? The tangent is y−f(xn)=f′(xn)(x−xn)y - f(x_n) = f'(x_n)(x - x_n)y−f(xn​)=f′(xn​)(x−xn​). Put y=0y = 0y=0:

xn+1=xn−f(xn)f′(xn).\displaystyle x_{n+1} = x_n - \dfrac{f(x_n)}{f'(x_n)}.xn+1​=xn​−f′(xn​)f(xn​)​.

This is the Newton-Raphson formula. It needs f′(xn)≠0f'(x_n) \ne 0f′(xn​)=0. Isaac Newton used the idea in the 1660s, and Joseph Raphson published the general rule in 1690.

A worked example

Solve x3+2x−5=0x^3 + 2x - 5 = 0x3+2x−5=0 with x0=1.5x_0 = 1.5x0​=1.5. Here f′(x)=3x2+2f'(x) = 3x^2 + 2f′(x)=3x2+2.

  1. First step. x1=1.5−1.3758.75≈1.342857x_1 = 1.5 - \dfrac{1.375}{8.75} \approx 1.342857x1​=1.5−8.751.375​≈1.342857.
  2. Second step. x2≈1.328384x_2 \approx 1.328384x2​≈1.328384.
  3. Third step. x3≈1.3282689x_3 \approx 1.3282689x3​≈1.3282689.

The errors are about 1.5×10−21.5 \times 10^{-2}1.5×10−2, 1.2×10−41.2 \times 10^{-4}1.2×10−4 and 7×10−97 \times 10^{-9}7×10−9. Bisection would need about 272727 steps for the accuracy of x3x_3x3​.

Two panels. On the left, a rising curve with three tangent lines: the tangent at x0 meets the x-axis at x1, the tangent at x1 meets it at x2, and the points close in on the root. On the right, the curve y = x cubed - 2x + 2 with the tangent at x = 0 meeting the axis at x = 1 and the tangent at x = 1 meeting it at x = 0, a cycle that never reaches the root near -1.77.

Square roots the old way

For f(x)=x2−Nf(x) = x^2 - Nf(x)=x2−N, Newton's formula becomes

xn+1=12(xn+Nxn).\displaystyle x_{n+1} = \dfrac{1}{2}\left(x_n + \dfrac{N}{x_n}\right).xn+1​=21​(xn​+xn​N​).

Take the average of a guess and NNN divided by the guess. This rule was used in Babylon and described by Heron of Alexandria, long before Newton.

Why it is so fast

Expand fff about xnx_nxn​, with en=xn−αe_n = x_n - \alphaen​=xn​−α and f(α)=0f(\alpha) = 0f(α)=0. A careful calculation gives

en+1≈f′′(α)2f′(α) en2.\displaystyle e_{n+1} \approx \dfrac{f''(\alpha)}{2f'(\alpha)}\,e_n^2.en+1​≈2f′(α)f′′(α)​en2​.

The new error is about a constant times the square of the old one. This is quadratic convergence. An error of 10−310^{-3}10−3 becomes about 10−610^{-6}10−6, then 10−1210^{-12}10−12. Compare fixed-point iteration, where the error is only multiplied by a fixed factor.

When Newton's method fails

  • A flat tangent. If f′(xn)=0f'(x_n) = 0f′(xn​)=0, the tangent never meets the axis. A start near a turning point sends x1x_1x1​ far away.
  • A cycle. For f(x)=x3−2x+2f(x) = x^3 - 2x + 2f(x)=x3−2x+2 and x0=0x_0 = 0x0​=0: x1=1x_1 = 1x1​=1 and x2=0x_2 = 0x2​=0, for ever.
  • Running away. For f(x)=x3f(x) = \sqrt[3]{x}f(x)=3x​, the formula gives xn+1=−2xnx_{n+1} = -2x_nxn+1​=−2xn​. Each step doubles the distance from the root 000.
  • The wrong root. A start between two roots may land near a third one.
  • A repeated root. At a double root, f′(α)=0f'(\alpha) = 0f′(α)=0 too. The method still converges, but only linearly, with the error about halving at each step.

So a good method is to locate the root by a change of sign first, then let Newton finish the job.

Practise with new numbers

Try it in Python

The program runs Newton's method and prints the error at each step, so you can watch the correct digits double.

Read it first. Then run it. Count the zeros after the decimal point in each error.

1. Start at x0 = 10. How many more steps does it need?

2. Change f to return x ** 2 - 2, df to return 2 * x, and root to 2 ** 0.5. Start at x0 = 1. How many steps give every digit?

Common mistakes

  • Dividing by fff instead of f′f'f′. The step is f(xn)f′(xn)\dfrac{f(x_n)}{f'(x_n)}f′(xn​)f(xn​)​.
  • Degrees on a calculator. Trigonometric functions in calculus use radians.
  • Trusting a far start. Newton's method is fast near a root, not from anywhere.
  • Expecting quadratic speed at a double root. There it is only linear.

Remember these

  • xn+1=xn−f(xn)f′(xn)x_{n+1} = x_n - \dfrac{f(x_n)}{f'(x_n)}xn+1​=xn​−f′(xn​)f(xn​)​.
  • Square root: xn+1=12(xn+Nxn)x_{n+1} = \tfrac{1}{2}\left(x_n + \tfrac{N}{x_n}\right)xn+1​=21​(xn​+xn​N​).
  • Near a simple root, en+1≈Cen2e_{n+1} \approx C e_n^2en+1​≈Cen2​: digits double.
  • It fails at flat tangents, in cycles and for x3\sqrt[3]{x}3x​, and slows at repeated roots.

Check yourself

Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.

  1. Use one Newton step on x2−5=0x^2 - 5 = 0x2−5=0 from x0=2x_0 = 2x0​=2.
  1. Write Newton's formula for f(x)=x−cos⁡xf(x) = x - \cos xf(x)=x−cosx.
  1. Why can Newton's method not start at x0=0x_0 = 0x0​=0 for f(x)=x2−4f(x) = x^2 - 4f(x)=x2−4?
  1. An error of 2×10−32 \times 10^{-3}2×10−3 at one Newton step becomes about 3×10−63 \times 10^{-6}3×10−6 at the next. Roughly what will the error be after one more step?
  1. For f(x)=x3f(x) = \sqrt[3]{x}f(x)=3x​, show that xn+1=−2xnx_{n+1} = -2x_nxn+1​=−2xn​.

References

  • OpenStax, Calculus Volume 1, Section 4.9, Newton's Method.
  • R. L. Burden and J. D. Faires, Numerical Analysis, Chapter 2, Newton's Method and Its Extensions.

Enroll free in Numerical Solution of Equations

Every lesson is open to read. Enrolling also lets you:

  • Mark lessons done and carry on where you stopped.
  • Take the tests of this lesson and its course.
  • Count the course towards the certificate for its chapter.
No payment. You can leave at any time.

Problems (4)

A machinist needs the edge of a cube of volume 20 cm³, that is √[3]20 cm, and has only a basic…Hard · High School (11–12) · by StemPy Lab
Let f(x) = x³ - 2x + 2. Prove that f has exactly one real root, and that it lies in (-2, -1)…Advanced · High School (11–12) · by StemPy Lab
The cubic f(x) = (x - 1)²(x + 2) = x³ - 3x + 2 has a double root at x = 1…Advanced · High School (11–12) · by StemPy Lab
That was the last lessonBack to the course: take the test
← Numerical Solution of Equations
← Fixed-point iterationNext →

Discussion (0)

Log in to join the discussion.

Loading…

. Near a simple root it is very fast: the number of correct digits roughly doubles at each step. It can fail: a flat tangent, a start that sends it to another root or round a cycle, a function like
x3\sqrt[3]{x}3x​
, and a repeated root, where it slows to linear speed.
about 25 min1 simulation2 practice questions1 Python program5 questions to check yourself

This lesson is free to read. Enroll free to keep your place and take the tests.

The equation eˣ + x = 4 has one root, between 1 and 1.5…Hard · High School (11–12) · by StemPy Lab

Python Labs (1)

A careful Newton solverPython Lab · by StemPy Lab

Question Sets (1)

Solving Equations Numerically: Concept Check10 questions · by StemPy Lab

Notes (1)

Numerical Solution of Equations: Quick RevisionNote · by StemPy Lab