Bisection Method Calculator

Stephanie Ben-Joseph headshot Stephanie Ben-Joseph

Overview

The bisection method is a reliable numerical algorithm for finding a real root of a function by repeatedly halving an interval that brackets a sign change. It is based on the Intermediate Value Theorem: if a function is continuous on an interval and takes opposite signs at the endpoints, then it must cross zero somewhere between them.

Requirements (Assumptions)

Core idea and formulas

Start with an interval [a,b] where the root is bracketed. At each iteration, compute the midpoint:

m=a+b2

Evaluate f(m). If f(a)·f(m) < 0, the root remains in [a,m] so set b = m. Otherwise (if f(m)·f(b) < 0), set a = m. Repeat.

Stopping criteria and error bound

After n iterations, the interval width is:

(b-a)/2^n

A common absolute error bound for the midpoint estimate is:

|x* - m_n| ≤ (b-a)/2^(n+1), where x* is the true root.

Your tolerance can be interpreted as an interval-width target (e.g., stop when |b-a| ≤ tol) or a function-residual target (e.g., stop when |f(m)| ≤ tol). If your calculator uses one specific rule, interpret the output accordingly.

How to interpret results

Worked example

Find a root of f(x)=x^3-2x-5 on [2,3].

Because the signs differ, a root is bracketed. Midpoint m=2.5, and f(2.5)=15.625-5-5=5.625 (positive), so the root lies in [2,2.5]. Repeating this halving process quickly narrows the interval until the requested tolerance or maximum iterations is reached. The true root is approximately 2.09455…, so you should see an answer near that value with a small final bracket.

Method comparison

Method Needs derivative? Convergence Pros Cons
Bisection No Linear (guaranteed if bracketed) Robust, simple, predictable error bound Slower than Newton/secant
Newton–Raphson Yes Quadratic (near root) Very fast when it works Can diverge; sensitive to initial guess
Secant No Superlinear (often) Fast without derivatives No guaranteed bracket; can fail on some functions

Limitations and common pitfalls

FAQ

What if f(a) and f(b) have the same sign?

Then the interval does not bracket a sign change, so bisection cannot guarantee a root. Try expanding the interval or plotting/inspecting values to find endpoints with opposite signs.

How many iterations do I need for a given tolerance?

To make the interval width ≤ tol, you can use: n ≥ log2((b-a)/tol). Some implementations use the midpoint error bound, which differs by a factor of 2.

Which tolerance is better: interval width or |f(m)|?

Interval width gives a direct worst-case bound on the root location (under continuity + bracketing). |f(m)| can be useful, but may be misleading if the function is very flat or steep.

Does bisection always converge?

It converges to a root as long as f is continuous on [a,b] and f(a)·f(b) < 0.

Reference

Burden, R. L., & Faires, J. D. Numerical Analysis. (Bisection method and bracketing root-finding.)

Enter function and interval to compute.

Embed this calculator

Copy and paste the HTML below to add the Bisection Method Calculator - Find Roots of Continuous Functions to your website.