Fermat, Rolle and Lagrange Theorems
The theorems we will cover in this document provide fundamental tools for analyzing the behavior of real-valued functions using the concept of the derivative. Let us start by defining the absolute maximum and the absolute minimum points of a function.
Let $f : [a, b] \to \mathbb{R}$ be a function. A point $x_0 \in [a, b]$ is the absolute maximum of $f$ if: $$ f(x_0) \geq f(x) \ \ \ \forall x \in [a, b] $$ Similarly, $x_0$ is the absolute minimum of $f$ if: $$ f(x_0) \leq f(x) \ \ \ \forall x \in [a, b] $$
In other words, absolute maxima and minima are defined on the entire domain. If we instead consider the behavior of a function in a neighborhood of a point, we obtain the notions of relative maximum and relative minimum. More precisely:
Let $(X, d_X)$ be a metric space and let $f : X \to \mathbb{R}$ be a function. A point $x_0 \in X$ is a relative maximum point of $f$ if: $$ \exists \epsilon > 0 : \forall x \in X, \quad d_X(x, x_0) < \epsilon \implies f(x_0) \geq f(x) $$ Similarly, $x_0$ is a relative minimum point of $f$ if: $$ \exists \epsilon > 0 : \forall x \in X, \quad d_X(x, x_0) < \epsilon \implies f(x_0) \leq f(x) $$
In the diagram below, for example, the points $x_0$ and $x_1$ are relative maximum and minimum points of $f$, respectively, while $a$ and $b$ are absolute minimum and maximum points of $f$, respectively.

Furthermore, we can observe that the tangent line at any interior maximum or minimum point is parallel to the $x$-axis; that is, it is horizontal.
Fermat’s Theorem
This geometrical intuition is what led Pierre de Fermat to formalize the following theorem:
Let $f : [a, b] \to \mathbb{R}$ be a function and let $x_0 \in (a, b)$ be a relative maximum or a relative minimum point of $f$. If the function $f$ is differentiable at $x_0$, then: $$ f'(x_0) = 0 $$
To prove this theorem, suppose that $x_0$ is a relative maximum point; the case for a relative minimum point will be analogous. By definition, there exists an $\epsilon > 0$ such that: $$ \forall x \in [a, b], \quad |x - x_0 | < \epsilon \implies f(x_0) \geq f(x) $$
Let’s now consider the difference quotient:
$$ \frac{f(x) - f(x_0)}{x - x_0} = \begin{cases} \leq 0, & x > x_0\\ \geq 0, & x < x_0 \end{cases}, \quad (x \neq x_0) $$
taking the one-sided limits as $x \to x_0^{\pm}$, we obtain:
$$ f'(x_0) = \lim_{x \to x_0^+} \frac{f(x) - f(x_0)}{x - x_0} \leq 0 $$
And
$$ f'(x_0) = \lim_{x \to x_0^-} \frac{f(x) - f(x_0)}{x - x_0} \geq 0 $$
Since $f$ is differentiable at $x_0$ by assumption, the two one-sided derivatives exist and are equal, therefore:
$$ f_{+}'(x_0) = f_{-}'(x_0) = f'(x_0) $$
Consequently, $f'(x_0) \leq 0$ and $f'(x_0) \geq 0$ implies that: $$ f'(x_0) = 0\\ \blacksquare $$
From a practical standpoint, this theorem allows us to assert that if a function $f$ is differentiable at a point $x_0$ and its derivative satisfies $f'(x_0) = 0$, then $x_0$ is a candidate for a relative minimum or a relative maximum. Our next concern is to classify these critical points; that is, we want to determine whether they are a relative maxima or a relative minima.
Rolle’s Theorem
In order to do that, we will first need to introduce the following theorem:
Let $f : [a, b] \to \mathbb{R}$ be a function continuous on $[a, b]$ and differentiable on $(a, b)$. If $f(a) = f(b)$, then there exists a point $x_0 \in (a, b)$ such that $f'(x_0) = 0$.
To prove this theorem, let $x_1$ and $x_2$ be points at which $f$ attains its absolute minimum and absolute maximum, respectively, on $[a, b]$. Their existence is guaranteed by the extreme value theorem. Specifically, this means that:
$$ f(x_1) \leq f(x) \leq f(x_2), \ \ \ \forall x \in [a, b] $$
We can distinguish two distinct cases.
First, suppose that neither $x_1$ nor $x_2$ belongs to $(a, b)$. In this case, since from the hypothesis $f(a) = f(b)$, we have that: $$ f(x_1) = f(a) = f(b) = f(x_2) $$
Consequently, for every $x \in [a, b]$, we have:
$$ f(a) \leq f(x) \leq f(b) $$
which implies that $f(x) = f(a) = f(b), \forall x \in [a, b]$. Thus, $f$ is constant on $[a, b]$ and hence: $$ f'(x) = 0 \ \ \ \forall x \in (a, b) $$
Now let’s consider the case in which at least one of the points $x_1$ and $x_2$ belongs to $(a, b)$. In this case, $f$ attains an absolute maximum or an absolute minimum at an interior point of the interval. Since $f$ is differentiable on $(a, b)$, Fermat’s theorem guarantees that its derivative is zero at that point. Therefore, we conclude that:
$$ \exists x_0 \in (a, b) : f'(x_0) = 0\\ \blacksquare $$
Geometrically, this corresponds to the following diagram:

