Maxima and minima

Walk along the graph of almost any smooth function and you pass over hilltops and through valleys — points where the curve stops rising and starts falling, or the reverse. At every such point the tangent line is momentarily flat: the slope f′(x)f'(x) is zero. That single geometric fact is the seed of an entire chapter, Applications of Derivatives, and this article develops it into two working tools — the first-derivative test and the second-derivative test — for finding and classifying these local high and low points, called local maxima and local minima. The payoff is not just graph-sketching. The same machinery turns real optimization questions — the cheapest box, the shortest fence, the most profitable price — into a short calculus recipe: write the quantity as a function of one variable, differentiate, find where the slope vanishes, and classify. This article carries that recipe through both a pure algebraic example and a real fencing problem, and flags the traps that cost the most marks in this topic.

The core insight

A differentiable function can have a local maximum or minimum only where its derivative is zero, and the sign of the second derivative there — negative for a peak, positive for a valley, zero for "test fails, check the first derivative instead" — tells you which.

The core idea

A function ff has a local maximum at x=cx = c if f(c)≥f(x)f(c) \geq f(x) for all xx near cc, and a local minimum at x=cx = c if f(c)≤f(x)f(c) \leq f(x) for all xx near cc. Together these are called local extrema, and the value f(c)f(c) is the corresponding extreme value. Note the word "local": the comparison is only with nearby points, not with the function's behaviour far away.

Critical points come first. If ff is differentiable at cc and has a local extremum there, then necessarily f′(c)=0f'(c) = 0 — this condition is necessary, not sufficient, since a horizontal tangent can also occur at a point that is neither a peak nor a valley. Points where f′(x)=0f'(x) = 0 are called stationary points; together with any points where f′f' fails to exist, they form the critical points, which are the only candidates worth testing.

f′(c)=0(necessary condition for a smooth local extremum at x=c).f'(c) = 0 \quad \text{(necessary condition for a smooth local extremum at } x=c\text{)}.

where: f′(c)f'(c) is the derivative of ff evaluated at the candidate point cc; the equation says the tangent is horizontal there, nothing more.

First-derivative test. Once a critical point cc is found, check how the sign of f′(x)f'(x) changes as xx crosses cc. If f′(x)f'(x) switches from positive (rising) to negative (falling), ff peaks at cc — a local maximum. If it switches from negative to positive, ff bottoms out at cc — a local minimum. If the sign does not change at all, cc is neither; it is a point of inflection with a momentarily flat tangent (the classic example is f(x)=x3f(x) = x^3 at x=0x = 0).

