Root finding · CMNA Laboratory

Follow the tangent to the root.

Supply both the function and its derivative in R. Newton's method turns local slope into the next guess.

The geometry is the algorithm.

At the current approximation, evaluate the function and derivative. The tangent line meets the x-axis somewhere else; that intercept becomes the next approximation. Repeat until the movement is small enough.

Bring your own function

Write f and f' in R.

Then play the tangent construction one iteration at a time.

RuntimePreparing R…
RDefine f and fp

nxf(x)f'(x)next x
Book§6.1.2 · Newton's Method · p. 170Book details
CMNA packagenewton
TeachingInstructor notes and chapter contextOpen teaching material
Numerical ZooWorked problems