Explainer: Second Derivative Test for Local Extrema

In this explainer, we will learn how to classify local extrema using the second derivative test.

Finding local maxima and minima is essential for solving many problems in mathematics and physics. For example, light travels along the path that minimizes the total time, and the equilibrium position of many systems is the position of minimal energy. Examples such as these lead mathematicians and physicists to develop a rich theory and many techniques for finding maxima and minima. In this explainer, we will focus on one particular technique for classifying stationary points as maxima or minima by using the second derivative.

Let us begin by recalling the definitions of local extrema and stationary points.

Definition: Local Extrema

A function 𝑓 has a local maximum at 𝑐 if 𝑓(𝑐)β‰₯𝑓(π‘₯) for all π‘₯ near 𝑐. When we say near 𝑐, to be precise, we mean that there exists some open interval 𝐼 around 𝑐 on which 𝑓(𝑐)β‰₯𝑓(π‘₯) for all π‘₯∈𝐼. Similarly, 𝑓 has a local minimum at 𝑐 if 𝑓(𝑐)≀𝑓(π‘₯) for all π‘₯ near 𝑐.

Stationary Points

A stationary point of a differentiable function 𝑓 is a point on the graph of 𝑓 where the derivative is zero. That is, when 𝑓(π‘₯)=0, we say that 𝑓 has a stationary point at π‘₯.

An important theorem in calculus links local extrema to stationary points; it is called Fermat’s theorem. It states the following.

Fermat’s Theorem

If 𝑓 has a local maximum or minimum at a point π‘₯ and 𝑓(π‘₯) exists, then 𝑓 has a stationary point at π‘₯; that is, 𝑓(π‘₯)=0.

Recall that the converse statement to Fermat’s theorem is not true; it is possible to have a stationary point which is not a maximum or a minimum.

In this explainer, we will consider how we can use the second derivative to classify stationary points as maxima or minima.

The second derivative tells us about the rate of change of the slope of a curve. Therefore, let us consider how the slop of a curve changes around a stationary point. We begin by considering a local minimum. To the left of a local minimum, the derivative is negative; at the local minimum, the derivative is zero; and on the right of the local minimum, the derivative is positive.

This tells us that around a local minimum the derivative is increasing. Given that the derivative of a function can be considered as a function, we can use the properties of the derivative to make conclusions about its behavior. In particular, recall that if a given function has a positive derivative, then it is increasing. Therefore, if the derivative of the derivativeβ€”which we call the second derivativeβ€”is positive, we can conclude that the derivative is increasing and consequently that we have a local minimum. Using this method to classify stationary points is called the second derivative test.

We can similarly consider how the derivative changes around a local maximum. To the left of a local maximum, the derivative is positive; at the local maximum, the derivative is zero; and on the right of the local maximum, the derivative is negative.

Therefore, using a similar argument, we can conclude that if the second derivative is negative, the stationary point is a local maximum.

Interestingly, if the second derivative is zero, then we cannot conclude anything about the nature of the stationary point. For example, consider the functions 𝑓(π‘₯)=π‘₯ and 𝑔(π‘₯)=π‘₯οŠͺ; both have a stationary point at π‘₯=0 and both their second derivatives at this point are zero. However, 𝑓’s stationary point is a point of inflection, whereas 𝑔’s is a minimum.

In summary, we can state the second derivative test for local extrema.

Second Derivative Test for Local Extrema

Given a differentiable function 𝑓 with a stationary point at π‘₯,

  • if 𝑓(π‘₯)>0οŽ™οŠ¦, the point is a local minimum;
  • if 𝑓(π‘₯)<0οŽ™οŠ¦, the point is a local maximum.

If 𝑓(π‘₯)=0οŽ™οŠ¦, the second derivative test is inconclusive; the point could be a local maximum, a local minimum, or a point of inflection. In such cases, it will be necessary to consider points in the neighborhood of π‘₯ to classify the stationary point.

We will now consider a number of examples where we apply the second derivative test to classify extrema.

Example 1: Finding Local Maxima and Minima

Find, if any, the point (π‘₯,𝑦) where 𝑦=βˆ’π‘₯+4π‘₯βˆ’6 has a local maximum or local minimum.

Answer