Notice that all three hypotheses (continuity, differentiability and $f(a) = f(b)$) are essential to the theorem. For example, consider the function $f(x) = |x|$ defined on the interval $[-1, 1]$:

This function is continuous on $[-1, 1]$ and satisfies $f(-1) = f(1)$ but it is not differentiable at $x = 0$ where it has a sharp corner. Therefore, Rolle’s theorem cannot be applied in this case.
Lagrange’s Mean Value Theorem
A generalization of Rolle’s result is known as the mean value theorem which, unlike Rolle’s theorem, it does not require that $f(a) = f(b)$.
Let $f : [a, b] \to \mathbb{R}$ a continuous function on $[a, b]$ and differentiable on $(a, b)$. Then, there exists a point $c \in (a, b)$ such that: $$ f'(c) = \frac{f(b) - f(a)}{b - a} $$
To prove this theorem, let us first consider its geometric interpretation. The theorem states that there is at least one point $(c, f(c))$ with $c \in (a, b)$, at which the tangent line to the graph of $f$ is parallel to the secant line connecting the endpoints of the function at $(a, f(a))$ and $(b, f(b))$. In other words, the tangent line and the secant line have the same slope:

Let us begin by writing the equation of the secant line passing through the endpoints:
$$ y = f(a) + \frac{f(b) - f(a)}{b - a} \cdot (x - a) $$
Now, let us define an auxiliary function $g(x)$ as the vertical distance between the graph of $f(x)$ and the secant line:
$$ g(x) = f(x) - \left[ f(a) + \frac{f(b) - f(a)}{b - a} \cdot (x - a) \right] $$
The function $g$ is continuous on $[a, b]$ since it is the difference of two continuous functions (the differentiable function $f$ and a linear function). Furthermore, $g$ is differentiable on $(a, b)$ since both $f$ and linear functions are differentiable there. Now let’s evaluate $g$ at the endpoints, starting with $x = a$:
$$ \begin{aligned} g(a) &= f(a) - \left[ f(a) + \frac{f(b) - f(a)}{b - a} \cdot (a - a) \right]\\ &= f(a) - f(a) = 0 \end{aligned} $$
And now with $x = b$:
$$ \begin{aligned} g(b) &= f(b) - \left[ f(a) + \frac{f(b) - f(a)}{b - a} \cdot (b - a) \right]\\ &= f(b) - f(a) - (f(b) - f(a)) = 0 \end{aligned} $$
We have therefore shown that $g(a) = g(b)$. Since $g$ also satisfies the continuity and differentiability hypothesis, we can apply Rolle’s theorem. Consequently, there exists at least one point $c \in (a, b)$ such that $g'(c) = 0$.
By differentiating $g(x)$ with respect to $x$, we obtain:
$$ g'(x) = f'(x) - \frac{f(b) - f(a)}{b - a} $$
Now, let’s replace $x = c$:
$$ g'(c) = f'(c) - \frac{f(b) - f(a)}{b - a} $$
And since $g'(c) = 0$, it follows that:
$$ f'(c) = \frac{f(b) - f(a)}{b - a}\\ \blacksquare $$
Lagrange’s theorem has important implications regarding the analysis of functions. In particular, it allows us to establish the following criteria for monotonicity:
Let $f : [a, b] \to \mathbb{R}$ be a continuous function on $[a, b]$ and differentiable on $(a, b)$, then:
- $f$ is non-decreasing on $[a, b]$ if and only if $f'(x) \geq 0$, $\forall x \in (a, b)$;
- $f$ is non-increasing on $[a, b]$ if and only if $f'(x) \leq 0$, $\forall x \in (a, b)$.
As mentioned earlier, we can also use the sign of the derivative to classify critical points. In order to do so, let $f$ be a differentiable function on an open interval containing $x_0$ where $f'(x_0) = 0$. Thus, if there exists a left-hand neighborhood of $x_0$ in which $f'(x) < 0$ and a right-hand neighborhood in which $f'(x) > 0$, then $x_0$ is a relative minimum.
Similarly, if $f'(x) > 0$ in a left-hand neighborhood of $x_0$ and $f'(x) < 0$ in a right-hand neighborhood, then $x_0$ is a relative maximum.