---
title: How Derivatives Shape a Graph
module: Applications of Derivatives
moduleNumber: 3
lessonNumber: 2
order: 302
summary: >
  The sign of the first derivative fixes where a function rises and falls, and
  a sign change identifies each local extremum through the First Derivative
  Test. The second derivative sets concavity and inflection points and gives a
  faster Second Derivative Test. Limits at infinity describe end behavior and
  the horizontal asymptotes a curve settles toward.
topics: [Applications of Derivatives]
sources:
  - book: Stewart
    ref: "Ch. 3 — Applications of Differentiation; §3.3 How Derivatives Affect the Shape of a Graph"
  - book: Stewart
    ref: "Ch. 3; §3.4 Limits at Infinity; Horizontal Asymptotes"
---

Critical numbers mark where extrema can occur, but not which are maxima and which
are minima. The two derivatives settle it. Since $f'(x)$ is the slope of the
curve, its sign records the direction of travel, and $f''(x)$ records how that
direction is turning. Reading these two signs off a function reconstructs its
shape without plotting a single extra point.

## Increasing, decreasing, and the sign of $f'$

Between two points where the tangent slopes uphill the function is rising;
between two points where it slopes downhill it is falling. The Mean Value
Theorem promotes that observation to a theorem.

> **Theorem (Increasing/Decreasing Test).** If $f'(x) > 0$ on an interval, then
> $f$ is increasing on that interval. If $f'(x) < 0$ on an interval, then $f$ is
> decreasing on that interval.

For any $x_1 < x_2$ in the interval, the Mean Value Theorem gives a $c$ between
them with $f(x_2) - f(x_1) = f'(c)(x_2 - x_1)$. The factor $x_2 - x_1$ is
positive, so $f(x_2) - f(x_1)$ takes the sign of $f'(c)$: positive slope makes
$f(x_2) > f(x_1)$, negative slope reverses it.

The critical numbers cut the domain into intervals on which $f'$ keeps a constant
sign, so testing one point per interval settles the whole interval. For
$f(x) = 3x^4 - 4x^3 - 12x^2 + 5$,

$$
f'(x) = 12x^3 - 12x^2 - 24x = 12x(x-2)(x+1),
$$

with critical numbers $x = -1, 0, 2$. A sign chart multiplies the signs of the
three factors on each interval.

| Interval | $12x$ | $x-2$ | $x+1$ | $f'(x)$ | $f$ |
| --- | --- | --- | --- | --- | --- |
| $x < -1$ | $-$ | $-$ | $-$ | $-$ | decreasing |
| $-1 < x < 0$ | $-$ | $-$ | $+$ | $+$ | increasing |
| $0 < x < 2$ | $+$ | $-$ | $+$ | $-$ | decreasing |
| $x > 2$ | $+$ | $+$ | $+$ | $+$ | increasing |

$$
% caption: A sign chart of $f'$: each critical number is a boundary where the
% slope changes sign, and the arrows show the matching rise and fall of $f$.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
\draw[black, thick] (-0.5,0) -- (9.0,0);
\foreach \x/\lab in {1/-1, 3/0, 5/2}
  {\fill[acc] (\x,0) circle (2.2pt); \node[black!75, below=4pt] at (\x,0) {\lab};}
% signs of f'
\node[black!70] at (0.2,0.5) {$\frac{df}{dx}<0$};
\node[black!70] at (2.0,0.5) {$\frac{df}{dx}>0$};
\node[black!70] at (4.0,0.5) {$\frac{df}{dx}<0$};
\node[black!70] at (7.0,0.5) {$\frac{df}{dx}>0$};
% arrows for rise/fall below
\draw[acc, thick, ->] (0.6,-0.95) -- (0.0,-1.35);
\draw[acc, thick, ->] (1.6,-1.35) -- (2.4,-0.95);
\draw[acc, thick, ->] (3.6,-0.95) -- (4.4,-1.35);
\draw[acc, thick, ->] (5.8,-1.35) -- (6.8,-0.95);
\node[black!70] at (0.3,-1.6) {fall};
\node[black!70] at (2.0,-1.6) {rise};
\node[black!70] at (4.0,-1.6) {fall};
\node[black!70] at (6.3,-1.6) {rise};
\end{tikzpicture}
$$

## The First Derivative Test

A local extremum sits where the function stops rising and starts falling, or the
reverse. In terms of the derivative, an extremum is a sign change of $f'$.