Given that the function is differentiable, we can use the second derivative test which states that if dd𝑦π‘₯=0 and ddοŠ¨οŠ¨π‘¦π‘₯<0 at some π‘₯, then the function has a local maximum value at π‘₯, whereas if dd𝑦π‘₯=0 and ddοŠ¨οŠ¨π‘¦π‘₯>0, then it has a local minimum value at π‘₯. We, therefore, begin by calculating the derivative of the function 𝑦=βˆ’π‘₯+4π‘₯βˆ’6. Since we have a polynomial, we can use the power rule to differentiate each term to get dd𝑦π‘₯=βˆ’2π‘₯+4.

We can find the stationary points of the function by solving dd𝑦π‘₯=0 for π‘₯ as follows: 0=βˆ’2π‘₯+4.

Adding 2π‘₯ to both sides of the equation, we have 2π‘₯=4π‘₯=2.

We can now find the second derivative of the function ddοŠ¨οŠ¨π‘¦π‘₯=βˆ’2.

Since ddοŠ¨οŠ¨π‘¦π‘₯ is negative for all π‘₯, it is also negative at π‘₯=2. Therefore, the function 𝑦=βˆ’π‘₯+4π‘₯βˆ’6 has a local maximum at π‘₯=2.

We can now substitute π‘₯=2 into the equation 𝑦=βˆ’π‘₯+4π‘₯βˆ’6 to find the maximum value: 𝑦=βˆ’(2)+4(2)βˆ’6=βˆ’4+8βˆ’6=βˆ’2.

Thus, the function 𝑦=βˆ’π‘₯+4π‘₯βˆ’6 has a maximum at (2,βˆ’2).

It is often worth sanity-checking our answer using our general mathematical knowledge. For example, the function we were given is a quadratic function with a negative π‘₯ coefficient; therefore, we would expect the function to have a single maximal value which is what we found.

Example 2: Using the Second Derivative Test

Find, if any, the points (π‘₯,𝑦) where 𝑦=π‘₯+3π‘₯βˆ’16 has a local maximum or local minimum.

Answer

Given that the function is differentiable, we can use the second derivative test which states that if dd𝑦π‘₯=0 and ddοŠ¨οŠ¨π‘¦π‘₯<0 at some π‘₯, then the function has a local maximum value at π‘₯, whereas if dd𝑦π‘₯=0 and ddοŠ¨οŠ¨π‘¦π‘₯>0, then it has a local minimum value at π‘₯. We, therefore, begin by calculating the first and second derivatives of the function 𝑦=π‘₯+3π‘₯βˆ’16. Since we have a polynomial, we can use the power rule to differentiate each term to get dd𝑦π‘₯=3π‘₯+6π‘₯.

Differentiating again, we have ddοŠ¨οŠ¨π‘¦π‘₯=6π‘₯+6.

We can find the stationary points of the function by setting dd𝑦π‘₯=0 and solving for π‘₯ as follows: 3π‘₯+6π‘₯=0; by factoring, we get 3π‘₯(π‘₯+2)=0.

Hence, the function has stationary points at π‘₯=0 and π‘₯=βˆ’2. We can now evaluate the second derivative at each point to determine the nature of the stationary point. Beginning with π‘₯=0, we substitute this value into the equation for the second derivative as follows: ddοŠ¨οŠ¨π‘¦π‘₯=6(0)+6=6.

Since ddοŠ¨οŠ¨π‘¦π‘₯>0 at π‘₯=0, we have a local minimum at π‘₯=0. We can now find the value of the function at this point by substituting π‘₯=0 into the expression for 𝑦 as follows: 𝑦=(0)+3(0)βˆ’16=βˆ’16.

Hence, at (0,βˆ’16), the function has a local minimum.

Similarly, for π‘₯=βˆ’2, we can find the value of ddοŠ¨οŠ¨π‘¦π‘₯ at this point by substituting π‘₯=βˆ’2 into the expression for the second derivative as follows: ddοŠ¨οŠ¨π‘¦π‘₯=6(βˆ’2)+6=βˆ’6.

Since ddοŠ¨οŠ¨π‘¦π‘₯<0 at π‘₯=βˆ’2, we have a local maximum at π‘₯=βˆ’2. We can now find the value of the function at this point by substituting π‘₯=βˆ’2 into the expression for 𝑦 as follows: 𝑦=(βˆ’2)+3(βˆ’2)βˆ’16=βˆ’8+12βˆ’16=βˆ’12.

Thus, the function 𝑦=π‘₯+3π‘₯βˆ’16 has a local minimum at (0,βˆ’16) and a local maximum at (βˆ’2,βˆ’12).

