# Mean Value Theorem and Rolles Theorem

The mean value theorem allows us to easily understand a number of useful facts about a function, such that it is continuous and differentiable. It's an important theorem that gets applied in a number of areas related to calculus, so understanding it as early as possible helps understanding of more complex subjects.

The mean value theorem relies on another related theorem known as Rolle's Theorem. We will start by understanding and proving this theorem before we move into the mean value theorem. Before looking at Rolle's theorem, we will cover one further theorem that will be helpful.

**Extreme Value Theorem: **If f is continuous on a closed interval [a,b], then f has an absolute maximum $f(c)$ and an absolute minimum $f(d)$ at some numbers c and d that are in the interval [a,b].

It's pretty clear to see why this holds true. On a closed interval, a function can move any way, but at some point, since the interval is closed, it will reach an inevitable maximum and minimum. Knowing this, we can now take on Rolle's theorem.

**Rolle's Theorem: **Let f be a function that satisfies three conditions:

- f is continuous on an interval [a,b]
- f is differentiable on the interval (a,b)
- f(a) = f(b)

If these three conditions are true, then there is a number c in (a,b) such that $f'(c) = 0$.

Essentially what this theorem tells us is that if we can find an interval where f(a) = f(b), then there must be a point where we have a flat tangent, meaning a critical value. This is very useful to help show the existence of a value such as a maximum or minimum on a given interval. Let's prove that Rolle's theorem is true.

To do this proof, we are going to consider three cases, and prove each of them.

**Case 1: **$f(x) = k$, where k is some constant value

If $f(x) = k$, then $f'(x) = 0$, so if we take c to be any number, we can guarantee that $f'(c) = 0$, therefore the theorem holds.

**Case 2: **$f(c) > f(a)$ for some x in the interval (a,b)

This case says that all values of f(x) are greater than f(a). If we apply extreme value theorem, it tells us that f has a minimum and maximum value in [a,b]. By the third condition, f(a) = f(b), which means that there must be a value c that is a minimum value in (a,b). By Fermat's theorem, we can conclude that f'(c) = 0, therefore the theorem holds.

**Case 3: **$f(x) < f(a)$ for some x in the interval (a,b)

This case is the opposite of case 2 and covers the remaining cases that could apply for f(x). In this case, all of f(x) is less than f(a). We can use the same argument as before, by the extreme value theorem, there will be a minimum and maximum value in [a,b]. This means that there will be a value c that is a minimum in (a,b), and by Fermat's theorem, we can again conclude that f'(c) = 0.

Therefore, by these three cases, we have proved that Rolle's theorem holds.

Rolle's theorem already has a number of useful applications, such as proving the existence of a critical value. It can also be used to prove the mean value theorem, which we will look at now.

**The Mean Value Theorem: **Let f be a function that satisfies the following two criteria:

- f is continuous on the interval [a,b]
- f is differentiable on the interval (a,b)

If these two criteria hold, then there is a number c in (a,b) such that: $f'(c) = \frac{f(b)-f(a)}{b-a}$

This essentially tells us that the slope of a point c in (a,b) is the same as the slope between the two endpoints of it. You'll notice that the criteria of this theorem are quite similar to the criteria of Rolle's theorem, which is why we are able to apply it to prove The Mean Value Theorem.

Suppose we define a new function, and we call it h(x). We will define h(x) as the difference between the function f(x), and the secant line between the points a and b. We can write this function as:

$y - f(a) = \frac{f(b)-f(a)}{b-a}(x-a)$

$\Longrightarrow y = f(a) + \frac{f(b) - f(a)}{b-a}(x-a)$

So, in general, we have h(x) defined as follows:

$h(x) = f(x)-f(a)-\frac{f(b)-f(a)}{b-a}(x-a)$

From this point, we now have a function that is related to the secant between a and b, as well as the actual function in question. Now, we can verify that h satisfies Rolle's theorem. If it does, then we can conclude that Mean Value Theorem holds.

- The function h(x) is continuous on [a,b]. This is because it is the sum of two functions, and both functions are continuous. We know that due to the laws of limits, if both functions are defined to be continuous, then their sum must be continuous as well
- The function h(x) is differentiable on (a,b), and this is for a similar reason as above. Since both functions are differentiable, their sums are differentiable as well. You could also demonstrate this using product rule on h(x) to get h'(x).
- Finally, we need to show that h(a) = h(b). We can do this as follows:

$h(a) = f(a)-f(a)-\frac{f(b)-f(a)}{(b-a)}(a-a) = 0$

$h(b) = f(b)-f(a)-\frac{f(b)-f(a)}{(b-a)} = f(b)-f(a)-f(b)+f(a) = 0$

Therefore, since h(a) = h(b), the final criteria holds. Since all three criteria hold, we can conclude that there exists a number c, where h'(c) = 0.

Therefore, we have $0 = h'(c) = f'(c)-\frac{f(b)-f(a)}{b-a}$. This can be rearranged to $f'(c) = \frac{f(b)-f(a)}{b-a}$

Now that we have a proof of The Mean Value Theorem, we can look at some applications of the theorem.

**Example: **Suppose that we have a function, where $f(0) = -3$ and $f'(x) \le 5$ for all values in the domain of f(x). How large can f(2) possibly be?

First, let's think about what information we currently know. We know the values of f(0), and the largest value of f'(x). The Mean Value Theorem tells us that there is a c value where $f'(c) = \frac{f(b)-f(a)}{b-a}$ on the interval [a,b].

Given we know x = 0, and what to determine the largest values f(2) can be, let the interval be [0,2]. This gives us:

$f'(c) = \frac{f(b)-f(a)}{b-a}$

$\Longrightarrow f'(c) = \frac{f(2)-f(0)}{2-0}$

$\Longrightarrow 2f'(c) = f(2) + 3$

$\Longrightarrow 2f'(c) - 3 = f(2)$

Since we know that $f'(x) \le 5$, we know that f'(x) can at most be 5. Therefore:

$2*5-3 = f(2)$

Therefore, f(2) can be at most 7.

Using The Mean Value Theorem, we can also prove some new useful theorems.

**Theorem: **If f'(x) = 0 for all x in an interval (a,b),
then f is constant on the interval (a,b)

To prove this, we can use the Mean Value Theorem. Let x_{1} and x_{2} be any two numbers in (a,b). Since f(x) is differentiable on (a,b) by the theorem definition, it is also continuous on (a,b). This means we can apply mean value theorem to get:

$f'(c) = \frac{f(x_2)-f(x_1)}{x_2-x_1}$

$= f'(c)(x_2-x_1)$

$=f(x_2)-f(x1)$

If, as the theorem says, we let $f'(c) = 0$, we get:

$0 = f(x_2) - f(x_1) \Longrightarrow f(x_2) = f(x_1)$

Therefore, since $f(x_2) = f(x_1)$, the function must be constant.