We will discuss the Mean Value Theorem in this section.
Rolle's Theorem is a simpler case of the Mean Value Theorem.
Suppose $s = f(t)$ is a position function. If the object is in same place at two different time points $t = a$ and $t = b$, then $f(a) = f(b)$.
Rolle's Theorem says there must exist $t = c$ between $a$ and $b$ where $f'(c) = 0$, or in other words, the velocity is zero.
You can see this in action by tossing a ball upwards; the ball's upward velocity reaches zero (which coincides with a local maximum!).
Imagine if the heights $f(a)$ and $f(b)$ were different. This is called the Mean Value Theorem.
Let $x_1, x_2 \in (a, b)$ where $x_1 < x_2$.
Because $f$ is differentiable on $(a, b)$, it must be differentiable on $(x_1, x_2)$ and continuous on $[x_1, x_2]$. Therefore the hypotheses of MVT are satisfied.
Applying MVT on the interval $[x_1, x_2]$ gives us a number $c$ where $x_1 < c < x_2$ and \[f(x_2) - f(x_1) = f'(c)(x_2 - x_1)\]
Because $f'(x) = 0$, in particular $f'(c) = 0$, the equation above becomes \[f(x_2) - f(x_1) = 0\] or $f(x_2) = f(x_1)$.
This means all the heights $f(x)$ are the same in $(a, b)$. Therefore $f(x) = c$, or what we call $f$ is constant.
This is saying if you take the derivative of $f(x)$ and it's equal to zero, then $f(x) = c$ for some $c \in \mathbb{R}$.
The next consequence is the one we are after: the link to the antiderivatives.
Let $F(x) = f(x) - g(x)$. Then \[F'(x) = f'(x) - g'(x) = 0\] because $f'(x) = g'(x)$. By the previous theorem $F$ is constant; that is, $f - g$ is constant.