The Intermediate Value Theorem
The Intermediate Value Theorem states that if \( f(x) \) is continuous on the interval \( [a,b] \) and \( f(a) \cdot f(b) < 0 \) (i.e., the function changes sign between \( a \) and \( b \)), then there exists at least one \( c \in (a,b) \) such that:
\[
f(c) = 0
\]
This means that there is a root of the function in the interval \( [a,b] \).
The Bisection Method
a. Initial Interval \( [a_0, b_0] \):
Start with an interval \( [a_0, b_0] \) such that:
\[
f(a_0) \cdot f(b_0) < 0
\]
This condition guarantees that there is at least one root in this interval.
b. Midpoint Calculation:
The next step is to narrow down the interval by calculating the midpoint of the current interval \( [a_n, b_n] \). The midpoint \( c_n \) of the interval is given by:
\[
c_n = \frac{a_n + b_n}{2}
\]
This midpoint divides the interval into two sub-intervals: \( [a_n, c_n] \) and \( [c_n, b_n] \).
c. Check the Sign of \( f(c_n) \):
Now, evaluate the function at the midpoint \( c_n \):
- If \( f(c_n) = 0 \), then \( c_n \) is the root, and we are done.
- If \( f(a_n) \cdot f(c_n) < 0 \), then the root lies in the interval \( [a_n, c_n] \), and we set \( b_{n+1} = c_n \) (i.e., discard the right half of the interval).
- If \( f(c_n) \cdot f(b_n) < 0 \), then the root lies in the interval \( [c_n, b_n] \), and we set \( a_{n+1} = c_n \) (i.e., discard the left half of the interval).
d. Repeat the Process:
This process is repeated iteratively, reducing the size of the interval with each step. After \( n \) iterations, the interval containing the root will be \( [a_n, b_n] \), and the root will be approximated as the midpoint \( c_n \).
e. Stopping Criterion:
The process is stopped when the interval \( [a_n, b_n] \) becomes sufficiently small, that is, when the length of the interval \( |b_n - a_n| \) is smaller than a predefined tolerance \( \epsilon \):
\[
|b_n - a_n| < \epsilon
\]
At this point, the root can be approximated by the midpoint:
\[
\text{Root} \approx c_n = \frac{a_n + b_n}{2}
\]
Algorithm
- Choose an initial interval \( [a_0, b_0] \) such that \( f(a_0) \cdot f(b_0) < 0 \).
- Compute the midpoint \( c_n = \frac{a_n + b_n}{2} \).
- If \( f(c_n) = 0 \), then \( c_n \) is the root.
- Otherwise:
- If \( f(a_n) \cdot f(c_n) < 0 \), set \( b_{n+1} = c_n \) (root is in \( [a_n, c_n] \)).
- If \( f(c_n) \cdot f(b_n) < 0 \), set \( a_{n+1} = c_n \) (root is in \( [c_n, b_n] \)).
- Repeat until the interval \( [a_n, b_n] \) is smaller than the tolerance \( \epsilon \).
- Approximate the root as \( \frac{a_n + b_n}{2} \).
Mathematical Formulation
At the \( n \)-th iteration, the midpoint \( c_n \) is given by:
\[
c_n = \frac{a_n + b_n}{2}
\]
The next interval is determined by:
- If \( f(a_n) \cdot f(c_n) < 0 \), set \( b_{n+1} = c_n \) (root is in \( [a_n, c_n] \)).
- If \( f(c_n) \cdot f(b_n) < 0 \), set \( a_{n+1} = c_n \) (root is in \( [c_n, b_n] \)).
This process continues iteratively until the interval is small enough to contain the root within the desired tolerance.