5

Why use the second derivative test over the first derivative test when finding maxima and minima if it's uncertain what $f''(x) = 0$ is? Why not just always use the first derivative since we need to take the first derivate either way?

Blue
  • 135
  • I think you must mean local minimum/maximum in the title. – TonyK Mar 19 '20 at 15:13
  • For what it's worth, I almost never needed the second derivative test for standard elementary calculus problems (of the type in textbooks). Also, the first derivative test nearly always gives you much more information. See the worked examples I posted in this 29 October 2006 sci.math post. I suppose the second derivative test can be better for certain applied problems in which context provides some useful information and you only want extrema information. – Dave L. Renfro Mar 19 '20 at 15:24
  • 3
    @TonyK "Relative extremum" is a synonym of "local extremum". – Xander Henderson Mar 19 '20 at 23:43
  • @XanderHenderson: WHY?! "Local extremum" means what it says, whereas this new-fangled "relative extremum" doesn't mean anything as far as I can see. Relative to what? O tempora, o mores... – TonyK Mar 19 '20 at 23:58
  • 1
    @TonyK To answer the question "why?": because that is the language that many undergraduate texts in calculus use. It is common nomenclature, whether you like it or not. – Xander Henderson Mar 20 '20 at 00:11
  • "local extremum" is more common. Try a google count check. And it is the term that goes waaay back and exists in the bulk of the math books. – Ponder Stibbons Mar 20 '20 at 00:19
  • @PonderStibbons: yes, here is confirmation. Thank goodness for that! – TonyK Mar 20 '20 at 00:27
  • I'm guessing it's to counterpoint "absolute extremum"--which is certainly a logical term. Maybe it's similar to how we use "concave up and down" instead of "convex and concave." But "relative" is certainly used in one of my textbooks, so it's not worth changing the title. – Bladewood Mar 20 '20 at 02:12
  • 1
    Every minimum and maximum is relative. The term makes no more sense than calling something an "ATM machine". Absolute is not much better. Local versus global at least indicates something sensible about the type - whether it is applicable only within a particular area or across the entirety. – Nij Mar 20 '20 at 03:22
  • @XanderHenderson: [Although this is mainly for others, I can only pick one person.] Regardless of what one thinks about the merits of the use of "local" over "relative", I think most anyone who hasn't confined their reading to a handful of textbooks actually used in courses taken should be aware that both terms are fairly widely used in English mathematics literature. Here's a google scholar search for "relative extrema" + "calculus of variations", which can be modified for dozens of other fields. – Dave L. Renfro Mar 20 '20 at 17:21
  • @Nij Every extremum is local, too. A global maximum is also a local maximum. Again, the nomenclature "relative extremum" is commonly used. I'm not sure what good it does to be pedantic about one own preferred terminology, given that the term is widely understood and should not generally cause any confusion or ambiguity. This level of pedantry is certainly not worth admonishing an asker on MSE over. – Xander Henderson Mar 20 '20 at 17:46

6 Answers6

13

Here's what I tell my students:

  1. The first derivative test is usually harder to use, but will always give you an answer (at least for reasonable functions);

  2. The second derivative test is usually easier to use, but it may not be applicable (if it is not a stationary point) and it may be inconclusive.

Why do I say that? To use the second derivative test, you just need to plug in a number and evaluate. That's straightforward. To use the first derivative test, you need to analyse the sign of the first derivative on a neighborhood of the point and figure out whether it changes signs as it goes through the point. This can be harder to do than just plugging in a single point.

As you say, you always already have the first derivative handy. But you may also need to have the second derivative handy: for example, if you are doing a full analysis of the function, looking for intervals in which the function is increasing and decreasing, and intervals in which the function is concave up and concave down, you will also have the second derivative handy.

It's a tradeoff, then:

  1. For the First Derivative Test, you can always use it (stationary points and points where the first derivative does not exist), will almost always give you an answer either way (detecting critical points that are not relative extremes), and does not require any further derivatives to be calculated. But it requires a sign analysis, which may not be trivial (or possible).

  2. For the Second Derivative, you can't always use it, and even if you can use it, it may be inconclusive and it will never detect critical points that are not relative extremes, and it requires you to calculate another derivative. But it is usually much easier to actually use, as it only requires figuring out the sign at a single point.

