In short

A local maximum of f is a point where the graph reaches a peak — higher than all its near neighbours. At such a point, either f' does not exist or f' equals zero. Those two cases together are called critical points. The first derivative test says: scan the sign of f' as x crosses a critical point. If f' goes from positive to negative, you have a local max. Negative to positive, a local min. No sign change, neither.

A ball is thrown straight up at 20 m/s from a ledge 5 m off the ground. Its height after t seconds is h(t) = 5 + 20t - 5t^2. What is the highest point the ball reaches?

You could guess it's about halfway through the flight. You could try a handful of t-values and look for the biggest h. But calculus gives a cleaner move. At the highest point, the ball is momentarily stopped — neither rising nor falling. Its velocity is zero. The velocity is h'(t) = 20 - 10t, and setting this to zero gives t = 2. Plug back: h(2) = 5 + 40 - 20 = 25 metres. That is the peak.

Look at what just happened. You did not check any other t-values. You found one number where the derivative is zero, and that number was the peak. The derivative spotted the maximum for you. This is not luck — it is the most important single fact about derivatives as a tool, and this article is about how to turn that fact into a rule you can apply to any function.

Peaks, valleys, and what the graph is doing near them

Start with the picture. Here is a function with several interesting features:

The curve $y = (x^3 - 3x^2 - 9x + 5)/2$. It has a local maximum near $x = -1$ and a local minimum near $x = 3$. At each of these, the tangent is horizontal.

At the peak near x = -1, the curve is going up just before, going down just after, and at the peak itself the tangent is horizontal. Same thing at the dip near x = 3, but upside-down — the curve is going down before, up after, and the tangent is horizontal at the bottom.

This is the whole story of local extrema in one picture. A local maximum is a point where the function hits a peak relative to a small neighbourhood around it — not necessarily the highest point on the whole graph, just the highest point locally. A local minimum is the same idea upside down.

Local maximum and minimum

A function f has a local maximum at x = c if there is some open interval around c on which f(c) \geq f(x) for every x in the interval.

A function f has a local minimum at x = c if there is some open interval around c on which f(c) \leq f(x) for every x in the interval.

Collectively, local maxima and minima are called local extrema.

"Local" is the operative word. In the graph above, the local max near x = -1 is not the global maximum — the curve goes higher than that if you keep marching right. But in a small window around x = -1, it's the champion. That's what local means.

Where can extrema live?

If f has a local maximum at c and f is differentiable there, what must f'(c) be?

Think about it this way. Just to the left of c, the function is increasing (going up toward the peak), so the slopes of secants coming in from the left are positive. Just to the right of c, the function is decreasing (falling away from the peak), so the slopes of secants going out to the right are negative. The derivative at c is the limit of these secant slopes. It must be zero — the only number that is the limit of "positive from the left, negative from the right."

This is a theorem with a name.

Fermat's theorem on extrema

If f has a local extremum at x = c and f is differentiable at c, then f'(c) = 0.

Proof sketch. Suppose f has a local maximum at c. For h small and positive, f(c + h) \leq f(c), so f(c+h) - f(c) \leq 0, and dividing by positive h gives \frac{f(c+h) - f(c)}{h} \leq 0. Taking the limit as h \to 0^+ gives f'(c) \leq 0. For h small and negative, f(c+h) \leq f(c) still holds, but now dividing by negative h flips the inequality: \frac{f(c+h) - f(c)}{h} \geq 0. Taking the limit as h \to 0^- gives f'(c) \geq 0. Both inequalities together force f'(c) = 0. The local minimum case is the same argument with flipped signs.

But there is a subtlety in the statement. It says "if f is differentiable at c." If f is not differentiable there — the corner case — then f'(c) does not even exist, so the equation f'(c) = 0 is meaningless. And yet the function might still have a local maximum there. Think of f(x) = -|x| — an inverted V with its peak at the origin. The origin is a local max (in fact a global max). But f'(0) does not exist.

So the full list of places a local extremum can live is:

These two cases together have a name.

Critical point

A critical point of f is a point c in the domain of f at which either f'(c) = 0 or f'(c) does not exist.

By Fermat's theorem, every local extremum is a critical point. The converse is not true — critical points do not have to be extrema. A classic example: f(x) = x^3 has f'(0) = 0, so x = 0 is a critical point, but the graph just passes smoothly through the origin without a peak or a valley. It goes up, levels off for an instant, and continues going up. No extremum.

$y = x^3$ has $f'(0) = 0$, so the origin is a critical point. But the function is increasing on both sides of zero, so there is no local maximum and no local minimum there — just a horizontal tangent.

So critical points are the candidates for extrema. You still need a test to decide, for each candidate, whether it is actually a peak, a valley, or neither. That test is the first derivative test.

The first derivative test

Here is the observation that turns the picture into a rule. At a local maximum, the function is increasing on the left and decreasing on the right — so f' is positive just before c and negative just after. At a local minimum, f' is negative before c and positive after. At a non-extremum critical point (like x = 0 for x^3), f' has the same sign on both sides — the function continues in the same direction through c.

