The zero theorem does not say where the zero is, only that it exists. The bisection algorithm finds it by successive approximations, halving the interval at each step.

In brief — Procedure

  1. Start from [a,b][a,b] with f(a)f(b)<0f(a)\cdot f(b)<0.
  2. Compute the midpoint m=a+b2m = \dfrac{a+b}{2} and the sign of f(m)f(m).
  3. If f(a)f(m)<0f(a)\cdot f(m) < 0: the zero is in [a,m][a,m], set b=mb=m. Otherwise it is in [m,b][m,b], set a=ma=m.
  4. Repeat from step 2 until ba<ε|b-a|<\varepsilon (the desired precision).

At each step the interval halves: after nn steps the error is ba2n\le\dfrac{b-a}{2^n}.

Example — Bisection applied to ln(x+3)3x+0,1=0\ln(x+3)-3x+0{,}1=0

Let f(x)=ln(x+3)3x+0,1f(x) = \ln(x+3)-3x+0{,}1. Let us look for a zero.

f(0)=ln3+0,11,2>0f(0) = \ln 3 + 0{,}1 \approx 1{,}2 > 0; f(1)=ln43+0,11,5<0\quad f(1) = \ln 4 - 3 + 0{,}1 \approx -1{,}5 < 0. Opposite signs: there is a zero in [0,1][0,1].

Stepaabbmmf(m)f(m)
100110,50{,}5f(0,5)0,15<0f(0{,}5)\approx -0{,}15 < 0
2000,50{,}50,250{,}25f(0,25)0,43>0f(0{,}25)\approx 0{,}43 > 0
30,250{,}250,50{,}50,3750{,}375f(0,375)0,12>0f(0{,}375)\approx 0{,}12 > 0
40,3750{,}3750,50{,}50,43750{,}4375f(0,4375)0,02<0f(0{,}4375)\approx -0{,}02 < 0
50,3750{,}3750,43750{,}43750,4060{,}406f(0,406)0,05>0f(0{,}406)\approx 0{,}05 > 0

After 5 steps the zero is in [0,406; 0,4375][0{,}406;\ 0{,}4375], with error <0,032<0{,}032. Approximate value: x0,42x\approx 0{,}42.

The strength of bisection is its robustness: it requires only being able to evaluate ff and recognise its sign, and it always converges (provided one starts from a change of sign). The price is its slowness: it gains about one decimal digit every 3,33{,}3 iterations.

Topics: Continuita
Concepts: Algoritmo di bisezione · Teorema degli zeri
Skills: Stimare · Usare formule