proof of Rolle’s theorem
Because is continuous on a compact (closed and bounded) interval , it attains itsmaximum and minimum values. In case is both the maximum andthe minimum, then there is nothing more to say, for then is a constant function and on the whole interval . So suppose otherwise, and attains an extremum
in the open interval, and without loss of generality, let this extremum be a maximum, considering inlieu of as necessary. We claim that at this extremum we have , with .
To show this, note that for all, because is the maximum. By definition of the derivative, we have that
Looking at the one-sided limits, we note that
because the numerator in the limit is nonpositive in the interval ,yet , as approaches from the right. Similarly,
Since is differentiable at , the left and right limits must coincide, so, that is to say, .