We can apply our mathematical intuition to sanity-check our answer. The function we were given is a cubic with a positive π‘₯ coefficient. We would, therefore, expect the function to either have a single inflection point or two turning points: one being maximal and the other minimal. This is exactly what we found. Moreover, given the positive coefficient of π‘₯, we would expect the local maximum to occur at a point to the left of the local minimum. Once again, this is correctly reflected in our answer.

We will now consider an example where the second derivative test is inconclusive.

Example 3: Classifying Stationary Points

Find the local maxima/minima of the function 𝑓(π‘₯)=3π‘₯βˆ’2π‘₯οŠͺ.

Answer

Given that the function is differentiable, we can use the second derivative test which states that if, for some π‘₯, 𝑓(π‘₯)=0 and 𝑓(π‘₯)<0οŽ™οŠ¦, then the function has a local maximum value at π‘₯, whereas if 𝑓(π‘₯)=0 and 𝑓(π‘₯)>0οŽ™οŠ¦, then it has a local minimum value at π‘₯.

We begin by finding the first and second derivatives of 𝑓. Since 𝑓 is a polynomial function, we can use the power rule to differentiate each term as follows: 𝑓(π‘₯)=12π‘₯βˆ’6π‘₯.

Differentiating again, we have 𝑓(π‘₯)=36π‘₯βˆ’12π‘₯=12π‘₯(3π‘₯βˆ’1).οŽ™οŠ¨

To find the stationary points of 𝑓, we set 𝑓(π‘₯)=0 and solve for π‘₯: 12π‘₯βˆ’6π‘₯=0.

Factoring out 6π‘₯, we have 6π‘₯(2π‘₯βˆ’1)=0.

Hence, 𝑓 has stationary points when π‘₯=0 or π‘₯=12. We will not try to apply the second derivative test by evaluating the second derivative at the points π‘₯=0 and π‘₯=12. Beginning with π‘₯=0, substituting this into the equation for the second derivative, we find that 𝑓(0)=12(0)(3(0)βˆ’1)=0.οŽ™

In this case, the second derivative test is inconclusive and we need to consider the value of 𝑓(π‘₯) in the immediate neighborhood of π‘₯=0. Writing 𝑓(π‘₯) in factored form, we have 𝑓(π‘₯)=6π‘₯(2π‘₯βˆ’1).

Since 6π‘₯>0 for all π‘₯β‰ 0, the sign of π‘“οŽ˜ around zero is completely determined by 2π‘₯βˆ’1. This is negative for all π‘₯<12, 𝑓(π‘₯)<0 for all π‘₯β‰ 0. Therefore, the stationary point is an inflection point.

We now consider the point π‘₯=12. Substituting this value into the expression for the second derivative, we have 𝑓12=12ο€Ό12οˆο€Ό3ο€Ό12οˆβˆ’1=6ο€Ό32βˆ’1=6ο€Ό12=3.οŽ™

Since 𝑓12>0οŽ™, the function 𝑓(π‘₯)=3π‘₯βˆ’2π‘₯οŠͺ has a local minimum at π‘₯=12. Finally, we can find the minimum value by substituting π‘₯=12 into the expression for 𝑓(π‘₯) as follows: 𝑓12=3ο€Ό12οˆβˆ’2ο€Ό12=3ο€Ό116οˆβˆ’2ο€Ό18=316βˆ’28=βˆ’116.οŠͺ

Thus, ο€Ό12,βˆ’116 is a local minimum of the function 𝑓(π‘₯)=3π‘₯βˆ’2π‘₯οŠͺ.

In a plot of the function, we can see both the inflection point and the minimum.

Example 4: Using the Second Derivative Test with Radical Functions

Find the local maximum and minimum values of 𝑓(π‘₯)=2√π‘₯βˆ’4√π‘₯.

Answer

Given that we have a radical function with even roots, the function is only defined for π‘₯β‰₯0. If we restrict the domain of the function to π‘₯>0, we have a differentiable function, so we can apply the second derivative test. Given a differentiable function 𝑓 with a stationary point at π‘₯,

  • if 𝑓(π‘₯)>0οŽ™οŠ¦, the point is a local minimum;
  • if 𝑓(π‘₯)<0οŽ™οŠ¦, the point is a local maximum.