But more generally: it's always good to have more than one way to do something, as different ways may provide strengths and weaknesses that the other methods don't have, or provide a different kind of insight.

Arturo Magidin
  • 398,050
  • 3
    Dare I ask what the downvote is for? – Arturo Magidin Mar 19 '20 at 15:26
  • 6
    This answer is comprehensive and clear, and I can't imagine a better one. It's baffling to me that somebody would downvote it. Maybe their computer is upside down. For example, they might have been reading your post on their phone while they were rolling down a hill. That's my best guess. – user729424 Mar 19 '20 at 15:37
  • I can't believe you let a random downvote bother you, Arturo! – TonyK Mar 19 '20 at 17:05
  • 2
    @TonyK: First, it's not "random"; I've been getting downvotes within minutes of my answers for a few days now. And it started about three weeks ago, though they seem to separate them to avoid triggering the auto-correction for serial downvoting. The two questions I've posted received their first downvotes literally within seconds of each other, after being on the site for years, for example. Second, if there was something actually wrong, I would like to know in order to correct it. – Arturo Magidin Mar 19 '20 at 17:11
3

In most cases there is no point in making the second derivative test. Given a differentiable function $f: \>[a,b]\to{\mathbb R}$, a point $x\in\>]a,b[\>$ where $f'(x)\ne0$ cannot be an extremal point. Therefore you make a (hopefully finite) candidate list containing $a$, $b$, and the zeros $x_i$ $(1\leq i\leq r)$ of $f'$ in $\>]a,b[\>$. Then find the minimum or maximum function value for the points in this list.

It is different when you are not specifically out for extrema, but have a special point $\xi$ that interests you. Especially in a multivariate situation you might want to know whether this point $\xi$ is a local extremum, or what kind of saddle point. In such a case you of course have to look at the second derivatives (the Hessian).

2

The second derivative test only works for local extrema. If you want global extrema, you have two options.

  1. If the function is defined on a closed bounded interval like $[-1,3]$. Then you can find the critical points, and compare the value at the critical points and on the side of the interval.
  2. Otherwise, you do need to know the variations of the function (i.e. the sign of the derivative). This also works for a closed bounded interval, and is often barely even more complicated than Method 1.

The thing is the second derivative test is essentially useless for single-variable calculus, since you can always almost always find the sign of the derivative and conclude.

The second thing is, you cannot speak of increasing / decreasing in multivariable calculus, and that is when the second derivative test really makes sense.

Raoul
  • 2,360
0

Well $f'(x)=0$ means that the slope of the function is $0$ at point $x$. But you don't know if it is a maximum or a minimum or an inflection point. Take $x^2,-x^2$ and $x^3$ for example. The derivative of each function is 0 in 0, but the first one has a minimum, the next one maximum and the third one an inflection point in 0.

Mick
  • 2,265
  • So basically for the first derivative test I NEED to do a sign diagram to find out what kind of point it is. While the second derivative test I just need to plug in the critical point value which is easier than writing a sign diagram. So the best thing is to use the second derivative test most of the time but if I encounter f''(c) = 0 then I use the first derivative test for that point instead? – Blue Mar 19 '20 at 15:08
  • Yes, solve $f'(x)=0$ for $x$ to get critical points. Plug in the crit. points to $f''$ to find out whether they are maxima, minima or inflection points. – Mick Mar 19 '20 at 15:11
  • @frigolit_tarzan: No! To find a minimum (resp. maximum), you need to test for $f'(x)=0$ and $f''(x)>0$ (resp. $f''(x)<0$). Note that if $f''(x)=0$ then the test is inconclusive $-$ you can't tell whether $x$ is a minimum, a maximum, or a point of inflexion. – TonyK Mar 19 '20 at 15:12
0

If you have a maximum or a minimum at $x$ then $f´(x) = 0$. But that does not make it true that if $f´(x) = 0$ you have a maximum or minimum at x. In order to know that you have a maximum/minimum at x, you need to know that both $f´(x)=0$ and $f´´(x) \neq 0$. Otherwise a function given by $f(x) = x^3$ would have a maximum or minimum at 0, because $3x^2(0) = 0$.

Dude1662
  • 101
  • You mean $f''(x)\ne 0$. – fleablood Mar 19 '20 at 15:15
  • $|x|$ has a clear minimum at $x = 0$, but the first derivative is not zero there. You should review the definition of critical point to remind that points where the derivative is undefined are also potential extrema. – Eric Towers Mar 19 '20 at 23:39
0

Let $f(x) = \sin(\mathrm{e}^{16-x^2})$ and determine whether $x = 0$ is a critical point, and if so, whether $f$ has a local minimum, local maximum, or neither at $x = 0$.

the function

(The small voids near the upper and lower bounds are numerical artifacts. A more accurate plot would look like a solid rectangle.) I immediately notice a difficulty with the first derivative attack on the problem: the function oscillates vigorously near $x = 0$.

Then $f'(x) = -2x\mathrm{e}^{16-x^2}\cos(\mathrm{e}^{16-x^2})$. We can immediately see $x = 0$ is a critical point. The first derivative has a lot of zeroes near $x = 0$.

the first derivative

It's "easy enough" to solve for the zeroes of the derivative: $x = 0$, $x = \pm \sqrt{16 + \ln(2/\pi)}$, $x = \pm \sqrt{16+\ln\left( \frac{-2}{\pi - 4 \pi k} \right)}$, or $x = \pm \sqrt{16+\ln\left( \frac{2}{\pi + 4 \pi k} \right)}$, for any integer $k$ with $1 \leq k \leq 1\,414\,268$. The fourth case with $k = 1\,414\,268$ gives the critical points closest to (and distinct from) $x=0$: $x = \pm 0.00034073{\dots}$. (How much work would one show to justify the claims in the previous sentence?) But all of this analysis has been a stupendous waste of time.

Instead, $$ f''(x) = (4x^2 - 2)\mathrm{e}^{16-x^2}\cos(\mathrm{e}^{16-x^2}) \\ - 4 x^2 \mathrm{e}^{32-2x^2}\sin(\mathrm{e}^{16-x^2}) $$ and $f''(0) = -2 \mathrm{e}^{16}\cos(\mathrm{e}^{16}) = 1.5251 \times 10^{7}$, so $f$ has a local minimum at $x = 0$.

aggressive zoom to a neighborhood of x = 0


We don't only run into problems with the "first derivative strategy" only when we use transcendental functions. Consider $$ f(x) = \frac{1}{6} x^6 - \frac{6}{5} x^5 - \frac{\mathrm{e}^2 + \pi^2 - 14}{4} x^4 + \frac{4}{3}(\mathrm{e}^2 + \pi ^2 - 4) x^3 + \frac{1}{2}(9 - 5\mathrm{e}^2 - 5\pi ^2 +\mathrm{e}^2\pi^2)x^2 - 2 (\mathrm{e}^2 -1)(\pi ^2 - 1) x + 7 \text{.} $$ It's just a polynomial. All its derivatives are polynomials, how bad could it be?

$$ f'(x) = x^5 - 6x^4 - (\mathrm{e}^2 + \pi^2 - 14)x^3 + 4(\mathrm{e}^2 + \pi^2 - 4)x^2 + (9 - 5\mathrm{e}^2 - 5 \pi^2 + \mathrm{e^2}\pi^2) x - 2 (\mathrm{e}^2 - 1)(\pi^2 - 1) \text{.} $$ If we abuse the rational root test, applying it even though the coefficients are not integers, we can find that $x = 2$ is a root of $f'$. $$ f'(x) = (x-2)(x^4 - 4x^3 - (\mathrm{e}^2 + \pi^2 - 6)x^2 + (2\mathrm{e}^2 + 2\pi^2 - 4)x + \mathrm{e}^2\pi^2-\mathrm{e}^2 - \pi^2 + 1) \text{.} $$ Good luck factoring that. (It's $f'(x) = (x-2)((x-1)^2 - \pi^2)((x-1)^2-\mathrm{e}^2)$.)

However, we can characterize the critical point at $x = 2$ immediately. $$ f''(2) = (\pi^2 - 1)(\mathrm{e}^2 - 1) = 56.668{\dots} \text{.} $$

Eric Towers
  • 67,037