A13 · Lesson 6 · Newton's method and the secant method
Follow the tangent, and double your digits every step
Every circuit simulator, every power-flow program and every square-root instruction in a processor runs on the same idea, Newton's: replace the curve by its tangent line, and jump to where the tangent crosses zero. Near a simple root it converges quadratically: the number of correct digits roughly doubles with each step, so five or six steps take a decent guess to full double precision. Far from the root it can do anything, which is why real implementations guard it. The secant method gets nearly the same speed without needing the derivative.
- The dashed lines are tangents: from the tangent meets zero at , and the tangent at meets zero at . The root of is 2.0945514815....
- Start at 3.5: the readouts show the correct digits growing roughly 1, 2, 5, 10, as each error is about the square of the one before.
- Now start near 0.82, where the curve is flat: the tangent is nearly horizontal and throws far away. Newton's method needs a good start.
Predict
Newton's method for is . Starting from 1, how many steps reach 12 correct digits?
Four: 1.5, 1.41667, 1.4142157, 1.414213562375. The errors are , , , : each roughly the square of the last (divided by ).
Name it
Newton's method
the zero of the tangent line at . Expanding f about the root shows that near a simple root ()
quadratic convergence: once the error is small, it squares each step. It's fixed-point iteration with , which has .
How it fails
- A flat spot: where , the step is huge.
- A bad start: for , starting at 0 gives 1, 0, 1, 0, ... forever.
- A multiple root of order m: convergence drops to linear, with rate .
- Exponentials (diodes, transistors): from too low a voltage, one step can land where overflows. Circuit simulators limit each junction's step to a few .
Useful Newton iterations
| Solve | Iteration |
|---|---|
| (division without dividing) | |
The secant method
Replace with the slope through the last two points:
It converges with order using one new function value per step, against Newton's two (f and f′), so per evaluation it's often faster.
Worked example
Solve the diode circuit of lesson 4, , by Newton's method from 0.8 V and from 0.5 V.
Show the solution
- From 0.8 V. The iterates are 0.7745, 0.7498, 0.7267, 0.7077, 0.6962, 0.6927, 0.692492, 0.6924904.
- Why it starts slowly. At first it moves about 25 mV per step: the exponential's tangent is steep, so each step undershoots. Then it converges quadratically.
- From 0.5 V. The first step goes to 4.6 V, where an overflow away from disaster.
- What simulators do. That's why simulators limit voltage steps.
Answer from 0.8 V Newton reaches 0.6924904 V in eight steps; from 0.5 V its first step jumps to 4.6 V, which is why simulators limit voltage steps.
Worked example
Find without dividing, from .
Show the solution
- The iteration.
- Iterate from 0.1. It gives 0.13, 0.1417, 0.1428478, 0.1428571422.
- The error squares. The error goes 0.3, 0.09, 0.0081, 0.000066, 0.0000000043.
Answer four steps reach 0.1428571422, with the error squaring at each step.
Worked example
Find the first root of above π by Newton's method, starting at 4.5.
Show the solution
- Why not use tan directly. has poles that can throw Newton far away.
- Multiply through by . The new function has the same roots and no poles:
- Iterate from 4.5. The iterates are 4.493419010, then 4.493409458, after which nothing changes: two steps gave nine digits.
- The general point. Rewriting an equation so its function is smooth near the root is often worth more than any refinement of the method.
Answer the root is 4.493409458, found to nine digits in two steps.
Check
One Newton step for from = 1: what's ?
Check
One Newton step for from = 1: what's ?
Check
Near a simple root, Newton's error obeys with C = 2. If = 0.01, what's ?
Check
Newton's method approaches a root of multiplicity 4. By what factor does each step shrink the error?
Check
One step of toward from = 0.1: what's ?
Check
For , one secant step from and : what's ?
Check
Newton's method needs f and f′ each step; the secant method needs one new f. If f′ costs as much as f, which reaches a given accuracy with fewer evaluations, near a simple root?
Check
Find the cube root of 3 as the root of .
(a)
What does one secant step from and give?
(b)
What does one Newton step from 2 give?
Check
Write Newton's step for two classic functions.
Step 1
For , whose root is ?
Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.
Step 2
For ?
Explain why
Why do the correct digits roughly double with each Newton step near a simple root?
Newton's method replaces f by its tangent line at the current guess and solves that line exactly. The only thing the tangent gets wrong is the curvature of f, and by Taylor's theorem that mistake is proportional to the square of the distance from the root: . So the new error is a constant times the old error squared. If the error is , the next is about and then : the number of correct digits doubles each step, as long as isn't zero.
Practice
Keep practicing
10 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.