# Theorem of Bolzano

Let $$f(x)$$ be a continuous function defined in an interval $$[a,b]$$.

Then, if $$f(a) \cdot f(b) <0$$ (therefore, $$f(a)<0$$ and $$f(b)>0$$ or $$f(a)>0$$ and $$f(b)<0$$), there exists at least a point $$c$$ inside the interval $$(a,b)$$ such that $$f(c)=0$$.

This theorem can turn out to be very intuitive since if we have a continuous function that is negative in $$f (a)$$ (below the $$x$$ axis) and is positive in $$f (b)$$ (above the $$x$$ axis), or vice versa, given that the function is continuous and has to connect the points $$f (a)$$ and $$f (b)$$, the graph will cross the $$x$$ axis at least once, so a value $$c$$ will exist inside the interval so that $$f (c) =0$$.

Let's see an example of the application of the theorem:

Let's take the function $$f(x)=x-\ln^2x$$ defined in the interval $$[0.1,0.5]$$ and we wonder whether it has a zero within the interval.

We observe that: $$\begin{array}{l} f(0.1)= -5.201898111 < 0 \\ f(0.5)=0.0195469860 >0 \end{array}$$$As the interval is closed and the function is continuous, the hypotheses of Bolzano's theorem are satisfied and consequently it can be applied. The theorem says that t a point $$c$$ inside the interval $$[0.1,0.5]$$ exists such that $$f(c)=0$$. Consequently it will be satisfied that $$0=f(c)=c-\ln^2c$$, or $$c=\ln^2c$$. Notice that we found the existence of a solution in the interval $$[0.1,0.5]$$ of the equation $$x=\ln^2x$$ which could not be previously solved. Let's see if the equation $$x^3+\ln x=- \sqrt{x}$$ has a solution. We will consider the function $$f(x)=x^3+\ln x+\sqrt{x}$$. If we find two points $$a$$ and $$b$$ where $$f (a) \cdot f (b) < 0$$, it will mean that a certain value $$c$$ exists between $$a$$ and $$b$$ such that it will be a solution to our equation. If $$a= 0.1 \Longrightarrow f(0.1)=0.1^3+\ln 0.1+\sqrt{0.1}=-1.985357 < 0$$ If $$b=1 \Longrightarrow f(1)=1^3+\ln 1+ \sqrt{1}=2>0$$ Therefore, in the interval $$[0.1,1]$$ a point $$c$$ exists such that $$f(c)=0$$ and we can say our equation has a solution (since $$0=f(c)=c^3+\ln c+ \sqrt{c}$$). ## Application of the theorem Now, using Bolzano’s theorem, we can define a method to bound a zero of a function or a solution in an equation: 1. To find an interval where at least one solution exists by Bolzano. 2. To divide the interval in $$2$$ subintervals (dividing it by half, for example). 3. To evaluate the function at the median point and depending on the sign of the value, repeat the process in the new subinterval where the Bolzano conditions are satisfied ($$f (a) \cdot f (b) <0$$). This process can be done as many times as we want, until we eventually find a very small interval where it is known with certainty that a zero of our function exists. Let's see an example of an application of the algorithm: Let's see if the equation $$x^2 \sin x= \ln x$$ has a solution. Before starting we will consider the function $$f(x)=x^2\sin x- \ln x$$. Finding the zeros of this function is equivalent to finding the solutions to our equation. • First, we will look for a closed interval where Bolzano’s theorem is satisfied, containing two values, $$a$$ and $$b$$, where the function $$f(x)$$ is positive and negative respectively: We will try with different values: $$\begin{array}{rcl} \mbox{if } x=2 & \Longrightarrow & f(2)=2^2\sin 2-\ln 2=2.94404 \ldots >0 \\ \mbox{if } x= 6 &\Longrightarrow & f(6)=6^2-\sin 6- \ln 6= -11.8507 \ldots < 0 \end{array}$$$ Therefore, in the interval $$[2,6]$$ a point $$c$$ exists such that $$f(c)=0$$.

We have bound our solution, but of course we can improve the interval.

• We will divide our interval in two subintervals: $$\begin{array} {l} I_1=[2,4] \\ I_2=[4,6]\end{array}$$$and we are going to evaluate the function at the median point: $$f(4)=-13.495 \ldots < 0$$ Since we had $$f(2)>0$$, in the interval $$I_1=[2,4]$$ the theorem will be satisfied. • Now we are going to repeat the same process until we find the bounds that we need. We divide again the interval: $$\begin{array}{l} I_1=[2,3] \\ I_2=[3,4] \\ f(3)=0.171467 >0 \end{array}$$$ And we are left with the interval $$I_2=[3,4]$$, since $$f(3)>0$$ and $$f(4) < 0$$.

We divide again the interval: $$\begin{array}{l} I_1=[3,3.5] \\I_2=[3.5,4]\\f(3.5)=-5.54 \ldots < 0\end{array}$$$We are left with the interval $$I_1=[3,3.5]$$. We divide again the interval: $$\begin{array}{l} I_1=[3,3.25] \\I_2=[3.25,3.5]\\f(3.25)=-2.32 \ldots < 0 \end{array}$$$ We are left with the interval $$I_1=[3,3.25]$$.

We divide the interval for the last time: $$\begin{array}{l} I_1=[3,3.125] \\I_2=[3.125,3.25]\\f(3.125)=-0.97 \ldots < 0\end{array}$$$We are left with the interval $$I_1=[3,3.125]$$. In conclusion, the equation $$x^2\sin x=\ln x$$ has a solution inside the interval $$I_1=[3,3.125]$$. For example, we might bring the solution near the median point of the interval: $$x=3.0625$$, and we would obtain the expressions: $$f(3.0625)=-0.378 \ldots \simeq 0$$$ or on the other hand $$x^2\sin x= \ln x \Rightarrow 0.741029 \ldots \simeq 1.1119 \ldots$$\$

We would remind you that when doing more iterations a better approximation of the exact solution may be found.