Calculus · Differential calculus

Ups, Downs and Bends: Monotonicity, Extrema and Inflection Points

Where does a function rise, where does it fall, where does it reach a peak or a valley, and where does its graph change the way it bends? The first and second derivatives answer all of these questions. This post shows how, step by step, and ends with optimization: using derivatives to find the best possible value of something.

1. Increasing and decreasing functions

On a hike, you know you are going uphill when the slope under your feet is positive. The derivative is that slope.

Sufficient condition for monotonicity If \(f(x)\) is continuous on \([a, b]\) and its first derivative \(f'(x)\) is positive in that interval, then \(f\) is increasing there; if \(f'(x)\) is negative, then \(f\) is decreasing.

This is a direct consequence of Lagrange's theorem (the post on mean value theorems): for \(x_1 < x_2\),

\[ f(x_2) - f(x_1) = (x_2 - x_1)\,f'(\xi), \]

and the sign of the right side is the sign of \(f'(\xi)\).

In practice: find where \(f'(x) = 0\) or doesn't exist. These points cut the domain into intervals; on each interval \(f'\) keeps one sign, so check one test point per interval.

Sufficient, not necessary \(f(x) = x^3\) is increasing on the whole real line, yet \(f'(0) = 0\). A function can increase even if its derivative vanishes at isolated points. What the theorem guarantees is the direction: positive derivative on an interval means increasing on it.

2. Extrema and critical points

Definition · Local extrema If \( f(x) > f(x_0) \) for every \(x \ne x_0\) in some neighbourhood of \(x_0\), the function has a minimum \(f(x_0)\) at \(x = x_0\). If \( f(x) < f(x_0) \) for every such \(x\), it has a maximum \(f(x_0)\). Minima and maxima together are called extrema.

These are local (relative) extrema: \(f(x_0)\) only has to be the biggest or smallest value nearby. A local maximum can be lower than a local minimum elsewhere on the graph, just as a hilltop in a valley can be lower than the floor of a mountain lake.

Necessary condition If \(x_0\) is a point of extremum, then \[ f'(x_0) = 0 \qquad \text{or} \qquad f'(x_0) \text{ does not exist.} \] Such a point is called a critical point. The points where \(f'(x_0) = 0\) are called stationary points.

Why: at a smooth peak or valley the tangent is horizontal (Fermat's theorem, used in the proof of Rolle's theorem). But a peak can also be a corner, like \(|x|\) at \(0\), or a cusp, where the derivative doesn't exist at all.

Critical does not mean extremum The condition is necessary, not sufficient. \(f(x) = x^3\) has \(f'(0) = 0\), but \(0\) is not an extremum: the function keeps increasing through it. Every critical point is only a candidate, which must be tested.

3. The first derivative test

Sufficient condition Let \(f\) be continuous at \(x_0\), with a finite derivative in a neighbourhood of \(x_0\) (except possibly at \(x_0\) itself). As \(x\) passes through \(x_0\) from left to right:
  • if \(f'(x)\) changes sign from \((+)\) to \((-)\), then \(f(x_0) = y_{\max}\);
  • if \(f'(x)\) changes sign from \((-)\) to \((+)\), then \(f(x_0) = y_{\min}\);
  • if \(f'(x)\) does not change sign, there is no extremum.

It is exactly the hiking picture: uphill then downhill means you passed a peak; downhill then uphill means a valley; downhill then downhill means you only crossed a flat or steep spot.

All the cases fit in one sign table (\(f\) decreasing at the far left, as in the original textbook):

\(x\)\(x_1\)\(x_2\)\(x_3\)\(x_4\)
\(y'\)−0+does not exist−0−−∞−
\(y\)decreasesmin ◡increasesmax ∧decreasesinflection, horizontal tangentdecreasesinflection, vertical tangentdecreases
Example 1 · An extremum where the derivative doesn't exist \( f(x) = \sqrt[3]{x^2} \): \( f'(x) = \frac{2}{3\sqrt[3]{x}} \) is negative for \(x < 0\), positive for \(x > 0\), and does not exist at \(0\). So \(f(0) = 0\) is a minimum, at a cusp. Setting \(f' = 0\) alone would have missed it.

4. The second derivative test (and higher derivatives)

At a stationary point there is often a quicker test that avoids checking signs on both sides.

Second derivative test Let \( f'(x_0) = 0 \).
  1. If \( f''(x_0) > 0 \), the function has a minimum at \(x_0\).
  2. If \( f''(x_0) < 0 \), the function has a maximum at \(x_0\).
  3. If \( f''(x_0) = 0 \), the question remains open.

Why: \( f''(x_0) > 0 \) means \(f'\) is increasing at \(x_0\). Since \(f'(x_0) = 0\), the derivative goes from negative to positive: a minimum. Geometrically, the graph bends upward like a cup \(\cup\), and the bottom of a cup is a minimum. Memory aid: positive second derivative, cup, minimum; negative, cap \(\cap\), maximum.

When \( f''(x_0) = 0 \), look at the higher derivatives:

Higher-derivative test Let \( f'(x_0) = f''(x_0) = \cdots = f^{(n-1)}(x_0) = 0 \) and \( f^{(n)}(x_0) \ne 0 \) (the first non-zero derivative has order \(n\)).
  • If \(n\) is even, \(f\) has an extremum at \(x_0\): a maximum if \( f^{(n)}(x_0) < 0 \), a minimum if \( f^{(n)}(x_0) > 0 \).
  • If \(n\) is odd, there is no extremum; \(x_0\) is an inflection point (with horizontal tangent).

Why: by Taylor's formula, near \(x_0\),

\[ f(x) - f(x_0) \approx \frac{f^{(n)}(x_0)}{n!}(x - x_0)^n. \]

For even \(n\), \((x - x_0)^n > 0\) on both sides, so \(f(x) - f(x_0)\) has one fixed sign: an extremum. For odd \(n\), \((x - x_0)^n\) changes sign at \(x_0\): no extremum. The model cases are \(x^2\), \(x^4\) (minimum) and \(x^3\), \(x^5\) (inflection).

Example 2 · When the second derivative is zero
  • \( f(x) = x^4 \): \( f'(0) = f''(0) = f'''(0) = 0 \), \( f^{(4)}(0) = 24 > 0 \). Order \(4\) is even: minimum.
  • \( f(x) = x^3 \): \( f'(0) = f''(0) = 0 \), \( f'''(0) = 6 \ne 0 \). Order \(3\) is odd: no extremum, an inflection point.

5. Concavity and inflection points

The second derivative tells which way the graph bends. Compare the curve with its tangent:

Definition · Concavity Near a point \(x_0\), the curve \(y = f(x)\) may lie
  • above its tangent at that point: the curve bends upward like a cup \(\cup\), called concave up (or convex), or
  • below its tangent: the curve bends downward like a cap \(\cap\), called concave down (or concave).
If \( y'' > 0 \) on \([a, b]\), the curve is concave up there; if \( y'' < 0 \), it is concave down.
A word about terminology Books disagree on the words "concave" and "convex". Many older European textbooks call a curve that lies above its tangent (\(y'' > 0\)) "concave in the positive direction of the \(y\)-axis", the view of an observer looking up from below. Most modern books call the same curve convex or concave up. The mathematics is the same; only the words differ. To stay safe, think in terms of the sign of \(y''\): \(y'' > 0\): cup \(\cup\), above the tangent; \(y'' < 0\): cap \(\cap\), below the tangent.

Why the sign of \(y''\) decides: \(y'' > 0\) means the slope \(y'\) is increasing. Walking left to right, the tangent keeps turning counter-clockwise, so the curve keeps bending upward, away from each tangent line.

Inflection points Points where the curve changes its concavity are called inflection points.
  • Necessary condition: \( f''(x_0) = 0 \) or \( f''(x_0) \) does not exist.
  • Sufficient condition: \(f''\) changes sign at \(x_0\), that is, \(y = f(x)\) changes concavity there.

At an inflection point the curve crosses its tangent: it is above the tangent on one side and below on the other. Physically, it is the moment when acceleration changes sign, when a car stops speeding up and starts slowing down (post on derivatives in physics).

\(f'' = 0\) is not enough For \( f(x) = x^4 \), \(f''(0) = 0\), but \( f''(x) = 12x^2 \ge 0 \) on both sides: the curve is concave up everywhere, and \(0\) is a minimum, not an inflection point. Always check that \(f''\) actually changes sign.

6. A complete example

Example 3 · \( f(x) = x^3 - 3x \)

Monotonicity and extrema. \( f'(x) = 3x^2 - 3 = 3(x - 1)(x + 1) \). Stationary points: \(x = \pm1\).

\(x\)\((-\infty, -1)\)\(-1\)\((-1, 1)\)\(1\)\((1, \infty)\)
\(f'\)+0−0+
\(f\)increasesmax \(2\)decreasesmin \(-2\)increases

Check with the second derivative \( f''(x) = 6x \): \( f''(-1) = -6 < 0 \) (maximum), \( f''(1) = 6 > 0 \) (minimum). ✓

Concavity and inflection. \( f''(x) = 6x \) is negative for \(x < 0\) (concave down) and positive for \(x > 0\) (concave up). It changes sign at \(0\), so \( (0, 0) \) is an inflection point. The tangent there, \(y = -3x\), is crossed by the curve.

x y max (−1, 2) min (1, −2) inflection concave down ∩ (y″ < 0) concave up ∪ (y″ > 0)
Figure 1. \(y = x^3 - 3x\): maximum at \((-1, 2)\), minimum at \((1, -2)\), and an inflection point at the origin, where the curve crosses its tangent \(y = -3x\) (dashed). Left of the origin the graph is concave down (\(y'' < 0\)), right of it concave up (\(y'' > 0\)).
Example 4 · \( f(x) = x\,e^{-x} \) \( f'(x) = (1 - x)e^{-x} \): positive for \(x < 1\), negative for \(x > 1\). So \( f(1) = \frac1e \approx 0.368 \) is a maximum.

\( f''(x) = (x - 2)e^{-x} \): changes sign at \(x = 2\). Inflection point \( \big(2, \frac{2}{e^2}\big) \approx (2, 0.27) \): concave down before it, concave up after it, as the curve flattens towards the \(x\)-axis.

7. Largest and smallest values on an interval

A continuous function on a closed interval \([a, b]\) always attains a largest and a smallest value (Weierstrass' theorem). These global extrema occur either at critical points inside the interval or at the endpoints. That gives a simple recipe:

  1. Find the critical points of \(f\) in \((a, b)\).
  2. Compute \(f\) at those points and at \(a\) and \(b\).
  3. The largest of these values is the global maximum, the smallest the global minimum.
Example 5 \( f(x) = x^3 - 3x \) on \([0, 3]\). Critical point inside: \(x = 1\). Values: \( f(0) = 0 \), \( f(1) = -2 \), \( f(3) = 18 \). Global minimum \(-2\) (at \(x = 1\)), global maximum \(18\) (at the endpoint \(x = 3\), which is not a critical point at all).

8. Optimization problems

Extrema are the mathematics of "the best": the largest area, the lowest cost, the shortest time. The method:

  1. Name the quantity to optimize and express it as a function of one variable (use the constraint to eliminate the others).
  2. Determine the allowed interval for that variable.
  3. Find the critical points, and check which gives the maximum or minimum (sign of \(f'\), sign of \(f''\), or comparing values at the endpoints).
  4. Answer the original question, with units.
Example 6 · Fencing a field by a river A farmer has \(100\) m of fence to enclose a rectangular field along a straight river; the river side needs no fence. What is the largest possible area?

Let \(x\) be the length of each side perpendicular to the river. The side parallel to it is \(100 - 2x\), so

\[ A(x) = x(100 - 2x) = 100x - 2x^2, \qquad 0 < x < 50. \]

\( A'(x) = 100 - 4x = 0 \) gives \(x = 25\), and \( A''(x) = -4 < 0 \): a maximum. The field is \(25 \times 50\) m, with area \(1250\) m².

Example 7 · An open box from a square sheet From a \(12 \times 12\) cm sheet, equal squares of side \(x\) are cut from the corners and the sides are folded up. Which \(x\) gives the largest volume? \[ V(x) = x(12 - 2x)^2, \qquad 0 < x < 6, \qquad V'(x) = (12 - 2x)(12 - 6x). \]

Inside the interval, \(V' = 0\) only at \(x = 2\); \(V'\) changes from \(+\) to \(-\) there. So the maximum volume is \( V(2) = 2\cdot 8^2 = 128 \) cm³.

9. Summary

QuestionLook atRule
Increasing / decreasing?sign of \(f'\)\(f' > 0\): increasing; \(f' < 0\): decreasing
Candidates for extremacritical points\(f' = 0\) or \(f'\) doesn't exist
Max or min? (1st test)sign change of \(f'\)\(+ \to -\): max; \(- \to +\): min; none: no extremum
Max or min? (2nd test)\(f''(x_0)\) at a stationary point\(f'' < 0\): max; \(f'' > 0\): min; \(= 0\): use higher derivatives
Higher-derivative testfirst non-zero \(f^{(n)}(x_0)\)\(n\) even: extremum; \(n\) odd: inflection
Concavitysign of \(f''\)\(f'' > 0\): \(\cup\), above tangent; \(f'' < 0\): \(\cap\), below tangent
Inflection pointssign change of \(f''\)candidates: \(f'' = 0\) or doesn't exist
Global extrema on \([a, b]\)critical points and endpointscompare all values

10. Practice problems

Try each one before opening the solution. More solved problems from this topic are in Differential Calculus.

Problem 1: Find the intervals of monotonicity, extrema and inflection points of \( f(x) = x^3 - 6x^2 + 9x + 1 \).

\( f' = 3(x - 1)(x - 3) \): increasing on \((-\infty, 1)\) and \((3, \infty)\), decreasing on \((1, 3)\). Maximum \(f(1) = 5\), minimum \(f(3) = 1\). \( f'' = 6x - 12 \): inflection point at \((2, 3)\).

Problem 2: Find the extrema of \( f(x) = x^2e^{-x} \).

\( f' = x(2 - x)e^{-x} \). Sign: \(-\) on \((-\infty, 0)\), \(+\) on \((0, 2)\), \(-\) on \((2, \infty)\). Minimum \(f(0) = 0\), maximum \( f(2) = \frac{4}{e^2} \approx 0.54 \).

Problem 3: Find the maximum of \( f(x) = \dfrac{\ln x}{x} \).

\( f' = \frac{1 - \ln x}{x^2} = 0 \Rightarrow x = e \); \(f'\) changes from \(+\) to \(-\). Maximum \( f(e) = \frac1e \). (Consequence: \( \sqrt[x]{x} \) is largest at \(x = e\), and \( e^\pi > \pi^e \).)

Problem 4: Does \( f(x) = x^5 \) have an extremum at \(x = 0\)?

\( f'(0) = f''(0) = f'''(0) = f^{(4)}(0) = 0 \), \( f^{(5)}(0) = 120 \ne 0 \). The order \(5\) is odd: no extremum, an inflection point.

Problem 5: Find the largest and smallest values of \( f(x) = x - 2\sin x \) on \([0, \pi]\).

\( f' = 1 - 2\cos x = 0 \Rightarrow x = \frac\pi3 \), with \( f''\big(\frac\pi3\big) = 2\sin\frac\pi3 > 0 \) (a minimum). Values: \( f(0) = 0 \), \( f\big(\frac\pi3\big) = \frac\pi3 - \sqrt3 \approx -0.685 \), \( f(\pi) = \pi \). Global minimum \( \frac\pi3 - \sqrt3 \), global maximum \(\pi\).

Problem 6: Find the intervals of concavity and the inflection points of \( f(x) = \dfrac{1}{1 + x^2} \).

\( f'' = \frac{6x^2 - 2}{(1 + x^2)^3} \). It is zero at \( x = \pm\frac{1}{\sqrt3} \) and changes sign there. Concave up (\(\cup\)) for \( |x| > \frac{1}{\sqrt3} \), concave down (\(\cap\)) for \( |x| < \frac{1}{\sqrt3} \). Inflection points \( \big(\pm\frac{1}{\sqrt3}, \frac34\big) \).

Problem 7: Of all rectangles with perimeter \(20\), which has the largest area?

Sides \(x\) and \(10 - x\): \( A = x(10 - x) \), \( A' = 10 - 2x = 0 \Rightarrow x = 5 \), \( A'' = -2 < 0 \). The square \(5 \times 5\), area \(25\).

Problem 8: Show that \( f(x) = \sqrt[3]{x} \) has an inflection point at \(0\), although \(f''(0)\) does not exist.

\( f''(x) = -\frac{2}{9}x^{-5/3} \): positive for \(x < 0\), negative for \(x > 0\), undefined at \(0\). Concavity changes, so \((0, 0)\) is an inflection point, with a vertical tangent (\(f'(0) = +\infty\)), the case \(x_4\) in the sign table, with the opposite orientation.

Final thoughts

The first derivative tells you where the graph goes (up or down), and where it turns around. The second derivative tells you how it bends, and where the bending changes. Every critical point and every zero of \(f''\) is only a candidate, to be confirmed by a sign change. With these two derivatives you can sketch almost any graph, and turn "what is the best possible value?" into a calculation.

Related posts: the mean value theorems (why the sign of \(f'\) decides monotonicity), higher derivatives, and Taylor's formula (the argument behind the higher-derivative test).