I2 - Newton-Raphson iteration

I2 - Newton-Raphson iteration

Derive Newton–Raphson from a tangent, use its recurrence to approximate roots, and justify the digits you report. You will also recognise starting values that cause undefined steps, cycles, divergence or convergence to the wrong root.

Tangents give new estimates

How can a straight line help find the root of a curved graph? For f(x)=x2−5f(x)=x^2-5, the point at x=2x=2 is (2,−1)(2,-1), close to the horizontal axis. The tangent there has gradient 44; following that tangent to the axis gives the next estimate, 2.252.25.

You already know

The derivative gives a tangent's gradient. A line through (a,b)(a,b) with gradient mm has equation y−b=m(x−a)y-b=m(x-a). This point-gradient equation is not in the formula booklet: learn it.

At the current input xnx_n, the curve point is (xn,f(xn))(x_n,f(x_n)) and the tangent gradient is f′(xn)f'(x_n). Set the tangent's height equal to zero to locate its intercept:

y−f(xn)=f′(xn)(x−xn)point-gradient equation−f(xn)=f′(xn)(xn+1−xn)set y=0xn+1=xn−f(xn)f′(xn)divide and rearrange\begin{aligned} y-f(x_n)&=f'(x_n)(x-x_n) && \text{point-gradient equation} \\ -f(x_n)&=f'(x_n)(x_{n+1}-x_n) && \text{set }y=0 \\ x_{n+1}&=x_n-\frac{f(x_n)}{f'(x_n)} && \text{divide and rearrange} \end{aligned}

The tangent is a local approximation to the curve, so its intercept is a new estimate rather than automatically the true root. Repeating this construction is the Newton–Raphson method.

Newton–Raphson iteration

To solve f(x)=0f(x)=0, use

xn+1=xn−f(xn)f′(xn)x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}

The derivative must be defined and nonzero at the current input.
In the formula booklet.

This is another recurrence xn+1=g(xn)x_{n+1}=g(x_n), now with g(x)=x−f(x)/f′(x)g(x)=x-f(x)/f'(x). Unlike a fixed-point rearrangement chosen by inspection, its rule comes from the tangent construction.

Worked example 1: following one tangent

Question. For f(x)=x2−5f(x)=x^2-5, use x1=2x_1=2 to find x2x_2, and verify it with the tangent equation.

Plan. Evaluate the curve height and gradient at 22, apply the recurrence, then set the tangent's height to zero.

f(2)=−1curve heightf′(2)=2(2)=4tangent gradientx2=2−−14=2.25Newton stepy+1=4(x−2)tangent through (2,−1)y=4x−9simplify the line\begin{aligned} f(2)&=-1 && \text{curve height} \\ f'(2)&=2(2)=4 && \text{tangent gradient} \\ x_2&=2-\frac{-1}{4}=2.25 && \text{Newton step} \\ y+1&=4(x-2) && \text{tangent through }(2,-1) \\ y&=4x-9 && \text{simplify the line} \end{aligned}

Why this step? Both the function and derivative must be evaluated at the same current input; the tangent is attached to that point.

Answer. x2=2.25x_2=2.25. The tangent also gives 0=4x−90=4x-9, hence x=2.25x=2.25.

Check. 2.252−5=0.0625≠02.25^2-5=0.0625\ne0: the intercept improves the estimate but is not the root itself. The true positive root is 5≈2.236068\sqrt5\approx2.236068.

Change only the constant term, from −5-5 to −6-6, retaining the starting input 22. The gradient is unchanged, while the height and tangent intercept change.

Worked example 2: a different curve height

Question. For f(x)=x2−6f(x)=x^2-6, starting at x1=2x_1=2, find the tangent and its intercept x2x_2.

Plan. Keep f′(x)=2xf'(x)=2x, calculate the new height, and find where the new tangent meets the axis.