Second-derivative test. This is usually faster when f′′f'' is easy to compute. At a stationary point cc (so f′(c)=0f'(c) = 0):

f′′(c)<0  ⟹  local maximum at c,f′′(c)>0  ⟹  local minimum at c,f′′(c)=0  ⟹  inconclusive.f''(c) < 0 \implies \text{local maximum at } c, \qquad f''(c) > 0 \implies \text{local minimum at } c, \qquad f''(c) = 0 \implies \text{inconclusive.}

where: f′′(c)f''(c) is the second derivative — the rate at which the slope itself is changing. A negative f′′(c)f''(c) means the curve is bending downward (concave down) near cc, consistent with a peak; a positive f′′(c)f''(c) means it bends upward (concave up), consistent with a valley. When f′′(c)=0f''(c) = 0 the curve's bending is too mild to decide, and you must fall back on the first-derivative test. For applied optimization problems the strategy is always the same three moves: express the quantity to be optimized as a function of a single variable using the given constraint, differentiate and set the derivative to zero to find critical points, then classify with either test.

Figure
A cubic curve showing a local maximum on the left and a local minimum on the right, each with a horizontal dashed tangent line marking the zero slope
Local maximum and local minimum — tangent is flat at each x f(x) local max local min At both marked points the tangent is horizontal, so slope equals zero
Derivation AClassifying the critical points of a cubic using both tests

The goal is to find and classify every local extremum of the cubic f(x)=x3−3x2−9x+5f(x) = x^3 - 3x^2 - 9x + 5, showing step by step how the necessary condition f′(x)=0f'(x)=0 locates the candidates and how the second-derivative test decides which candidate is a peak and which is a valley, ending with both the location and the actual extreme value at each point.

Step 1. Differentiate ff once to get the slope function: f′(x)=3x2−6x−9f'(x) = 3x^2 - 6x - 9. This can be factored as f′(x)=3(x2−2x−3)=3(x−3)(x+1)f'(x) = 3(x^2 - 2x - 3) = 3(x-3)(x+1), which makes the zeros easy to read off directly.

Step 2. Set f′(x)=0f'(x) = 0 to find the critical points: 3(x−3)(x+1)=03(x-3)(x+1) = 0 gives x=3x = 3 and x=−1x = -1. These are the only two places the tangent to ff is horizontal, so they are the only candidates for a local extremum.

Step 3. Differentiate again to get f′′(x)=6x−6f''(x) = 6x - 6, and evaluate it at each candidate to classify. At x=−1x = -1: f′′(−1)=6(−1)−6=−12<0f''(-1) = 6(-1) - 6 = -12 < 0, so ff has a local maximum at x=−1x = -1. At x=3x = 3: f′′(3)=6(3)−6=12>0f''(3) = 6(3) - 6 = 12 > 0, so ff has a local minimum at x=3x = 3.

Step 4. Report the actual extreme values by substituting back into ff, not just the locations. f(−1)=(−1)3−3(−1)2−9(−1)+5=−1−3+9+5=10f(-1) = (-1)^3 - 3(-1)^2 - 9(-1) + 5 = -1 - 3 + 9 + 5 = 10, and f(3)=27−27−27+5=−22f(3) = 27 - 27 - 27 + 5 = -22. So the local maximum value is 1010 at x=−1x=-1, and the local minimum value is −22-22 at x=3x=3 — matching the shape of the graph above, one peak followed by one valley as xx increases.

Worked example

A farmer wants to fence a rectangular field of area 200 m2200\ \text{m}^2 using the minimum possible length of fencing. Find the dimensions that minimize the perimeter.

Step 1. Set up one variable using the constraint. Let the sides be xx and yy metres, so xy=200xy = 200, which gives y=200xy = \dfrac{200}{x} for x>0x > 0. The perimeter to minimize is P(x)=2x+2y=2x+400xP(x) = 2x + 2y = 2x + \dfrac{400}{x}, now written purely in terms of xx.

Step 2. Differentiate and find the critical point. P′(x)=2−400x2P'(x) = 2 - \dfrac{400}{x^2}. Setting P′(x)=0P'(x) = 0 gives 2=400x22 = \dfrac{400}{x^2}, so x2=200x^2 = 200 and x=200=102x = \sqrt{200} = 10\sqrt{2} metres (taking the positive root since xx is a length).

Step 3. Confirm it is a minimum using the second derivative. P′′(x)=800x3P''(x) = \dfrac{800}{x^3}, and since x=102>0x = 10\sqrt{2} > 0, P′′(x)>0P''(x) > 0 — confirming a local minimum, not a maximum.

Step 4. Find the matching yy and state the answer. y=200102=102y = \dfrac{200}{10\sqrt{2}} = 10\sqrt{2}, so x=y=102 m≈14.14 mx = y = 10\sqrt{2}\ \text{m} \approx 14.14\ \text{m}: the field is a square of side 10210\sqrt{2} m, giving the minimum perimeter P=4(102)=402≈56.6P = 4(10\sqrt2) = 40\sqrt2 \approx 56.6 m.

Common traps

  • Treating every stationary point as an extremum. f′(c)=0f'(c) = 0 is necessary but not sufficient — a point of inflection with a horizontal tangent (like f(x)=x3f(x)=x^3 at x=0x=0) is neither a maximum nor a minimum.
  • Confusing the extreme point with the extreme value. The critical point x=cx = c tells you where the extremum occurs; you must substitute back into ff to report the actual maximum or minimum value.
  • Forgetting the inconclusive case. When f′′(c)=0f''(c) = 0, the second-derivative test decides nothing — switch to the first-derivative sign-change test instead of guessing.
  • Not reducing an optimization problem to one variable. In applied problems with a constraint, eliminate one variable first; differentiating an expression that still has two independent variables is a common setup error.

Ask the tutor: Want to try classifying a trickier critical point, or work through another applied optimization problem such as minimizing the cost of an open box? Ask the AI tutor to walk you through it.

Why is f prime of c equals zero not enough to guarantee an extremum?

Because a horizontal tangent can also occur at a point where the curve is simply pausing on its way up or down, not turning around. The standard example is f(x)=x3f(x) = x^3 at x=0x = 0: here f′(0)=0f'(0) = 0, but for xx slightly negative f(x)<0f(x) < 0 and for xx slightly positive f(x)>0f(x) > 0, so the function never actually stops increasing near x=0x=0 — it is a point of inflection, not an extremum. That is why f′(c)=0f'(c)=0 only narrows down the candidates; you still need the first- or second-derivative test to confirm what kind of point it actually is.

When should I use the first-derivative test instead of the second-derivative test?

Use the second-derivative test first because it is usually quicker — just compute f′′(c)f''(c) and check its sign. Switch to the first-derivative test whenever f′′(c)=0f''(c) = 0 (the second-derivative test is inconclusive there) or whenever f′′f'' is awkward or impossible to compute cleanly. The first-derivative test is also more fundamental: it works even at points where f′f' exists but f′′f'' does not, since it only needs the sign of f′f' just before and just after the critical point.

In word problems how do I know whether I am looking for a maximum or a minimum?

Read the question's wording carefully: "minimum fencing," "least cost," or "shortest length" call for a local minimum, while "maximum area," "greatest volume," or "highest profit" call for a local maximum. Once you differentiate and find the critical point, do not assume which one it is — always confirm with the second-derivative test (or first-derivative test), as in the fencing example where P′′(x)>0P''(x) > 0 genuinely confirmed a minimum rather than just being assumed from the wording.

Before this

Where this leads