# Numerical Analysis. Bisection method.

What will happen if the bisection method is used with the function $f(x) = \tan(x)$ and

a) $[3,4]$

b) $[1,3]$

Attempt:

Check the signs of the function:

$f(x) = \tan(x)$

a) $f(3)f(4) = -0.165 <0 \implies$ the root is between $3$ and $4$

b) $f(1)f(3)= -0.222<0 \implies$ the root is between $1$ and $3$ ,

but this is obviously wrong.

-

The bisection method is applicable when we wish to solve $f(x) = 0$ for $x \in \mathbb{R}$, where $$\color{red}{f \text{ is a continuous function defined on an interval } [a, b]}$$ and $f(a)$ and $f(b)$ have opposite signs.
In your case, in the domain $[3,4]$ the function $\tan(x)$ is continuous and hence you can claim that there is a root in this domain and use bisection method. However, in the domain $[1,3]$, $\tan(x)$ is discontinuous at $\pi/2 \in (1.55,1.6)$ and hence the bisection method is not applicable in this interval.
$f(x) = \tan{x}$ has a pole at $\pi/2 \approx 1.57$, about which $f$ changes sign without crossing the $x$-axis. Thus bisection is not applicable within any bracketed interval containing $x=\pi/2$.