Skip to content

When numerical iteration fails: causes and fixes

An iteration can produce numbers without producing the root you want. It may diverge, oscillate, repeat a cycle, leave the function’s domain, encounter division by zero or converge to a different root.

Failure is not just a calculator problem. It usually comes from the iteration formula, the starting value, or the shape of the graph. Recognising the cause lets you choose a better rearrangement, a better starting value or a more reliable method.

You should be able to:

  • generate terms from xn+1=g(xn)x_{n+1}=g(x_n);
  • use the local convergence test g(α)<1|g'(\alpha)|<1;
  • apply xn+1=xnf(xn)/f(xn)x_{n+1}=x_n-f(x_n)/f'(x_n);
  • interpret roots, gradients and tangents graphically;
  • identify the domains of square root, logarithmic and rational functions.

Review fixed point iteration and the Newton Raphson method first.

Suppose the intended root is α\alpha. Successful iteration means

xnαas n.x_n\longrightarrow\alpha \quad\text{as }n\longrightarrow\infty.

Several other behaviours are possible.

BehaviourWhat the values doTypical cause
DivergenceMove farther from the root or grow without boundA repelling fixed point or unsuitable start
OscillationAlternate from side to side without settlingA negative multiplier with magnitude at least 11
CycleRepeat two or more valuesRepeated application of gg returns to an earlier value
Undefined stepLeave the domain or divide by zeroFormula is not defined at an iterate
Wrong-root convergenceSettle, but at another rootStarting value lies in another root’s region of attraction
False confidenceConsecutive displayed values agree temporarilyRounding or very slow movement

The first few terms alone do not prove convergence. Always connect numerical evidence to the formula or graph.

Fixed point failure and the derivative test

Section titled “Fixed point failure and the derivative test”

For

xn+1=g(xn),x_{n+1}=g(x_n),

let α\alpha satisfy g(α)=αg(\alpha)=\alpha. If xnx_n is close to α\alpha, the error en=xnαe_n=x_n-\alpha approximately obeys

en+1g(α)en.e_{n+1}\approx g'(\alpha)e_n.

Therefore:

  • g(α)<1|g'(\alpha)|<1 makes nearby errors shrink;
  • g(α)>1|g'(\alpha)|>1 makes nearby errors grow;
  • g(α)<0g'(\alpha)<0 reverses the sign of the error, so values alternate across the root;
  • g(α)=1|g'(\alpha)|=1 is inconclusive and needs further investigation.

This is a local test. It describes starts sufficiently close to α\alpha, not every possible x0x_0.

Worked example 1: a divergent rearrangement

Section titled “Worked example 1: a divergent rearrangement”

The equation

x2x1=0x^2-x-1=0

has positive root

α=1+52=1.618.\alpha=\frac{1+\sqrt5}{2}=1.618\ldots.

Consider the valid rearrangement

x=x21,xn+1=xn21.x=x^2-1, \qquad x_{n+1}=x_n^2-1.

Here g(x)=2xg'(x)=2x, so

g(α)=2α=3.236>1.|g'(\alpha)|=2\alpha=3.236\ldots>1.

The fixed point is repelling. Even with x0=1.6x_0=1.6, close to the root,

nxn01.60000011.56000021.43360031.05520940.11346650.987125\begin{array}{c|c} n&x_n\\ \hline 0&1.600000\\ 1&1.560000\\ 2&1.433600\\ 3&1.055209\\ 4&0.113466\\ 5&-0.987125 \end{array}

The values initially look plausible, but their errors grow. Algebraic equivalence does not guarantee numerical stability.

A better rearrangement for the positive root is

x=x+1.x=\sqrt{x+1}.

Then

g(x)=12x+1,g(α)=12α=0.309,g'(x)=\frac1{2\sqrt{x+1}}, \qquad g'(\alpha)=\frac1{2\alpha}=0.309\ldots,

so nearby errors shrink rapidly.

Misconception: If x=g(x)x=g(x) is algebraically correct, its iteration must converge.

Correction: The equation identifies fixed points. The size of gg' determines whether nearby iterates are attracted to or repelled from them.

For the positive root of x2+x4=0x^2+x-4=0, compare

g1(x)=4x+1andg2(x)=4x.g_1(x)=\frac4{x+1} \qquad\text{and}\qquad g_2(x)=\sqrt{4-x}.

Which iteration is locally convergent?

Answer

The positive root is

α=1+172=1.5615.\alpha=\frac{-1+\sqrt{17}}2=1.5615\ldots.

For g1g_1,

g1(x)=4(x+1)2.g_1'(x)=-\frac4{(x+1)^2}.

