proof of Fermat’s Theorem (stationary points)
Suppose that is a local maximum (a similar proof applies if is a local minimum). Then there exists such that and such that we have for all with . Hence for we notice that it holds
Since the limit of this ratio as exists and is equal to we conclude that . On the other hand for we notice that
but again the limit as exists and is equal to so we also have .
Hence we conclude that .
To prove the second part of the statement (when is equal to or ), just notice that in suchpoints we have only one of the two estimates written above.