---
title: Curve Sketching and Optimization
module: Applications of Derivatives
moduleNumber: 3
lessonNumber: 3
order: 303
summary: >
  A checklist that synthesizes domain, symmetry, asymptotes, monotonicity,
  extrema, and concavity into a hand sketch of any function, plus the slant
  asymptote for rational functions whose degree exceeds the denominator's. The
  same extremum machinery, applied to a word problem, becomes the optimization
  template: model one quantity, reduce it to a function of a single variable,
  and find its absolute extremum.
topics: [Applications of Derivatives]
sources:
  - book: Stewart
    ref: "Ch. 3 — Applications of Differentiation; §3.5 Summary of Curve Sketching"
  - book: Stewart
    ref: "Ch. 3; §3.6 Graphing with Calculus and Calculators, §3.7 Optimization Problems"
---

Monotonicity, extrema, concavity, and end behavior are separate readings of a
function. A hand sketch merges them into one picture. Optimization runs the same
extremum tests in the other direction: reduce a real quantity to a function of one
variable and find its extreme value.

## The curve-sketching checklist

A calculus sketch places the features that matter — intercepts, asymptotes,
extrema, inflections — rather than sampling points blindly. Stewart organizes the
work as eight steps.[^stewart-sketch]

- **A. Domain.** Determine the set $D$ of $x$ for which $f(x)$ is defined.
- **B. Intercepts.** The $y$-intercept is $f(0)$. Find $x$-intercepts by solving
  $f(x) = 0$ (skip if intractable).
- **C. Symmetry.** If $f(-x) = f(x)$, $f$ is **even** and the graph is symmetric
  about the $y$-axis. If $f(-x) = -f(x)$, $f$ is **odd** and symmetric about the
  origin. If $f(x + p) = f(x)$, $f$ is **periodic** with period $p$.
- **D. Asymptotes.** Horizontal: $\lim_{x \to \pm\infty} f(x) = L$ gives $y = L$.
  Vertical: $x = a$ where a one-sided limit is $\pm\infty$. Slant: handled below.
- **E. Intervals of increase/decrease.** Sign of $f'$ by the Increasing/Decreasing
  Test.
- **F. Local extrema.** Critical numbers plus the First (or Second) Derivative
  Test.
- **G. Concavity and inflection.** Sign of $f''$ by the Concavity Test;
  inflections where it changes.
- **H. Sketch.** Draw asymptotes as dashed lines, plot the intercepts and the
  extreme and inflection points, then join them respecting E and G.

Symmetry is a labor saver. For an even or odd function, sketch $x \ge 0$ and
reflect; for a periodic function, sketch one period and translate.

$$
% caption: Even functions reflect across the $y$-axis; odd functions rotate
% $180^{\circ}$ about the origin. Either halves the sketching work.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
% even
\begin{scope}
\draw[->, black] (-2.2,0) -- (2.2,0) node[right, black!70] {$x$};
\draw[->, black] (0,-0.4) -- (0,2.2) node[above, black!70] {$y$};
\draw[acc, very thick] plot[domain=-1.9:1.9, samples=60] (\x, {0.45*\x*\x});
\node[black!70] at (0,-0.85) {even: $f(\text{-}x)=f(x)$};
\end{scope}
% odd
\begin{scope}[xshift=6.0cm]
\draw[->, black] (-2.2,0) -- (2.2,0) node[right, black!70] {$x$};
\draw[->, black] (0,-2.0) -- (0,2.0) node[above, black!70] {$y$};
\draw[acc, very thick] plot[domain=-1.75:1.75, samples=60] (\x, {0.32*\x*\x*\x});
\node[black!70] at (0,-2.55) {odd: $f(\text{-}x)=\text{-}f(x)$};
\end{scope}
\end{tikzpicture}
$$

### A worked sketch

Apply the checklist to $y = \dfrac{2x^2}{x^2 - 1}$.

- **Domain:** all $x$ with $x^2 \ne 1$, so $x \ne \pm 1$.
- **Intercepts:** $f(0) = 0$; the only $x$-intercept is the origin.
- **Symmetry:** $f(-x) = f(x)$, so the graph is even.
- **Asymptotes:** $\lim_{x \to \pm\infty} \frac{2x^2}{x^2-1} = 2$, so $y = 2$ is a
  horizontal asymptote. The denominator vanishes at $x = \pm 1$, giving vertical
  asymptotes there.
