Introduction

Finding the largest or smallest value of a function is a main use of the derivative. The method is short: locate the critical points, classify them with a derivative test, and, on a closed interval, compare with the endpoints. The tasks are to find the value or location of a maximum, the number of local extrema, whether a point is a maximum, minimum or neither, the inflection points, or the optimum of a small word problem.

Prerequisites

Core concepts

Local and global extrema

ff has a local maximum at cc if f(c)≥f(x)f(c) \ge f(x) for all xx in some open interval around cc, and a global (absolute) maximum on a set DD if f(c)≥f(x)f(c) \ge f(x) for all x∈Dx \in D. Minima are defined with ≤\le. A global extremum at an interior point is also a local one, but a global extremum on [a,b][a, b] can sit at an endpoint, where the local definition (which needs an open interval) does not apply.

Critical points and Fermat's theorem

Fermat's theorem. If ff has a local extremum at an interior point cc and f′(c)f'(c) exists, then f′(c)=0f'(c) = 0.

A critical point is an interior point of the domain where f′(c)=0f'(c) = 0 or f′(c)f'(c) does not exist. Every interior local extremum is a critical point, but not every critical point is an extremum: x3x^3 has f′(0)=0f'(0) = 0 and no extremum at 0.

First derivative test

Let cc be a critical point and ff continuous at cc.

  • f′f' changes from ++ to −- at cc: local maximum.
  • f′f' changes from −- to ++: local minimum.
  • f′f' keeps its sign: no extremum.

This test also works where f′(c)f'(c) does not exist (∣x∣|x| at 0, x2/3x^{2/3} at 0). Relatedly, f′>0f' > 0 on an interval makes ff strictly increasing there, and f′<0f' < 0 strictly decreasing (a consequence of the mean value theorem).

Second derivative test

