Tutorials › Real Analysis › Local Extrema

Differentiation · Tutorial 439 of 1000

Local Extrema

Distinguish local extrema from stationary points, then use derivative signs and second derivatives to determine when a candidate is a local maximum or minimum.

Advanced 9 min read

What You'll Learn

  • Define local and strict local maxima and minima relative to a function’s domain
  • Distinguish stationary points from points where a local extremum actually occurs
  • Apply first-derivative sign changes to classify local extrema
  • Prove the second-derivative test for strict local extrema
  • Recognize why a zero second derivative does not settle the classification
  • Account for nondifferentiable points and domain endpoints

Comparing Nearby Function Values

A local extremum is determined by comparing function values near one point, not by comparing the point with every value on the domain. This distinction makes local extrema useful when studying a graph in pieces: a function may rise, fall, and rise again, with several local extrema along the way. In “Strict Convexity,” we studied a condition on an entire interval. Here the focus is the behavior near a single point, whether or not the function is convex.

Definition (Local Maximum and Local Minimum): Let \(E\subseteq\mathbb{R}\), let \(f:E\to\mathbb{R}\), and let \(a\in E\). The function \(f\) has a local maximum at \(a\) if there is a \(\delta>0\) such that \(f(x)\leq f(a)\) for every \(x\in E\) with \(|x-a|<\delta\). It has a local minimum at \(a\) if there is a \(\delta>0\) such that \(f(x)\geq f(a)\) for every such \(x\). The extremum is strict if the corresponding inequality is strict whenever \(x\ne a\).

The comparisons are restricted to points of the domain \(E\). Thus this definition applies at an endpoint as well as at an interior point: near an endpoint, only the points of the domain on the available side are compared. When \(E\) is an interval and \(a\) is an interior point, there are domain points both to the left and right of \(a\) sufficiently close to it.

The word “local” does not mean that the inequality holds only at the single point \(a\). It means there is some neighborhood around \(a\) on which the comparison holds. The size of that neighborhood may depend on \(a\). A non-strict local maximum and a non-strict local minimum can occur at the same point: for example, a function constant on a neighborhood of \(a\) has both there. Neither is a strict extremum.

Stationary Points and Necessary Conditions

At an interior local extremum where the function is differentiable, Fermat’s Theorem gives a necessary condition: \(f'(a)=0\). This condition helps identify candidates, but it does not prove that an extremum occurs. A point where \(f'(a)=0\) is called a stationary point; it may be a local extremum, or it may not.