- **Monotonicity:** $f'(x) = \dfrac{-4x}{(x^2 - 1)^2}$, positive for $x < 0$ and
  negative for $x > 0$ (away from $\pm 1$). So $f$ increases on $(-\infty, -1)$
  and $(-1, 0)$, decreases on $(0, 1)$ and $(1, \infty)$.
- **Extrema:** $f'(0) = 0$ with a sign change from $+$ to $-$, so $f(0) = 0$ is a
  local maximum.
- **Concavity:** $f''(x) = \dfrac{12x^2 + 4}{(x^2 - 1)^3}$, positive when
  $x^2 > 1$ and negative when $x^2 < 1$, so the graph is concave up on
  $(-\infty, -1)$ and $(1, \infty)$ and concave down on $(-1, 1)$. No inflection
  points, since $x = \pm 1$ are not in the domain.

$$
% caption: The finished sketch of $y = 2x^2/(x^2-1)$: even, with vertical
% asymptotes at $x = \pm 1$, horizontal asymptote $y = 2$, and a local maximum at
% the origin.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
\draw[->, black] (-3.6,0) -- (3.6,0) node[right, black!70] {$x$};
\draw[->, black] (0,-3.4) -- (0,4.1) node[above, black!70] {$y$};
% asymptotes
\draw[black, dashed] (-1,-3.3) -- (-1,4.0);
\draw[black, dashed] (1,-3.3) -- (1,4.0);
\draw[black, dashed] (-3.5,2) -- (3.5,2) node[right, black!70] {$y=2$};
\node[black!70, anchor=north east] at (-1,-3.3) {$x=\text{-}1$};
\node[black!70, anchor=north west] at (1,-3.3) {$x=1$};
\begin{scope}
\clip (-3.5,-3.3) rectangle (3.5,4.0);
% central hump
\draw[black, very thick]
  (-0.86,-3.3) .. controls (-0.55,-1.1) and (-0.25,0.0) .. (0,0)
  .. controls (0.25,0.0) and (0.55,-1.1) .. (0.86,-3.3);
% right branch
\draw[black, very thick]
  (1.14,4.0) .. controls (1.5,2.9) and (2.2,2.35) .. (3.5,2.12);
% left branch
\draw[black, very thick]
  (-1.14,4.0) .. controls (-1.5,2.9) and (-2.2,2.35) .. (-3.5,2.12);
\end{scope}
\fill[acc] (0,0) circle (2.2pt) node[above right=0pt, black!75] {loc max at origin};
\end{tikzpicture}
$$

## Slant asymptotes

When the numerator of a rational function has degree exactly one more than the
denominator, the graph approaches a slanted line rather than a horizontal one.
Polynomial division writes

$$
f(x) = mx + b + \frac{R(x)}{Q(x)},
\qquad \lim_{x \to \pm\infty} \frac{R(x)}{Q(x)} = 0,
$$

so $f(x) - (mx + b) \to 0$ and the line $y = mx + b$ is a **slant asymptote**. The
curve approaches that line at both ends, above it where the remainder is positive
and below where it is negative.

> **Worked example.** Sketch $f(x) = \dfrac{x^3}{x^2 + 1}$ with its slant
> asymptote. The domain is all of $\mathbb{R}$ since $x^2 + 1$ is never zero, the
> only intercept is the origin, and $f(-x) = -f(x)$ makes $f$ odd. Long division
> separates the linear part,
>
> $$
> f(x) = x - \frac{x}{x^2 + 1}, \qquad f(x) - x = -\frac{x}{x^2 + 1} \to 0,
> $$
>
> so $y = x$ is a slant asymptote. The first derivative
>
> $$
> f'(x) = \frac{x^2(x^2 + 3)}{(x^2 + 1)^2} \ge 0
> $$
>
> is nonnegative, so $f$ increases on all of $\mathbb{R}$; although $f'(0) = 0$,
> the sign does not change there, so no extremum occurs. The second derivative
>
> $$
> f''(x) = \frac{2x(3 - x^2)}{(x^2 + 1)^3}
> $$
>
> vanishes at $x = 0, \pm\sqrt{3}$ and changes sign at each, giving three
> inflection points: $(0, 0)$ and $\left(\pm\sqrt{3}, \pm\tfrac{3\sqrt3}{4}\right)$.

