NapkinCalc

Calculus 1C — Applications of the Derivative

Newton's method — how solvers find roots

continues from lesson 4 — values defined earlier in the course stay live here

ELI5: to find where a function hits zero, stand at a guess, slide down its tangent line until you hit the x-axis, and use that landing spot as your next guess. Repeat, and you rocket toward the root. The update is x_next = x − f(x) / f′(x). This is what nsolve does under the hood.

Find √2, the positive root of x² − 2, starting at 1.5. One step lands at 1.41667; a second step at 1.41422 — already four correct digits.

newton1=1.51.52221.5newton_{1} = 1.5 - \frac{1.5^{2} - 2}{2 \cdot 1.5} = 1.41671.4167 one step: 1.41667
newton2=newton1newton1222newton1newton_{2} = newton_{1} - \frac{newton_{1}^{2} - 2}{2 \cdot newton_{1}} = 1.41421.4142 two steps: 1.41422
✓ pass abs(newton22)<0.0001\mathrm{abs}\left(newton_{2} - \sqrt{2}\right) < 0.0001 four correct digits after just two steps
rootnewton:=nsolve("x22","x",1.5)root_{newton} := nsolve("x^2 - 2", "x", 1.5) = 1.41421.4142 nsolve runs the iteration for you — Steps replays each landing
✓ pass abs(rootnewton2)<109\mathrm{abs}\left(root_{newton} - \sqrt{2}\right) < 10^{-9} the very same √2

Real-world hook: Newton's method (and its cousins) is how calculators, solvers, GPS receivers, and graphics engines actually compute square roots, trajectories, and intersections — fast, to full precision.

Try it yourself: do one Newton step on x² − 5 starting from x₀ = 2. (x_next = 2 − (2² − 5)/(2·2).)

newtonstep=222522newton_{step} = 2 - \frac{2^{2} - 5}{2 \cdot 2} = 2.25002.2500 ✏️ Your turn: replace 0 with the result of one Newton step on x² − 5 from x₀ = 2. Work out 2 − f(2)/f′(2) yourself.
✓ pass abs(newtonstep222522)<109\mathrm{abs}\left(newton_{step} - 2 - \frac{2^{2} - 5}{2 \cdot 2}\right) < 10^{-9} green when your single Newton step is correct

That completes Calculus 1. Next, Calculus 2 runs the machine in reverse — from slopes back to areas, with integrals and infinite series.