Root-Finding & Nonlinear Equations

a cobweb diagram

A cobweb diagram is a simple picture that lets you SEE whether a fixed-point iteration will converge, just by tracing a path with your finger. It turns the abstract rule x_{n+1} = g(x_n) into a visible staircase or spiral on a graph, so you can watch the iterates march toward — or flee from — a fixed point.

Here is how to draw it. Plot two curves on the same axes: the graph y = g(x), and the diagonal line y = x. Their crossing point is the fixed point x*, where g(x) = x. Now start at your guess x_0 on the horizontal axis and trace: go vertically to the curve (this height is g(x_0) = x_1), then go horizontally to the diagonal (this moves x_1 onto the x-axis as the new input), then vertically to the curve again, and so on. The path of vertical-then-horizontal moves weaves a web. If g rises gently across the diagonal (slope between -1 and 1), the web spirals or steps INWARD to x* — convergence. If g is steep there (slope above 1 or below -1), the web flings OUTWARD — divergence. A positive slope gives a staircase; a negative slope gives a spiral that alternates sides.

The cobweb is the geometric face of the contraction condition |g'(x*)| < 1: a shallow crossing slope means contraction and an inward web, a steep crossing means expansion and an outward web. It is a wonderful teaching tool because the same picture also explains period-2 cycles (a square that never shrinks) and the route to chaos in maps like the logistic equation. For root-finding it gives instant intuition for why one rearrangement x = g(x) works and another fails.

For x = cos(x) the curve y = cos(x) crosses y = x gently at x* = 0.739 with slope -0.674; the cobweb spirals inward, alternating left and right of the fixed point, and tightens onto it — a textbook convergent spiral. For x = x^2 - 1 the parabola crosses steeply (slope 3.24), and the cobweb spirals outward and escapes.

Web spirals inward when the crossing slope is shallow (|g'| < 1), outward when steep.

The cobweb shows local behaviour near where you start; a globally complicated g can converge from one side of a fixed point and diverge from another. It is a diagnostic and teaching picture, not a numerical method.

Also called
cobweb plotstaircase diagram蛛網圖階梯圖