A guess at a stationary point
Newton-Raphson replaces the curve by its tangent at the guess and moves to where the tangent meets the x-axis. That needs the tangent to meet the axis.
Take again, whose roots are , and guess , the bottom of the curve. A point where the gradient is zero is a stationary point, and its tangent is horizontal. Here f(0) = −2, so the tangent is the line y = −2. It runs parallel to the x-axis and never reaches it, so there is no next guess.
The gold curve is . Its tangent at the bottom, , is the dashed horizontal line y = −2, which never meets the x-axis, although the curve crosses it twice.
The formula divides by zero
The formula says the same thing. , and f'(x) = 2x, so f'(0) = 0. The step would be , and nothing can be divided by zero, so has no value.
This is not because the curve has no root, and not because the guess is a root: f(0) = −2, not 0. The trouble is only where the guess was made. Any start other than 0 works for this curve.
A nearly flat tangent
A tangent that is almost horizontal does meet the axis, but a long way off. The step is the height divided by the gradient, and dividing by a small gradient gives a large step.
Take , whose positive root is , and whose gradient is zero at x = 1. Guess , just past that stationary point. Then f(1.1) = 1.331 − 3.3 = −1.969 and f'(1.1) = 3 × 1.21 − 3 = 0.63, so the step is and . The guess was 0.63 from the root, and the next one is 2.49 from it.
The gold curve is , which crosses the x-axis at . Its tangent at , dashed, has gradient only 0.63, so it reaches the axis at , much further from the root than the guess.
It may come back, slowly
From 4.225 the method does return: the next guesses are 2.984, 2.241, 1.865, 1.745 and 1.7322, and only then 1.73205. Six steps were spent recovering from one bad tangent. From , where the curve is steeper, the guesses are 1.8, 1.7357 and 1.73206, three steps for the same accuracy.
The flatter the tangent, the worse the throw. From the gradient is 0.06, and .
Going round in a cycle
The method can also go round in a loop. Take , with , and start at . Then f(0) = 2 and f'(0) = −2, so .
From : f(1) = 1 − 2 + 2 = 1 and f'(1) = 3 − 2 = 1, so , which is where it began. The guesses run 0, 1, 0, 1 forever and never reach the root.
The tangent at 0 is y = 2 − 2x, which meets the axis at 1. The tangent at 1 is y = x, which meets the axis at 0. Each tangent points to the other start. The only root of this cubic is near −1.7693, on the far side of a hump, and neither tangent leads there.
The curve is . The gold straight line, its tangent at , meets the x-axis at 1, and the dashed line, its tangent at , meets it back at 0. The root, near −1.7693, is never reached from either.
A better start
The same cubic is easy from the right start. f(−2) = −8 + 4 + 2 = −2 and f(−1) = −1 + 2 + 2 = 3 have opposite signs, so the root lies between −2 and −1. From : f'(−2) = 10, so , then and . Three steps give the root to 5 decimal places.
x₄ = −1.769 to three places: from a start in the root's basin, Newton converges in a few steps
Start at x₀ = 0 and take four steps
Newton-Raphson on , from : the tangents close in on the root. Drag to 0 and the four steps go 1, 0, 1, 0; drag it toward −0.82 or 0.82, where the curve is flat, and the next guess is thrown far away.
The wrong root
Even when the guesses settle, they may settle on a root nobody wanted. The method finds the root the tangent at the start points to. has roots , 0 and ; a start at 0.5 gives f(0.5) = −1.375 and f'(0.5) = −2.25, so , heading for 0, not for . And a root of the equation may make no sense in the problem, such as a negative time or a depth deeper than the object.
Choosing a start
Find an interval where f changes sign, so that a root is known to be inside it. Find where f' = 0, and start well away from those points, where the curve is steep. Run the method until successive guesses agree to the accuracy wanted; if they jump about or repeat, start somewhere else. Then check the answer by a change of sign either side of it.
The usual mistakes
Thinking f is zero at a stationary point. It is the gradient that is zero there; the height, here −2, is not.
Deciding the curve has no root because the method failed. crosses the axis twice; only the start was bad.
Thinking a shallow tangent helps. A small gradient makes large, so the step is large too.
Giving when is asked for. In the cycle, , and one more step sends it back to .
Taking f(0) = 2 as a term of the sequence. It is the height of the curve at the guess, not the next guess.
Two applications
In the first application below, a walker starts Newton-Raphson at the top of a hill to find where the path reaches a lake. The summit is a stationary point, so the method has nowhere to go, and a start just beside it is thrown far beyond the lake.
In the second, a start at 1 minute sends the method back and forth between 1 and 2 forever, because the tangent at each meets the axis at the other. A start at 4 finds the landing time.
Worked example: A Hill Path Down to a Lake: Why a Start at the Summit Gives Newton-Raphson Nowhere to Go
Question A path climbs over a hill and down to a lake. At a distance x km along the path, measured horizontally, its height above the lake is y = 8 + 12x − x3 tens of meters, for x ≥ 0. (a) A walker wants to know where the path reaches the lake, and starts the Newton-Raphson method at the summit, x0 = 2. Explain why the method fails there. Then find x1 from x0 = 2.1, and say whether that start is any better. (b) Use the method from x0 = 4 to find where the path reaches the lake, to 3 decimal places.
1.The path reaches the lake where y = 0: f(x) = 8 + 12x − x3 = 0. Differentiate: f'(x) = 12 − 3x2, which is zero at x = 2, the summit, where f(2) = 24, a height of 240 m.
The path meets the lake where f(x) = 8 + 12x − x3 = 0. The derivative f'(x) = 12 − 3x2 is zero at the summit, x = 2. 2.At x0 = 2 the formula needs f(2)f'(2) = 240, which has no value. The tangent at the summit is the horizontal line y = 24, which never meets the x-axis, so there is no x1.
At the summit the tangent is the horizontal line y = 24. It never meets the x-axis, so f(2)f'(2) = 240 gives no x1. 3.(a) The method fails at the summit because f'(2) = 0. From x0 = 2.1 the tangent is nearly horizontal: f(2.1) = 23.939 and f'(2.1) = −1.23, so x1 = 2.1 − 23.939−1.23 = 21.56, far beyond the lake.
(a) From x0 = 2.1 the tangent is nearly horizontal, with gradient −1.23, and it meets the axis at x1 = 21.56, far beyond the lake. 4.From x0 = 4: f(4) = −8 and f'(4) = −36, so x1 = 4 − −8−36 = 3.7778. Then f = −0.5816 and f' = −30.8148, so x2 = 3.7589, and x3 = 3.7588.
From x0 = 4, where the path is steep, the tangents land at 3.7778, 3.7589 and 3.7588. 5.(b) The path reaches the lake at x = 3.759 km, to 3 decimal places. Check: f(3.7585) = 0.008 and f(3.7595) = −0.022 have opposite signs.
(b) The path reaches the lake at x = 3.759 km. The start that works is on the steep side, near the lake.
Answer: (a) f'(2) = 0, so the tangent at the summit is horizontal and never meets the axis; from x0 = 2.1 the nearly horizontal tangent sends x1 to 21.56; (b) x = 3.759 km
Common mistakes
- Starting at the highest point because it is easy to find. The top of a hill is exactly where the tangent is horizontal, so it is the one start Newton-Raphson cannot use; start where the path is steep, close to the lake.
- Giving a root of the cubic that is not on the path. 8 + 12x − x3 = 0 also has the roots x ≈ −0.69 and x ≈ −3.06, but the path is described only for x ≥ 0.
More solving equations numerically problems, worked step by step →
Worked example: A Drone Coming In to Land: A Start That Sends Newton-Raphson Back and Forth Forever
Question A drone is launched from a roof and flies a programmed path. After x minutes its height is h(x) = −x3 + 6x2 − 10x + 6 meters, so h'(x) = −3x2 + 12x − 10. (a) After 1 minute the drone is only 1 m up, so an engineer starts the Newton-Raphson method at x0 = 1 to find when it lands. Show that the iterates go back and forth between two values forever. (b) Use the method from x0 = 4 to find the time at which the drone lands, to 3 decimal places.
1.The drone lands when h(x) = 0. From x0 = 1: h(1) = −1 + 6 − 10 + 6 = 1 and h'(1) = −3 + 12 − 10 = −1, so x1 = 1 − 1−1 = 2.
The tangent at x0 = 1, where h = 1 and h'(1) = −1, meets the axis at x1 = 2. 2.From x1 = 2: h(2) = −8 + 24 − 20 + 6 = 2 and h'(2) = −12 + 24 − 10 = 2, so x2 = 2 − 22 = 1, which is x0 again.
The tangent at x1 = 2, where h = 2 and h'(2) = 2, meets the axis back at x2 = 1. 3.(a) Each step repeats an earlier one, so the iterates run 1, 2, 1, 2, … forever and never approach a root. The tangent at x = 1 meets the axis at 2, and the tangent at x = 2 meets it back at 1. Between them the drone dips to about 0.91 m and climbs again, so neither tangent reaches the landing point.
(a) The two tangents send each estimate to the other, so the iterates run 1, 2, 1, 2, … forever and never reach the landing point. 4.From x0 = 4: h(4) = −64 + 96 − 40 + 6 = −2, a negative height, which means the formula has already passed the landing. With h'(4) = −48 + 48 − 10 = −10, x1 = 4 − −2−10 = 3.8. Then h(3.8) = −0.232 and h'(3.8) = −7.72, so x2 = 3.8 − −0.232−7.72 = 3.7699.
From x0 = 4 the tangents land at x1 = 3.8 and x2 = 3.7699. 5.The next step gives x3 = 3.7693, and x4 = 3.7693 again. (b) The drone lands 3.769 minutes after launch, about 3 minutes 46 seconds. Check: h(3.7685) = 0.006 and h(3.7695) = −0.002 have opposite signs.
(b) The next estimates are 3.7693 and 3.7693: the drone lands 3.769 minutes after launch, about 3 minutes 46 seconds.
Answer: (a) x1 = 2, x2 = 1, x3 = 2, …: the tangent at each estimate meets the axis at the other, forever; (b) 3.769 minutes
Common mistakes
- Taking a small value of h as a sign that a root is close. At x = 1 the drone is only 1 m up, but the curve turns back up before it reaches the axis, and the tangent there points the method to x = 2.
- Running a fixed number of steps and reporting the last one. The iterates 1, 2, 1, 2 never settle, so a root may be stated only when successive iterates agree to the accuracy asked for.
More solving equations numerically problems, worked step by step →