The shape of a graph

The derivatives of a function tell us the shape of its graph. The first derivative tells us where the graph goes up and where it goes down. The second derivative tells us which way the graph bends.

Increasing and decreasing functions

A function is increasing on an interval if its graph goes up from left to right there. It is decreasing if its graph goes down.

Increasing/Decreasing Test:

Why: Take $x_1<x_2$ in the interval. By the Mean Value Theorem,

$f(x_2)-f(x_1)=f'(c)(x_2-x_1)$

for some $c$ between them. If $f'(c)>0$, the right side is positive. So $f(x_2)>f(x_1)$, and $f$ is increasing.

To use the test, find where $f'$ is positive and where it is negative. The sign of $f'$ can change only at critical numbers (or where $f$ is not defined). So the critical numbers split the number line into intervals. On each interval, test one number.

Example 1: Find where

$f(x)=x^3-3x^2-9x+2$

is increasing and where it is decreasing.

Solution:

$\begin{align*}&f'(x)\\&=3x^2-6x-9\\&=3(x^2-2x-3)\\&=3(x+1)(x-3)\end{align*}$

The critical numbers are $-1$ and $3$. Test one number in each interval.

For example, on $(-1,3)$, test $x=0$: $f'(0)=-9$, which is negative.

IntervalSign of $f'$$f$ is
$(-\infty,-1)$$+$increasing
$(-1,3)$$-$decreasing
$(3,\infty)$$+$increasing

So $f$ is increasing on $(-\infty,-1)$ and on $(3,\infty)$. It is decreasing on $(-1,3)$.

The first derivative test

At a local maximum, the graph goes up and then down. At a local minimum, it goes down and then up. This gives a test for local extreme values.

The First Derivative Test: Let $c$ be a critical number of a continuous function $f$.

Example 2: Find the local maximum and minimum values of the function in Example 1.

Solution:

From the table in Example 1:

  • At $-1$, $f'$ changes from $+$ to $-$. So $f$ has a local maximum, $f(-1)=7$.
  • At $3$, $f'$ changes from $-$ to $+$. So $f$ has a local minimum, $f(3)=-25$.
(−1, 7)(3, −25)(1, −9)xy
The graph of $f(x)=x^3-3x^2-9x+2$: a local maximum at $(-1,7)$, a local minimum at $(3,-25)$, and an inflection point at $(1,-9)$.

Concavity

Two graphs can both go up but bend in different ways. Concavity describes the bending.

xy
(a) Concave up: the graph lies above its tangent lines.
xy
(b) Concave down: the graph lies below its tangent lines.

On a concave up graph, the slopes increase from left to right. So $f'$ is increasing, and its derivative, $f''$, is positive. This gives the following test.

Concavity Test:

A point where the graph changes concavity is called an inflection point. To find one, look where $f''(x)=0$ or $f''(x)$ does not exist. Then check that $f''$ really changes sign there.

Example 3: Find the intervals of concavity and the inflection points of the function in Example 1,

$f(x)=x^3-3x^2-9x+2$.

Solution:

From Example 1, $f'(x)=3x^2-6x-9$. So

$f''(x)=6x-6$.

It is $0$ at $x=1$.

IntervalSign of $f''$Concave
$(-\infty,1)$$-$down
$(1,\infty)$$+$up

The concavity changes at $x=1$. So there is an inflection point at

$\begin{align*}&(1,f(1))\\&=(1,\,1-3-9+2)\\&=(1,-9)\end{align*}$

This is the teal point in the figure for Example 2.

The second derivative test

At a critical number with $f'(c)=0$, the concavity tells us what kind of point it is. A cup has a lowest point. A cap has a highest point.

The Second Derivative Test: Suppose that

$f'(c)=0$.

Check Example 1 with this test:

This agrees with Example 2.

Why can the test fail? The functions $x^4$, $-x^4$, and $x^3$ all have $f'(0)=0$ and $f''(0)=0$. But at $0$, the first has a minimum, the second has a maximum, and the third has neither.

Example 4: Let

$g(x)=x^4-4x^3$.

Find the local extreme values, the intervals of concavity, and the inflection points.

Solution:

The first two derivatives:

$\begin{align*}&g'(x)\\&=4x^3-12x^2\\&=4x^2(x-3)\end{align*}$

$\begin{align*}&g''(x)\\&=12x^2-24x\\&=12x(x-2)\end{align*}$

Critical numbers: $g'(x)=0$ at $x=0$ and $x=3$.

  • At $x=3$: $g''(3)=36$, which is positive. So $g$ has a local minimum, $g(3)=-27$.
  • At $x=0$: $g''(0)=0$, so the second derivative test gives no answer.

Use the first derivative test at $x=0$. The factor $4x^2$ is never negative, so $g'$ has the sign of $x-3$:

IntervalSign of $g'$$g$ is
$(-\infty,0)$$-$decreasing
$(0,3)$$-$decreasing
$(3,\infty)$$+$increasing

The sign of $g'$ does not change at $0$. So there is no maximum or minimum at $0$. The graph flattens for an instant there and keeps falling.

Concavity: The second derivative is $0$ at $x=0$ and at $x=2$.

IntervalSign of $g''$Concave
$(-\infty,0)$$+$up
$(0,2)$$-$down
$(2,\infty)$$+$up

The concavity changes at both numbers. So the inflection points are $(0,0)$ and $(2,g(2))=(2,-16)$.

(3, −27)(2, −16)(0, 0)xy
The graph of $g(x)=x^4-4x^3$: a local minimum at $(3,-27)$, and inflection points at $(0,0)$ and $(2,-16)$.

Example 5: Describe the shape of the graph of

$f(x)=xe^{-x}$.

Solution:

Use the product rule and the chain rule. The derivative of $e^{-x}$ is $-e^{-x}$.

$\begin{align*}&f'(x)\\&=e^{-x}+x(-e^{-x})\\&=e^{-x}(1-x)\end{align*}$

$\begin{align*}&f''(x)\\&=-e^{-x}(1-x)+e^{-x}(-1)\\&=e^{-x}(x-2)\end{align*}$

The factor $e^{-x}$ is always positive. So the signs come from $1-x$ and $x-2$.

Increasing and decreasing:

  • For $x<1$: $f'(x)>0$, so $f$ increases.
  • For $x>1$: $f'(x)<0$, so $f$ decreases.

So $f$ has a local maximum at $x=1$:

$f(1)=\dfrac{1}{e}\approx 0.368$

Concavity:

  • For $x<2$: $f''(x)<0$, so $f$ is concave down.
  • For $x>2$: $f''(x)>0$, so $f$ is concave up.

So the inflection point is

$\left(2,\dfrac{2}{e^2}\right)\approx(2,\ 0.271)$.

Summary

If on an intervalthen $f$ is
$f'(x)>0$increasing
$f'(x)<0$decreasing
$f''(x)>0$concave up
$f''(x)<0$concave down