$$
% caption: The finished sketch of $y = x^3/(x^2+1)$: odd, strictly increasing,
% with the slant asymptote $y = x$ approached from below on the right and from
% above on the left.
\begin{tikzpicture}[scale=0.82, >=stealth, font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
\draw[->, black] (-3.9,0) -- (3.9,0) node[right, black!70] {$x$};
\draw[->, black] (0,-3.9) -- (0,3.9) node[above, black!70] {$y$};
\draw[acc, dashed] (-3.6,-3.6) -- (3.6,3.6);
\node[acc, anchor=south] at (2.35,3.15) {$y=x$};
\draw[black, very thick] plot[domain=-3.7:3.7, samples=110]
  (\x, {(\x*\x*\x)/(\x*\x+1)});
\fill[black] (0,0) circle (1.8pt);
\fill[black] (1.732,1.299) circle (1.4pt);
\fill[black] (-1.732,-1.299) circle (1.4pt);
\end{tikzpicture}
$$

## Optimization: modeling one quantity

The extremum tools answer applied questions once the situation is written as a
function. The difficulty is almost always the setup, not the calculus. A fixed
template turns a word problem into a single-variable extremum.

```algorithm
caption: $\textsc{Optimize}$ — solving an applied maximum/minimum problem
read the problem; identify the quantity $Q$ to be optimized and the given data
draw a diagram and label every relevant quantity with a symbol
express $Q$ in terms of those symbols
use the constraints to eliminate variables until $Q = f(x)$ of one variable
record the domain of $x$ implied by the physical setting
find the absolute extremum of $f$ on that domain
translate the optimizing $x$ back into the answer the problem asked for
```

The last step matters: a problem asking for dimensions is not answered by the
critical number alone.

### Maximizing an area under a constraint

A farmer has $2400$ ft of fencing for a rectangular field bordering a straight
river, needing no fence along the river. Which dimensions maximize the area?

Let $x$ be the depth (the two sides perpendicular to the river) and $y$ the width
(the side parallel to it). The area is $A = xy$, and the fence covers three sides:

$$
2x + y = 2400 \;\Longrightarrow\; y = 2400 - 2x.
$$

Substituting eliminates $y$:

$$
A(x) = x(2400 - 2x) = 2400x - 2x^2, \qquad 0 \le x \le 1200.
$$

Then $A'(x) = 2400 - 4x = 0$ at $x = 600$. Since $A''(x) = -4 < 0$, the graph is
concave down everywhere and the critical number is the absolute maximum;
$A(0) = A(1200) = 0$ confirms it by the Closed Interval Method. The width is
$y = 2400 - 2(600) = 1200$, so the field is $600$ ft deep and $1200$ ft wide, with
area $720{,}000$ ft$^2$.

$$
% caption: The fenced field (left) and its area function (right): the parabola
% $A(x) = 2400x - 2x^2$ peaks at the critical number $x = 600$.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
% left: field
\begin{scope}
\draw[black, line width=2pt] (0,0) rectangle (3.2,1.8);
% river along the top (no fence)
\draw[black, line width=1.2pt, dotted] (-0.3,1.8) -- (3.5,1.8);
\node[black!70, anchor=south] at (1.6,1.85) {river (no fence)};
\node[black!75] at (1.6,0.9) {f\/ield, area $xy$};
\node[black!75, anchor=north] at (1.6,0) {$y$ (width)};
\node[black!75, anchor=east] at (0,0.9) {$x$};
\node[black!75, anchor=west] at (3.2,0.9) {$x$};
\end{scope}
% right: area function
\begin{scope}[xshift=5.6cm]
\draw[->, black] (-0.3,0) -- (4.2,0) node[right, black!70] {$x$};
\draw[->, black] (0,-0.3) -- (0,3.0) node[above, black!70] {$A$};
\draw[black, very thick] plot[domain=0:4.0, samples=60] (\x, {2.5*(\x/2)*(1-\x/4)*2});
\coordinate (pk) at (2.0,2.5);
\fill[acc] (pk) circle (2.2pt);
\draw[dashed, black] (2.0,0) -- (pk);
\node[black!75, anchor=north] at (2.0,-0.05) {$600$};
\node[black!75, anchor=south] at (2.0,2.55) {max 720{,}000};
\end{scope}
\end{tikzpicture}
$$

### Minimizing material with an open domain

A cylindrical can must hold $1$ L $= 1000$ cm$^3$. Which radius and height use the
least metal? The cost tracks the total surface area of the top, bottom, and side.

The side unrolls into a rectangle of height $h$ and width equal to the
circumference $2\pi r$, so its area is $2\pi r h$; the two disks contribute
$2\pi r^2$. Thus $A = 2\pi r^2 + 2\pi r h$. The volume constraint
$\pi r^2 h = 1000$ gives $h = 1000/(\pi r^2)$, and substituting eliminates $h$:

$$
A(r) = 2\pi r^2 + \frac{2000}{r}, \qquad r > 0.
$$

$$
% caption: The can and its unrolled surface: two disks of area $2\pi r^2$ and a
% rectangular side of height $h$ and width equal to the circumference.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
% can
\begin{scope}
\draw[black, line width=1.6pt] (0,0) ellipse (0.85 and 0.32);
\draw[black, line width=1.6pt] (-0.85,0) -- (-0.85,2.2);
\draw[black, line width=1.6pt] (0.85,0) -- (0.85,2.2);
\draw[black, line width=1.6pt] (-0.85,2.2) arc (180:360:0.85 and 0.32);
\draw[black, line width=1.6pt, dashed] (-0.85,2.2) arc (180:360:0.85 and -0.32);
\draw[black!70] (0,0) -- (0.85,0);
\node[black!75, anchor=south] at (0.45,0.02) {$r$};
\draw[black!70, <->] (1.15,0) -- (1.15,2.2);
\node[black!75, anchor=west] at (1.2,1.1) {$h$};
\end{scope}
% unrolled: two disks + rectangle
\begin{scope}[xshift=4.4cm, yshift=0.2cm]
\draw[acc!55, line width=1.4pt, fill=acc!8] (0,1.15) circle (0.55);
\draw[acc!55, line width=1.4pt, fill=acc!8] (1.4,1.15) circle (0.55);
\node[black!75] at (0.7,2.05) {two disks};
\draw[acc!55, line width=1.4pt, fill=acc!8] (2.5,0.3) rectangle (5.6,2.0);
\node[black!75] at (4.05,1.15) {side};
\node[black!75, anchor=north] at (4.05,0.3) {width $=$ circumference};
\draw[black!70, <->] (5.85,0.3) -- (5.85,2.0);
\node[black!75, anchor=west] at (5.9,1.15) {$h$};
\end{scope}
\end{tikzpicture}
$$

The domain is open, $r > 0$, so the Closed Interval Method does not apply and the
First Derivative Test for absolute extrema takes over. Differentiate:

$$
A'(r) = 4\pi r - \frac{2000}{r^2} = \frac{4(\pi r^3 - 500)}{r^2}.
$$

The only critical number is $r = \sqrt[3]{500/\pi} \approx 5.42$ cm. For
$r$ below it $A' < 0$ and above it $A' > 0$, so this critical number is the
absolute minimum.

> **Theorem (First Derivative Test for absolute extrema).** Suppose $c$ is a
> critical number of a continuous $f$ on an interval. If $f'(x) > 0$ for all
> $x < c$ and $f'(x) < 0$ for all $x > c$, then $f(c)$ is the **absolute
> maximum**. If $f'(x) < 0$ for all $x < c$ and $f'(x) > 0$ for all $x > c$, then
> $f(c)$ is the **absolute minimum**.

The corresponding height is $h = 1000/(\pi r^2) = 2r$: the most economical can is
exactly as tall as it is wide across the diameter. This single-critical-number
argument is the standard replacement for the Closed Interval Method whenever the
physical domain is an open or infinite interval.

The two examples used different closing arguments because their domains differed.
The choice is dictated by whether the domain is a closed bounded interval.

| | Closed Interval Method | First Derivative Test for absolute extrema |
| --- | --- | --- |
| Domain | closed and bounded, $[a,b]$ | any interval, including open or infinite |
| Candidates | critical numbers **and** endpoints | the critical number alone |
| Decision rule | compare all candidate values | sign change of $f'$ across the critical number |
| Guarantee | Extreme Value Theorem ensures extrema exist | valid only when a single critical number controls the whole domain |
| Example above | fenced field, $0 \le x \le 1200$ | cylindrical can, $r > 0$ |

### Minimizing distance to a curve

A closest-point problem models the distance from a fixed point to a curve, then
minimizes it. Minimizing the _squared_ distance avoids the square root and has the
same minimizer.

> **Worked example.** Find the point on the parabola $y^2 = 2x$ closest to
> $A = (1, 4)$. A point on the parabola is $\left(\tfrac12 y^2, y\right)$, at
> squared distance
>
> $$
> d^2 = f(y) = \left(\tfrac12 y^2 - 1\right)^2 + (y - 4)^2.
> $$
>
> Differentiating,
>
> $$
> f'(y) = 2\left(\tfrac12 y^2 - 1\right)y + 2(y - 4) = y^3 - 8,
> $$
>
> which is zero at $y = 2$. Since $f'(y) < 0$ for $y < 2$ and $f'(y) > 0$ for
> $y > 2$, the First Derivative Test for absolute extrema makes $y = 2$ the
> minimizer. Then $x = \tfrac12 y^2 = 2$, so the closest point is $Q = (2, 2)$, at
> distance $\sqrt{f(2)} = \sqrt{5}$.

$$
% caption: The point $Q=(2,2)$ on $y^2 = 2x$ is the one nearest the target
% $A=(1,4)$; the shortest segment joins them.
\begin{tikzpicture}[scale=0.9, >=stealth, font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
\draw[->, black] (-0.4,0) -- (5.2,0) node[right, black!70] {$x$};
\draw[->, black] (0,-1.6) -- (0,4.6) node[above, black!70] {$y$};
\draw[black, very thick] plot[domain=-1.6:4.0, samples=90] ({0.5*\x*\x},\x);
\node[black, anchor=west] at (4.3,3.4) {$y^2=2x$};
\fill[black!70] (1,4) circle (2pt) node[above right=0pt, black!75] {$A$};
\fill[acc] (2,2) circle (2.2pt) node[above right=1pt, black!75] {$Q$};
\draw[black, thick, dashed] (1,4) -- (2,2);
\end{tikzpicture}
$$

### Least-time paths

Fermat's principle in optics states that light takes the path of least time. The
same structure governs a traveler choosing where to cross terrain of two speeds.

> **Worked example.** A boat launches from $A$ on one bank of a river $3$ km wide
> and must reach $B$, $8$ km downstream on the far bank. Rowing covers $6$ km/h,
> running along the bank $8$ km/h. Landing $x$ km downstream from the point $C$
> directly opposite $A$, the rowing distance is $\sqrt{x^2 + 9}$ and the running
> distance is $8 - x$, so the total time is
>
> $$
> T(x) = \frac{\sqrt{x^2 + 9}}{6} + \frac{8 - x}{8}, \qquad 0 \le x \le 8.
> $$
>
> Setting the derivative to zero,
>
> $$
> T'(x) = \frac{x}{6\sqrt{x^2 + 9}} - \frac{1}{8} = 0
> \;\Longrightarrow\; 4x = 3\sqrt{x^2 + 9}
> \;\Longrightarrow\; 7x^2 = 81,
> $$
>
> so $x = \tfrac{9}{\sqrt7} \approx 3.4$. Comparing $T(0) = 1.5$,
> $T\!\left(\tfrac{9}{\sqrt7}\right) \approx 1.33$, and $T(8) \approx 1.42$ by the
> Closed Interval Method, the least time lands the boat $\tfrac{9}{\sqrt7}$ km
> downstream, then runs the rest.

$$
% caption: The least-time crossing: rowing from $A$ to a landing point $D$ on the
% far bank, then running along the bank to $B$. The optimum balances the two legs.
\begin{tikzpicture}[scale=0.62, >=stealth, font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
% banks
\draw[black, line width=1pt] (-0.7,3) -- (9.2,3);
\draw[black, line width=1pt] (-0.7,0) -- (9.2,0);
\node[black, anchor=east] at (-0.7,3) {far bank};
\node[black, anchor=east] at (-0.7,0) {near bank};
% points
\fill[black!70] (0,0) circle (2.4pt) node[below left=0pt, black!75] {$A$};
\fill[black!70] (0,3) circle (2pt) node[above=2pt, black!75] {$C$};
\fill[acc] (3.4,3) circle (2.4pt) node[above=2pt, black!75] {$D$};
\fill[black!70] (8,3) circle (2.4pt) node[above right=0pt, black!75] {$B$};
% legs
\draw[black, very thick] (0,0) -- (3.4,3);
\draw[black, very thick] (3.4,3) -- (8,3);
% width and downstream labels
\draw[black, <->] (0.25,0) -- (0.25,3);
\node[black!70, anchor=west] at (0.35,1.5) {$3$ km};
\node[black!70] at (1.5,1.9) {row};
\node[black!70] at (5.7,3.4) {run};
\node[black!70, anchor=south] at (1.7,3.02) {$x$};
\end{tikzpicture}
$$

[^stewart-sketch]: Stewart, §3.5 — Summary of Curve Sketching: the eight-step guideline (domain, intercepts, symmetry, asymptotes, monotonicity, extrema, concavity, sketch) and slant asymptotes; §3.7 — Optimization Problems: the six-step problem-solving procedure, the fencing and cylindrical-can examples, and the First Derivative Test for Absolute Extreme Values.
