A136 of 55
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

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 (x0,f(x0)) the tangent meets zero at x1, and the tangent at x1 meets zero at x2. The root of x3−2x−5 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 x1 far away. Newton's method needs a good start.

Predict

Newton's method for 2 is x←12(x+2/x). Starting from 1, how many steps reach 12 correct digits?

Name it

Newton's method

xn+1=xn−f(xn)f′(xn)

the zero of the tangent line at xn. Expanding f about the root shows that near a simple root (f′(x*)≠0)

en+1≈f′′(x*)2f′(x*)en2

quadratic convergence: once the error is small, it squares each step. It's fixed-point iteration with g=x−f/f′, which has g′(x*)=0.

How it fails

  • A flat spot: where f′≈0, the step is huge.
  • A bad start: for x3−2x+2, starting at 0 gives 1, 0, 1, 0, ... forever.
  • A multiple root of order m: convergence drops to linear, with rate m−1m.
  • Exponentials (diodes, transistors): from too low a voltage, one step can land where eV/nVT overflows. Circuit simulators limit each junction's step to a few nVT.

Useful Newton iterations

SolveIteration
x2=ax←12(x+a/x)
1/x=a (division without dividing)x←x(2−ax)
x3=ax←x−x3−a3x2

The secant method

Replace f′(xn) with the slope through the last two points:

xn+1=xn−f(xn)xn−xn−1f(xn)−f(xn−1)

It converges with order φ=1+52≈1.618 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, f(V)=5−V1000−10−14(eV/0.02585−1)=0, by Newton's method from 0.8 V and from 0.5 V.

Show the solution
  1. From 0.8 V. The iterates are 0.7745, 0.7498, 0.7267, 0.7077, 0.6962, 0.6927, 0.692492, 0.6924904.
  2. 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.
  3. From 0.5 V. The first step goes to 4.6 V, where eV/nVT≈1077 an overflow away from disaster.
  4. 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 1/7 without dividing, from x0=0.1.

Show the solution
  1. The iteration. x←x(2−7x)
  2. Iterate from 0.1. It gives 0.13, 0.1417, 0.1428478, 0.1428571422.
  3. The error squares. The error 1−7x 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 tan⁡x=x above π by Newton's method, starting at 4.5.

Show the solution
  1. Why not use tan directly. x−tan⁡x has poles that can throw Newton far away.
  2. Multiply through by cos⁡x. The new function has the same roots and no poles: f(x)=sin⁡x−xcos⁡xf′(x)=xsin⁡x
  3. Iterate from 4.5. The iterates are 4.493419010, then 4.493409458, after which nothing changes: two steps gave nine digits.
  4. 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 3 from x0 = 1: what's x1?

Check

One Newton step for x3=5 from x0 = 1: what's x1?

Check

Near a simple root, Newton's error obeys en+1≈Cen2 with C = 2. If en = 0.01, what's en+1?

Check

Newton's method approaches a root of multiplicity 4. By what factor does each step shrink the error?

Check

One step of x←x(2−ax) toward 1/7 from x0 = 0.1: what's x1?

Check

For f(x)=x2−3, one secant step from x0=1 and x1=2: what's x2?

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 f(x)=x3−3.

(a)

What does one secant step from x0=1 and x1=2 give?

(b)

What does one Newton step from 2 give?

Check

Write Newton's step for two classic functions.

Step 1

For f(x)=1/x2−a, whose root is 1/a?

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°.

Explain why

Why do the correct digits roughly double with each Newton step near a simple root?

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.