Fixed-Point Iteration

Fixed-point iteration solves an equation written as x = g(x) by picking a starting guess x₀ and repeating xₙ₊₁ = g(xₙ). If the iterates settle down, their limit p satisfies g(p) = p and is called a fixed point. The method converges when |g′(x)| < 1 near the fixed point.

Before this lesson: Bisection Method and Mean Value Theorem

What a fixed point is

A fixed point of a function g is a number p with g(p) = p: plugging it in gives it right back. On a graph, fixed points are where y = g(x) crosses the line y = x.

Any root-finding problem f(x) = 0 can be rewritten as x = g(x), usually in several ways. For example, x^2 - x - 3 = 0 becomes x = x^2 - 3, x = \sqrt{x + 3} or x = 1 + 3/x. Each version has the same solutions, but, as Example 2 shows, they do not all work equally well.

The iteration itself is as simple as a method can be: take a guess, feed it to g, feed the output back in, and repeat. If you’ve ever pressed the cos key on a calculator over and over and watched the display settle at 0.739085…, you have done fixed-point iteration.

Cobweb diagram on the square from 0 to 1. The blue curve y = e^(−x) falls from (0, 1) to about (1, 0.37), and the gray line y = x rises from (0, 0) to (1, 1); they cross at the fixed point near (0.567, 0.567). Starting at x₀ = 0, an orange path goes up to the curve, across to the line, and repeats, through x₁ = 1, x₂ ≈ 0.368, x₃ ≈ 0.692, x₄ ≈ 0.500 and x₅ ≈ 0.606, spiraling in toward the fixed point.
A cobweb diagram: go up to y = g(x), across to y = x, and repeat. For g(x) = e^(−x) the path spirals in to the fixed point near 0.567.

The fixed-point iteration formula and convergence theorem

Choose x_0 and compute

x_{n+1} = g(x_n), \qquad n = 0, 1, 2, \ldots

Fixed-point theorem. Suppose g is continuous on [a, b], g(x) is in [a, b] for every x in [a, b], and |g'(x)| \le k \lt 1 on (a, b). Then g has exactly one fixed point p in [a, b], the iteration converges to p from any x_0 in [a, b], and

|x_n - p| \le k^n \max\{x_0 - a,\; b - x_0\}, \qquad |x_n - p| \le \frac{k}{1 - k}\,|x_n - x_{n-1}|

The reason is the mean value theorem: x_{n+1} - p = g(x_n) - g(p) = g'(\xi)(x_n - p) for some \xi between x_n and p, so each step multiplies the error by a factor of at most k.

Near the fixed point, the error shrinks by about |g'(p)| per step. If |g'(p)| \gt 1, the iterates are pushed away instead. If g'(p) \lt 0, they bounce from side to side; if g'(p) \gt 0, they approach from one side.

Fixed-point iteration examples

Example 1: Iterating g(x) = e^(−x)

Use fixed-point iteration with g(x) = e^{-x} and x_0 = 0 to solve x = e^{-x}. Do four iterations.

x_1 = e^{-0} = 1

Apply g to x_0 = 0.

x_2 = e^{-1} \approx 0.367879

Apply g to x_1.

x_3 = e^{-0.367879} \approx 0.692201

Apply g to x_2.

x_4 = e^{-0.692201} \approx 0.500473

Apply g to x_3.

g'(x) = -e^{-x}

Differentiate to check convergence (see derivatives of exponential functions).

|g'(0.567)| \approx 0.567 \lt 1

Evaluate near the fixed point: below 1, so the iteration converges.

nxₙxₙ₊₁ = e^(−xₙ)
001
110.367879
20.3678790.692201
30.6922010.500473

Answer: x_4 \approx 0.500473. The iterates jump above and below the fixed point p = 0.567143… because g'(p) \lt 0, and they close in slowly because |g'(p)| \approx 0.567 is not small.

Example 2: Choosing a good g(x)

The equation x^2 - x - 3 = 0 has the positive root p = \frac{1 + \sqrt{13}}{2} \approx 2.302776. Compare g_1(x) = x^2 - 3 and g_2(x) = \sqrt{x + 3}, both starting at x_0 = 2.

g_1(2) = 4 - 3 = 1

First step with g_1.

g_1(1) = 1 - 3 = -2

Second step with g_1.

g_1(-2) = 4 - 3 = 1

Third step: the values cycle between 1 and −2.

g_1'(p) = 2p \approx 4.61