> **Theorem (First Derivative Test).** Suppose $c$ is a critical number of a
> continuous function $f$.
> - If $f'$ changes from positive to negative at $c$, then $f$ has a **local
>   maximum** at $c$.
> - If $f'$ changes from negative to positive at $c$, then $f$ has a **local
>   minimum** at $c$.
> - If $f'$ does not change sign at $c$, then $f$ has **neither** at $c$.

The test follows from the Increasing/Decreasing Test: rising then falling makes a
peak, falling then rising makes a valley, and no change of direction makes
neither.

$$
% caption: The four sign patterns of $f'$ around a critical number $c$, and the
% shape each produces.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\scriptsize]
\definecolor{acc}{HTML}{4A6FA5}
% (a) local max
\begin{scope}
\draw[->, black] (-0.2,0) -- (2.2,0);
\draw[black, very thick] (0.1,0.2) .. controls (0.9,1.4) and (1.1,1.4) .. (1.9,0.2);
\fill[acc] (1.0,1.28) circle (1.6pt);
\draw[dashed, black] (1.0,0) -- (1.0,1.28);
\node[black!75, below=2pt] at (1.0,0) {$c$};
\node[black!70] at (1.0,-0.7) {local max};
\end{scope}
% (b) local min
\begin{scope}[xshift=3.2cm]
\draw[->, black] (-0.2,0) -- (2.2,0);
\draw[black, very thick] (0.1,1.4) .. controls (0.9,0.2) and (1.1,0.2) .. (1.9,1.4);
\fill[acc] (1.0,0.32) circle (1.6pt);
\draw[dashed, black] (1.0,0) -- (1.0,0.32);
\node[black!75, below=2pt] at (1.0,0) {$c$};
\node[black!70] at (1.0,-0.7) {local min};
\end{scope}
% (c) no extremum, increasing through
\begin{scope}[xshift=6.4cm]
\draw[->, black] (-0.2,0) -- (2.2,0);
\draw[black, very thick] (0.1,0.3) .. controls (0.9,0.85) and (1.1,0.85) .. (1.9,1.4);
\fill[acc] (1.0,0.85) circle (1.6pt);
\draw[dashed, black] (1.0,0) -- (1.0,0.85);
\node[black!75, below=2pt] at (1.0,0) {$c$};
\node[black!70] at (1.0,-0.7) {neither};
\end{scope}
% (d) no extremum, decreasing through
\begin{scope}[xshift=9.6cm]
\draw[->, black] (-0.2,0) -- (2.2,0);
\draw[black, very thick] (0.1,1.4) .. controls (0.9,0.85) and (1.1,0.85) .. (1.9,0.3);
\fill[acc] (1.0,0.85) circle (1.6pt);
\draw[dashed, black] (1.0,0) -- (1.0,0.85);
\node[black!75, below=2pt] at (1.0,0) {$c$};
\node[black!70] at (1.0,-0.7) {neither};
\end{scope}
\end{tikzpicture}
$$

For the function above, $f'$ changes from negative to positive at $x = -1$ and at
$x = 2$, so both give local minima, $f(-1) = 0$ and $f(2) = -27$. It changes from
positive to negative at $x = 0$, so $f(0) = 5$ is a local maximum.

> **Worked example.** Classify the critical numbers of $f(x) = 3x^5 - 5x^3$. The
> derivative $f'(x) = 15x^4 - 15x^2 = 15x^2(x-1)(x+1)$ vanishes at $x = -1, 0, 1$.
> The factor $15x^2$ is nonnegative, so the sign of $f'$ tracks $(x-1)(x+1)$:
>
> - **At $x = -1$:** $f'$ runs $+$ then $-$, a local maximum, $f(-1) = 2$.
> - **At $x = 0$:** $f'$ is negative on both sides (the $x^2$ factor keeps the
>   sign), no extremum — the tangent is horizontal but the curve keeps falling.
> - **At $x = 1$:** $f'$ runs $-$ then $+$, a local minimum, $f(1) = -2$.
>
> The point $x = 0$ shows the third case of the First Derivative Test: a critical
> number where $f'$ does not change sign is neither a maximum nor a minimum.

## Concavity and the second derivative

The first derivative reports direction; the second reports how direction bends.
A curve can rise while curving up like a bowl or up like a dome, and the two look
completely different.

> **Definition (Concavity).** If the graph of $f$ lies above all of its tangent
> lines on an interval $I$, $f$ is **concave upward** on $I$. If it lies below
> all of its tangents on $I$, $f$ is **concave downward** on $I$.

Concave upward means the slope $f'$ is itself increasing, which happens exactly
when $f'' > 0$. Concave downward is the mirror image.

