Newton's Method

Category: Calculus   Level: 301

xn+1 = xn - f(xn)/f'(xn)

Guess a root, replace the curve by its tangent line, and jump to where the tangent crosses zero. Each jump roughly doubles the number of correct digits.

Step through it

Watch it

Animated walkthrough

Step by step

Step 1: Make a first guess

Find where y = x² − 2 crosses zero, that is √2. Start with the guess x₀ = 2, where the curve sits at height 2.

x0 = 2, f(2) = 2, f'(2) = 4

Step 1: Make a first guess

Step 2: Follow the tangent down

The tangent at (2, 2) has slope 4. It hits zero 2/4 = 0.5 to the left, at x₁ = 1.5.

x1 = 2 - f(2)/f'(2) = 2 - 2/4 = 1.5

Step 2: Follow the tangent down

Step 3: Repeat from the new guess

Climb to the curve at x₁ = 1.5, where f = 0.25, and slide down its tangent of slope 3. The next guess is 1.41667.

x2 = 1.5 - 0.25/3 ≈ 1.41667

Step 3: Repeat from the new guess

Step 4: Watch the digits pile up

One more jump lands within 0.000003 of √2. The error column roughly squares each time, so a few jumps beat a lot of guessing.

x3 ≈ 1.414216, √(2) ≈ 1.414214

Step 4: Watch the digits pile up

All steps at once

Storyboard

Generate it yourself

cd svg-generator
python3 -m svgmath render newtons-method --out /tmp/newtons-method

Source: svgmath/diagrams/approximation.py