6.3 Newton–Raphson search
Source: Ideas from Computational Physics (Landau, Páez, Bordeianu), §6.3–6.3.1. Rewritten in original wording — not a paste of
NewtonCD.py. Continues 6.2 Bisection search. Labs: 6.3b Newton–Raphson labs.
Tangent intercept
Bisection is reliable but only halves the bracket each step. Newton–Raphson is usually faster when you already have a rough guess near a root of .
Graphically (Fig. 6.2): at the current guess , draw the tangent line to , then take the intercept of that line with the -axis as the next guess. If were exactly linear, one step would finish; otherwise you repeat.
Write the update as an old guess plus a correction, Taylor-expand to first order, and force the linear model through zero. Pick each equation among lookalikes.
Repeat with the improved until or falls below a chosen .
Derivative, failure modes, and backtracking
If you know in closed form, use it. For messy residuals (including the square-well ), approximate by a forward difference, and backtrack when grows after a step. Pick each formula among lookalikes.
Newton assumes the local picture is nearly linear. Fig. 6.3 shows two classic traps:
Flat blows up ; cycling searches escape the nearly-linear neighborhood. A practical hybrid: bisect until the bracket is small, then switch to Newton for the last digits.
Square-well reminder
Use the even residual from §6.1,
with a close start (e.g. for , or for the first even root at ). Far starts can land near poles — plot first, or start with bisection.
Newton–Raphson
1 / 4The Newton correction is…
Pick an answer to see if you are right.
Next: 6.3b Newton–Raphson labs — cubic and square-well roots, iteration counts vs bisection, backtracking. Then 6.4 Magnetization search.