> **Theorem (Concavity Test).** If $f''(x) > 0$ for all $x$ in $I$, the graph is
> concave upward on $I$. If $f''(x) < 0$ for all $x$ in $I$, it is concave
> downward on $I$.

A point where concavity switches is where the curve changes the way it bends.

> **Definition (Inflection point).** A point $P$ on $y = f(x)$ is an **inflection
> point** if $f$ is continuous there and the concavity changes from upward to
> downward, or downward to upward, at $P$.

At an inflection point the second derivative changes sign, so any inflection
point with $f''$ defined has $f''= 0$ there. The converse fails: $f(x) = x^4$ has
$f''(0) = 0$ but $(0,0)$ is not an inflection point, since $f'' = 12x^2 \ge 0$
never changes sign.

$$
% caption: Concave up (slopes increasing) meets concave down (slopes decreasing)
% at the inflection point, where the curve crosses its own tangent.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
\draw[->, black] (-0.3,0) -- (7.2,0) node[right, black!70] {$x$};
\draw[->, black] (0,-0.3) -- (0,3.6) node[above, black!70] {$y$};
% cubic-like S curve: concave up then down... use concave down then up
\draw[black, very thick]
  (0.5,0.5) .. controls (1.8,1.3) and (2.6,2.0) .. (3.4,2.0)
  .. controls (4.2,2.0) and (5.0,2.7) .. (6.4,3.4);
% inflection point at (3.4,2.0)
\fill[acc] (3.4,2.0) circle (2.2pt);
\draw[black, thick] (2.2,1.35) -- (4.6,2.65);
\draw[dashed, black] (3.4,0) -- (3.4,2.0);
\node[black!75, anchor=north] at (3.4,-0.05) {inf\/lection};
\node[black!70] at (1.7,2.25) {concave up};
\node[black!70] at (5.4,1.55) {concave down};
\end{tikzpicture}
$$

## The Second Derivative Test

At a critical number where $f'(c) = 0$, the concavity settles which kind of
extremum it is. A bowl-shaped graph sits above its horizontal tangent (minimum);
a dome sits below it (maximum).

> **Theorem (Second Derivative Test).** Suppose $f''$ is continuous near $c$.
> - If $f'(c) = 0$ and $f''(c) > 0$, then $f$ has a **local minimum** at $c$.
> - If $f'(c) = 0$ and $f''(c) < 0$, then $f$ has a **local maximum** at $c$.

The test is inconclusive when $f''(c) = 0$: there might be a maximum, a minimum,
or neither, and the First Derivative Test must be used instead. It is also
inconclusive when $f''(c)$ does not exist.

For $f(x) = x^4 - 4x^3$, the derivatives are $f'(x) = 4x^2(x-3)$ and
$f''(x) = 12x(x-2)$. The critical numbers are $x = 0$ and $x = 3$. At $x = 3$,
$f''(3) = 36 > 0$, so $f(3) = -27$ is a local minimum. At $x = 0$, $f''(0) = 0$
and the Second Derivative Test gives nothing; the First Derivative Test shows
$f' < 0$ on both sides, so $x = 0$ yields neither. The second derivative vanishes
at $x = 0$ and $x = 2$, and it changes sign at both, so $(0,0)$ and $(2, -16)$ are
inflection points.

| Interval | $f''(x) = 12x(x-2)$ | concavity |
| --- | --- | --- |
| $x < 0$ | $+$ | upward |
| $0 < x < 2$ | $-$ | downward |
| $x > 2$ | $+$ | upward |

The two tests carry the same information in different form. The choice between
them is one of convenience: the Second Derivative Test is a single evaluation
when $f''$ is easy, while the First Derivative Test always applies and handles
the cases the second cannot.

> **Worked example.** Analyze $f(x) = x^4 - 2x^2$ completely. The derivative
> $f'(x) = 4x^3 - 4x = 4x(x-1)(x+1)$ has critical numbers $x = -1, 0, 1$. The
> second derivative $f''(x) = 12x^2 - 4$ evaluates to
>
> $$
> f''(-1) = 8 > 0, \qquad f''(0) = -4 < 0, \qquad f''(1) = 8 > 0.
> $$
>
> The Second Derivative Test gives local minima $f(\pm 1) = -1$ and a local
> maximum $f(0) = 0$. Concavity flips where $f'' = 0$, at $x = \pm\tfrac{1}{\sqrt3}$,
> so $\left(\pm\tfrac{1}{\sqrt3}, -\tfrac{5}{9}\right)$ are inflection points. The
> function is even, so the two wells are mirror images across the $y$-axis.

