Me4, Me5 - Newton–Raphson and convergence failures

Me4, Me5 - Newton–Raphson and convergence failures

Can a tangent give an excellent approximation and still lead a calculation astray? Under Me4, you will use Newton–Raphson and represent its steps on a graph. Under Me5, you will explain Newton and fixed point failures through the actual paths, starting values and domains.

A tangent supplies the next approximation

How can the tangent at (2,2)(2,2) help solve x2−2=0x^2-2=0? It meets the axis at 1.51.5, already close to the positive root. The next tangent does better still.

You already know

A tangent at (a,f(a))(a,f(a)) has equation y−f(a)=f′(a)(x−a)y-f(a)=f'(a)(x-a). Put y=0y=0 to find its intercept on the horizontal axis.

The curve is replaced locally by a line, and the line's zero supplies the next input.

Newton–Raphson step

For differentiable ff, with f′(xn)≠0f'(x_n)\ne0,

−f(xn)=f′(xn)(xn+1−xn)xn+1=xn−f(xn)f′(xn).\begin{aligned} -f(x_n)&=f'(x_n)(x_{n+1}-x_n)\\ x_{n+1}&=x_n-\frac{f(x_n)}{f'(x_n)}. \end{aligned}

In the formula sheet.

Draw the tangent from the point on the curve, not from the starting value on the axis.

Newton tangents and an initial horizontal tangent

The left panel has tangent intercepts at 3/23/2 and 17/1217/12. Vertical moves take those intercepts back to the curve. The right panel shows a horizontal tangent at 00, which cannot supply a next intercept.

Worked example 1: from curve point to intercept

Question. Find the tangent at x0=2x_0=2 for f(x)=x2−2f(x)=x^2-2, then its intercept.

Plan. Use the function value and derivative at the same input.

f(2)=2,f′(2)=4y−2=4(x−2)tangent at (2,2)0=4x−6interceptx1=32\begin{aligned} f(2)&=2,\qquad f'(2)=4\\ y-2&=4(x-2) && \text{tangent at }(2,2)\\ 0&=4x-6 && \text{intercept}\\ x_1&=\frac32 \end{aligned}

Why use a tangent? Its root is a readily calculated approximation to the nearby curve's root.

Answer. The tangent y=4x−6y=4x-6 gives x1=3/2x_1=3/2.

Check. f(3/2)=1/4f(3/2)=1/4, compared with the initial value 22.

Change only the current input to 3/23/2.

Worked example 2: building the second tangent

Question. Find the next tangent intercept.

Plan. Return vertically to the curve and recompute the gradient there.

f(32)=14,f′(32)=3y−14=3(x−32)x2=32−1/43=1712\begin{aligned} f(\tfrac32)&=\frac14,\qquad f'(\tfrac32)=3\\ y-\frac14&=3(x-\tfrac32)\\ x_2&=\frac32-\frac{1/4}{3}=\frac{17}{12} \end{aligned}

Why recompute the derivative? A different point of the curve generally has a different tangent.

Answer. The tangent is y=3x−17/4y=3x-17/4, with intercept 17/1217/12.

Check. f(17/12)=1/144f(17/12)=1/144, much nearer zero.

There is an exact explanation for the speed: for x>0x>0, the new value (x+2/x)/2(x+2/x)/2 has error (x−2)2/(2x)(x-\sqrt2)^2/(2x) from 2\sqrt2. Squaring the old error can make a dramatic difference.

Watch out

The iterate is the tangent's intercept, not the height of the point on the curve. Label the curve, tangent, input and intercept when representing the method.

Use a changed constant to make the construction your own.

Compute and validate a Newton root

Use the bracket from the previous numerical lessons to choose a start for x3−x−4=0x^3-x-4=0. The sign change on (1,2)(1,2) suggests looking there; it does not guarantee every Newton start will work.

Worked example 3: a cubic root calculation

Question. Use Newton–Raphson from x0=2x_0=2 to find the root of x3−x−4=0x^3-x-4=0 to four decimal places.

