Back

The IVT and Bisection

The intermediate value theorem says something almost obvious and proves it rigorously: a continuous function that is negative at one end of an interval and positive at the other has to cross zero somewhere in between, because it cannot jump the gap. The theorem only promises that a root exists, not where, but its proof is constructive and hands you an algorithm for free. Test the midpoint of the bracket: whichever half still shows the sign change, negative at one end and positive at the other, must by the same theorem contain a root, so throw the other half away and repeat. That is bisection. Each step halves the bracket, so after $k$ steps the root is pinned to within $(b_0 - a_0)/2^k$, and the uncertainty falls off a cliff, ten more correct binary digits every thirty-odd steps. The top panel runs it: the shaded bracket shrinks onto the crossing while the midpoint, in purple, is tested and discarded. The bottom panel plots the bracket width and the size of $f$ at the midpoint against the step count on a log scale, where geometric halving is a straight line marching downward. Drag the endpoints $a$ and $b$ to bracket the root yourself; just keep the signs opposite, or the theorem has nothing to promise.

Figure 1. The IVT and bisection. Top: f (gold) with the bracket (blue band) that holds the sign change, the endpoints coloured by the sign of f, and the tested midpoint (purple); the bracket halves onto the root. Bottom: the bracket width and |f(midpoint)| against step on a log axis, a straight downhill line (geometric halving). Method: bisection, keeping the half that retains the sign change. Source: Burden and Faires, Numerical Analysis, 9th ed., Sec. 2.1.

WHAT TO TRY

  • Press Step to advance one bisection at a time (or Play to run it): the purple midpoint is tested and one half is discarded, and the white bar on the left shows f(a) and f(b) straddling the green zero, the intermediate value the root sits at.
  • Read the log plot: the width falls along a straight line, one bit of accuracy gained per step (geometric convergence).
  • Drag the endpoints $a$ and $b$ to bracket the root yourself, keeping $f(a)$ and $f(b)$ opposite in sign.
  • Drag both endpoints to the same side of the root: the sign change is gone and the theorem promises nothing.