The slope at the fixed point is above 1, so g_1 pushes iterates away.

g_2(2) = \sqrt{5} \approx 2.236068

First step with g_2.

g_2(2.236068) = \sqrt{5.236068} \approx 2.288246

Second step.

g_2(2.288246) = \sqrt{5.288246} \approx 2.299619

Third step.

g_2(2.299619) = \sqrt{5.299619} \approx 2.302090

Fourth step.

g_2'(x) = \frac{1}{2\sqrt{x + 3}}

Differentiate (see chain rule).

g_2'(p) = \frac{1}{2p} \approx 0.217

Use \sqrt{p + 3} = p: the slope is well below 1.

Answer: g_1 never converges, while g_2 reaches 2.302090 in four steps, within about 0.0007 of p. The same equation can give a working or a failing iteration; always check |g'(p)|.

Example 3: Checking the theorem and bounding the error

The equation x^3 - 5x + 1 = 0 has a root in [0, 1]. Use g(x) = \frac{x^3 + 1}{5} with x_0 = 0. Check the theorem, find how many steps the a priori bound requires for an error of 10^{-4}, then do three steps and use the a posteriori bound.

g(0) = 0.2, \quad g(1) = 0.4

g is increasing, so it maps [0, 1] into [0.2, 0.4], inside [0, 1].

g'(x) = \frac{3x^2}{5} \le \frac{3}{5} = 0.6

On [0, 1], take k = 0.6 \lt 1. The theorem applies.

0.6^n \cdot 1 \le 10^{-4}

A priori bound with \max\{0 - 0,\; 1 - 0\} = 1.

n \ge \frac{\ln 10^{-4}}{\ln 0.6} \approx 18.03

Take natural logs; dividing by the negative \ln 0.6 flips the inequality.

x_1 = \frac{0 + 1}{5} = 0.2

First iteration.

x_2 = \frac{0.008 + 1}{5} = 0.2016

Second iteration: 0.2^3 = 0.008.

x_3 = \frac{0.008193540096 + 1}{5} \approx 0.201638708

Third iteration: 0.2016^3 = 0.008193540096.

\frac{0.6}{1 - 0.6}\,|x_3 - x_2| = 1.5(0.000038708) \approx 0.000058

A posteriori bound.

Answer: the a priori bound asks for 19 steps, but three steps already give an error below 0.000058. (The true root is 0.201639675…, so the actual error is about 10^{-6}.) The bound uses the worst slope 0.6, while near the root g'(p) \approx 0.024.

Example 4: How fast does it converge?

Use the iterates from Example 1 and p = 0.567143 to find the errors e_n = x_n - p and the ratios e_{n+1}/e_n.

e_1 = 1 - 0.567143 = 0.432857

Error of x_1.

e_2 = 0.367879 - 0.567143 = -0.199264

Error of x_2.

e_3 = 0.692201 - 0.567143 = 0.125058

Error of x_3.

e_4 = 0.500473 - 0.567143 = -0.066670

Error of x_4.

\frac{e_2}{e_1} \approx -0.460, \quad \frac{e_3}{e_2} \approx -0.628, \quad \frac{e_4}{e_3} \approx -0.533

Divide each error by the one before.

g'(p) = -e^{-p} = -p \approx -0.567

Since e^{-p} = p at the fixed point.

Answer: the ratios approach g'(p) \approx -0.567. The error shrinks by a constant factor each step and flips sign, so the convergence is linear. About \ln 10 / \ln(1/0.567) \approx 4 steps are needed per extra correct decimal digit.

Example 5: Kepler’s equation (word problem)

A planet’s position on its elliptical orbit comes from Kepler’s equation E - e\sin E = M, where e is the eccentricity, M the mean anomaly and E the eccentric anomaly (radians). For e = 0.2 and M = 1, solve E = 1 + 0.2\sin E with E_0 = 1.

E_1 = 1 + 0.2\sin 1 \approx 1 + 0.2(0.841471) = 1.168294

First iteration.

E_2 = 1 + 0.2\sin 1.168294 \approx 1 + 0.2(0.920084) = 1.184017

Second iteration.

E_3 = 1 + 0.2\sin 1.184017 \approx 1 + 0.2(0.926129) = 1.185226

Third iteration.

E_4 = 1 + 0.2\sin 1.185226 \approx 1 + 0.2(0.926584) = 1.185317

Fourth iteration.