Since 4=α(α+1)4=\alpha(\alpha+1),

g1(α)=αα+1=0.6096<1.|g_1'(\alpha)|=\frac{\alpha}{\alpha+1}=0.6096\ldots<1.

For g2g_2,

g2(α)=124α=12α=0.3202<1.|g_2'(\alpha)|=\frac1{2\sqrt{4-\alpha}}=\frac1{2\alpha}=0.3202\ldots<1.

Both are locally convergent. The second should converge faster because its derivative has smaller magnitude. The first alternates because g1(α)<0g_1'(\alpha)<0.

Alternation is not itself failure. If 1<g(α)<0-1<g'(\alpha)<0, values alternate with decreasing error and converge. Failure occurs when the alternating error does not shrink.

Solve x2=2x^2=2 using the rearrangement

x=2x,xn+1=2xn.x=\frac2x, \qquad x_{n+1}=\frac2{x_n}.

Starting with x0=1x_0=1 gives

x1=2,quadx2=1,quadx3=2,quadx4=1,ldotsx_1=2,quad x_2=1,quad x_3=2,quad x_4=1,ldots

The iteration is trapped in the two-cycle 1,21,2. In fact,

g(g(x))=22/x=xg(g(x))=\frac{2}{2/x}=x

for every non-zero xx, so almost every starting value repeats after two steps. At the positive fixed point α=2\alpha=\sqrt2,

g(α)=2α2=1.g'(\alpha)=-\frac2{\alpha^2}=-1.

The usual derivative test is inconclusive at magnitude 11, but the identity g(g(x))=xg(g(x))=x proves the cycling behaviour.

By contrast, the Babylonian iteration

xn+1=12(xn+2xn)x_{n+1}=\frac12\left(x_n+\frac2{x_n}\right)

converges to 2\sqrt2 from any positive start. Averaging damps the oscillation.

The iteration xn+1=1xnx_{n+1}=1-x_n has fixed point α=1/2\alpha=1/2. What happens from x0=0.2x_0=0.2?

Answer x1=0.8,quadx2=0.2,quadx3=0.8,ldotsx_1=0.8,quad x_2=0.2,quad x_3=0.8,ldots

It enters a two-cycle. Since g(x)=1g'(x)=-1, the distance from 1/21/2 is preserved while its sign reverses.

An iteration formula may be equivalent to the original equation only where every operation is valid. During iteration, a value can leave that domain.

Worked example 3: a square root becomes undefined

Section titled “Worked example 3: a square root becomes undefined”

Consider

xn+1=3xn2,x0=0.x_{n+1}=\sqrt{3-x_n^2}, \qquad x_0=0.

Then

x1=3,x2=3(3)2=0,x_1=\sqrt3, \qquad x_2=\sqrt{3-(\sqrt3)^2}=0,

so the values cycle between 00 and 3\sqrt3. A small rounded error can be worse. If a calculator stores x1x_1 as slightly larger than 3\sqrt3, then 3x12<03-x_1^2<0 and the next real square root is undefined.

Common domain failures include:

h(xn) with h(xn)<0,\sqrt{h(x_n)}\text{ with }h(x_n)<0, ln(h(xn)) with h(xn)0,\ln(h(x_n))\text{ with }h(x_n)\le0,

and

p(xn)q(xn) with q(xn)=0.\frac{p(x_n)}{q(x_n)}\text{ with }q(x_n)=0.

Before iterating, state the domain and check whether gg maps the proposed interval back into itself.

Misconception: A calculator error means the equation has no root.

Correction: It means the chosen formula is undefined at that iterate. The original equation may still have roots.

Newton Raphson uses

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

It relies on a tangent at (xn,f(xn))(x_n,f(x_n)). Trouble occurs when the tangent gives poor information about the nearby root.

Failure 1: a zero or very small derivative

Section titled “Failure 1: a zero or very small derivative”

If f(xn)=0f'(x_n)=0, the formula divides by zero. If f(xn)f'(x_n) is merely close to zero, the correction

