Finding extreme values of a single variable function
If a function is continuous, its rate of change is non-constant and there are intervals in which it's crescent and others where it's decrescent, a natural conclusion is to expect the rate of change to be zero somewhere. [math]\displaystyle{ f'(x) = 0 }[/math] is a necessary but insufficient condition for a point to be a local maximum or minimum. It's insufficient because there are points where [math]\displaystyle{ f'(x) = 0 }[/math] and yet that point is neither a maximum nor a minimum. The same concept applies to multivariable functions. A point can have a necessary property to be a critical point and yet fail to meet other necessary criteria to be a maximum or a minimum.
Take the function [math]\displaystyle{ f(x) = x^3 }[/math] for example. At the origin its rate of change inverts its sign, but this function is strictly crescent and doesn't have a local maximum or minimum anywhere.
Fermat's stationary points
If [math]\displaystyle{ f }[/math] is differentiable at [math]\displaystyle{ c }[/math] and [math]\displaystyle{ c \in D_f }[/math] in an open interval. A requisite for that point to be a local maximum or minimum is [math]\displaystyle{ f'(c) = 0 }[/math].
We begin with the hypothesis that [math]\displaystyle{ c }[/math] is a local maximum. Now let's consider a small step to the right and to the left of that point and call the step [math]\displaystyle{ s }[/math]:
[math]\displaystyle{ f(c) \geq f(x + s) }[/math] (with our starting assumption every step that we take to the right or to the left, from the local maximum, results in going down)
Therefore:
[math]\displaystyle{ f(x + s) - f(c) \leq 0 }[/math] (added [math]\displaystyle{ -f(c) }[/math] to both sides. Note that the inequality wasn't inverted.)
We can divide both sides by a positive constant without affecting the inequality:
[math]\displaystyle{ \frac{f(x + s) - f(c)}{s} \leq \frac{0}{s} }[/math]
We are assuming that [math]\displaystyle{ f }[/math] is differentiable at [math]\displaystyle{ c }[/math], therefore the sided limits exist and are equal to each other:
[math]\displaystyle{ f'(c) = \lim_{s \ \to \ 0^{+}} \frac{f(x + s) - f(c)}{s} \leq 0 }[/math]
With that we have shown that [math]\displaystyle{ f'(c) \leq 0 }[/math].
If we consider [math]\displaystyle{ s \lt 0 }[/math] the previous inequality inverts to being greater than or equal to zero. We calculate the same limit, but from the left [math]\displaystyle{ h \to 0^{-} }[/math]. With that we prove that [math]\displaystyle{ f'(c) \geq 0 }[/math]. With both inequalities being true we conclude that [math]\displaystyle{ f'(c) = 0 }[/math]. It makes perfect sense if we think graphically. To the right and to the left of [math]\displaystyle{ f'(c) }[/math] the derivatives have opposite signs. When the take the sided limits, both converge to the same, horizontal, tangent line.
The same reasoning follows to prove that a local minimum also has [math]\displaystyle{ f'(c) = 0 }[/math].
Note: I have a textbook that does the proof by applying the sign conservation theorem, which condenses the proof by not having to deal with positive and negative increments separately.
Careful! Fermat's theorem of stationary points is not about global maximum or minimum. Take the function [math]\displaystyle{ f(x) = |x| }[/math] for example. At the origin it does have a global minimum, but it's not differentiable there.
Links for the proofs:
- https://en.wikipedia.org/wiki/Fermat%27s_theorem_(stationary_points)
- https://demonstrations.wolfram.com/FermatsTheoremOnStationaryPoints/
- https://www.technologyuk.net/mathematics/differential-calculus/fermats-theorem.shtml
- https://planetmath.org/proofoffermatstheoremstationarypoints
The second derivative test
The graphical idea is the application of [math]\displaystyle{ f'(c) = 0 }[/math] to the derivative of the derivative. With the derivative we know, in a certain interval, whether a function is increasing or decreasing. With the second derivative we do the same, but for the derivative itself. The easiest way to explain this is by using the graph of a cubic and its derivative and second derivative:
[math]\displaystyle{ ]-\infty, \ a[ }[/math] we have that [math]\displaystyle{ f }[/math] is crescent, [math]\displaystyle{ f' }[/math] is decrescent and [math]\displaystyle{ f'' }[/math] is crescent and always negative. [math]\displaystyle{ f'(a) = 0 }[/math] and [math]\displaystyle{ f''(a) \lt 0 }[/math]. [math]\displaystyle{ a }[/math] is a local maximum.
[math]\displaystyle{ ]b, \ +\infty[ }[/math] we have that [math]\displaystyle{ f }[/math] is crescent, [math]\displaystyle{ f' }[/math] is crescent and [math]\displaystyle{ f'' }[/math] is crescent and always positive. [math]\displaystyle{ f'(b) = 0 }[/math] and [math]\displaystyle{ f''(b) \gt 0 }[/math]. [math]\displaystyle{ b }[/math] is a local minimum.
Theoretically we can have a function that can be derived to the nth order, but for most purposes we lose meaningful interpretations beyond the second or third orders.
Careful! The sign of the function at a point is one thing. The rate of change being positive or negative is another thing. Notice that at [math]\displaystyle{ x = a }[/math] and [math]\displaystyle{ x = b }[/math], [math]\displaystyle{ f''(x) \neq 0 }[/math].
If [math]\displaystyle{ f }[/math] admits a second order derivative and the derivative is continuous in an open interval [math]\displaystyle{ I }[/math]. Then, with [math]\displaystyle{ c \in I }[/math] we can state that:
If [math]\displaystyle{ f'(c) = 0 }[/math] and [math]\displaystyle{ f''(c) \gt 0 }[/math]. Then we have a local minimum.
If [math]\displaystyle{ f'(c) = 0 }[/math] and [math]\displaystyle{ f''(c) \lt 0 }[/math]. Then we have a local maximum.
The formal proof is often left for a course in analysis. Nonetheless I have a textbook that uses the Sign Conservation Theorem to prove the second derivative test using calculus. Looking back, the second derivative test is about knowing whether [math]\displaystyle{ f'' }[/math] is positive or negative around the point where [math]\displaystyle{ f'(x) = 0 }[/math]. What the sign conservation theorem states is that if we consider an open interval around the point of a function, taking one step forwards or backwards should keep the sign of that point. Consider the number 1, if we take a small increment forwards or backwards, we are still on the positive side of the number line. If we consider the number -1, taking a small increment to the left or to the right should remain a negative number. Now consider the number 0. Any step to the right and we have a positive number. Any step to the left and we have a negative number. And there are two more possibilities, both steps go down or both go up if the function is, respectively, decreasing or increasing. That's why [math]\displaystyle{ f''(x) = 0 }[/math] does not guarantee that we have either a local maximum or a minimum.
In case the above explanation wasn't clear, try this: in the graph above we have a cubic function and the parabola's vertex is located below the [math]\displaystyle{ x }[/math] axis. That point could had been located above or over the [math]\displaystyle{ x }[/math] axis. This is why [math]\displaystyle{ f''(x) }[/math] does not guarantee that that point is a maximum or a minimum.
For multivariable functions it's more complicated because with two and more coordinates to consider we have to use concepts from vectors and linear algebra to study the behaviour of functions.
Links for the proofs:
- https://second.wiki/wiki/teorema_de_la_conservacic3b3n_del_signo
- https://www.khanacademy.org/math/multivariable-calculus/applications-of-multivariable-derivatives/optimizing-multivariable-functions/a/reasoning-behind-the-second-partial-derivative-test
- https://tutorial.math.lamar.edu/classes/calci/DerivativeAppsProofs.aspx
- https://en.wikipedia.org/wiki/Derivative_test