We begin by finding the first and second derivatives of the function. Since we have radical functions, we can apply the power rule. We start by rewriting the radicals in terms of exponents as follows: 𝑓(π‘₯)=2π‘₯βˆ’4π‘₯.

We can now apply the power rule to differentiate each term: 𝑓(π‘₯)=π‘₯βˆ’π‘₯.

Differentiating again, we have 𝑓(π‘₯)=βˆ’12π‘₯+34π‘₯.οŽ™οŠ±οŠ±οŽ’οŽ‘οŽ¦οŽ£

We can now find the stationary points of the function by setting the first derivative equal to zero and solving for π‘₯ as follows: 0=π‘₯βˆ’π‘₯.

Multiplying through by π‘₯, we have 0=π‘₯βˆ’1.

Hence, √π‘₯=1.

Therefore, 𝑓 has a stationary point at π‘₯=1. We can now evaluate the second derivative at this point to determine the nature of the stationary point. Substituting π‘₯=1 into the expression for the second derivative, we have 𝑓(1)=βˆ’12(1)+34(1)=βˆ’12+34=14.οŽ™οŠ±οŠ±οŽ’οŽ‘οŽ¦οŽ£

Since 𝑓(1)>0οŽ™, 𝑓 has a local minimum at π‘₯=1. To find the minimum value, we substitute π‘₯=1 into the expression for 𝑓 as follows: 𝑓(1)=2√1βˆ’4√1=2βˆ’4=βˆ’2.

Therefore, the function 𝑓(π‘₯)=2√π‘₯βˆ’4√π‘₯ has a local minimum at (1,βˆ’2).

In a plot of the function, we can clearly see the minimum.

Example 5: Using the Second Derivative Test to Find Maxima and Minima

Find, if any, the local maximum and local minimum values of 𝑦=7π‘₯+7π‘₯.

Answer

Since the function 𝑦=7π‘₯+7π‘₯ is differentiable for all π‘₯β‰ 0, we can apply the second derivative test. Recall that the second derivative test states that, given a differentiable function with a stationary point at π‘₯,

  • if ddοŠ¨οŠ¨π‘¦π‘₯<0, the point is a local minimum;
  • if ddοŠ¨οŠ¨π‘¦π‘₯>0, the point is a local maximum.

We begin by finding the first and second derivatives of the functions. Using the power rule to differentiate each term, we have dd𝑦π‘₯=7βˆ’7π‘₯.

Differentiating again, we have ddοŠ¨οŠ¨οŠ©π‘¦π‘₯=14π‘₯.

We now find the stationary points of the function by setting dd𝑦π‘₯=0 and solving for π‘₯ as follows: 0=7βˆ’7π‘₯.

Multiplying the equation through by π‘₯ and dividing by 7, we have 0=π‘₯βˆ’1.

Hence, the function has stationary points at π‘₯=1 and π‘₯=βˆ’1.

Beginning with π‘₯=1, we substitute this into the equation for the second derivative to find ddοŠ¨οŠ¨οŠ©π‘¦π‘₯=141=14.

Since ddοŠ¨οŠ¨π‘¦π‘₯>0, the function 𝑦=7π‘₯+7π‘₯ has a local minimum at π‘₯=1. We can now find the value of this local minimum by substituting π‘₯=1 into the equation 𝑦=7π‘₯+7π‘₯: 𝑦=7(1)+71=14.

Hence, the function has a local minimum value of 14 at π‘₯=1.

We now consider the second stationary point. Substituting π‘₯=βˆ’1 into the equation for the second derivative, we have ddοŠ¨οŠ¨οŠ©π‘¦π‘₯=14(βˆ’1)=βˆ’14.

Since ddοŠ¨οŠ¨π‘¦π‘₯<0, the function 𝑦=7π‘₯+7π‘₯ has a local maximum at π‘₯=βˆ’1. Finally, we can find the value of this local maximum by substituting π‘₯=βˆ’1 into the equation 𝑦=7π‘₯+7π‘₯ to get 𝑦=7(βˆ’1)+7βˆ’1=βˆ’14.

Thus, the function 𝑦=7π‘₯+7π‘₯ has a local maximum value of βˆ’14 at π‘₯=βˆ’1 and a local minimum value of 14 at π‘₯=1.

At first, it might seem strange that the value of the local maximum is less than the value of the local minimum. However, a plot of the graph demonstrates why this is the case.

Example 6: Using the Second Derivative Test to Find Maxima and Minima