g'(E) = 0.2\cos E, \quad |g'(E)| \le 0.2

Differentiate (see derivatives of trig functions): k = 0.2 for every E.

\frac{0.2}{0.8}\,|1.185317 - 1.185226| = 0.25(0.000091) \approx 0.000023

A posteriori bound.

Answer: E \approx 1.18532 radians, within 0.000023. Because k = 0.2 is small, each step gains almost a full decimal digit. Astronomers have solved Kepler’s equation this way for centuries.

Common mistakes

MistakeExample of the errorFix
Using any rearrangement without checking itIterating x = x^2 - 3 and getting 1, −2, 1, −2, …Check |g'(p)| \lt 1 (or the theorem’s conditions) before iterating.
Checking g' at the wrong place|g'(0)| \lt 1, but |g'(p)| \gt 1What matters is the slope near the fixed point, or the bound k on the whole interval.
Forgetting that g must map the interval into itselfUsing [0, 1] when g(1) = 1.4Check that g(x) stays in [a, b]; otherwise the theorem doesn’t apply.
Stopping as soon as two iterates agree to a few digitsStopping when |x_n - x_{n-1}| \lt 10^{-4} with k = 0.99Use \frac{k}{1-k}|x_n - x_{n-1}|; when k is close to 1, the true error can be 100 times larger.
Using degree modeIterating \cos x in degrees and landing at 0.99985Use radians.
Confusing the fixed point with the iterate countWriting “g(p) = 0“A fixed point satisfies g(p) = p; a root satisfies f(p) = 0.

Related methods

The same idea solves linear systems: the Jacobi method and the Gauss-Seidel method rewrite each equation to solve for one unknown, then repeat until the values settle.

Bisection

The bisection method also converges linearly, with factor 1/2 every step. Fixed-point iteration can be faster or slower: faster when |g'(p)| \lt 1/2, slower when it is close to 1, and divergent when it is above 1.

Newton’s method is a fixed-point iteration