f(xn)f(xn)\frac{f(x_n)}{f'(x_n)}

can be enormous.

Let

f(x)=x32x+2,f(x)=3x22.f(x)=x^3-2x+2, \qquad f'(x)=3x^2-2.

Starting at

x0=23x_0=\sqrt{\frac23}

gives f(x0)=0f'(x_0)=0, so x1x_1 is undefined. Geometrically, the tangent is horizontal and never meets the xx-axis.

Starting near this value makes f(x0)|f'(x_0)| small, so the tangent’s axis intercept may be very far away. A nearby starting value is not always a good starting value.

For the same function, start at x0=0x_0=0:

x1=022=1,x_1=0-\frac{2}{-2}=1,

then

x2=111=0.x_2=1-\frac{1}{1}=0.

Thus

0,1,0,1,0,1,0,1,\ldots

is a two-cycle, even though ff has a real root near 1.769-1.769.

Failure 3: convergence to a different root

Section titled “Failure 3: convergence to a different root”

Newton Raphson is sensitive to x0x_0 when a function has several roots.

Worked example 5: the starting value selects the root

Section titled “Worked example 5: the starting value selects the root”

For

f(x)=x3x=x(x1)(x+1),f(x)=x^3-x=x(x-1)(x+1),

the roots are 1-1, 00 and 11, and

xn+1=xnxn3xn3xn21.x_{n+1}=x_n-\frac{x_n^3-x_n}{3x_n^2-1}.

With x0=0.8x_0=0.8,

x1=1.1130,quadx2=1.0150,quadx3=1.0003,x_1=1.1130\ldots,quad x_2=1.0150\ldots,quad x_3=1.0003\ldots,

so the method converges to 11.

With x0=0.1x_0=0.1,

x1=0.002061,quadx21.75×108,x_1=-0.002061\ldots,quad x_2\approx1.75\times10^{-8},

so it converges to 00. Newton Raphson finds a root associated with the starting value, not necessarily the root intended by the question.

Explain why Newton Raphson cannot start at x0=0x_0=0 for f(x)=x25f(x)=x^2-5.

Answer

Since f(x)=2xf'(x)=2x, we have f(0)=0f'(0)=0. The formula would require

x1=050,x_1=0-\frac{-5}{0},

which is undefined. On the graph, the tangent at (0,5)(0,-5) is horizontal.

When g(α)|g'(\alpha)| is just below 11, errors shrink very slowly. If

en+10.99en,e_{n+1}\approx0.99e_n,

then after 100100 steps

e1000.99100e00.366e0.|e_{100}|\approx0.99^{100}|e_0|\approx0.366|e_0|.

Most of the original error remains. Conversely, rounded calculator displays can repeat even when the exact iterates still move. Agreement of successive displayed values is evidence, not proof of accuracy.

To justify a rounded root, test the two rounding boundaries using a change of sign.

When an iteration fails:

  1. Check the formula. Confirm signs, brackets, derivatives and calculator angle mode.
  2. Check the domain. Identify where g(x)g(x) and the Newton Raphson quotient are defined.
  3. Inspect the values. Look for growth, alternation, a repeating cycle or a large jump.
  4. Use the graph. Locate roots, stationary points and suitable starting regions.
  5. Test local convergence. For fixed point iteration, evaluate g(α)|g'(\alpha)| or bound g(x)|g'(x)| on a known interval.
  6. Change one feature. Try another rearrangement, choose x0x_0 from a sign-changing bracket, or use bisection.
  7. Verify the result. Substitute back and justify the requested accuracy.

Bisection is slower but safer when ff is continuous and a sign-changing bracket is known. It keeps the root trapped inside the current interval. Newton Raphson is faster near a suitable simple root but does not preserve a bracket automatically.

Match each observation to the most likely diagnosis.

  1. xnx_n alternates across the root with steadily decreasing error.
  2. Newton Raphson produces a huge jump when xnx_n is near a stationary point.
  3. A logarithmic iteration reports a domain error.
  4. xn+2=xnx_{n+2}=x_n but xn+1xnx_{n+1}\ne x_n.
  5. The method converges accurately, but to the wrong solution.
Answers
  1. Convergence with 1<g(α)<0-1<g'(\alpha)<0. Alternation alone is not failure.
  2. f(xn)f'(x_n) is close to zero, making the Newton Raphson correction large.
  3. The logarithm’s argument has become non-positive.
  4. The iteration is in a two-cycle.
  5. The starting value belongs to the region attracted to a different root.
  • A correct rearrangement can still give a divergent iteration.
  • For fixed point iteration, g(α)<1|g'(\alpha)|<1 predicts local convergence; g(α)>1|g'(\alpha)|>1 predicts local divergence.
  • The case g(α)=1|g'(\alpha)|=1 needs separate analysis.
  • Newton Raphson can fail at a horizontal tangent, jump far away, cycle or find another root.
  • Domain restrictions apply to every iterate, not only to the final root.
  • A graph and a sign-changing bracket help you choose a sensible starting value.
  • Repeated decimal displays do not prove the claimed accuracy.

Next, consolidate the whole topic in A-level numerical methods or practise reliable bracketing with locating roots using a change of sign.