calculator.onl
Categories50

Numerical function root on an interval

Find one numerical zero by bisection and inspect its residual, final interval and iteration history.

A worked example

Switch from x² − 4 to x² − 9 on the interval [0, 4]. The zero crossing moves from x = 2 to x = 3; try x² − 1 as well.

Root approximation0.7391Residual f(x)4.722E-9Final interval left0.7391Final interval right0.7391Iterations27
Examples: cos(x)-x; x^3-2*x-5; log(x)-1. No implicit multiplication or executable code.

Left endpoint a

Right endpoint b

Absolute x tolerance, 1e−12 to 0.01; a small machine-precision term is also included.

Residual tolerance relative to the larger absolute endpoint value. Convergence requires the x test and this residual test, unless a numerical zero is reached.

Maximum 200 bisection iterations. Reaching this limit is shown explicitly.

Updates as you type

Use a dot or comma for decimals. No thousands separators.

YOUR RESULT

Root approximation

0.7391

Calculated from your inputs

Residual f(x)0
Final interval left0.7391
Final interval right0.7391
Iterations27
Final interval width0
The numbers, at a glance

Calculations run in your browser.
UNDERSTAND THE RESULT

A little context. A clearer answer.

↑ Back to calculator

When this calculator is useful

Enter a function and a bracket to see how bisection narrows a sign change. The parser accepts a limited mathematical grammar and checks expression-domain bounds across the full interval before iteration. For a related calculation, try Quadratic equation calculator.

What to enter

InputWhat it meansExample value
Function f(x)Examples: cos(x)-x; x^3-2*x-5; log(x)-1. No implicit multiplication or executable code.cos(x)-x
Left endpoint aLeft endpoint a0
Right endpoint bRight endpoint b1
Absolute x toleranceAbsolute x tolerance, 1e−12 to 0.01; a small machine-precision term is also included.0.00000001
Relative residual toleranceResidual tolerance relative to the larger absolute endpoint value. Convergence requires the x test and this residual test, unless a numerical zero is reached.0.00000001
Iteration limitMaximum 200 bisection iterations. Reaching this limit is shown explicitly.100

How the calculation works

  1. Write f(x) with explicit multiplication, supported functions and integer literal powers.
  2. Choose a < b within the function’s domain and set x tolerance, relative residual tolerance and iteration limit.
  3. Read the stopping status and residual; expand the history to inspect the brackets. A failed bracket is not proof that no root exists.
The formulam = a + (b−a)/2; keep the half whose endpoints have opposite signs

A worked example

cos(x) − x on [0,1] converges to approximately 0.7390851332. For x² − 1 on [−2,0], bisection finds −1.

Example you can load

What to enter
Result for this example · Root approximation0.7391

This is a fixed example; changing the form above does not change these numbers.

Assumptions & limits

No guarantee of all roots. Even-multiplicity roots may lack a sign change. Conservative domain checks can reject valid expressions with dependent subexpressions; narrow the interval. Calculations use floating-point arithmetic, not a symbolic proof. For numerical precision, trigonometric arguments are limited to an absolute value of 1,000,000 radians.

Frequently asked questions

Which syntax is accepted?

Use x, pi, e, decimal numbers, + − * /, parentheses, sin, cos, tan, exp, log, sqrt and abs. Powers must be integer literals from −20 to 20. Trigonometric arguments are radians; log is natural logarithm.

Why is 1/x on [−1,1] rejected?

Its denominator crosses zero, so the sign change does not bracket a continuous zero. Tangent poles and invalid logarithm or square-root domains are also rejected.

What if both endpoint signs are the same?

The method reports no sign-changing bracket. An even-multiplicity root, several roots or closely spaced roots can still lie inside. Choose a smaller suitable interval.