Newtons Method to Solve Equations
Learn Newton's method for Victorian Year 11 Mathematical Methods (VCAA) — a fast technique that uses tangents to close in on a solution of an equation.
You will learn to apply the iteration rule from a starting value, repeat it to reach a required accuracy, and recognise when the method fails, such as where the gradient is zero.
Theory
In Year 11 Mathematical Methods (Unit 2), Newton's method is a numerical way to approximate a root of \(f(x)=0\). Starting from an estimate \(x_0\), it follows the tangent to \(y=f(x)\) down to the \(x\)-axis to get a better estimate, and repeats. This page shows the iteration formula \(x_{n+1}=x_n-\dfrac{f(x_n)}{f'(x_n)}\), how to run one or more steps for polynomial equations, and when the method breaks down.
Newton's method (also called the Newton–Raphson method) is an iterative technique for approximating a solution of \(f(x)=0\) — a root, or \(x\)-intercept, of \(y=f(x)\).
Geometrically, from a current estimate \(x_n\) you draw the tangent to the curve at \(\big(x_n,\,f(x_n)\big)\). Where that tangent cuts the \(x\)-axis is the next, usually better, estimate \(x_{n+1}\). Because the tangent has gradient \(f'(x_n)\), solving for its \(x\)-intercept gives the update rule below.
Each pass is one iteration. You repeat until the digits you need stop changing to the required accuracy; the sequence \(x_0,x_1,x_2,\dots\) then converges to the root.
Given \(f(x)\) and its derivative \(f'(x)\), each iteration of Newton's method is:
For the first step, put \(n=0\):
How to run Newton's method
- Set up: write the equation as \(f(x)=0\) and differentiate to get \(f'(x)\).
- Start: choose a starting estimate \(x_0\) (given, or read from a sketch near the root).
- Substitute: evaluate \(f(x_0)\) and \(f'(x_0)\), then apply \(x_{1}=x_0-\dfrac{f(x_0)}{f'(x_0)}\).
- Iterate: feed \(x_1\) back in to get \(x_2\), and repeat until the value is stable to the required number of decimal places.
- State the root to the requested accuracy.
Write the first-step formula:
| \(x_{1}\) | \(=\) | \(x_{0}-\dfrac{f(x_0)}{f'(x_0)}\) |
Evaluate \(f\) and \(f'\) at \(x_0=3\):
| \(f(3)\) | \(=\) | \((3)^2-7\) |
| \(=\) | \(2\) | |
| \(f'(3)\) | \(=\) | \(2(3)\) |
| \(=\) | \(6\) |
Substitute and simplify:
| \(x_{1}\) | \(=\) | \(3-\dfrac{2}{6}\) |
| \(x_{1}\) | \(\approx\) | \(2.6667\) |
\(x_1\approx 2.6667\) (4 d.p.) — already close to \(\sqrt7\approx 2.6458\).
First iteration — evaluate at \(x_0=2\):
| \(f(2)\) | \(=\) | \((2)^3-6=2\) |
| \(f'(2)\) | \(=\) | \(3(2)^2=12\) |
| \(x_{1}\) | \(=\) | \(2-\dfrac{2}{12}\) |
| \(x_{1}\) | \(\approx\) | \(1.8333\) |
Second iteration — feed \(x_1\) back in:
| \(x_{2}\) | \(=\) | \(1.8333-\dfrac{0.1620}{10.0833}\) |
| \(x_{2}\) | \(\approx\) | \(1.8173\) |
Continue until the digits stop changing:
| \(x\) | \(\approx\) | \(1.8171\) |
\(x\approx 1.8171\) (4 d.p.), the cube root of \(6\).
First iteration — evaluate at \(x_0=2\):
| \(f(2)\) | \(=\) | \((2)^3-2(2)-5=-1\) |
| \(f'(2)\) | \(=\) | \(3(2)^2-2=10\) |
| \(x_{1}\) | \(=\) | \(2-\dfrac{-1}{10}\) |
| \(x_{1}\) | \(\approx\) | \(2.1000\) |
Second iteration — feed \(x_1\) back in:
| \(x_{2}\) | \(=\) | \(2.1000-\dfrac{0.0610}{11.2300}\) |
| \(x_{2}\) | \(\approx\) | \(2.0946\) |
Continue until the digits stop changing:
| \(x\) | \(\approx\) | \(2.095\) |
\(x\approx 2.095\) (3 d.p.); the firm breaks even near \(2095\) units.
Evaluate the derivative at the start:
| \(f'(0)\) | \(=\) | \(2(0)\) |
| \(=\) | \(0\) |
Try to apply the formula:
| \(x_{1}\) | \(=\) | \(0-\dfrac{f(0)}{f'(0)}\) |
| \(x_{1}\) | \(=\) | \(0-\dfrac{-2}{0}\) |
The tangent at \(x_0=0\) is horizontal, so it never meets the \(x\)-axis and the update divides by zero. A different starting value (with \(f'(x_0)\neq0\)) is needed.
\(f'(x_0)=0\): the horizontal tangent makes the formula divide by zero.
Common pitfalls
Frequently asked questions
What is Newton's method used for?
It numerically approximates a root of \(f(x)=0\) — an \(x\)-intercept of \(y=f(x)\) — when an exact solution is hard to find.
What is the formula for Newton's method?
Each iteration is \(x_{n+1}=x_n-\dfrac{f(x_n)}{f'(x_n)}\); start with \(n=0\) using your estimate \(x_0\).
Why does Newton's method use the derivative?
\(f'(x_n)\) is the gradient of the tangent at \(x_n\). The next estimate \(x_{n+1}\) is where that tangent crosses the \(x\)-axis.
How do I know when to stop iterating?
Stop when the estimate is stable to the accuracy you need — the digits you are asked for stop changing between successive iterations.
When does Newton's method fail?
When \(f'(x_n)=0\) the tangent is horizontal and the formula divides by zero; a poor starting value can also make the sequence diverge or cycle.
How do I choose a starting value?
Pick \(x_0\) close to the root (often read from a sketch or a sign change of \(f\)) and where \(f'(x_0)\neq0\).