It belongs to the mathematical field of real analysis and is named after French mathematician Pierre de Fermat.
By using Fermat's theorem, the potential extrema of a function
The function's second derivative, if it exists, can sometimes be used to determine whether a stationary point is a maximum or minimum.
Pierre de Fermat proposed in a collection of treatises titled Maxima et minima a method to find maximum or minimum, similar to the modern Fermat's theorem, albeit with the use of infinitesimals rather than derivatives.
[1]: 456–457 [2]: 2 After Marin Mersenne passed the treatises onto René Descartes, Descartes was doubtful, remarking "if [...] he speaks of wanting to send you still more papers, I beg of you to ask him to think them out more carefully than those preceding".
[2]: 8 One way to state Fermat's theorem is that, if a function has a local extremum at some point and is differentiable there, then the function's derivative at that point must be zero.
In precise mathematical language: Another way to understand the theorem is via the contrapositive statement: if the derivative of a function at any point is not zero, then there is not a local extremum at that point.
is a global extremum of f, then one of the following is true:[2]: 1 In higher dimensions, exactly the same statement holds; however, the proof is slightly more complicated.
[4][better source needed] Fermat's theorem is central to the calculus method of determining maxima and minima: in one dimension, one can find extrema by simply computing the stationary points (by computing the zeros of the derivative), the non-differentiable points, and the boundary points, and then investigating this set to determine the extrema.
In both cases, it cannot attain a maximum or minimum, because its value is changing.
It can only attain a maximum or minimum if it "stops" – if the derivative vanishes (or if it is not differentiable, or if one runs into the boundary and cannot continue).
However, making "behaves like a linear function" precise requires careful analytic proof.
More precisely, the intuition can be stated as: if the derivative is positive, there is some point to the right of
Stated this way, the proof is just translating this into equations and verifying "how much greater or less".
The intuition is based on the behavior of polynomial functions.
is a local maximum then, roughly, there is a (possibly small) neighborhood of
The theorem (and its proof below) is more general than the intuition in that it does not require the function to be differentiable over a neighbourhood around
The schematic of the proof is: Formally, by the definition of derivative,
is not a local or global maximum or minimum of f. Suppose that
[5]: 182 A subtle misconception that is often held in the context of Fermat's theorem is to assume that it makes a stronger statement about local behavior than it does.
Notably, Fermat's theorem does not say that functions (monotonically) "increase up to" or "decrease down from" a local maximum.
This is very similar to the misconception that a limit means "monotonically getting closer to a point".
Then f is increasing on this interval, by the mean value theorem: the slope of any secant line is at least
However, in the general statement of Fermat's theorem, where one is only given that the derivative at
is a stationary point), one cannot in general conclude anything about the local behavior of f – it may increase to one side and decrease to the other (as in
), then one can treat f as locally close to a polynomial of degree k, since it behaves approximately as
but if the k-th derivative is not continuous, one cannot draw such conclusions, and it may behave rather differently.
then the extended function is continuous and everywhere differentiable (it is differentiable at 0 with derivative 0), but has rather unexpected behavior near 0: in any neighborhood of 0 it attains 0 infinitely many times, but also equals
, but on no neighborhood of 0 is it decreasing down to or increasing up from 0 – it oscillates wildly near 0.
This reflects the oscillation between increasing and decreasing values as it approaches 0.