That's the test.

The first derivative test

Let c be a critical point of a continuous function f, and suppose f is differentiable on an interval around c except possibly at c itself.

  • If f' changes from positive to negative as x increases through c, then f has a local maximum at c.
  • If f' changes from negative to positive as x increases through c, then f has a local minimum at c.
  • If f' does not change sign at c, then c is not a local extremum.

Proof. Suppose f' changes from positive to negative at c. Then there is an interval (c - \delta, c) on which f' > 0, meaning f is strictly increasing on (c - \delta, c]. And there is an interval (c, c + \delta) on which f' < 0, meaning f is strictly decreasing on [c, c + \delta). Combine: for any x \in (c - \delta, c), f(x) < f(c) (because f was increasing on that interval, and c is to the right). For any x \in (c, c + \delta), f(x) < f(c) (because f was decreasing, and c is to the left). So f(c) is the largest value on the whole neighbourhood (c - \delta, c + \delta). That is exactly the definition of a local maximum. The minimum case is the symmetric argument. And if f' does not change sign at c — say it is positive on both sides — then f is increasing on both sides, so f(c - \delta/2) < f(c) < f(c + \delta/2), and c cannot be a local maximum (because there's a larger value just after) or a local minimum (because there's a smaller value just before). \blacksquare

The whole method is now three steps:

  1. Find all critical points — set f'(x) = 0 and also find points where f' does not exist.
  2. Build a sign chart for f' — plot the critical points on a line, pick a test value in each resulting interval, plug it into f', and record the sign.
  3. Read off maxima and minima by scanning sign changes.

Let's run it on a real function.

Example 1: Extrema of $f(x) = x^3 - 3x^2 - 9x + 5$

Step 1. Compute the derivative.

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

Why: factoring makes the sign analysis immediate. You can read off the sign of a product by reading off the signs of its factors.

Step 2. Find the critical points. f' is a polynomial so it is defined everywhere — the only critical points come from f'(x) = 0. The roots of the product are x = -1 and x = 3. Why: these are the two candidates. Everything else in the sign chart follows from knowing where these live.

Step 3. Build the sign chart. Split the real line at -1 and 3:

Interval Test x f'(x) = 3(x-3)(x+1) Sign
(-\infty, -1) x = -2 3 \cdot (-5)(-1) = 15 +
(-1, 3) x = 0 3 \cdot (-3)(1) = -9 -
(3, \infty) x = 4 3 \cdot (1)(5) = 15 +

Why: you do not need to compute the actual values, just the signs. Pick any convenient test point in each interval.

Step 4. Scan for sign changes.

  • At x = -1: f' goes from + to -. Local maximum.
  • At x = 3: f' goes from - to +. Local minimum.

Compute the function values at these points to say where the peaks are:

f(-1) = -1 - 3 + 9 + 5 = 10, \quad f(3) = 27 - 27 - 27 + 5 = -22.

Result: f has a local maximum of 10 at x = -1 and a local minimum of -22 at x = 3.

The cubic $y = x^3 - 3x^2 - 9x + 5$ with its local maximum at $(-1, 10)$ and its local minimum at $(3, -22)$. The sign chart predicted exactly this picture: up, peak, down, valley, up.

The sign chart and the graph agree. That is typical — once you trust the sign chart, you can answer "where are the extrema" without even drawing the curve.

When the derivative doesn't exist

The critical-point definition also covers points where f' fails to exist. Here is an example where that matters.

Example 2: Extrema of $f(x) = x^{2/3}(x - 5)$

Step 1. Rewrite in a form that makes differentiation clean.

f(x) = x^{5/3} - 5x^{2/3}

Why: multiplying out puts the function into a pure power form, where the power rule applies directly.

Step 2. Differentiate.

f'(x) = \frac{5}{3} x^{2/3} - 5 \cdot \frac{2}{3} x^{-1/3} = \frac{5}{3} x^{2/3} - \frac{10}{3 x^{1/3}}

Pull out a common factor and simplify.

f'(x) = \frac{5}{3 x^{1/3}} \left( x - 2 \right) = \frac{5(x - 2)}{3 x^{1/3}}

Why: the factored form shows exactly where the derivative is zero and where it blows up.

Step 3. Find the critical points.

  • f'(x) = 0: the numerator 5(x - 2) = 0, so x = 2.
  • f'(x) does not exist: the denominator 3 x^{1/3} = 0, so x = 0. The original function f is defined at x = 0 (f(0) = 0), so x = 0 is in the domain and is therefore a critical point.

Step 4. Sign chart. Split the line at 0 and 2. Test x = -1, 1, 3 in f'(x) = \frac{5(x-2)}{3x^{1/3}}:

