Hi there. This page is about the bisection method for finding approximate roots or x-intercepts to polynomial equations.
What Is The Bisection Method?
The Bisection method aims to find approximate solutions to polynomial equations with the use of midpoints. It also belongs to a class of numerical methods. Numerical methods provide approaches to certain mathematical problems when finding the exact numeric answers is not possible. Instead of finding exact answers, we find approximate solutions with a certain loss of precision. Some approximate answers are close to the real answer by 0.01 and some are as close as .
The Intermediate Value Theorem
To help us understand the bisection method, I think it is important to go over the Intermediate Value Theorem (IVT) from calculus.
Suppose there is a continuous function in a closed interval with and . Then there is some number such that we have and . This would be a horizontal line or even 0.
Note that I have put in the min and max parts above to deal with both increasing and decreasing functions. If is an increasing function in the interval then I have . With the other case I would have if is an decreasing function in the interval .
In the bisection method, we try to look for the number such that .
Here is a rough idea of what the bisection method function would look like in a programming language such as R, Python, etc. At each interation, we want to shrink the interval [a, b].
# Pseudocode For Bisection Method
if f(a)*f(b) > 0
print("No root found") # Both f(a) and f(b) are the same sign
while (b - a) / 2 > tolerance
c = (b + a) /2 # c is like a midpoint
if f(c) == 0
return(midpt) # The midpt is the root such that f(midpt) = 0
else if f(a)*f(c) < 0
b = c # Shrink interval from right.
a = c
In , either is is negative or is negative. If is positive then the line has to cross the x-axis to get to which is megative. In this case, the new would be . In the increasing case, would be negative and would be positive. The choice here would be having the new as .
With the case, you would choose the new as .
This process is repeated until (b – a)/2 is small enough (or the interval is very small).
Some Picture Examples
Suppose and the function is increasing.In this case, f(c) is negative, f(a) is negative and f(b) is positive. You would not choose c as the new b since both f(c) and f(a) are negative and there would be no root in the interval [a, c]. Instead, you choose as the new to obtain the new subinterval as [c, b].
The picture has as the midpoint in the interval [a, b]. The point would be the new b giving the interval because is positive and is negative.