Find the local maxima and local minima of 𝑓(π‘₯)=βˆ’5π‘₯3+2π‘₯βˆ’16π‘₯ln, if any.

Answer

Since lnπ‘₯ is only defined for positive π‘₯, the domain of our function is π‘₯>0. On this domain, the function is differentiable. Therefore, we can use the second derivative test to classify the stationary points. Recall the second derivative test: given a differentiable function 𝑓 with a stationary point at π‘₯,

  • if 𝑓(π‘₯)>0οŽ™οŠ¦, the point is a local minimum;
  • if 𝑓(π‘₯)<0οŽ™οŠ¦, the point is a local maximum.

We begin by finding the first and second derivatives of 𝑓. Recall that the derivative ddlnπ‘₯π‘₯=1π‘₯. Therefore, using the power rule for the other terms, we have 𝑓(π‘₯)=βˆ’103π‘₯+2βˆ’16π‘₯.

Differentiating again, we have 𝑓(π‘₯)=βˆ’103+16π‘₯.οŽ™οŠ¨

We now find the stationary points of 𝑓 by setting 𝑓(π‘₯)=0 and solving for π‘₯ as follows: 0=βˆ’103π‘₯+2βˆ’16π‘₯.

Multiplying through by βˆ’6π‘₯, we have 0=20π‘₯βˆ’12π‘₯+1.

This equation can be factored as follows: 0=(10π‘₯βˆ’1)(2π‘₯βˆ’1).

Therefore, 𝑓 has stationary points at π‘₯=110 and π‘₯=12. We can now consider the value of the second derivative at each of these points to determine whether they are maxima or minima. Beginning with π‘₯=110 and substituting this into the expression for the second derivative, we have 𝑓110=βˆ’103+16=βˆ’103+1006=403.οŽ™οŠ§οŠ§οŠ¦οŠ¨

Since 𝑓110>0οŽ™, the function has a local minimum at π‘₯=110. We can find the value of this minimum by substituting π‘₯=110 into the expression for 𝑓 as follows: 𝑓110=βˆ’53+2ο€Ό110οˆβˆ’16ο€Ό110=βˆ’5300+210βˆ’16ο€Ό110=1160βˆ’16ο€Ό110.lnlnln

Therefore, the function has a local minimum of 1160βˆ’16ο€Ό110ln at π‘₯=110.

We can now consider the nature of the other stationary point π‘₯=12. Substituting this value into the expression for the second derivative yields 𝑓12=βˆ’103+16=βˆ’103+46=βˆ’83.οŽ™οŠ§οŠ¨οŠ¨

Since 𝑓12<0οŽ™, the function has a local maximum at π‘₯=12. We can find the value of this maximum by substituting π‘₯=12 into the expression for 𝑓 as follows: 𝑓12=βˆ’53+2ο€Ό12οˆβˆ’16ο€Ό12=βˆ’512+1βˆ’16ο€Ό12=712βˆ’16ο€Ό12.lnlnln

Therefore, the function 𝑓(π‘₯)=βˆ’5π‘₯3+2π‘₯βˆ’16π‘₯ln has a local maximum of 712βˆ’16ο€Ό12ln at π‘₯=12 and a local minimum of 1160βˆ’16ο€Ό110ln at π‘₯=110.

A plot of the graph clearly shows the local maximum and minimum of the function.

Key Points

  1. The second derivative can be used to help classify the maxima and minima of a function.
  2. The second derivative test states that, given a differentiable function 𝑓 with a stationary point at π‘₯,
    • if 𝑓(π‘₯)>0οŽ™οŠ¦, the point is a local minimum;
    • if 𝑓(π‘₯)<0οŽ™οŠ¦, the point is a local maximum.
    If 𝑓(π‘₯)=0οŽ™οŠ¦, the second derivative test is inconclusive; the point could be a local maximum, a local minimum, or a point of inflection. In such cases, it will be necessary to consider points in the neighborhood of π‘₯ to classify the stationary point.
  3. To apply the second derivative test, we follow the following method:
    1. Check the differentiability of the function.
    2. Calculate the first and second derivatives.
    3. Set the first derivative equal to zero and solve the independent variable.
    4. Evaluate the second derivative at the zeros of the first derivative and apply the second derivative test.
    5. To find the maximal and minimal values, substitute the zeros of the derivative into the original function.

Nagwa uses cookies to ensure you get the best experience on our website. Learn more about our Privacy Policy.