In calculus, a derivative test uses the derivatives of a function to locate the critical points of a function and determine whether each point is a local maximum, a local minimum, or a saddle point. Derivative tests can also give information about the concavity of a function.
The usefulness of derivatives to find extrema is proved mathematically by Fermat's theorem of stationary points.
The first-derivative test examines a function's monotonic properties (where the function is increasing or decreasing), focusing on a particular point in its domain. If the function "switches" from increasing to decreasing at the point, then the function will achieve a highest value at that point. Similarly, if the function "switches" from decreasing to increasing at the point, then it will achieve a least value at that point. If the function fails to "switch" and remains increasing or remains decreasing, then no highest or least value is achieved.
One can examine a function's monotonicity without calculus. However, calculus is usually helpful because there are sufficient conditions that guarantee the monotonicity properties above, and these conditions apply to the vast majority of functions one would encounter.
Stated precisely, suppose that f is a real-valued function defined on some open interval containing the point x and suppose further that f is continuous at x.
In the last case, Taylor's Theorem may sometimes be used to determine the behavior of f near x using higher derivatives.
Suppose we have f ″ ( x ) > 0 {\displaystyle f''(x)>0} (the proof for f ″ ( x ) < 0 {\displaystyle f''(x)<0} is analogous). By assumption, f ′ ( x ) = 0 {\displaystyle f'(x)=0} . Then
0 < f ″ ( x ) = lim h → 0 f ′ ( x + h ) − f ′ ( x ) h = lim h → 0 f ′ ( x + h ) h . {\displaystyle 0<f''(x)=\lim _{h\to 0}{\frac {f'(x+h)-f'(x)}{h}}=\lim _{h\to 0}{\frac {f'(x+h)}{h}}.}Thus, for h sufficiently small we get
f ′ ( x + h ) h > 0 , {\displaystyle {\frac {f'(x+h)}{h}}>0,}which means that f ′ ( x + h ) < 0 {\displaystyle f'(x+h)<0} if h < 0 {\displaystyle h<0} (intuitively, f is decreasing as it approaches x {\displaystyle x} from the left), and that f ′ ( x + h ) > 0 {\displaystyle f'(x+h)>0} if h > 0 {\displaystyle h>0} (intuitively, f is increasing as we go right from x). Now, by the first-derivative test, f {\displaystyle f} has a local minimum at x {\displaystyle x} .
A related but distinct use of second derivatives is to determine whether a function is concave up or concave down at a point. It does not, however, provide information about inflection points. Specifically, a twice-differentiable function f is concave up if f ″ ( x ) > 0 {\displaystyle f''(x)>0} and concave down if f ″ ( x ) < 0 {\displaystyle f''(x)<0} . Note that if f ( x ) = x 4 {\displaystyle f(x)=x^{4}} , then x = 0 {\displaystyle x=0} has zero second derivative, yet is not an inflection point, so the second derivative alone does not give enough information to determine whether a given point is an inflection point.
The higher-order derivative test or general derivative test is able to determine whether a function's critical points are maxima, minima, or points of inflection for a wider variety of functions than the second-order derivative test. As shown below, the second-derivative test is mathematically identical to the special case of n = 1 in the higher-order derivative test.
Let f be a real-valued, sufficiently differentiable function on an interval I ⊂ R {\displaystyle I\subset \mathbb {R} } , let c ∈ I {\displaystyle c\in I} , and let n ≥ 1 {\displaystyle n\geq 1} be a natural number. Also let all the derivatives of f at c be zero up to and including the n-th derivative, but with the (n + 1)th derivative being non-zero:
f ′ ( c ) = ⋯ = f ( n ) ( c ) = 0 and f ( n + 1 ) ( c ) ≠ 0. {\displaystyle f'(c)=\cdots =f^{(n)}(c)=0\quad {\text{and}}\quad f^{(n+1)}(c)\neq 0.}There are four possibilities, the first two cases where c is an extremum, the second two where c is a (local) saddle point:
Since n must be either odd or even, this analytical test classifies any stationary point of f, so long as a nonzero derivative shows up eventually.
Say we want to perform the general derivative test on the function f ( x ) = x 6 + 5 {\displaystyle f(x)=x^{6}+5} at the point x = 0 {\displaystyle x=0} . To do this, we calculate the derivatives of the function and then evaluate them at the point of interest until the result is nonzero.
f ′ ( x ) = 6 x 5 {\displaystyle f'(x)=6x^{5}} , f ′ ( 0 ) = 0 ; {\displaystyle f'(0)=0;} f ″ ( x ) = 30 x 4 {\displaystyle f''(x)=30x^{4}} , f ″ ( 0 ) = 0 ; {\displaystyle f''(0)=0;} f ( 3 ) ( x ) = 120 x 3 {\displaystyle f^{(3)}(x)=120x^{3}} , f ( 3 ) ( 0 ) = 0 ; {\displaystyle f^{(3)}(0)=0;} f ( 4 ) ( x ) = 360 x 2 {\displaystyle f^{(4)}(x)=360x^{2}} , f ( 4 ) ( 0 ) = 0 ; {\displaystyle f^{(4)}(0)=0;} f ( 5 ) ( x ) = 720 x {\displaystyle f^{(5)}(x)=720x} , f ( 5 ) ( 0 ) = 0 ; {\displaystyle f^{(5)}(0)=0;} f ( 6 ) ( x ) = 720 {\displaystyle f^{(6)}(x)=720} , f ( 6 ) ( 0 ) = 720. {\displaystyle f^{(6)}(0)=720.}As shown above, at the point x = 0 {\displaystyle x=0} , the function x 6 + 5 {\displaystyle x^{6}+5} has all of its derivatives at 0 equal to 0, except for the 6th derivative, which is positive. Thus n = 5, and by the test, there is a local minimum at 0.
For a function of more than one variable, the second-derivative test generalizes to a test based on the eigenvalues of the function's Hessian matrix at the critical point. In particular, assuming that all second-order partial derivatives of f are continuous on a neighbourhood of a critical point x, then if the eigenvalues of the Hessian at x are all positive, then x is a local minimum. If the eigenvalues are all negative, then x is a local maximum, and if some are positive and some negative, then the point is a saddle point. If the Hessian matrix is singular, then the second-derivative test is inconclusive.