Root Finding — Bracketing
Bisection Method
The bisection method finds a root of f(x) by halving an interval [a,b] where f(a) and f(b) have opposite signs. Apply to f(x)=x²-2 on [1,2]: after 3 steps the root lies in [1.375,1.5], interval width 0.1250.
bisection-method
If f(a)<0 and f(b)>0, a root exists in [a,b]. Compute midpoint m=(a+b)/2. If f(m) has the same sign as f(a), replace a with m; otherwise replace b with m. Repeat.