Plan. Form the recurrence and retain precision through successive steps.

f′(x)=3x2−1xn+1=xn−xn3−xn−43xn2−1x1=1.818181818…x2=1.796613026…x3=1.796321956…x4=1.796321903…\begin{aligned} f'(x)&=3x^2-1\\ x_{n+1}&=x_n-\frac{x_n^3-x_n-4}{3x_n^2-1}\\ x_1&=1.818181818\ldots\\ x_2&=1.796613026\ldots\\ x_3&=1.796321956\ldots\\ x_4&=1.796321903\ldots \end{aligned}

Why show the recurrence? It identifies the requested method, rather than just a calculator's root output.

Answer. The suggested root is 1.79631.7963 to four decimal places.

Check. f(1.79625)=−0.000624115234375<0f(1.79625)=-0.000624115234375<0 and f(1.79635)≈0.000243892873>0f(1.79635)\approx0.000243892873>0. Continuity proves that rounded value; 3x2−1>03x^2-1>0 gives local uniqueness.

Change only the constant from 44 to 55.

Worked example 4: adapting the recurrence

Question. Use Newton–Raphson from x0=2x_0=2 to find the root of x3−x−5=0x^3-x-5=0 to four decimal places.

Plan. Change the function's constant, retaining its derivative.

xn+1=xn−xn3−xn−53xn2−1x1=1.909090909…x2=1.904174860…x3=1.904160859…x4=1.904160859…\begin{aligned} x_{n+1}&=x_n-\frac{x_n^3-x_n-5}{3x_n^2-1}\\ x_1&=1.909090909\ldots\\ x_2&=1.904174860\ldots\\ x_3&=1.904160859\ldots\\ x_4&=1.904160859\ldots \end{aligned}

Why alter only the numerator? Adding a constant changes the function values but not the derivative.

Answer. The root is approximately 1.90421.9042 to four decimal places.

Check. For this new function, f(1.90415)<0<f(1.90425)f(1.90415)<0<f(1.90425); these rounding boundaries validate the answer.

Repeated ANS must use the current value in every occurrence of xnx_n. A spreadsheet can record xn,f(xn),f′(xn)x_n,f(x_n),f'(x_n) and xn+1x_{n+1} in separate columns, filled down from the previous unrounded row. For comparison, Newton iteration on x3−2x−3x^3-2x-3 from 1.51.5 begins 2.052631579,1.907603557,1.893420372,1.8932892072.052631579,1.907603557,1.893420372,1.893289207: an initial overshoot can still lead to convergence.

Exam tip

Report the requested accuracy after retaining extra precision during calculation. If the command specifies Newton–Raphson or detailed reasoning, an unexplained solver value is insufficient.

Try a fresh constant with the same structure.

Recognise undefined steps and cycles

A zero derivative prevents the Newton division. For x2−2x^2-2 at 00, the tangent y=−2y=-2 is horizontal and has no intercept. If both ff and f′f' are zero, you already have a root; the formula still contains an undefined 0/00/0. A very small nonzero gradient instead produces a large step, which can head away from the intended root.

A cycle is another failure, even when all the derivatives used are nonzero.

Worked example 5: a repeating pair

Question. Show that Newton–Raphson for f(x)=x3−2x+2f(x)=x^3-2x+2 fails from 00.

Plan. Calculate the next two tangent intercepts exactly.

f′(x)=3x2−2x1=0−2−2=1x2=1−11=0\begin{aligned} f'(x)&=3x^2-2\\ x_1&=0-\frac{2}{-2}=1\\ x_2&=1-\frac{1}{1}=0 \end{aligned}

Why calculate two steps? They return to the initial value, so all later steps repeat.

Answer. The sequence cycles 0,1,0,1,…0,1,0,1,\ldots, without approaching a root.

Check. f(0)=2f(0)=2 and f(1)=1f(1)=1, so neither member of the cycle is a root.

Change only the start to the other member, 11.

Continue this lesson.

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

Create free account