$$
% caption: The graph of $y = x^4 - 2x^2$: two local minima at $x = \pm 1$ flank a
% local maximum at the origin, with inflection points where the concavity flips.
\begin{tikzpicture}[xscale=1.75, yscale=1.2, >=stealth, font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
\draw[->, black] (-1.7,0) -- (1.7,0) node[right, black!70] {$x$};
\draw[->, black] (0,-1.3) -- (0,1.35) node[above, black!70] {$y$};
\draw[black, very thick] plot[domain=-1.48:1.48, samples=100] (\x, {\x*\x*\x*\x - 2*\x*\x});
\fill[acc] (0,0) circle (1.6pt) node[above right=1pt, black!75] {loc max};
\fill[acc] (1,-1) circle (1.6pt) node[below=2pt, black!75] {loc min};
\fill[acc] (-1,-1) circle (1.6pt) node[below=2pt, black!75] {loc min};
\fill[black] (0.577,-0.556) circle (1.2pt) node[right=1pt, black!70] {inf\/lection};
\fill[black] (-0.577,-0.556) circle (1.2pt);
\end{tikzpicture}
$$

## The correspondence between $f$, $f'$, and $f''$

Stacking a function above its first and second derivatives makes every feature
line up vertically. Where $f'$ crosses zero, $f$ has a horizontal tangent; where
$f''$ crosses zero, $f$ has an inflection.

$$
% caption: $f$, $f'$, and $f''$ aligned: zeros of $f'$ mark extrema of $f$;
% zeros of $f''$ mark inflections of $f$ and extrema of $f'$.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
% f on top
\begin{scope}[yshift=5.2cm]
\draw[->, black] (-0.2,0) -- (6.6,0) node[right, black!70] {$x$};
\draw[black, very thick] plot[domain=0.3:6.1, samples=80]
  (\x, {0.11*(\x-1)*(\x-3.2)*(\x-5.3)+1.3});
\node[black!70, anchor=west] at (6.0,1.7) {$f$};
\draw[dashed, black] (2.0,0) -- (2.0,1.74);
\draw[dashed, black] (4.35,0) -- (4.35,0.90);
\end{scope}
% f' middle: parabola with roots at the extrema of f
\begin{scope}[yshift=2.7cm]
\draw[->, black] (-0.2,0) -- (6.6,0) node[right, black!70] {$x$};
\draw[black, very thick] plot[domain=0.3:6.1, samples=80]
  (\x, {0.20*(\x-2.0)*(\x-4.35)+0.8});
\node[black!70, anchor=west] at (6.0,1.3) {$\frac{df}{dx}$};
\fill[acc] (2.0,0.8) circle (1.8pt);
\fill[acc] (4.35,0.8) circle (1.8pt);
\draw[dashed, black] (2.0,0) -- (2.0,0.8);
\draw[dashed, black] (4.35,0) -- (4.35,0.8);
\node[black, anchor=south] at (2.0,0.85) {$\frac{df}{dx}=0$};
\node[black, anchor=south] at (4.35,0.85) {$\frac{df}{dx}=0$};
\end{scope}
% f'' bottom: line with root at the inflection of f
\begin{scope}
\draw[->, black] (-0.2,0) -- (6.6,0) node[right, black!70] {$x$};
\draw[black, very thick] plot[domain=0.3:6.1, samples=2]
  (\x, {0.42*(\x-3.175)+0.7});
\node[black!70, anchor=west] at (6.0,1.15) {$\frac{d^2f}{dx^2}$};
\fill[acc] (3.175,0.7) circle (1.8pt);
\draw[dashed, black] (3.175,0) -- (3.175,0.7);
\node[black, anchor=south] at (3.175,0.8) {$\frac{d^2f}{dx^2}=0$};
\end{scope}
\end{tikzpicture}
$$

## Limits at infinity and horizontal asymptotes

The tests above describe local shape. End behavior asks a different question:
what does $f(x)$ approach as $x$ runs off to $\pm\infty$?

> **Definition (Limit at infinity).** $\lim_{x \to \infty} f(x) = L$ means the
> values of $f(x)$ can be made arbitrarily close to $L$ by requiring $x$
> sufficiently large. Replacing "large" with "large negative" defines
> $\lim_{x \to -\infty} f(x) = L$.

> **Definition (Horizontal asymptote).** The line $y = L$ is a **horizontal
> asymptote** of $y = f(x)$ if $\lim_{x \to \infty} f(x) = L$ or
> $\lim_{x \to -\infty} f(x) = L$.

A curve can approach its asymptote from above, from below, or by oscillating
across it, and the two ends may settle toward different values. The base case is
the reciprocal power.

> **Theorem (Reciprocal powers vanish).** For any rational $r > 0$,
> $\lim_{x \to \infty} \dfrac{1}{x^r} = 0$, and if $x^r$ is defined for $x < 0$,
> $\lim_{x \to -\infty} \dfrac{1}{x^r} = 0$.

$$
% caption: As $x$ grows, $1/x^r$ collapses toward the asymptote $y = 0$; the
% rational function settles toward its ratio-of-leading-coefficients line.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
\draw[->, black] (-0.3,0) -- (7.4,0) node[right, black!70] {$x$};
\draw[->, black] (0,-0.3) -- (0,3.2) node[above, black!70] {$y$};
% horizontal asymptote y = L
\draw[acc, dashed] (0,1.8) -- (7.1,1.8);
\node[acc, anchor=east] at (-0.05,1.8) {$L$};
% curve approaching L from below
\draw[black, very thick] plot[domain=0.35:7.0, samples=90]
  (\x, {1.8 - 1.6/(\x+0.4)});
\node[black, anchor=west] at (5.3,1.35) {$y=f(x)$};
\end{tikzpicture}
$$

For a rational function, divide numerator and denominator by the highest power of
$x$ in the denominator, then send each reciprocal power to zero. For
$f(x) = \dfrac{3x^2 - x - 2}{5x^2 + 4x + 1}$,

$$
\lim_{x \to \infty} \frac{3x^2 - x - 2}{5x^2 + 4x + 1}
= \lim_{x \to \infty} \frac{3 - \tfrac{1}{x} - \tfrac{2}{x^2}}
                            {5 + \tfrac{4}{x} + \tfrac{1}{x^2}}
= \frac{3 - 0 - 0}{5 + 0 + 0} = \frac{3}{5}.
$$

The same value comes out at $-\infty$, so $y = \tfrac{3}{5}$ is a horizontal
asymptote at both ends. The rule generalizes: for a rational function the
horizontal asymptote is the ratio of leading coefficients when the degrees match,
$y = 0$ when the denominator's degree is larger, and there is none when the
numerator's degree is larger.

A radical in the numerator makes the two ends disagree, because $\sqrt{x^2}$
equals $x$ for positive $x$ but $-x$ for negative $x$.

> **Worked example.** Find the horizontal asymptotes of
> $f(x) = \dfrac{\sqrt{2x^2 + 1}}{3x - 5}$. Divide numerator and denominator by
> $x$. For $x > 0$, $\sqrt{x^2} = x$, so
>
> $$
> \lim_{x \to \infty} \frac{\sqrt{2x^2 + 1}}{3x - 5}
> = \lim_{x \to \infty} \frac{\sqrt{2 + \tfrac{1}{x^2}}}{3 - \tfrac{5}{x}}
> = \frac{\sqrt{2}}{3}.
> $$
>
> For $x < 0$, $\sqrt{x^2} = -x$, which flips the sign of the numerator once it
> passes under the radical, so the limit as $x \to -\infty$ is $-\tfrac{\sqrt2}{3}$.
> The graph has two horizontal asymptotes, $y = \tfrac{\sqrt2}{3}$ and
> $y = -\tfrac{\sqrt2}{3}$.

> **Worked example.** Evaluate $\lim_{x \to \infty}\bigl(\sqrt{x^2 + 1} - x\bigr)$.
> Both terms grow without bound, so multiply by the conjugate over itself:
>
> $$
> \sqrt{x^2 + 1} - x
> = \frac{\bigl(\sqrt{x^2 + 1} - x\bigr)\bigl(\sqrt{x^2 + 1} + x\bigr)}{\sqrt{x^2 + 1} + x}
> = \frac{1}{\sqrt{x^2 + 1} + x}.
> $$
>
> The denominator grows without bound, so the limit is $0$. Geometrically, the
> curve $y = \sqrt{x^2 + 1}$ approaches the line $y = x$ from above.[^stewart-shape]

[^stewart-shape]: Stewart, §3.3 — How Derivatives Affect the Shape of a Graph: the Increasing/Decreasing Test, First Derivative Test, Concavity Test, inflection points, and Second Derivative Test; §3.4 — Limits at Infinity; Horizontal Asymptotes: limits at infinity, horizontal asymptotes, vanishing reciprocal powers, and end behavior of rational functions.
