The bisection method is a root-finding method that applies to any continuous functions for which one knows two values with opposite signs. The method consists of repeatedly bisecting the interval defined by these values and then selecting the subinterval in which the function changes sign, and therefore must contain a root. It is a very simple and robust method, but it is also relatively slow. Because of this, it is often used to obtain a rough approximation to a solution which is then used as a starting point for more rapidly converging methods.

For a given function $f(x)$,the Bisection Method algorithm works as follows:

- two values a and b are chosen for which $f(a)>0$ and $f(b)<0$ (or the other way around)
**interval halving**: a midpoint $s$ is calculated as the arithmetic mean between $a$ and $b$, $s = \frac{a+b}{2}$- the function $f$ is evaluated for the value of $s$
- if $f(s) = 0$ means that we found the root of the function, which is $s$
- if $f(s) \neq 0$ we check the sign of $f(s)$:
- if $f(s)$ has the same sign as $f(a)$ we replace $a$ with $s$ and we keep the same value for $b$
- if $f(s)$ has the same sign as $f(b)$, we replace $b$ with $s$ and we keep the same value for $a$

- we go back to step 2. and recalculate $s$ with the new value of $a$ or $b$

Visualisation for Bisection method is displayed in figure below. $a_1$ and $b_1$ are initial bounderies. Drag them.

You may change the function term here: | |

and set the number of iterations: | |

10 | |