Newton’s method is fixed-point iteration with g(x) = x - \frac{f(x)}{f'(x)}. At a simple root, g'(p) = 0, so the error shrinks much faster than linearly. That idea is made precise in Order of Convergence.

Sequences and series

The iterates form a sequence, and convergence means the sequence converges. The a posteriori bound comes from summing a geometric series of step sizes with ratio k.

Practice problems

  1. Is x = 2 a fixed point of g(x) = x^2 - 2?
  2. Find all fixed points of g(x) = x^2 - 2.
  3. Do three iterations of g(x) = \sqrt{2x + 1} from x_0 = 2.
  4. Do three iterations of g(x) = \cos x from x_0 = 1 (radians).
  5. Does g(x) = 3/x work for solving x^2 = 3? Try x_0 = 1.
  6. To solve x^3 + 2x - 5 = 0 (root near 1.3283), which rearrangement converges: g(x) = \frac{5 - x^3}{2} or g(x) = \sqrt[3]{5 - 2x}?
  7. Show that g(x) = \frac{x^2 + 3}{5} meets the fixed-point theorem on [0, 1], and find its fixed point exactly.
  8. For the g in Problem 7 with k = 0.4 and x_0 = 0, how many steps does the a priori bound require for an error of 10^{-5}?
  9. By about what factor does the error shrink each step when iterating g(x) = \sqrt{x + 3} (Example 2)?
  10. A lake holds 100 kg of a pollutant. Each year 20% washes out and 50 kg flows in, so L_{n+1} = 0.8L_n + 50. Do three iterations and find the long-run amount.
Show answers

1.

g(2) = 4 - 2 = 2

Substitute x = 2.

Answer: yes, because g(2) = 2.

2.

x^2 - 2 = x

Set g(x) = x.

x^2 - x - 2 = 0

Subtract x from both sides.

(x - 2)(x + 1) = 0

Factor (see factoring trinomials).

Answer: x = 2 and x = -1.

3.

x_1 = \sqrt{5} \approx 2.236068

Apply g to 2.

x_2 = \sqrt{5.472136} \approx 2.339260

Apply g: 2(2.236068) + 1 = 5.472136.

x_3 = \sqrt{5.678520} \approx 2.382965

Apply g: 2(2.339260) + 1 = 5.678520.

Answer: x_3 \approx 2.382965, approaching 1 + \sqrt{2} \approx 2.414214.

4.

x_1 = \cos 1 \approx 0.540302

First iteration.

x_2 = \cos 0.540302 \approx 0.857553

Second iteration.

x_3 = \cos 0.857553 \approx 0.654290

Third iteration.

Answer: x_3 \approx 0.654290; the iterates bounce around 0.739085….

5.

x_1 = 3/1 = 3, \quad x_2 = 3/3 = 1

Iterate twice.

g'(\sqrt{3}) = -\frac{3}{(\sqrt{3})^2} = -1

Check the slope at the fixed point.

Answer: no. The iterates cycle 1, 3, 1, 3, … because |g'(p)| = 1, so the error never shrinks.

6.

\left|\frac{d}{dx}\frac{5 - x^3}{2}\right| = \frac{3x^2}{2} \approx 2.65

First rearrangement at p \approx 1.3283: above 1.

\left|\frac{d}{dx}\sqrt[3]{5 - 2x}\right| = \frac{2}{3(5 - 2x)^{2/3}} \approx 0.378

Second rearrangement at p: below 1.

Answer: g(x) = \sqrt[3]{5 - 2x} converges; \frac{5 - x^3}{2} diverges.

7.

g(0) = 0.6, \quad g(1) = 0.8

g is increasing on [0, 1], so its values lie in [0.6, 0.8].

|g'(x)| = \frac{2x}{5} \le 0.4

So k = 0.4 \lt 1, and the theorem applies.

x^2 + 3 = 5x

Set g(x) = x and multiply by 5.

x^2 - 5x + 3 = 0

Subtract 5x.

x = \frac{5 - \sqrt{13}}{2} \approx 0.697224

Use the quadratic formula and keep the root in [0, 1].

Answer: the unique fixed point in [0, 1] is \frac{5 - \sqrt{13}}{2} \approx 0.697224.

8.

0.4^n \le 10^{-5}

A priori bound with \max\{0, 1\} = 1.

n \ge \frac{\ln 10^{-5}}{\ln 0.4} \approx 12.56

Take natural logs and divide by the negative \ln 0.4.

Answer: 13 steps.

9.

g'(p) = \frac{1}{2\sqrt{p + 3}} = \frac{1}{2p}

Use \sqrt{p + 3} = p at the fixed point.

\frac{1}{2(2.302776)} \approx 0.217

Substitute p \approx 2.302776.

Answer: by about 0.217 each step, so the error drops by a factor of 10 about every 1.5 steps.

10.

L_1 = 0.8(100) + 50 = 130

First year.

L_2 = 0.8(130) + 50 = 154

Second year.

L_3 = 0.8(154) + 50 = 173.2

Third year.

L = 0.8L + 50

Long run: set L_{n+1} = L_n = L.

0.2L = 50

Subtract 0.8L.

L = 250

Divide by 0.2.

Answer: 130, 154 and 173.2 kg; the amount approaches 250 kg (k = 0.8, so slowly).

Fixed-point iteration FAQ

What is fixed-point iteration?

It is a method for solving x = g(x): start with a guess x_0 and compute x_{n+1} = g(x_n) until the values stop changing. The limit, if it exists, is a fixed point of g.

When does fixed-point iteration converge?

It converges if |g'(x)| \le k \lt 1 on an interval that g maps into itself and that contains x_0. In practice, check that |g'(p)| \lt 1 near the fixed point and start close to it.

How do you choose g(x)?

Rearrange f(x) = 0 into x = g(x) in a way that makes |g'(x)| small near the root. Try a few algebraic forms, or use Newton’s choice g(x) = x - f(x)/f'(x).

What is the rate of convergence of fixed-point iteration?

Usually linear: the error is multiplied by about |g'(p)| each step. If g'(p) = 0, as in Newton’s method, convergence is faster.

Summary

  • A fixed point satisfies g(p) = p; rewrite f(x) = 0 as x = g(x) and iterate x_{n+1} = g(x_n).
  • If g maps [a, b] into itself and |g'(x)| \le k \lt 1, there is one fixed point and the iteration converges to it.
  • Error bounds: |x_n - p| \le k^n \max\{x_0 - a, b - x_0\} and |x_n - p| \le \frac{k}{1 - k}|x_n - x_{n-1}|.
  • The error shrinks by about |g'(p)| per step; if |g'(p)| \gt 1, the iteration fails.
  • Different rearrangements of the same equation can converge, crawl or diverge.

Previous lesson: Bisection Method

Next lesson: Secant Method

Back to the Numerical Methods Index