Calculus · Differential calculus
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.
On a hike, you know you are going uphill when the slope under your feet is positive. The derivative is that slope.
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.
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.
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.
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\) | decreases | min ◡ | increases | max ∧ | decreases | inflection, horizontal tangent | decreases | inflection, vertical tangent | decreases |
At a stationary point there is often a quicker test that avoids checking signs on both sides.
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:
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).
The second derivative tells which way the graph bends. Compare the curve with its 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.
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).
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\) | increases | max \(2\) | decreases | min \(-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.
\( 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.
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:
Extrema are the mathematics of "the best": the largest area, the lowest cost, the shortest time. The method:
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².
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³.
| Question | Look at | Rule |
|---|---|---|
| Increasing / decreasing? | sign of \(f'\) | \(f' > 0\): increasing; \(f' < 0\): decreasing |
| Candidates for extrema | critical 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 test | first non-zero \(f^{(n)}(x_0)\) | \(n\) even: extremum; \(n\) odd: inflection |
| Concavity | sign of \(f''\) | \(f'' > 0\): \(\cup\), above tangent; \(f'' < 0\): \(\cap\), below tangent |
| Inflection points | sign change of \(f''\) | candidates: \(f'' = 0\) or doesn't exist |
| Global extrema on \([a, b]\) | critical points and endpoints | compare all values |
Try each one before opening the solution. More solved problems from this topic are in Differential Calculus.
\( 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)\).
\( 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 \).
\( 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 \).)
\( 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.
\( 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\).
\( 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) \).
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\).
\( 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.
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).