# Showing a function has exactly one zero with IVT and Rolle's Theorem

This is an exercise that appears on differential calculus exams at my university. I'm typing up a thorough response to this exercise here to share with my class, and maybe it'll help other students too.

Let $$f$$ be the function given by $$f(x) = 3x -2\sin(x)+7\,.$$ Use the Intermediate Value Theorem to show that $$f$$ has at least one zero, and then use the Mean Value Theorem to show $$f$$ has exactly one zero.

First, let's recall what the Intermediate Value Theorem says. Informally, this theorem just says that if you have a function $f$ that is continuous on some interval $[a,b]$, every possible output value between $f(a)$ and $f(b)$ must get hit by $f$ for some input in that interval. A special case of this is when $f(a)$ and $f(b)$ have different sign (one is negative and the other is positive), then the graph of $f$ must cross the $x$-axis between $a$ and $b$ (so $f$ has a zero between $a$ and $b$).

As an example, for the continuous function with the above graph (green), since the value of the function at $2$ and at $-2$ (red) have different sign, the function must have a zero (yellow) on the interval $(-2,2)$. Now it's may be very difficult to calculate the actual value of that zero, but the strength of the Intermediate Value Theorem is that it allows us to say a zero exists without ever calculating it.

So now to show that our function $f(x) = 3x -2\sin(x)+7$ has a zero, we just have to find a pair of inputs for $f$ that return outputs of different sign. First we'll input our favorite number, zero, and get that $f(0) = 7$. Great! So now we need to find an input for which $f$ outputs a negative number. This is a little tricky, but it helps to notice that $\sin(x)$ is bounded; it bounces between $1$ and $-1$. So in our expression for $f(x)$, the $-2\sin(x)+7$ is bounded too; it's going to bounce between $-2(1)+7$ and $-2(-1)+7$, so between $5$ and $9$. To get a negative output then, we'll need to plug in a sufficiently large negative number so that the $3x$ summand "overpowers" the $-2\sin(x)+7$ summand and makes the value of the function negative. Notice that $x=-4$ works: $$f(-4) = -12 + (-2\sin(-4) + 7) < -12 + (9) = -3\,.$$ So $f(-4)$ must be negative, and we can say by the intermediate value theorem that $f$ must have at least one zero on the interval $(-4,0)$.

Arguing that $f$ has exactly one zero is a bit trickier. First let's recall what the Mean Value Theorem says. Informally, if you've got a function that is continuous and differentiable on some interval, then there must be an input in that interval such the rate of change of the function at that input is equal to the average rate of change of the function over the entire interval. For our response though it'll turn out to be helpful to think of a special case of the Mean Value Theorem called Rolle's Theorem, where this average rate of change of the function is zero (i.e. when the value of the function at the endpoints are equal). In this case the theorem reduces to saying that there must be an input in the interval such that the rate of change of the function at that input is zero, which is the same as saying the slope of the tangent line through that corresponding point on the graph must be zero, which is the same as saying the value of the derivative at that point must be zero.

For example, look at function with it's graph (green) above. The function is continuous and differentiable on the interval between its two zeros (yellow). So by Rolle's Theorem, there must be an point on the graph (red) such that the slope of the tangent line at that point (violet) is the same as the slope of the line through the two (yellow) endpoints of the interval, which is zero.

Thinking of the Mean Value Theorem this way is actually a helpful hint for how to show what we need to show: we can apply the Mean Value Theorem this way if we have at least two zeros of the function to work with. Showing that $f$ has exactly one zero is equivalent to showing that $f$ cannot have more than one zero, so the big idea is that we're going to (falsely) assume that $f$ has at least two zeros, apply the Mean Value Theorem (Rolle's Theorem specifically), and arrive at a contradiction. This sort of argument is called a proof by contradiction.

So let's do it! Suppose for the sake of arriving at a contradiction that $f$ has at least two zeros. So there are at least two inputs $a$ and $b$ such that $f(a) = f(b) = 0$. The average rate of change of $f$ on the interval $[a,b]$ is $$\frac{f(b)-f(a)}{b-a} = 0\,,$$ and so by the Mean Value Theorem there must be some input $c$ in the interval $(a,b)$ such that the rate of change of $f$ at this point is zero too. I.e. $f'(c) = 0$. Now we can calculate the derivative of $f$, which is $f'(x) = 3-2\cos(x)$. Remember that the value $\cos(x)$ bounces between $1$ and $-1$, so the value of $f'$ bounces between $1$ and $5$. In particular, $f'$ is always positive. But the Mean Value Theorem told us some input $c$ exists such that $f'(c)=0$. If $f'$ is always positive, this must be incorrect! No such $c$ can exist! And so our original assumption that led us to believe that such a value of $c$ existed, the assumption that $f$ has two or more zeros, must have been wrong! Since $f$ doesn't have more than one zero, it must have exactly one zero, which is exactly what we wanted to show.

Now this is a lot to parse and condense into a response. After understanding everything above, here's how I would write it down if this question were asked on an exam:

Notice that $f(0) = 7$, which is greater than zero, and that since $\sin(x)$ is bounded by $-1$ and $1$, $f(-4) = 3(-4) + -2\sin(-4) + 7 < 0$. Then by the Intermediate Value Theorem, there must be some input $c$ in the interval $(-4,0)$ such that $f(c) = 0$. So $f$ has at least one zero.

Next suppose that $f$ doesn't have exactly one zero, so it has at least two zeros, say $a$ and $b$. Since $f(a) = f(b) = 0$, the average rate of change of the function on the interval $[a,b]$ is $$\frac{f(b)-f(a)}{b-a} = 0\,.$$ By the Mean Value Theorem, there must be some $c$ in the interval $(a,b)$ such that $f'(c)=0$. But $f'(x) = 3-2\cos(x)$. Since $\cos(x)$ is bounded between $1$ and $-1$, the value of $f'$ is bounded between $1$ and $5$. In particular $f'$ is never zero, so no such value of $c$ can exist, and so it can't be the case that $f$ has at least two zeros! Therefore, $f$ must have exactly one zero.