Bisection method always works

bisectionnumerical methods

So as I understand it the bisection method works by checking the intervals in between two endpoints and checking where the function changes signs, correct? I am just a little confused as to why this might work every single time.

Say we had a function that looked like this:

enter image description here

Then wouldn't it be so that if we took the interval from -5 to 0, then we would have two zeroes, but if we really actually used the bisection method, the product of the function at the two points would be positive. So wouldn't we be essentially overlooking that?

Best Answer

The bisection method is only guaranteed to work if (1) the initial endpoints evaluate to opposite-sign values and (2) the function is continuous. The intermediate value theorem guarantees a root in the initial interval when these conditions are satisfied.

The interval $[-5,0]$ is not a valid starting interval for bisection here per se, as you have pointed out. But you could poke around and try $2.5$ and notice that $f(2.5)$ has opposite sign to both $f(0)$ and $f(5)$, thus giving you two roots. A priori (without looking at a graph) you would not know that there are roots in this interval.