Use the second derivative test
A stationary point of a function \(f\) is an input \(c\) where \(f'(c)=0\), so the tangent line at \(\big(c,f(c)\big)\) is horizontal. Where \(f'\) exists, a local maximum or minimum of \(f\) occurs only at a stationary point (topic 5.2), but not every stationary point is one. Topic 5.4 classifies a stationary point as a local maximum, a local minimum or neither from the signs of \(f'\) on its two sides.
This topic classifies it from one number, the second derivative \(\cy{f''(c)}\), and shows what to do when that number gives no answer.
Why the sign of the second derivative decides
Two graphs on the same x-scale. The upper graph is a curve f that rises to a peak, falls to a valley and rises again, green where it rises and red where it falls. The lower graph is its derivative f′, which is positive, falls through 0 at the input of the peak, reaches a lowest value, and rises through 0 at the input of the valley; it is red where it falls and green where it rises. An orange point on f carries its orange tangent line, an orange bar on the lower graph reaches f′ at the same x, and an orange line touches the lower graph there. The point starts at the bottom of the valley, at the input c: the tangent on f is horizontal, the bar has no height, and the tangent on the lower graph slopes up, labeled f″(c) > 0. At the peak, the tangent on the lower graph slopes down, labeled f″(c) < 0. A button flattens the valley: the lower graph then crosses 0 at c with a horizontal tangent, labeled f″(c) = 0, but it is still below the axis to the left of c and above it to the right.
The graph of \(f\) in Figure 1 rises to a peak, falls to a valley and rises again. The orange bar on the lower graph reaches \(\cy{f'(x)}\), the slope of the orange tangent line on \(f\). A faint dashed line marks the same \(x\) on both graphs. The orange line on the lower graph is tangent to the graph of \(f'\), so its slope is \(\cy{f''(x)}\) (topic 3.6).
The point starts at the bottom of the valley, at the input \(c\). The tangent line on \(f\) is horizontal and the bar has no height, because \(f'(c)=0\). The tangent line on the lower graph slopes up, so \(f''(c)>0\). Drag the point across \(c\). Near \(c\), the bar lies below the axis on the left and above it on the right.
The same holds at every stationary point where \(f''(c)\) is positive. The second derivative is the derivative of \(f'\), and \(f'(c)=0\), so
Suppose that \(f''(c)>0\). A quotient that approaches a positive number is positive for every \(h\neq 0\) close enough to 0, because its values are then close to that number. For such \(h\), \(f'(c+h)\) and \(h\) have the same sign, because their quotient is positive. The derivative \(f'\) is therefore negative close to \(c\) on the left, where \(h<0\), and positive close to \(c\) on the right, where \(h>0\).
The function \(f\) is continuous at \(c\), because it is differentiable there. By the First Derivative Test (topic 5.4), a change in the sign of \(f'\) from negative to positive gives \(f\) a local minimum at \(c\). If \(f''(c)<0\), the same steps with the signs reversed show that \(f'\) changes from positive to negative, so \(f\) has a local maximum at \(c\). Move the point to the peak. Its input is now labeled \(c\), and the tangent line on the lower graph slopes down, so \(f''(c)<0\).
This result is the Second Derivative Test. If \(f''\) is also continuous at \(c\), then \(f''\) keeps the sign of \(f''(c)\) on an interval around \(c\), by the same reasoning. If \(f''(c)>0\), the graph is concave up on that interval and lies above its tangent lines (topic 5.6). It therefore lies above the horizontal tangent line at \(c\), so \(f\) has a local minimum there. If \(f''(c)<0\), the graph is concave down and lies below that line, so \(f\) has a local maximum there.
The argument needs \(f''(c)\neq 0\). Use the button under Figure 1 to flatten the valley. The point returns to the valley, and \(c\) labels its input again. The tangent line on the lower graph now lies along the axis, so \(f''(c)=0\). As the point crosses \(c\), the bar still changes from below the axis to above it, so \(f\) still has a local minimum there. A second derivative of 0 does not show that there is no extremum.
When the test gives no answer
If \(f''(c)=0\), the quotient \(f'(c+h)/h\) approaches 0, so its limit no longer fixes the sign of \(f'(c+h)\), and every outcome can occur. The functions \(x^4\), \(-x^4\) and \(x^3\) all have first and second derivatives equal to 0 at \(x=0\). Yet \(x^4\) has a local minimum there, because \(x^4>0\) for every \(x\neq 0\), and \(-x^4\) has a local maximum. The function \(x^3\) has neither, because it is negative to the left of 0 and positive to the right.
The test also gives no conclusion when \(f''(c)\) does not exist. For \(f(x)=x^{4/3}\), the derivative \(f'(x)=\tfrac43x^{1/3}\) is 0 at \(x=0\), but the graph of \(f'\) has a vertical tangent there, so \(f''(0)\) does not exist. In both cases, use the First Derivative Test, which reads the sign of \(f'\) on each side of \(c\). For \(x^{4/3}\), the signs are negative and then positive, so \(f\) has a local minimum at 0.
Before you use the test, check that \(f'(c)=0\). If \(f'(c)\) exists but is not 0, Fermat's Theorem (topic 5.2) shows that \(f\) has no local extremum at \(c\), whatever the sign of \(f''(c)\). A positive \(f''(c)\) at such a point means only that the slope of \(f\) increases there. If \(f'(c)\) does not exist, as at a corner, then \(f''(c)\) does not exist either, so use the First Derivative Test.
Example 1
Check that the point is stationary
The function \(f\) is twice differentiable for all \(x\). The table gives the values of \(f'\) and \(f''\) at four inputs. At which of these inputs does \(f\) have a local maximum or a local minimum? \[\begin{array}{c|cccc} x & 1 & 3 & 5 & 7\\ \hline f'(x) & 0 & -4 & 0 & 6\\ f''(x) & -10 & 8 & 9 & -2\end{array}\]
Solution
The Second Derivative Test applies only at a stationary point, so read the row of \(f'\) first. Since \(f'(1)=0\) and \(f'(5)=0\), the inputs 1 and 5 are stationary points.
At \(x=3\) and \(x=7\), \(f'\) exists and is not 0, so \(f\) has no local extremum at either input (topic 5.2). The signs of \(f''(3)\) and \(f''(7)\) cannot change this.
Because \(f'(1)=0\) and \(f''(1)=-10<0\), \(f\) has a local maximum at \(x=1\). Because \(f'(5)=0\) and \(f''(5)=9>0\), \(f\) has a local minimum at \(x=5\).
Example 2
Evaluate the second derivative
A function \(f\) has derivative \(f'(x)=\left(x^2-9\right)e^{-x}\). Find the value of \(f''\) at each stationary point of \(f\).
Solution
The factor \(e^{-x}\) is positive for every \(x\), so \(f'(x)=0\) only where \(x^2-9=0\). The stationary points are \(x=-3\) and \(x=3\).
Both factors of \(f'\) are differentiable, so \(f''\) exists for every \(x\). Differentiate \(f'\) while \(x\) is still a variable. The chain rule gives \(-e^{-x}\) as the derivative of \(e^{-x}\), so the product rule gives
Then substitute each stationary point:
Example 3
Classify a positive or negative result
Let \(f(x)=x+2\cos x\) for \(0<x<2\pi\). Use the Second Derivative Test to classify each stationary point of \(f\) as a local maximum or a local minimum.
Solution
The function \(f\) has a first and a second derivative at every \(x\). Its stationary points are the solutions of
so \(\sin x=\tfrac12\). In the interval \(0<x<2\pi\), this happens at \(x=\frac{\pi}{6}\) and at \(x=\frac{5\pi}{6}\). The second derivative is \(f''(x)=-2\cos x\), so
The second derivative is negative at \(\frac{\pi}{6}\) and positive at \(\frac{5\pi}{6}\), so \(f\) has a local maximum at \(x=\frac{\pi}{6}\) and a local minimum at \(x=\frac{5\pi}{6}\).
Example 4
Handle an inconclusive result
Let \(f(x)=x^5-5x^4\). Find the \(x\)-coordinate of each local extremum of \(f\), and classify each one.
Solution
The function is a polynomial, so \(f'\) and \(f''\) exist everywhere, and its local extrema lie at zeros of
The derivative is 0 at \(x=0\) and at \(x=4\). The second derivative is
At \(x=4\), \(f''(4)=20\cdot 16\cdot 1=320>0\), so \(f\) has a local minimum there. At \(x=0\), \(f''(0)=0\), so the test gives no conclusion.
Use the signs of \(f'\) near 0 instead. For \(x<0\), both \(x^3\) and \(x-4\) are negative, so \(f'(x)>0\). For \(0<x<4\), \(x^3>0\) and \(x-4<0\), so \(f'(x)<0\). The sign of \(f'\) changes from positive to negative at 0, so by the First Derivative Test \(f\) has a local maximum at \(x=0\).
In all, \(f\) has a local maximum at \(x=0\) and a local minimum at \(x=4\).
Each example is one of the four skills of topic 5.7 in Which & Why: AP Calculus.