Calculator · Engineering Mathematics

Bisection Method Calculator

Solve f(x) = 0 by repeatedly halving a bracket [a, b] known to contain a sign change. The method is unconditionally convergent for a continuous f, at the cost of one bit of accuracy per iteration.

Problem definition

Operators + − * / ^, parentheses, pi and e, and sin, cos, tan, asin, acos, atan, exp, sqrt, abs, ln, log, log10. Write 2*x, not 2x.

Results

Endpoint values
a = 0f(a) = -2[negative]
b = 2f(b) = 2[positive]

Opposite endpoint signs: the bracket contains at least one root if f is continuous on [a, b].

Root estimate x*1.414
Residual f(x*)3.154e-11
Iterations30
Function evaluations32
Final step |Δx|1.863e-9
StatusConverged
Final bracket [a, b][1.414, 1.414]
Bracket width3.725e-9
Error bound |x* − root| ≤ width/21.863e-9

Function plot

f(x) = x^2 - 2 over [-0.2, 2.2]

Iteration history

Bisection iterations
nabmidpointf(mid)bracket width
1021-12
2121.50.251
311.51.25-0.43750.5
41.251.51.375-0.10940.25
51.3751.51.4380.066410.125
61.3751.4381.406-0.022460.0625
71.4061.4381.4220.021730.03125
81.4061.4221.414-4.272e-40.01563
91.4141.4221.4180.010640.007813
101.4141.4181.4160.00510.003906
111.4141.4161.4150.0023360.001953
121.4141.4151.4159.539e-49.766e-4
131.4141.4151.4142.633e-44.883e-4
141.4141.4141.414-8.200e-52.441e-4
151.4141.4141.4149.063e-51.221e-4
161.4141.4141.4144.315e-66.104e-5
171.4141.4141.414-3.884e-53.052e-5
181.4141.4141.414-1.726e-51.526e-5
191.4141.4141.414-6.475e-67.629e-6
201.4141.4141.414-1.080e-63.815e-6
211.4141.4141.4141.617e-61.907e-6
221.4141.4141.4142.687e-79.537e-7
231.4141.4141.414-4.056e-74.768e-7
241.4141.4141.414-6.846e-82.384e-7
251.4141.4141.4141.001e-71.192e-7
261.4141.4141.4141.584e-85.960e-8
271.4141.4141.414-2.631e-82.980e-8
281.4141.4141.414-5.237e-91.490e-8
291.4141.4141.4145.300e-97.451e-9
301.4141.4141.4143.154e-113.725e-9

Continue

Open in Root Finding Lab

f(x), the bracket [a, b], the tolerance and the iteration limit continue into the Lab, with bisection enabled and a plot window that contains the whole bracket.

Assumptions & validity

  • · f is continuous on [a, b].
  • · a < b.
  • · f(a) and f(b) have genuinely opposite signs — a real sign change, not a discontinuity or pole.
  • · Continuity plus opposite endpoint signs guarantee AT LEAST one root in (a, b); they do not establish that there is exactly one.
  • · Uniqueness needs extra knowledge of f — strict monotonicity on [a, b], for example — which this tool does not assume or check.
  • · Same-sign endpoints do not prove the absence of roots: an even number of roots inside the interval leaves the endpoint signs unchanged.
  • · The reported error bound applies to the bracket, not to the residual f(x*).

Technical reference

Bracket requirement: sign(f(a)) ≠ sign(f(b))

Midpoint: m = a + (b − a)/2

Update: if sign(f(m)) = sign(f(a)) then a ← m, else b ← m

Error bound at midpoint n (n = 1 is the first midpoint, as numbered in the table): |x* − mₙ| ≤ (b₀ − a₀) / 2ⁿ

a
lower bracket endpoint
b
upper bracket endpoint
m
current midpoint of [a, b]
f(x)
the function whose root is sought
x*
the reported root estimate
atol, rtol
absolute and relative tolerance[–]

By the intermediate value theorem, a continuous f with f(a) and f(b) of opposite sign has AT LEAST one root in (a, b); bisection exploits exactly this guarantee and nothing stronger. A single sign change does not prove the root is unique — uniqueness requires further conditions on f, such as strict monotonicity on the interval.

Convergence is linear and unconditional: the bracket width halves every iteration regardless of f, gaining roughly one bit of accuracy per step — slower than Newton or secant near a simple root, but never divergent.

Same-sign endpoints do NOT prove there is no root: a bracket containing an even number of roots has f(a) and f(b) of the same sign and is rejected before iterating, because the sign test alone cannot see roots that cancel in pairs.

A sign change can also occur across a pole rather than a root — for example 1/(x − 1) changes sign at x = 1 without being zero there — so the residual f(x*) should always be checked alongside the bracket.

Each iteration stops on whichever of three conditions is met first: f(m) is exactly zero, the normalised residual test |f(m)|/fScale ≤ atol + rtol, or the bracket-width test in x.

The residual is normalised by the characteristic magnitude of f on the initial bracket, so multiplying the equation by a non-zero constant — which does not change the root problem — does not change the verdict, the iteration count or the error bound.

An endpoint is reported as an exact starting root only when f(a) or f(b) evaluates to exactly zero; an endpoint that merely satisfies the residual test is not treated as one, and the ordinary bracket iteration runs instead.

When the run stops at the iteration or evaluation limit, the estimate is the last midpoint, which is an endpoint of the updated final bracket. The valid bound is then the full bracket width, not half of it — the page reports the engine's bound rather than assuming the converged case.

Related tools