The bisection method is used to find the roots of a polynomial equation. It separates the interval and subdivides the interval in which the root of the equation lies. The principle behind this method is the intermediate theorem for continuous functions.
Let's consider the continous function \(f\) in closed interval \([a,b]\) is given with
and of different signs. Then by intermediate theorem, there exists a point \(c\) belong to for which \(f(c)=0\).
Steps to find the root:
- Find two points \(a\) and \(b\) such that \(f(a) \times f(b) < 0 \)
- Find midpoint of \(a\) and \(b\), say \(c\)
- If \(f(c) \times f(a) < 0 \), there exist a root between \(c\) and \(a\). else if \(f(c) \times f(b) < 0 \) there exist a root between \(c\) and \(b\).
- Repeat above three steps until \(f(c)=0\)
Example: Consider a function \(f(x)=0.5x^3+0.1x^2-2\)
Assume, \(a=-2, b=3\)
We have \(f(a)=-14.6,f(b)=12.4\)
\(1^{st}\) Iteration:
\(c=\frac{a+b}{2}=\frac{-2+3}{2}=0.5\)
\(f(c)=-1.9125\)
Now, replace \(a=c\)
\(2^{nd}\) Iteration:
\(c=\frac{a+b}{2}=\frac{0.5+3}{2}=1.75\)
\(f(c)=0.9859\)
Now, replace \(b=c\)
\(3^{rd}\) Iteration:
\(c=\frac{a+b}{2}=\frac{0.5+1.75}{2}=1.125\)
\(f(c)=-1.1615\)
Now, replace \(a=c\)
\(4^{th}\) Iteration:
\(c=\frac{a+b}{2}=\frac{1.125+1.75}{2}=1.4375\)
\(f(c)=-0.3081\)
Now, replace \(a=c\)
\(5^{th}\) Iteration:
\(c=\frac{a+b}{2}=\frac{1.4375+1.75}{2}=1.5938\)
\(f(c)=0.2781\)
Now, replace \(b=c\)
\(6^{th}\) Iteration:
\(c=\frac{a+b}{2}=\frac{1.4375+1.5938}{2}=1.5156\)
\(f(c)=-0.0294\)
Now, replace \(a=c\)
\(7^{th}\) Iteration:
\(c=\frac{a+b}{2}=\frac{1.5156+1.5938}{2}=1.5547\)
\(f(c)=0.1206\)
Now, replace \(b=c\)
\(8^{th}\) Iteration:
\(c=\frac{a+b}{2}=\frac{1.5156+1.5547}{2}=1.5352\)
\(f(c)=0.0446\)
Now, replace \(b=c\)
\(9^{th}\) Iteration:
\(c=\frac{a+b}{2}=\frac{1.5156+1.5352}{2}=1.5254\)
\(f(c)=0.0074\)
We can stop the iteration here as the \(f(c)\) is closed to zero, so the root of the equation is \(c=1.5254\).
Assume, \(a=-2, b=3\)
We have \(f(a)=-14.6,f(b)=12.4\)
\(1^{st}\) Iteration:
\(c=\frac{a+b}{2}=\frac{-2+3}{2}=0.5\)
\(f(c)=-1.9125\)
Now, replace \(a=c\)
\(2^{nd}\) Iteration:
\(c=\frac{a+b}{2}=\frac{0.5+3}{2}=1.75\)
\(f(c)=0.9859\)
Now, replace \(b=c\)
\(3^{rd}\) Iteration:
\(c=\frac{a+b}{2}=\frac{0.5+1.75}{2}=1.125\)
\(f(c)=-1.1615\)
Now, replace \(a=c\)
\(4^{th}\) Iteration:
\(c=\frac{a+b}{2}=\frac{1.125+1.75}{2}=1.4375\)
\(f(c)=-0.3081\)
Now, replace \(a=c\)
\(5^{th}\) Iteration:
\(c=\frac{a+b}{2}=\frac{1.4375+1.75}{2}=1.5938\)
\(f(c)=0.2781\)
Now, replace \(b=c\)
\(6^{th}\) Iteration:
\(c=\frac{a+b}{2}=\frac{1.4375+1.5938}{2}=1.5156\)
\(f(c)=-0.0294\)
Now, replace \(a=c\)
\(7^{th}\) Iteration:
\(c=\frac{a+b}{2}=\frac{1.5156+1.5938}{2}=1.5547\)
\(f(c)=0.1206\)
Now, replace \(b=c\)
\(8^{th}\) Iteration:
\(c=\frac{a+b}{2}=\frac{1.5156+1.5547}{2}=1.5352\)
\(f(c)=0.0446\)
Now, replace \(b=c\)
\(9^{th}\) Iteration:
\(c=\frac{a+b}{2}=\frac{1.5156+1.5352}{2}=1.5254\)
\(f(c)=0.0074\)
We can stop the iteration here as the \(f(c)\) is closed to zero, so the root of the equation is \(c=1.5254\).