Find roots by bisection

The bisection method repeatedly halves an interval. If f(x) is continuous and changes sign at the endpoints, each iteration keeps a subinterval containing at least one root.

For example x^3-x-2 or cos(x)-x. Supported: +, −, *, /, ^, parentheses, sin, cos, tan, sqrt, ln, log, exp and abs. Use explicit multiplication: 2*x. Angles in radians.

Requirement: verify that your function is continuous on [a,b] and has opposite signs at a and b, unless one endpoint is already a root. The output does not certify continuity or uniqueness.

How to solve equations with the bisection method

Enter a one-variable function, an initial interval [a,b], a tolerance in x and a maximum number of iterations. This bisection calculator checks endpoint signs, displays a complete iteration table and reports the error bound of the final interval, along with a function graph and worked explanation. The method requires continuity on the interval and a sign change; you must verify continuity because individual numerical evaluations cannot prove it.

Example: f(x)=x³−x−2 on [1,2] with tolerance 0.000001. The approximate root is 1.52138; each iteration shrinks the sign-changing interval.

Results are estimates and depend on the supplied values.

Bisection method explained from scratch

1. Check the assumptions

Choose an interval [a,b] where the function is continuous and f(a) and f(b) have opposite signs. The intermediate value theorem guarantees at least one root in the interval. A sign change does not guarantee a unique root.

f(a) × f(b) < 0, for a continuous function on [a,b]

2. Halve the interval

Find the midpoint m=(a+b)/2 and calculate f(m). If f(m) is zero, the numerical procedure has found a root. Otherwise keep the half where the function still changes sign.

m = (a+b)/2

3. Repeat to the chosen precision

Each halving reduces the sign-changing bracket. The root remains inside and the distance from its midpoint to any enclosed root is bounded by half the bracket width.

Error in x ≤ (b_final − a_final)/2

4. Understand the table

Every iteration shows a, b, their midpoint, f(m) and the bracket half-width BEFORE reduction. If the iteration limit is reached, the result is marked as an approximation without claiming the tolerance was met.

The tolerance measures error in X, not |f(x)|
Assumptions and limitations

Continuity on the interval is a mathematical requirement that cannot be proven by sampling. Discontinuous functions such as 1/x on [−1,1] can produce misleading sign changes. This tool does not guarantee root uniqueness, cannot detect tangent roots without a sign change and does not replace domain analysis. It can stop due to iteration limits or floating-point precision.

Frequently asked questions

What is the bisection method?

It repeatedly reduces a sign-changing interval to approximate a root of a continuous function.

Why do I need an initial bracket?

Because the algorithm needs a bracket guaranteed to contain a root when continuity and sign-change conditions hold.

What does a tolerance of 0.000001 mean?

You want the geometric bound on the error in X to be no more than 0.000001 units.

Why does it report same-sign endpoints?

The selected endpoints do not satisfy the sign-change condition. Try another interval; roots may still exist without a sign change.

Does it work with sine and cosine?

Yes. It supports sin and cos and other common functions, with angles in radians.

Can it return a misleading solution?

Yes, for a discontinuous function inside the bracket. Opposite endpoint signs alone do not prove continuity.

Why is f(x) not exactly zero?

The approximate root is chosen through the interval-width criterion, not necessarily because its function residual is exactly zero.

Is this better than Newton–Raphson?

They have different trade-offs. Bisection requires no derivative but usually converges more slowly. Newton may be faster when its assumptions hold.