mean value theorem
Mean value theorem

The mean value theorem, or known as Lagrange's mean value theorem, states that for a given curve between two endpoints, there is at least one point at which the tangent to the curve is parallel to the secant through its endpoints.
Essentially, it can be summarised as: It is guaranteed to exist a derivative (gradient) at some point that has the same value as the gradient of the line going through \[A\] and \[B\] (however it doesn't tell us exactly what \[c\] is).
Definition
Suppose \[a<b\]. If \[f: \left[ a,b \right]\to\mathbb{R}\] is continuous on \[\left[ a,b \right]\] and differentiable on \[\left( a,b \right)\], then there exists a point \[c\in \left( a,b \right)\] such that \[f^{\prime}(c)=\frac{f(b)-f(a)}{b-a}\] (as derivative is the gradient).
Notice that the formula for \[f^{\prime}(c)\] is very similar to the formula to calculate gradients, \[m=\frac{y-y_{0}}{x-x_{0}}\] (because it is the definition for derivatives).
Proof
The first thing we need is the equation of the secant line that goes through the two points \[A\] and \[B\].
Let \[A\] be the point \[\left( a,f(a) \right)\] and \[B\] be the point \[\left( b,f(b) \right)\].
To find the equation of the secant line, since \[m=\frac{y-y_{0}}{x-x_{0}}\implies y-y_{0}=m(x-x_{0})\], then \[y-f(a)=\frac{f(b)-f(a)}{b-a}\cdot \left( x-a \right)\]. We will rewrite the equation as \[y=f(a)+\frac{f(b)-f(a)}{b-a}\left( x-a \right)\].
Let's now define a new function \[g(x)\], to be the difference between \[f(x)\] and the equation of the secant line, so that \[g(a)=g(b)\] to be able to apply Rolle's theorem.
So combining the equations, \[g(x)=f(x)-\left( f(a)+\frac{f(b)-f(a)}{b-a}(x-a) \right)\]. We intend to show that \[g(x)\] satisfies the three hypotheses of Rolle's theorem.
First, \[g(x)\] is continuous on \[\left[ a,b \right]\], being the difference of \[f\] and a polynomial function, both of which are continuous.
Second, \[g(x)\] is differentiable on \[\left( a,b \right)\] for similar reasons. \[f\] is differentiable, same applies to polynomial functions.
Lastly, at \[a\] and \[b\]. When \[x=a\], \[g(a)=f(a)-\left( \frac{f(b)-f(a)}{b-a}(a-a)+f(a) \right)=0\]. On the other hand, when \[x=b\], \[g(b)=f(b)-\left( \frac{f(b)-f(a)}{b-a}(b-a)+f(a) \right)=0\]. Thus, \[g(a)=g(b)=0\].
Therefore, the conditions of Rolle's theorem are satisfied and there must exist some \[c\] in \[\left( a,b \right)\] where \[g^{\prime}(c)=0\].
Expanding of \[g(x)\], \[g(x)=f(x)-f(a)-\frac{f(b)-f(a)}{b-a}(x-a)\].
We'll differentiate \[g(x)\] term by term: \[\frac{d}{dx}\left[ f(x) \right]=f^{\prime}(x)\], \[\frac{d}{dx}\left[ -f(a) \right]=0\] (as \[f(a)\] is a constant with respect to \[x\]), \[\frac{d}{dx}\left[ -\frac{f(b)-f(a)}{b-a}x \right]=-\frac{f(b)-f(a)}{b-a}\] (again, the fraction is a constant with respect to \[x\]) and \[\frac{d}{dx}\left[ \frac{f(b)-f(a)}{b-a}a \right]=0\].
Therefore, \[g^{\prime}(x)=f^{\prime}(x)-\frac{f(b)-f(a)}{b-a}\]. For some \[c\] in \[\left( a,b \right)\], by Rolle's theorem, it's guaranteed that \[g^{\prime}(c)=0=f^{\prime}(c)-\frac{f(b)-f(a)}{b-a}\].
Equivalently, we've shown that there exists some \[c\in \left( a,b \right)\] such that \[f^{\prime}(c)=\frac{f(b)-f(a)}{b-a}\].