Definition (Stationary Point): If \(f\) is differentiable at \(a\), then \(a\) is a stationary point of \(f\) if \(f'(a)=0\).

The distinction between a candidate and a conclusion matters. Fermat’s Theorem applies only at an interior point where differentiability holds. A local extremum at a point where the function is not differentiable need not satisfy \(f'(a)=0\), because that derivative may not exist. An endpoint extremum is not covered by Fermat’s Theorem either.

Worked Example: Classifying Two Stationary Points by Derivative Signs

Let \(f(x)=x^3-3x\) on \(\mathbb{R}\). Differentiation gives

$$ f'(x)=3x^2-3=3(x-1)(x+1). $$

The stationary points are \(x=-1\) and \(x=1\). If \(x<-1\), both \(x-1\) and \(x+1\) are negative, so \(f'(x)>0\). If \(-1<x<1\), the factors have opposite signs, so \(f'(x)<0\). If \(x>1\), both factors are positive, so \(f'(x)>0\). Thus the derivative changes from positive to negative at \(-1\), and from negative to positive at \(1\).

The Derivative Sign Change Gives a Local Extremum Theorem from “Monotonicity From the Derivative” applies: \(f\) has a local maximum at \(-1\) and a local minimum at \(1\). The function values are

$$ f(-1)=(-1)^3-3(-1)=-1+3=2, \qquad f(1)=1^3-3(1)=1-3=-2. $$

The sign changes also give strict comparisons on a sufficiently small neighborhood: on each side of either point, the derivative has a strict sign, so the Mean Value Theorem shows that the function values on that side are strictly ordered toward or away from the stationary point. Hence these are strict local extrema.

The Second-Derivative Test

When a stationary point is available and the second derivative exists nearby, its sign can settle the classification. The underlying idea is that \(f''(a)\) describes the rate at which \(f'\) changes at \(a\). If \(f'(a)=0\) and \(f''(a)>0\), then \(f'\) is negative just to the left and positive just to the right. If \(f''(a)<0\), those signs are reversed.

Theorem (Second-Derivative Test for a Strict Local Extremum): Let \(I\) be an open interval, let \(a\in I\), and suppose \(f\) is twice differentiable on a neighborhood of \(a\). If \(f'(a)=0\) and \(f''(a)>0\), then \(f\) has a strict local minimum at \(a\). If \(f'(a)=0\) and \(f''(a)<0\), then \(f\) has a strict local maximum at \(a\).

Proof. First suppose \(f''(a)>0\). By the definition of \(f''(a)\),

$$ \lim_{x\to a,\ x\ne a} \frac{f'(x)-f'(a)}{x-a}=f''(a)>0. $$

Therefore, for all \(x\ne a\) sufficiently close to \(a\), the quotient is positive. Since \(f'(a)=0\), this says \(f'(x)/(x-a)>0\). Consequently \(f'(x)<0\) just to the left of \(a\), and \(f'(x)>0\) just to the right.

Take any \(x>a\) sufficiently close to \(a\). The Mean Value Theorem applied to \(f\) on \([a,x]\) gives a \(c\in(a,x)\) such that

$$ f(x)-f(a)=f'(c)(x-a). $$

Here \(f'(c)>0\) and \(x-a>0\), so \(f(x)>f(a)\). If instead \(x<a\) is sufficiently close, apply the Mean Value Theorem on \([x,a]\). For some \(c\in(x,a)\),

$$ f(a)-f(x)=f'(c)(a-x). $$

Now \(f'(c)<0\) and \(a-x>0\), so \(f(a)-f(x)<0\), again giving \(f(x)>f(a)\). Thus \(f\) has a strict local minimum at \(a\).

If \(f''(a)<0\), the same limit shows that \(f'(x)/(x-a)<0\) for all sufficiently nearby \(x\ne a\). Hence \(f'(x)>0\) to the left and \(f'(x)<0\) to the right. The Mean Value Theorem on \([x,a]\) for \(x<a\) gives \(f(a)-f(x)>0\); on \([a,x]\) for \(x>a\) it gives \(f(x)-f(a)<0\). In both cases \(f(x)<f(a)\), so \(a\) is a strict local maximum. \(\square\)

Worked Example: A Second-Derivative Test for a Minimum

Let \(g(x)=x^2+4x+7\). Its derivatives are

$$ g'(x)=2x+4, \qquad g''(x)=2. $$

The equation \(g'(x)=0\) gives \(a=-2\), and \(g''(-2)=2>0\). The Second-Derivative Test therefore proves that \(g\) has a strict local minimum at \(-2\). Its value there is

$$ g(-2)=(-2)^2+4(-2)+7=4-8+7=3. $$

The test establishes a local conclusion; it does not require comparing \(g(-2)\) with values far from \(-2\).

When the Second Derivative Is Zero

The second-derivative test is decisive when its hypotheses hold and \(f''(a)\ne0\). If \(f''(a)=0\), however, the test gives no classification. The point might be a strict local minimum, a strict local maximum, or not an extremum at all. Other information, such as the signs of \(f'\) on either side or the function values themselves, is then needed.

Worked Example: A Strict Minimum with Zero Second Derivative

For \(f(x)=x^4\), we have

$$ f'(x)=4x^3, \qquad f''(x)=12x^2. $$

At \(a=0\), both \(f'(0)\) and \(f''(0)\) are zero, so the second-derivative test is inconclusive. But for every \(x\ne0\),

$$ f(x)-f(0)=x^4>0. $$

Thus \(f\) has a strict local minimum at \(0\). The zero second derivative does not prevent an extremum; it only prevents this particular test from deciding the question.

Worked Example: A Stationary Point That Is Not an Extremum

Let \(h(x)=x^3\). Then

$$ h'(x)=3x^2, \qquad h'(0)=0, \qquad h''(x)=6x, \qquad h''(0)=0. $$

Although \(0\) is a stationary point, values to its left are negative and values to its right are positive: if \(x<0\), then \(x^3<0=h(0)\); if \(x>0\), then \(x^3>0=h(0)\). Therefore every neighborhood of \(0\) contains a value below \(h(0)\) and a value above \(h(0)\). The point is neither a local maximum nor a local minimum.

Necessary Second-Derivative Conditions

The strict second-derivative test also has a useful counterpart: at a local extremum, the second derivative cannot have the sign that would contradict the extremum. This condition is necessary, not sufficient. In particular, a local minimum may have \(f''(a)=0\), as \(x^4\) shows.

Theorem (Second-Derivative Necessary Condition): Let \(a\) be an interior point of an interval, and suppose \(f\) is twice differentiable on a neighborhood of \(a\). If \(f\) has a local minimum at \(a\), then \(f''(a)\geq0\). If \(f\) has a local maximum at \(a\), then \(f''(a)\leq0\).

Proof. By Fermat’s Theorem, either type of interior local extremum satisfies \(f'(a)=0\). Suppose first that \(f\) has a local minimum and, contrary to the conclusion, \(f''(a)<0\). From

$$ \lim_{x\to a,\ x\ne a} \frac{f'(x)-f'(a)}{x-a}=f''(a)<0, $$

the quotient is negative for all \(x\ne a\) sufficiently close to \(a\). For \(x>a\), this implies \(f'(x)<0\). Choose such an \(x\) close enough that the entire interval \([a,x]\) lies in the neighborhood where the local minimum inequality holds. By the Mean Value Theorem, for some \(c\in(a,x)\),

$$ f(x)-f(a)=f'(c)(x-a)<0. $$

This contradicts \(f(x)\geq f(a)\) near a local minimum. Therefore \(f''(a)\geq0\).

Now suppose \(f\) has a local maximum and, contrary to the conclusion, \(f''(a)>0\). The same quotient is positive for nearby \(x\ne a\), so \(f'(x)>0\) for \(x>a\) sufficiently close to \(a\). The Mean Value Theorem then gives \(f(x)-f(a)=f'(c)(x-a)>0\) for some \(c\in(a,x)\), contradicting the local maximum inequality \(f(x)\leq f(a)\). Hence \(f''(a)\leq0\). \(\square\)

Domain Boundaries and Points Without Derivatives

Worked Example: A Local Minimum at an Endpoint

Define \(p:[0,1]\to\mathbb{R}\) by \(p(x)=x\). For every \(x\in[0,1]\) with \(|x-0|<1\), we have \(x\geq0=p(0)\), with strict inequality when \(x\ne0\). Therefore \(p\) has a strict local minimum at the endpoint \(0\), using neighborhoods relative to its domain. The function has derivative \(p'(x)=1\) at interior points, so there is no interior stationary point involved. This does not contradict Fermat’s Theorem, which requires an interior point.

A different limitation appears at a nondifferentiable point. For example, \(q(x)=|x|\) has a strict local minimum at \(0\), since \(|x|>0=q(0)\) whenever \(x\ne0\). Its derivative at \(0\) does not exist: the right-hand difference quotient is \(1\), while the left-hand difference quotient is \(-1\). This is another reason not to treat the equation \(f'(a)=0\) as a complete search for local extrema.

A practical classification begins by identifying the point’s role. If it is an interior point and \(f\) is differentiable there, Fermat’s Theorem says an extremum must be stationary. A first-derivative sign change can then classify the point, using the result from “Monotonicity From the Derivative.” If the second derivative exists, the strict second-derivative test may settle the classification; if it is zero, the test is inconclusive. Finally, endpoints and nondifferentiable points require direct consideration of nearby function values within the domain.

Check Your Understanding

Use the definitions and results in this tutorial to answer the following questions.

  1. What is the difference between a local maximum and a strict local maximum?
  2. Why does Fermat’s Theorem not rule out a local minimum of \(p(x)=x\) at \(0\) when the domain is \([0,1]\)?
  3. Suppose \(f'(a)=0\) and \(f''(a)<0\). What does the second-derivative test conclude, and what role do the nearby signs of \(f'\) play?
  4. Why does \(f''(a)=0\) fail to decide whether \(a\) is a local extremum? Give an example from this tutorial.
  5. How can a point be a strict local minimum even though the function is not differentiable there?