f(2)=−2new curve heightf′(2)=4same gradienty+2=4(x−2)tangent equationy=4x−10simplifyx2=104=2.5set y=0\begin{aligned} f(2)&=-2 && \text{new curve height} \\ f'(2)&=4 && \text{same gradient} \\ y+2&=4(x-2) && \text{tangent equation} \\ y&=4x-10 && \text{simplify} \\ x_2&=\frac{10}{4}=2.5 && \text{set }y=0 \end{aligned}

Why this step? A more negative height with the same positive gradient needs a larger move to reach the axis.

Answer. The tangent is y=4x−10y=4x-10, giving x2=2.5x_2=2.5.

Check. The supplied recurrence gives 2−(−2)/4=2.52-(-2)/4=2.5, and f(2.5)=0.25f(2.5)=0.25, closer to zero than f(2)=−2f(2)=-2.

The left panel draws the first example. The horizontal tangent on the right will explain an important failure later.

A tangent step for x squared minus 5, beside a horizontal tangent that has no horizontal-axis intercept

The polynomial derivatives used above are recall results, not supplied in the formula booklet. The same method applies beyond polynomials: for f(x)=ex−4f(x)=e^x-4, f′(x)=exf'(x)=e^x, so a start at 11 gives x2=1−(e−4)/e=4/e≈1.4715x_2=1-(e-4)/e=4/e\approx1.4715. The exponential derivative is also a recall result; the Newton–Raphson recurrence itself is supplied.

Watch out

Wrong: x2=x1−f′(x1)/f(x1)x_2=x_1-f'(x_1)/f(x_1). This inverts the tangent correction. Correct: subtract the height divided by the gradient, f(x1)/f′(x1)f(x_1)/f'(x_1), as the intercept derivation shows.

Change only the constant again, keeping the same starting input and tangent method.

Iterating and certifying accuracy

Use a graph or continuous sign-changing bracket to select a starting input near the root you want, then keep full precision through the repeated steps.

Differentiate algebraically before entering the recurrence. Store the current input and calculate both ff and f′f' at that value. Show the function-specific recurrence and requested iterates when Newton–Raphson is prescribed. A calculator root-solver value alone does not show that method.

Worked example 3: a cubic root and its last digit

Question. Use Newton–Raphson from x1=2x_1=2 for x3−2x−5=0x^3-2x-5=0, then certify the nearby root to three decimal places.

Plan. Differentiate, apply three Newton steps with stored digits, then test the rounding boundaries of the suggested answer.

f′(x)=3x2−2differentiatexn+1=xn−xn3−2xn−53xn2−2substitute into the rulex2=2−−110=2.1first stepx3≈2.094568121use unrounded x2x4≈2.094551482use unrounded x3\begin{aligned} f'(x)&=3x^2-2 && \text{differentiate} \\ x_{n+1}&=x_n-\frac{x_n^3-2x_n-5}{3x_n^2-2} && \text{substitute into the rule} \\ x_2&=2-\frac{-1}{10}=2.1 && \text{first step} \\ x_3&\approx2.094568121 && \text{use unrounded }x_2 \\ x_4&\approx2.094551482 && \text{use unrounded }x_3 \end{aligned}

The candidate is 2.0952.095. At its rounding boundaries,

f(2.0945)=−0.000574591375negativef(2.0955)=0.010592483875positive\begin{aligned} f(2.0945)&=-0.000574591375 && \text{negative} \\ f(2.0955)&=0.010592483875 && \text{positive} \end{aligned}

Why this step? The iteration suggests the digits, while the continuous sign-changing bracket establishes them independently of consecutive-iterate agreement.

Answer. Continuity gives 2.0945<α<2.09552.0945<\alpha<2.0955, so α≈2.095\alpha\approx2.095 to three decimal places.

Check. On this interval f′(x)>0f'(x)>0, so it contains just one root. Also f(2)=−1f(2)=-1 and f(3)=16f(3)=16, consistent with the initial search.

Change only the constant term from −5-5 to −7-7, retaining the same starting value and three-decimal-place target. Recalculate the iterates and the rounding boundaries.

Continue this lesson.

You’re previewing NovaLearn without an account. Create a free account to read the rest.

Create free account