If f′(c)=0f'(c) = 0 and f′′(c)f''(c) exists:

  • f′′(c)<0f''(c) < 0: local maximum;
  • f′′(c)>0f''(c) > 0: local minimum;
  • f′′(c)=0f''(c) = 0: no conclusion (x4x^4 has a minimum, −x4-x^4 a maximum and x3x^3 neither, all with f′(0)=f′′(0)=0f'(0) = f''(0) = 0).

Higher-order test. If f′(c)=⋯=f(n−1)(c)=0f'(c) = \cdots = f^{(n-1)}(c) = 0 and f(n)(c)≠0f^{(n)}(c) \ne 0: for even nn, a minimum when f(n)(c)>0f^{(n)}(c) > 0 and a maximum when it is negative; for odd nn, no extremum.

Sign convention. At a stationary point, f′′(c)<0f''(c) < 0 gives a maximum (the graph bends down); picture −x2-x^2.

Concavity and inflection points

ff is convex (concave up) on an interval if f′′≥0f'' \ge 0 there (f′′>0f'' > 0 is sufficient) and concave (concave down) if f′′≤0f'' \le 0 (f′′<0f'' < 0 is sufficient). An inflection point is a point of the graph where the concavity changes. If f′′f'' exists there it must be 0, but f′′(c)=0f''(c) = 0 is not enough: x4x^4 has f′′(0)=0f''(0) = 0 and is convex on both sides. Check that f′′f'' changes sign.

Global extrema on a closed interval

For ff continuous on [a,b][a, b] (so the extreme value theorem guarantees both extremes):

  1. find the critical points in (a,b)(a, b);
  2. evaluate ff at each critical point and at aa and bb;
  3. the largest value is the global maximum, the smallest the global minimum.

No classification is needed. On an open or unbounded interval, also examine the limits at the ends, since the extremes may not be attained.

Local and global extrema of x^3 - 3x on a closed interval
Figure 1. f(x)=x3−3xf(x) = x^3 - 3x on [−1.5,2.5][-1.5, 2.5]: a local maximum at x=−1x = -1 (value 2), a local minimum at x=1x = 1 (value −2-2, also the global minimum), an inflection point at the origin, and the global maximum 8.125 at the endpoint x=2.5x = 2.5.

Functions of two variables

For a C2C^2 function on a neighbourhood of an interior stationary point, first solve fx=fy=0f_x=f_y=0. Then evaluate D=fxxfyy−fxy2D=f_{xx}f_{yy}-f_{xy}^2 at that point. Boundary and nondifferentiable points require separate treatment:

  • D>0D > 0, fxx<0f_{xx} < 0: local maximum; D>0D > 0, fxx>0f_{xx} > 0: local minimum;
  • D<0D < 0: saddle point (neither);
  • D=0D = 0: no conclusion.

Worked examples

Example 1: the figure's function

f(x)=x3−3xf(x) = x^3 - 3x, f′(x)=3(x−1)(x+1)f'(x) = 3(x - 1)(x + 1), f′′(x)=6xf''(x) = 6x. Critical points ±1\pm 1: f′′(−1)=−6<0f''(-1) = -6 < 0 gives a local maximum f(−1)=2f(-1) = 2; f′′(1)=6>0f''(1) = 6 > 0 gives a local minimum f(1)=−2f(1) = -2. f′′f'' changes sign at 0, an inflection point. On [−1.5,2.5][-1.5, 2.5]: f(−1.5)=1.125f(-1.5) = 1.125 and f(2.5)=8.125f(2.5) = 8.125, so the global maximum is 8.125 (at the endpoint 2.5) and the global minimum is −2-2 (at 1).

Example 2: a stationary point that is not an extremum

f(x)=x4−4x3f(x) = x^4 - 4x^3, f′(x)=4x2(x−3)f'(x) = 4x^2(x - 3), f′′(x)=12x(x−2)f''(x) = 12x(x - 2). At x=3x = 3: f′′(3)=36>0f''(3) = 36 > 0, a local (in fact global) minimum f(3)=−27f(3) = -27. At x=0x = 0: f′′(0)=0f''(0) = 0, and f′<0f' < 0 on both sides of 0, so there is no extremum. Inflection points where f′′f'' changes sign: x=0x = 0 and x=2x = 2.

Example 3: counting extrema

f(x)=x5−5xf(x) = x^5 - 5x: f′(x)=5(x4−1)=0f'(x) = 5(x^4 - 1) = 0 at x=±1x = \pm 1; f′′(x)=20x3f''(x) = 20x^3. So x=−1x = -1 is a local maximum (f=4f = 4) and x=1x = 1 a local minimum (f=−4f = -4): two local extrema, and no global ones on R\mathbb{R} because f→±∞f \to \pm\infty.

Example 4: an open-box problem

Squares of side xx are cut from the corners of a 12×1212 \times 12 sheet and the sides folded up. Volume V(x)=x(12−2x)2V(x) = x(12 - 2x)^2 for 0<x<60 < x < 6. V′(x)=(12−2x)(12−6x)=0V'(x) = (12 - 2x)(12 - 6x) = 0 gives x=2x = 2 in the domain. V′′(2)=−48<0V''(2) = -48 < 0, so the maximum volume is V(2)=2⋅82=128V(2) = 2 \cdot 8^2 = 128.

Example 5: a critical point where f′f' does not exist

f(x)=x2/3f(x) = x^{2/3} has f′(x)=23x−1/3f'(x) = \frac{2}{3}x^{-1/3}, undefined at 0, negative for x<0x < 0 and positive for x>0x > 0. By the first derivative test, 0 is a minimum (a cusp). The second derivative test cannot be applied.

Example 6: maximum on an unbounded interval

f(x)=xe−xf(x) = xe^{-x} on [0,∞)[0, \infty): f′(x)=(1−x)e−xf'(x) = (1 - x)e^{-x}, positive before 1 and negative after. f(0)=0f(0) = 0 and f(x)→0f(x) \to 0 as x→∞x \to \infty, so the global maximum is f(1)=1/e≈0.368f(1) = 1/e \approx 0.368.

Example 7: a trigonometric maximum

f(x)=sin⁡x+cos⁡xf(x) = \sin x + \cos x: f′(x)=cos⁡x−sin⁡x=0f'(x) = \cos x - \sin x = 0 at x=π/4x = \pi/4 (in [0,2π)[0, 2\pi) also 5π/45\pi/4). f(π/4)=2f(\pi/4) = \sqrt{2} and f(5π/4)=−2f(5\pi/4) = -\sqrt{2}. In general asin⁡x+bcos⁡xa\sin x + b\cos x ranges over [−a2+b2,a2+b2][-\sqrt{a^2 + b^2}, \sqrt{a^2 + b^2}].

Example 8: two variables

f(x,y)=x3−3x+y2f(x, y) = x^3 - 3x + y^2: fx=3x2−3f_x = 3x^2 - 3, fy=2yf_y = 2y, so the critical points are (1,0)(1, 0) and (−1,0)(-1, 0). fxx=6xf_{xx} = 6x, fyy=2f_{yy} = 2, fxy=0f_{xy} = 0, so D=12xD = 12x. At (1,0)(1, 0): D=12>0D = 12 > 0 and fxx=6>0f_{xx} = 6 > 0, a local minimum with value −2-2. At (−1,0)(-1, 0): D=−12<0D = -12 < 0, a saddle point.

Important properties and observations

  • Between two local maxima of a continuous function there is always a local minimum (the smallest value of ff on the interval between them), so for a smooth function with finitely many critical points, local maxima and minima alternate.
  • A continuous function with a single critical point on an interval, where that point is a local extremum, has a global extremum of the same kind there (Example 6).
  • Monotone functions on [a,b][a, b] take their extremes at the endpoints; no derivative is needed.
  • For a quadratic ax2+bx+cax^2 + bx + c, the vertex is at x=−b/(2a)x = -b/(2a): a minimum if a>0a > 0 and a maximum if a<0a < 0.
  • A product xyxy with fixed sum x+y=sx + y = s is largest at x=y=s/2x = y = s/2 (value s2/4s^2/4); a sum with fixed product xy=pxy = p (x,y>0x, y > 0) is smallest at x=y=px = y = \sqrt{p}.

GATE examination perspective

  • Value or location of the maximum or minimum of a polynomial, exponential or trigonometric function, including on a closed interval.
  • Count local extrema or inflection points.
  • Classify a stationary point, including cases where the second derivative test is inconclusive.
  • Small optimisation problems (box, fence, product with a fixed sum).
  • Trap: forgetting the endpoints when the question asks for a global extremum on [a,b][a, b].
  • Trap: treating f′′(c)=0f''(c) = 0 as "inflection point" or "no extremum" without checking signs.

Summary

Sources

  1. G. Strang, Calculus, 3rd ed., Wellesley-Cambridge Press, 2017: Sections 3.2 (Maximum and Minimum Problems), 3.3 (Second Derivatives: Bending and Acceleration), 3.4 (Graphs) and 13.6 (Maxima, Minima, and Saddle Points). Free edition on MIT OpenCourseWare, (consulted 2026-11-11).

Next steps