Newton’s Method
Newton’s method approximates a zero of a function, a solution of f(x) = 0, by following tangent lines. Start with a guess x₀. Then repeat the formula x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}. Each new value is where the tangent line at the old value crosses the x-axis, and the values usually close in on the zero very quickly.
Before this lesson: Linear Approximation, Equation of a Tangent Line and Optimization
The idea: slide down the tangent line
Near a guess x₀, the graph of f looks like its tangent line. A line is easy to solve: set f(x_0) + f'(x_0)(x - x_0) = 0 and solve for x. That gives a new guess, x₁, which is usually much closer to where the curve crosses the axis. Repeating the step gives x₂, x₃ and so on.
Newton’s method formula
x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}- Write f so the equation is f(x) = 0, and find f′(x).
- Choose a starting guess x₀ close to the zero (a graph helps).
- Use the formula to find x₁, then x₂, and so on.
- Stop when two values agree to the number of decimal places you need.
Newton’s method can fail. It breaks down if f′(xₙ) = 0 (a horizontal tangent never reaches the axis), and a poor starting guess can jump to a different zero or bounce back and forth forever.
Newton’s method examples
Example 1: Approximating √2
Use Newton’s method with x₀ = 1 to approximate √2. Do three steps.
f(x) = x^2 - 2, \; f'(x) = 2x
√2 is the positive zero of x² − 2.
x_1 = 1 - \frac{1 - 2}{2(1)} = 1 + \frac{1}{2} = 1.5Step 1: f(1) = −1 and f′(1) = 2.
x_2 = 1.5 - \frac{2.25 - 2}{3} = 1.5 - 0.083333 = 1.416667Step 2: f(1.5) = 0.25 and f′(1.5) = 3.
x_3 = 1.416667 - \frac{0.006944}{2.833333} \approx 1.414216Step 3: f(1.416667) ≈ 0.006944 and f′ ≈ 2.833333.
Answer: √2 ≈ 1.414216 after three steps. The true value is 1.4142136, so the error is about 0.000002.
Example 2: A cubic equation
Approximate the real solution of x^3 - x - 1 = 0, starting at x₀ = 1.5.
f(x) = x^3 - x - 1, \; f'(x) = 3x^2 - 1
The function and its derivative.
x_1 = 1.5 - \frac{0.875}{5.75} \approx 1.347826f(1.5) = 3.375 − 1.5 − 1 = 0.875 and f′(1.5) = 5.75.
x_2 = 1.347826 - \frac{0.100682}{4.449905} \approx 1.325200Evaluate f and f′ at x₁.
x_3 = 1.325200 - \frac{0.002058}{4.268468} \approx 1.324718Evaluate at x₂.
Answer: x ≈ 1.3247. The number of correct digits roughly doubles with each step.
Example 3: Solving cos x = x
Solve \cos x = x (in radians), starting at x₀ = 1.
f(x) = \cos x - x, \; f'(x) = -\sin x - 1
Move everything to one side.
x_1 = 1 - \frac{-0.459698}{-1.841471} \approx 0.750364f(1) = cos 1 − 1 and f′(1) = −sin 1 − 1.
x_2 = 0.750364 - \frac{-0.018923}{-1.681905} \approx 0.739113Evaluate at x₁.
x_3 = 0.739113 - \frac{-0.000046}{-1.673633} \approx 0.739085Evaluate at x₂.
Answer: x ≈ 0.7391. Algebra alone cannot solve this equation, but Newton’s method handles it easily.
Example 4: When Newton’s method fails
Try Newton’s method on x^3 - 2x + 2 = 0 starting at x₀ = 0.
f'(x) = 3x^2 - 2
Differentiate.
x_1 = 0 - \frac{2}{-2} = 1f(0) = 2 and f′(0) = −2.
x_2 = 1 - \frac{1}{1} = 0f(1) = 1 and f′(1) = 1.
x_3 = 1, \; x_4 = 0, \ldots
The values bounce between 0 and 1 forever.
Answer: the method cycles and never converges. A different start, like x₀ = −2, finds the real zero near −1.7693.
Example 5: Word problem with a bowl
A hemispherical bowl has radius 3 ft. When the water is h feet deep, the volume is V = \frac{\pi h^2(9 - h)}{3} ft³. How deep is the water when the bowl holds 20 ft³? Start at h₀ = 1.5.
f(h) = \frac{\pi h^2(9 - h)}{3} - 20Set the volume equal to 20 and move 20 to the left.
f'(h) = \frac{\pi(18h - 3h^2)}{3}Expand to (9h² − h³)π/3, then differentiate.
h_1 = 1.5 - \frac{-2.328541}{21.205750} \approx 1.609807Step 1.
h_2 = 1.609807 - \frac{0.055434}{22.202778} \approx 1.607310Step 2.
Answer: the water is about 1.607 ft (19.3 in.) deep. A third step gives 1.607309, so the answer has settled.
Common mistakes
| Mistake | Example of the error | Fix |
|---|---|---|
| Adding instead of subtracting | x_1 = x_0 + \frac{f(x_0)}{f'(x_0)} | The formula subtracts: x_0 - \frac{f(x_0)}{f'(x_0)}. |
| Not setting the equation equal to 0 | Using f(x) = cos x for cos x = x | Use f(x) = cos x − x. |
| Using degrees in trig problems | Calculator in degree mode for cos x = x | Use radians. |
| Rounding too early | Rounding x₁ to 1.3 in Example 2 | Keep at least 6 decimal places until the end. |
| Starting where f′ = 0 | x₀ = 1 for x³ − 3x + 1 | f′(1) = 0, so the formula divides by 0. Pick another start. |
Related methods
Newton’s method and linear approximation
Each step is a linear approximation: you replace f by its tangent line and solve the line exactly. Newton’s method is that idea repeated.
The divide-and-average square root
For f(x) = x² − a, the formula simplifies to x_{n+1} = \frac{1}{2}\left(x_n + \frac{a}{x_n}\right), an ancient method for square roots (Practice Problem 7).
Practice problems
- Do one step of Newton’s method for f(x) = x^2 - 5 with x₀ = 2.
- Approximate √10 with two steps from x₀ = 3.
- Approximate \sqrt[3]{5} with two steps from x₀ = 2.
- Do two steps for x^3 + 2x - 5 = 0 from x₀ = 1.
- Solve e^x = 3 - x with two steps from x₀ = 1.
- Why can’t you start Newton’s method at x₀ = 1 for f(x) = x^3 - 3x + 1?
- Show that for f(x) = x^2 - a, Newton’s formula becomes x_{n+1} = \frac{1}{2}\left(x_n + \frac{a}{x_n}\right).
- Use one step from x₀ = 3 to approximate the solution of ln x = 1.
- Use one step from x₀ = 2 to approximate the positive solution of \sin x = \frac{x}{2}.
- A cube-shaped tank must hold 40 ft³. Use two steps from x₀ = 3 to approximate its side length.
Show answers
1.
x_1 = 2 - \frac{4 - 5}{4} = 2 + \frac{1}{4} = 2.25f(2) = −1 and f′(2) = 4.
Answer: x₁ = 2.25
2.
x_1 = 3 - \frac{-1}{6} \approx 3.166667f(x) = x² − 10: f(3) = −1 and f′(3) = 6.
x_2 = 3.166667 - \frac{0.027778}{6.333333} \approx 3.162281Evaluate at x₁.
Answer: √10 ≈ 3.1623
3.
x_1 = 2 - \frac{3}{12} = 1.75f(x) = x³ − 5: f(2) = 3 and f′(2) = 12.
x_2 = 1.75 - \frac{0.359375}{9.1875} \approx 1.710884f(1.75) = 5.359375 − 5 and f′(1.75) = 9.1875.
Answer: ∛5 ≈ 1.7109 (true value 1.70998)
4.
x_1 = 1 - \frac{-2}{5} = 1.4f(1) = −2 and f′(x) = 3x² + 2 gives f′(1) = 5.
x_2 = 1.4 - \frac{0.544}{7.88} \approx 1.330964f(1.4) = 0.544 and f′(1.4) = 7.88.
Answer: x ≈ 1.3310
5.
x_1 = 1 - \frac{0.718282}{3.718282} \approx 0.806824f(x) = eˣ + x − 3 and f′(x) = eˣ + 1.
x_2 = 0.806824 - \frac{0.047605}{3.240781} \approx 0.792135Evaluate at x₁.
Answer: x ≈ 0.7921
6.
f'(x) = 3x^2 - 3, \; f'(1) = 0
Differentiate and substitute.
Answer: the formula would divide by f′(1) = 0. The tangent line at x = 1 is horizontal and never crosses the x-axis.
7.
x_{n+1} = x_n - \frac{x_n^2 - a}{2x_n}f′(x) = 2x.
x_{n+1} = \frac{2x_n^2 - x_n^2 + a}{2x_n} = \frac{x_n^2 + a}{2x_n}Use a common denominator.
x_{n+1} = \frac{1}{2}\left(x_n + \frac{a}{x_n}\right)Split the fraction.
Answer: shown
8.
x_1 = 3 - \frac{\ln 3 - 1}{\frac{1}{3}} = 3 - 3(0.098612)f(x) = ln x − 1 and f′(x) = 1/x.
x_1 \approx 2.704163
Multiply and subtract.
Answer: about 2.7042 (the exact answer is e ≈ 2.7183)
9.
x_1 = 2 - \frac{-0.090703}{-0.916147} \approx 1.900996f(x) = sin x − x/2 and f′(x) = cos x − ½.
Answer: about 1.9010 (the true value is about 1.8955)
10.
x_1 = 3 - \frac{27 - 40}{27} \approx 3.481481f(x) = x³ − 40 and f′(x) = 3x².
x_2 = 3.481481 - \frac{2.198039}{36.362140} \approx 3.421033Evaluate at x₁.
Answer: about 3.421 ft (the true value is 3.41995)
Newton’s method FAQ
What is the formula for Newton’s method?
x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}. Start with a guess x₀ and apply the formula again and again.
Why does Newton’s method work?
Near a point, a smooth curve looks like its tangent line. The zero of the tangent line is a good estimate of the zero of the curve, and each step uses a better tangent line.
When does Newton’s method fail?
When f′(xₙ) = 0, when the guess is far from the zero, or when the values cycle, as in Example 4. Try a different starting value.
How many steps should I do?
Stop when two values in a row agree to the accuracy you need. Near a zero, the number of correct digits roughly doubles each step.
Summary
- Write the equation as f(x) = 0 and find f′(x).
- Repeat x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)} from a good starting guess.
- Each step is where the tangent line crosses the x-axis.
- Keep plenty of decimals, and use radians for trig.
- Watch for f′ = 0 and cycling.
Previous lesson: Optimization
Next lesson: Antiderivatives and Indefinite Integrals
Back to the Calculus 1 Index