Bisection Method

Introduction

The bisection method is a simple and robust numerical technique for finding the roots of a continuous function \( f(x) \) within a specified interval \([a, b]\). The method is particularly useful when you know that the function changes sign within the interval, meaning there is at least one root \( x \) such that \( f(x) = 0 \).

Basic Idea

The bisection method relies on the Intermediate Value Theorem, which states that if a continuous function changes sign over an interval, then there must be at least one root within that interval. The method works by repeatedly halving the interval \([a, b]\) and selecting the subinterval where the sign change occurs (see figure below).

solutions of the differential equation

The algorithm for the bisection method is as follows.

Step 1:

Choose \(a\) and \(b\) such that \(f(a) \cdot f(b) < 0\), that is, \(f(a)\) and \(f(b)\) are of different signs.

Step 2:

Calculate the first iteration of the numerical solution \(x_1\) by

\(x_1 = \frac{a + b}{2}\)

Step 3:

Now check whether \(f(x_1) \cdot f(a) < 0\) or \(f(x_1) \cdot f(b) < 0\).

  • If \(f(x_1) \cdot f(a) < 0\), then for the next iteration replace \(b\) by \(x_1\). Now new \(a = a\) and \(b = x_1\).
  • If \(f(x_1) \cdot f(b) < 0\), then for the next iteration replace \(a\) by \(x_1\). Now new \(a = x_1\) and \(b = b\).

Step 4:

Repeat the process until the interval is sufficiently small, at which point the midpoint is taken as the approximate root.

Convergence

The bisection method guarantees convergence to a root as long as the function is continuous and the initial interval contains a root. The convergence is linear, meaning that the error is reduced by about half with each iteration. While the method is not as fast as some other root-finding algorithms, its reliability makes it a valuable tool, especially when the behavior of the function is not well understood.

Example:

Use the bisection method to find the real root of the equation \(f(x) = x^3 - x - 1 = 0\). Show five iterations.


Solution:

Here we have:

\(f(1) = -1 \quad \text{and} \quad f(2) = 5,\)

so we can use the bisection method with \(a = 1\) and \(b = 2\).

  • First iteration:

    \(x_1 = \frac{a + b}{2} = \frac{1 + 2}{2} = 1.5\)

    Note that \(f(1.5) = 0.88\), which is positive. So, for the next iteration we have:

    \(a = 1\) and \(b = 1.5\)

  • Second iteration:

    \(x_2 = \frac{a+b}{2} = \frac{1 + 1.5}{2} = 1.25\)

    Since \(f(1.25) = -0.3\), we take \(a = 1.25\) and \(b = 1.5\) for the next iteration.

  • Third iteration:

    \(x_3 = \frac{a+b}{2} = \frac{1.25 + 1.5}{2} = 1.375\)

    Since \(f(1.375) > 0\), we take \(a = 1.25\) and \(b = 1.375\) for the next iteration.

  • Fourth iteration:

    \(x_4 = \frac{a+b}{2} = \frac{1.25 + 1.375}{2} = 1.3125\)

    Since \(f(1.3125) < 0\), we take \(a = 1.3125\) and \(b = 1.375\) for the next iteration.

  • Fifth iteration:

    \(x_5 = \frac{a+b}{2} = \frac{1.3125 + 1.375}{2} = 1.34375\)

    Since \(f(1.34375) > 0\), we take \(a = 1.3125\) and \(b = 1.34375\) for the next iteration.

Additional Iterations:

In the following array, we can give more iterations:

\(a\) \(b\) \(f(a)\) \(f(b)\) Root
1.0000 2.0000 -1.0000 5.0000 1.5000
1.0000 1.5000 -1.0000 0.8750 1.2500
1.2500 1.5000 -0.2969 0.8750 1.3750
1.2500 1.3750 -0.2969 0.2246 1.3125
1.3125 1.3750 -0.0515 0.2246 1.3438
1.3125 1.3438 -0.0515 0.0826 1.3281
1.3125 1.3281 -0.0515 0.0146 1.3203
1.3203 1.3281 -0.0187 0.0146 1.3242
1.3242 1.3281 -0.0021 0.0146 1.3262
1.3242 1.3262 -0.0021 0.0043 1.3252