Interval Test x Numerator 5(x-2) Denom 3x^{1/3} Sign of f'
(-\infty, 0) x = -1 -15 -3 +
(0, 2) x = 1 -5 3 -
(2, \infty) x = 3 5 3 \cdot 3^{1/3} +
  • At x = 0: f' goes from + to -. Local maximum — even though the derivative doesn't exist here, the sign change rule still applies.
  • At x = 2: f' goes from - to +. Local minimum.

Compute function values:

f(0) = 0, \qquad f(2) = 2^{2/3}(2 - 5) = -3 \cdot 2^{2/3} \approx -4.76.

Result: local max at (0, 0), local min at (2, -3 \cdot 2^{2/3}). The local max at x = 0 is a cusp — the graph comes up sharply from both sides.

$y = x^{2/3}(x - 5)$. The origin is a sharp cusp — the derivative blows up there, but the function still has a clean local maximum. The smooth local minimum at $x = 2$ is a standard $f'(x) = 0$ case.

The key moment is step 3: the derivative does not exist at x = 0, yet that is still a critical point and still a local maximum. If you forget to look for non-differentiable points, you miss this entirely.

Absolute extrema on a closed interval

So far everything has been local. Sometimes you want the absolute maximum or minimum — the single largest or smallest value of f on some domain.

On an unbounded domain, absolute extrema might not exist at all. f(x) = x on the whole real line has no maximum. But on a closed bounded interval [a, b], the situation is much nicer: a continuous function always attains both a maximum and a minimum. That is the extreme value theorem, and the procedure to find those extrema is called the closed interval method.

Closed interval method

To find the absolute maximum and minimum of a continuous function f on [a, b]:

  1. Find all critical points of f in the open interval (a, b).
  2. Compute f at each of those critical points.
  3. Compute f(a) and f(b).
  4. The largest of these values is the absolute maximum on [a, b]; the smallest is the absolute minimum.

The logic is clean. The absolute maximum must be attained at some point in [a, b]. If that point is in the open interval, it is a local maximum, hence a critical point. If it is not in the open interval, it must be an endpoint. So the maximum is either at a critical point or an endpoint — and the method simply checks all of them.

Worked on the function from Example 1: find the absolute extrema of f(x) = x^3 - 3x^2 - 9x + 5 on [-2, 4].

Critical points in (-2, 4): from the work above, these are x = -1 and x = 3. Endpoints: x = -2 and x = 4. Evaluate f at all four:

The largest is 10 (at x = -1); the smallest is -22 (at x = 3). So on the interval [-2, 4], the absolute maximum is 10 and the absolute minimum is -22. Both happen to coincide with the local extrema you already found — which is not always the case. If you had chosen an interval like [-3, 4], the value f(-3) = -27 - 27 + 27 + 5 = -22 would tie with the local min, so the absolute minimum would appear at two places.

Common confusions

A few things students reliably get wrong.

Going deeper

You have the method. The rest of this section connects it to the mean value theorem, handles the edge case of infinitely many critical points, and explains why the test is really a geometric statement about slopes.

Why the test is just the mean value theorem in disguise

The proof of the first derivative test given above used monotonicity, which in turn comes from the mean value theorem. So you can unpack the whole test into one clean chain.

The mean value theorem says: if f is continuous on [a, b] and differentiable on (a, b), there is some c \in (a, b) with f'(c) = \frac{f(b) - f(a)}{b - a}. Rearranged, f(b) - f(a) = f'(c)(b - a). If f' > 0 on (a, b), the right side is positive, so f(b) > f(a) — meaning f is strictly increasing. If f' < 0, f is strictly decreasing. The first derivative test is just this observation, applied on both sides of a critical point. The sign change of f' at c translates directly into a maximum or minimum by saying "increasing on the left, decreasing on the right" (or vice versa). Nothing else is going on.

What if f' changes sign infinitely often?

Pathological example: f(x) = x^4 (2 + \sin(1/x)) for x \neq 0, with f(0) = 0. This function has a local minimum at x = 0 (because the factor 2 + \sin(1/x) is always at least 1 and x^4 \geq 0), but the derivative f' oscillates wildly near zero — there is no interval around 0 on which you can cleanly read off the sign of f' as "positive on the left" or "negative on the right." The first derivative test fails to apply because there is no one-sided sign.

You will not see this in a JEE problem. The functions you meet are always tame enough that the sign chart makes sense near every critical point. But the gap between "c is a local min" and "f' has a clean negative-to-positive sign change at c" is real, and for fully rigorous work in real analysis you need a more careful statement.

Relation to the second derivative test

The first derivative test works whenever f' has a clean sign change at c and f'(c) = 0 (or f' is undefined there). It always tells you something. The second derivative test, which you will meet in the next article, is often faster — just compute f''(c) and look at its sign — but it fails when f''(c) = 0. When the second derivative test is inconclusive, you fall back on the first derivative test. They are complementary: one is fast but sometimes silent, the other is always willing to talk but slower.

Where this leads next

The first derivative test is step one of a two-step story. The second step is the second derivative test, which uses f'' instead of sign-charting f'. After that, you can combine the two with concavity to sketch any curve by hand.