Bisection Method
Bracket roots of continuous polynomials, follow interval halving, and distinguish each tested midpoint from the current midpoint and its guaranteed error bound.
By Riano · Published · Report a correction
Bisection: keep the root, halve the uncertainty
A promising guess and a guaranteed enclosure answer different questions. Bisection starts with an interval known to contain a root, tests its midpoint, and keeps a half that still contains one. The interval supplies an error bound even when the exact root is unknown. No derivative or tangent is needed.
The permission to discard a half
Let f be continuous on a closed interval [a, b], with a < b. If the nonzero endpoint values have opposite signs, the intermediate value theorem puts at least one zero inside. At c = (a + b)/2, either f(c) = 0 or its sign agrees with one endpoint. Replace that endpoint by c, leaving a sign change across the retained half.
Check initial endpoint zeros before requiring a strict sign change. In this explorer an endpoint root ends the run immediately; the left endpoint is chosen when both are roots. An exactly zero midpoint ends the run when a bisection step tests it. A displayed midpoint at budget zero is a preview, not a completed step.
Wk = bk − ak = W0 / 2k
|ck − r| ≤ Wk / 2
Here k counts completed halvings and ck is the midpoint of the current retained interval. The root r is one enclosed zero, not necessarily the only one. Before an exact-root stop, the guaranteed error bound halves at every step. The actual error and residual need not decrease monotonically. Nested intervals with shrinking widths converge to a common point; continuity makes that limit a zero.
Worked example: three tests around √2
Take the original example f(x) = x2 − 2 on [0, 2]. The endpoint values are −2 and 2, so a root is enclosed. First test 1: f(1) = −1, so keep [1, 2]. Next test 3/2: f(3/2) = 1/4, so keep [1, 3/2]. Third test 5/4: f(5/4) = −7/16, so keep [5/4, 3/2].
| k | Last tested | Retained interval | Current midpoint | Width | Current bound |
|---|---|---|---|---|---|
| 0 | None | [0, 2] | 1 | 2 | 1 |
| 1 | 1 | [1, 2] | 1.5 | 1 | 0.5 |
| 2 | 1.5 | [1, 1.5] | 1.25 | 0.5 | 0.25 |
| 3 | 1.25 | [1.25, 1.5] | 1.375 | 0.25 | 0.125 |
| 4 | 1.375 | [1.375, 1.5] | 1.4375 | 0.125 | 0.0625 |
After three tests, the new current midpoint is 11/8 = 1.375. Its residual is |121/64 − 2| = 7/64 = 0.109375, while its distance to √2 is at most 1/8 = 0.125. These are different quantities. The last tested point is 5/4, whose actual error is about 0.1642, larger than 0.125. That point belonged to the previous bracket and had its own pre-test bound 0.25. Assigning it the new midpoint's smaller bound would be wrong.
The bound shrinks regularly; the actual error does not. From k = 1 to k = 2, the current estimate moves from 1.5 to 1.25, farther from √2, even though its guaranteed bound improves from 0.5 to 0.25. After sixteen tests the retained endpoints are 1.4141845703125 and 1.414215087890625. Their midpoint is 1.4141998291015625 with bound 1/65536 = 0.0000152587890625. Reaching the display limit does not make it an exact root.
Run and challenge the bracket
Open the Bisection Method explorer. Its four polynomial presets accept custom decimal endpoints; the following values are actual supported inputs.
- Click Reset all. Function is x^2 − 2, endpoints are 0 and 2, and Bisection budget is 0. Predict current midpoint 1, error bound 1, and no last tested point.
- Click Next bisection three times, or set Bisection budget to 3. Verify [1.25, 1.5], current midpoint 1.375, bound 0.125, and last tested point 1.25. Read its separate pre-test bound 0.25 in the results.
- Set Plot window to Current bracket. The curve and axes zoom around the retained interval; the mathematical numbers stay the same. Drag the graph to pan, use arrow keys, and press Home or Reset view to restore navigation. These actions do not restart the calculation.
- Click Previous bisection: the retained interval becomes [1, 1.5], with current midpoint 1.25 and bound 0.25. Restart bisections returns to budget zero while preserving endpoints, function and plot-window choice.
- Choose Function x^3 − x, which supplies [−2, 2]. Finish bisections requests sixteen steps, but the first tested midpoint is exactly 0, so only one step completes. The initial interval also contains roots −1 and 1. Previous bisection returns to the zero-step preview, even though the requested budget was sixteen.
- Choose Function (x − 1)^2. On its default [0, 2], both endpoint values are 1 and the run has no sign-changing bracket, despite a root at 1. Change Left endpoint to 1: an endpoint root is now recognized immediately. Equal endpoints remain invalid, even at a root.
- For a narrow case, choose x^3 − x − 2, fill Left endpoint 1.521 and Right endpoint 1.522, and click Finish bisections. The current midpoint is approximately 1.521379707336, with positive bound 7.62939453125e-9. Switch to Current bracket to see the tiny retained interval at a useful scale. Clear an endpoint to hide invalid results, then Reset all to recover the default.
The solid indigo curve is the function; emerald marks a valid retained interval and endpoints, while rose marks an unverified input interval. White marks the current midpoint when a bracket is available, while amber marks the last completed test. A collapsed root can put several marks at the same coordinate. The ledger records the tested values before each interval update.
Existence, uniqueness and finite displays
The guarantee depends on continuity and a valid enclosure. The presets are continuous polynomials; a user-supplied discontinuous function is outside this module. For example, opposite signs of 1/x on [−1, 1] do not enclose a zero because the function is undefined at 0. The curve is sampled for drawing, so pixels alone are not the proof of enclosure.
- Same signs are inconclusive. They can hide an even-multiplicity root, as with (x − 1)^2 on [0, 2], or two crossings, as with x^2 − 2 on [−2, 2]. A blocked run says no guarantee, not no root.
- A sign-changing bracket need not have a unique root. x^3 − x has three roots in [−2, 2]. Bisection selects one by its midpoint decisions and does not enumerate every root.
- A bound is not a residual. The interval controls a distance in x. A residual |f(c)| measures an equation mismatch and depends on the function's scale. A small residual alone does not supply the interval's distance guarantee.
- The budget is finite. At most sixteen bisection steps are displayed. The width formula W0/2k applies before an exact-root stop; when a root is found, the retained interval collapses and its bound is zero instead.
Endpoints are restricted to −6 through 6, with at most three fractional decimal digits. The module keeps those decimal rationals and all supported midpoint tests exact using integer arithmetic, including polynomial signs and zero detection. Displayed decimal text, axis labels and sampled curve coordinates are rounded. Tiny positive bounds use scientific notation; they are not rounded into an exact zero. The input restriction excludes exponents and whitespace, rather than silently changing them.
Each mathematical bisection adds one new midpoint evaluation after the initial endpoint evaluations; the displayed preview is also evaluated for explanation. A full teaching replay reconstructs its short trace when the budget changes and samples a curve, so rendering cost is more than one polynomial evaluation. For a nonzero initial width W and a positive desired current-midpoint bound ε, a sufficient halving count is max(0, ceil(log2(W/(2ε)))); an exact root can stop earlier. Bisection improves its worst-case bound predictably, while Newton's method can converge faster locally and also fail from some starts.
Primary explanations to compare
These sources support the method and its assumptions. The polynomial traces, decimal values and control experiment above are independently derived for this module.
- NIST Digital Library of Mathematical Functions, §3.8(iii), Bisection Method describes locating zeros using an opposite-sign interval. Our single run encloses one root and does not claim to compute all roots.
- University of Maryland, Nonlinear Equations notes, §2.1, pages 2–3 states the continuity assumption, midpoint sign decision, nested-interval convergence and current-midpoint half-width bound. Its example polynomial differs from this article's square-root calculation.
Experience it interactively
Adjust parameters, observe in real time, and build deep intuition with Riano’s interactive Bisection Method module.
Try Bisection Method on Riano →