Calculus I

Limits · Derivatives · Applications · Integrals · Applications of integration. 30 lectures with rules, worked examples, interactive demos, quizzes and exercises.
Prof. Mostafa Zahri
Department of Mathematics
University of Sharjah · zahri-edu.net
Chapter 1

Limits and Continuity

Limits are the foundation of calculus: they let us talk precisely about what happens to a function near a point, and they lead directly to derivatives and integrals.

lim
1.1

The Concept of Limit

DefinitionDemoQuiz

We write $\displaystyle\lim_{x\to a} f(x)=L$ when the values $f(x)$ can be made as close to $L$ as we like by taking $x$ close enough to $a$ (but $x\neq a$). The value of $f$ at $a$ does not matter, and $f(a)$ need not even exist.

Definition (intuitive) $\displaystyle\lim_{x\to a} f(x)=L$ means: as $x$ approaches $a$ from both sides, $f(x)$ approaches $L$.
Definition (precise, ε–δ) $\displaystyle\lim_{x\to a} f(x)=L$ if for every $\varepsilon>0$ there is a $\delta>0$ such that $$0\lt |x-a|\lt \delta \quad\Longrightarrow\quad |f(x)-L|\lt \varepsilon .$$
One-sided limits $\displaystyle\lim_{x\to a^-} f(x)$ uses only $x\lt a$, and $\displaystyle\lim_{x\to a^+} f(x)$ uses only $x\gt a$. $$\lim_{x\to a} f(x)=L \iff \lim_{x\to a^-} f(x)=L=\lim_{x\to a^+} f(x).$$

Worked examples

Example 1
Estimate $\displaystyle\lim_{x\to 1}\frac{x^2-1}{x-1}$ numerically, then find it exactly.
  1. The function is not defined at $x=1$ (we get $\tfrac00$), so we look at nearby values.
    x0.90.990.9991.0011.011.1
    f(x)1.91.991.9992.0012.012.1
  2. The table suggests the limit is $2$. To confirm, factor: $$\dfrac{x^2-1}{x-1}=\dfrac{(x-1)(x+1)}{x-1}=x+1$$ for $x\neq1$.
  3. Since $x\neq 1$ in a limit, the cancellation is allowed: $$\lim_{x\to1}(x+1)=2$$
$\displaystyle\lim_{x\to 1}\frac{x^2-1}{x-1}=2$, even though $f(1)$ is undefined.
Example 2: a limit that does not exist
Let $f(x)=\dfrac{|x|}{x}$. Find $\displaystyle\lim_{x\to0^-}f(x)$, $\displaystyle\lim_{x\to0^+}f(x)$ and $\displaystyle\lim_{x\to0}f(x)$.
  1. For $x\gt 0$, $|x|=x$, so $f(x)=1$. Hence $$\lim_{x\to0^+}f(x)=1$$
  2. For $x\lt 0$, $|x|=-x$, so $f(x)=-1$. Hence $$\lim_{x\to0^-}f(x)=-1$$
  3. The one-sided limits differ, so the two-sided limit does not exist.
$\displaystyle\lim_{x\to0}\frac{|x|}{x}$ does not exist (DNE).
Example 3: ε–δ proof
Prove that $\displaystyle\lim_{x\to 3}(2x-1)=5$.
  1. Let $\varepsilon\gt0$. We need $|(2x-1)-5|\lt\varepsilon$, i.e. $$|2x-6|=2|x-3|\lt\varepsilon$$
  2. This holds whenever $|x-3|\lt \varepsilon/2$. So choose $\delta=\varepsilon/2$.
  3. Check: if $0\lt|x-3|\lt\delta$ then $$|(2x-1)-5|=2|x-3|\lt2\delta=\varepsilon$$ ∎
Going deeper

What a limit really says. Think of a game between two players. Player A names a tolerance $\varepsilon$ ("I want $f(x)$ within $0.001$ of $L$"). Player B must answer with a window $\delta$ around $a$ that guarantees it. The limit equals $L$ exactly when B can always win, however small $\varepsilon$ is.

Three facts follow from this picture:

  • The value $f(a)$ is never used: the condition $0\lt|x-a|$ excludes $x=a$.
  • A limit, if it exists, is unique: $f(x)$ cannot be close to two different numbers at once.
  • A smaller $\varepsilon$ usually forces a smaller $\delta$. The proof must show how to choose $\delta$ in terms of $\varepsilon$.
Remark Tables of values can mislead. For $f(x)=\sin(\pi/x)$, the values $x=1,\tfrac12,\tfrac13,\dots$ all give $f(x)=0$, yet $\lim_{x\to0}f(x)$ does not exist. Numerical evidence suggests a limit; only algebra or a proof establishes it.
Remark "$\lim_{x\to a}f(x)=\infty$" does not mean the limit exists. It describes how the limit fails to exist: the values grow without bound.
Example 4: reading limits from a piecewise function
Let $f(x)=\begin{cases}x^2, & x\lt 1\\ 3, & x=1\\ 2-x, & x\gt1\end{cases}$. Find $\lim_{x\to1^-}f$, $\lim_{x\to1^+}f$, $\lim_{x\to1}f$ and $f(1)$.
  1. From the left we use the formula valid for $x\lt1$:

    $$\lim_{x\to1^-}f(x)=\lim_{x\to1^-}x^2=1^2=1$$
  2. From the right we use the formula valid for $x\gt1$:

    $$\lim_{x\to1^+}f(x)=\lim_{x\to1^+}(2-x)=2-1=1$$
  3. The one-sided limits agree, so the two-sided limit exists:

    $$\lim_{x\to1}f(x)=1$$
  4. The value at the point is given separately: $f(1)=3\neq1$. The limit ignores this value.

$\lim_{x\to1}f(x)=1$ but $f(1)=3$
Challenge Example 5: ε–δ proof for a quadratic
Prove that $$\lim_{x\to 2}x^2=4 .$$
  1. We must make $|x^2-4|$ small. Factor it, separating the "good" factor $|x-2|$ from the rest:

    $$|x^2-4|=|x-2|\,|x+2|$$
  2. The factor $|x+2|$ is not constant, so we bound it. First agree to take $\delta\le1$. Then $|x-2|\lt1$ gives $1\lt x\lt3$, and so:

    $$|x+2|\lt 5$$
  3. Combining the two estimates:

    $$|x^2-4|=|x-2|\,|x+2|\lt 5\,|x-2|$$
  4. This is less than $\varepsilon$ as soon as $|x-2|\lt\varepsilon/5$. Both requirements hold if we take the smaller of the two numbers:

    $$\delta=\min\left\{1,\ \frac{\varepsilon}{5}\right\}$$
  5. Check: if $0\lt|x-2|\lt\delta$ then $|x+2|\lt5$ and $|x-2|\lt\varepsilon/5$, so

    $$|x^2-4|\lt 5\cdot\frac{\varepsilon}{5}=\varepsilon .\qquad\blacksquare$$
If $f(2)=7$ but $\displaystyle\lim_{x\to2}f(x)=5$, which statement is true?
A limit describes behaviour near $a$, not at $a$. A function with a "moved point" (removable discontinuity) does exactly this.
$\displaystyle\lim_{x\to 0}\sin\!\left(\tfrac{1}{x}\right)$ is
As $x\to0$, $1/x$ runs through infinitely many periods, so $\sin(1/x)$ oscillates between $-1$ and $1$ and never settles.

Exercises

  1. Estimate $\displaystyle\lim_{x\to0}\frac{e^x-1}{x}$ using a table of values.
    Answer
    $1$
  2. Find $\displaystyle\lim_{x\to2^-}\lfloor x\rfloor$ and $\displaystyle\lim_{x\to2^+}\lfloor x\rfloor$. Does $\displaystyle\lim_{x\to2}\lfloor x\rfloor$ exist?
    Answer
    $1$ and $2$; the limit does not exist.
  3. Sketch a function with $f(1)=3$, $\displaystyle\lim_{x\to1^-}f(x)=2$, $\displaystyle\lim_{x\to1^+}f(x)=4$.
    Answer
    Any graph with a jump at $x=1$: left piece approaching height 2, right piece approaching height 4, a solid dot at $(1,3)$.
  4. Prove using ε–δ: $\displaystyle\lim_{x\to-1}(4x+3)=-1$.
    Answer
    $|4x+3+1|=4|x+1|\lt\varepsilon$ when $\delta=\varepsilon/4$.
1.2

Computation of Limits

Limit lawsDemoQuiz

Rather than guessing from tables, we compute limits with algebraic rules. If $\displaystyle\lim_{x\to a}f(x)=L$ and $\displaystyle\lim_{x\to a}g(x)=M$, then:

RuleStatement
Sum / difference$\lim (f\pm g)=L\pm M$
Constant multiple$\lim (c f)=cL$
Product$\lim (fg)=LM$
Quotient$\lim \dfrac fg=\dfrac LM$ if $M\neq0$
Power / root$\lim f^n=L^n,\ \lim\sqrt[n]{f}=\sqrt[n]{L}$
Polynomials & rational functions$\lim_{x\to a}p(x)=p(a)$ (direct substitution, denominator $\neq 0$)
Squeeze Theorem If $g(x)\le f(x)\le h(x)$ near $a$ and $\displaystyle\lim_{x\to a}g(x)=\lim_{x\to a}h(x)=L$, then $\displaystyle\lim_{x\to a}f(x)=L$.
Two special limits $$\lim_{x\to0}\frac{\sin x}{x}=1,\qquad \lim_{x\to0}\frac{1-\cos x}{x}=0 .$$
Strategy for $\tfrac00$ Factor and cancel · multiply by the conjugate · simplify compound fractions · use a special limit.

Worked examples

Example 1: conjugate
Find $\displaystyle\lim_{x\to0}\frac{\sqrt{x+9}-3}{x}$.
  1. Direct substitution gives $\tfrac00$. Multiply by the conjugate $\sqrt{x+9}+3$.
  2. $$\dfrac{\sqrt{x+9}-3}{x}\cdot\dfrac{\sqrt{x+9}+3}{\sqrt{x+9}+3}=\dfrac{(x+9)-9}{x(\sqrt{x+9}+3)}=\dfrac{1}{\sqrt{x+9}+3}$$
  3. Now substitute: $$\dfrac{1}{\sqrt{9}+3}=\dfrac16$$
$\dfrac16$
Example 2: squeeze
Find $\displaystyle\lim_{x\to0}x^2\cos\!\left(\tfrac1x\right)$.
  1. Since $-1\le\cos(1/x)\le1$, multiplying by $x^2\ge0$ gives $$-x^2\le x^2\cos(1/x)\le x^2$$
  2. Both $-x^2\to0$ and $x^2\to0$ as $x\to0$.
  3. By the Squeeze Theorem the limit is $0$.
$0$
Example 3: special limit
Find $\displaystyle\lim_{x\to0}\frac{\sin 5x}{3x}$.
  1. Rewrite: $$\dfrac{\sin5x}{3x}=\dfrac53\cdot\dfrac{\sin5x}{5x}$$
  2. Let $u=5x\to0$: $\dfrac{\sin u}{u}\to1$.
$\dfrac53$
Going deeper

Why does "cancel and substitute" work? If $f(x)=g(x)$ for every $x\neq a$ near $a$, then $f$ and $g$ have the same limit at $a$, because a limit never looks at $x=a$. Cancelling $(x-a)$ replaces $f$ by a simpler $g$ that agrees with it everywhere except at $a$. If $g$ is continuous, its limit is just $g(a)$.

Reading the form $\tfrac00$. "$\tfrac00$" is not a number. It is a signal that the numerator and denominator share a factor that vanishes at $a$, and that more work is needed. In contrast, $\tfrac{c}{0}$ with $c\neq0$ signals an infinite limit or a vertical asymptote.

Remark The limit laws require the individual limits to exist. For example, $\lim_{x\to0}\left(\frac1x-\frac1x\right)=0$, but you cannot split it as $\lim\frac1x-\lim\frac1x$, because neither limit exists.
Example 4: compound fraction
Find $$\lim_{h\to0}\frac{\dfrac{1}{(x+h)^2}-\dfrac{1}{x^2}}{h}\qquad(x\neq0).$$
  1. Combine the two fractions in the numerator over the common denominator $x^2(x+h)^2$:

    $$\frac{1}{(x+h)^2}-\frac1{x^2}=\frac{x^2-(x+h)^2}{x^2(x+h)^2}=\frac{-2xh-h^2}{x^2(x+h)^2}$$
  2. Divide by $h$ (that is, cancel the common factor $h\neq0$):

    $$\frac{-2xh-h^2}{h\,x^2(x+h)^2}=\frac{-2x-h}{x^2(x+h)^2}$$
  3. Now substitution is allowed, since the denominator $\to x^4\neq0$:

    $$\lim_{h\to0}\frac{-2x-h}{x^2(x+h)^2}=\frac{-2x}{x^4}=-\frac{2}{x^3}$$
$-\dfrac{2}{x^3}$, which is the derivative of $x^{-2}$ (Chapter 2)
Challenge Example 5: cube roots
Find $$\lim_{x\to 8}\frac{\sqrt[3]{x}-2}{x-8}.$$
  1. Substitution gives $\tfrac00$. Put $t=\sqrt[3]x$, so $x=t^3$, and $x\to8$ means $t\to2$:

    $$\frac{\sqrt[3]{x}-2}{x-8}=\frac{t-2}{t^3-8}$$
  2. Factor the difference of cubes, $t^3-8=(t-2)(t^2+2t+4)$:

    $$\frac{t-2}{(t-2)(t^2+2t+4)}=\frac{1}{t^2+2t+4}\qquad(t\neq2)$$
  3. Substitute $t=2$:

    $$\lim_{t\to2}\frac1{t^2+2t+4}=\frac1{4+4+4}=\frac1{12}$$
$\dfrac1{12}$
Challenge Example 6: squeeze with a floor function
Find $$\lim_{x\to0^+}x\left\lfloor\frac1x\right\rfloor .$$
  1. For any real $y$: $y-1\lt\lfloor y\rfloor\le y$. Take $y=1/x$:

    $$\frac1x-1\lt\left\lfloor\frac1x\right\rfloor\le\frac1x$$
  2. Multiply through by $x\gt0$ (the inequalities keep their direction):

    $$1-x\lt x\left\lfloor\frac1x\right\rfloor\le1$$
  3. Both bounds tend to $1$ as $x\to0^+$. By the Squeeze Theorem:

    $$\lim_{x\to0^+}x\left\lfloor\frac1x\right\rfloor=1$$
$\displaystyle\lim_{x\to3}\frac{x^2-9}{x-3}=$
Factor: $\frac{(x-3)(x+3)}{x-3}=x+3\to6$.
$\displaystyle\lim_{x\to0}\frac{\tan x}{x}=$
$\frac{\tan x}{x}=\frac{\sin x}{x}\cdot\frac{1}{\cos x}\to1\cdot1=1$.

Exercises

  1. $\displaystyle\lim_{x\to-2}\frac{x^2+5x+6}{x+2}$
    Answer
    $1$
  2. $\displaystyle\lim_{h\to0}\frac{(2+h)^3-8}{h}$
    Answer
    $12$
  3. $\displaystyle\lim_{x\to4}\frac{\sqrt x-2}{x-4}$
    Answer
    $\frac14$
  4. $\displaystyle\lim_{x\to0}\frac{1-\cos x}{x^2}$
    Answer
    $\frac12$ (multiply by $1+\cos x$)
  5. $\displaystyle\lim_{x\to0}\frac{\frac{1}{3+x}-\frac13}{x}$
    Answer
    $-\frac19$
1.3

Continuity and Its Consequences

IVTDemoQuiz
Definition $f$ is continuous at $a$ if three conditions hold: (1) $f(a)$ is defined, (2) $\displaystyle\lim_{x\to a}f(x)$ exists, (3) $\displaystyle\lim_{x\to a}f(x)=f(a)$.

Types of discontinuity: removable (a hole), jump (one-sided limits differ), infinite (vertical asymptote), and oscillating.

  • Polynomials, rational functions (on their domain), roots, $\sin$, $\cos$, $e^x$, $\ln x$ are continuous on their domains.
  • Sums, products, quotients (denominator $\neq0$) and compositions of continuous functions are continuous.
Intermediate Value Theorem (IVT) If $f$ is continuous on $[a,b]$ and $N$ is between $f(a)$ and $f(b)$, then there is $c\in(a,b)$ with $f(c)=N$. In particular, if $f(a)$ and $f(b)$ have opposite signs, $f$ has a root in $(a,b)$.
Extreme Value Theorem A continuous function on a closed interval $[a,b]$ attains an absolute maximum and an absolute minimum.

Worked examples

Example 1
Find $k$ so that $f(x)=\begin{cases}kx, & x\lt2\\ x^2-1, & x\ge2\end{cases}$ is continuous everywhere.
  1. Each piece is a polynomial, so the only possible problem is at $x=2$.
  2. Left limit: $$\lim_{x\to2^-}kx=2k$$ Right limit and value: $$\lim_{x\to2^+}(x^2-1)=3=f(2)$$
  3. Continuity requires $2k=3$.
$k=\dfrac32$
Example 2: IVT
Show that $x^3+x-1=0$ has a root in $(0,1)$.
  1. $f(x)=x^3+x-1$ is a polynomial, hence continuous on $[0,1]$.
  2. $f(0)=-1\lt0$ and $f(1)=1\gt0$.
  3. $0$ lies between $f(0)$ and $f(1)$, so by the IVT some $c\in(0,1)$ has $f(c)=0$. (Numerically $c\approx0.682$.)
Going deeper

Continuity = "limits commute with $f$". If $f$ is continuous at $L$ and $\lim_{x\to a}g(x)=L$, then $$\lim_{x\to a}f\big(g(x)\big)=f\Big(\lim_{x\to a}g(x)\Big).$$ This is why we may "pull limits inside" continuous functions, for example $\lim e^{g(x)}=e^{\lim g(x)}$.

Why the IVT needs continuity. The function $f(x)=\begin{cases}-1&x\lt0\\1&x\ge0\end{cases}$ changes sign on $[-1,1]$ but never equals $0$. A single jump is enough to break the theorem.

The bisection method turns the IVT into an algorithm. Halve the interval, keep the half where the sign changes, and repeat. Each step halves the error, so 10 steps gain about 3 decimal digits.

Remark The IVT guarantees existence, not uniqueness, and it does not tell you where the root is. To show a root is unique, combine it with monotonicity (Section 3.5) or Rolle's theorem (Section 3.1).
Example 3: bisection by hand
Locate the root of $f(x)=x^3+x-1$ in $(0,1)$ to within $0.125$.
  1. Start: $f(0)=-1\lt0$, $f(1)=1\gt0$. Midpoint $0.5$:

    $$f(0.5)=0.125+0.5-1=-0.375\lt0\ \Rightarrow\ \text{root in }(0.5,\,1)$$
  2. Midpoint $0.75$:

    $$f(0.75)=0.421875+0.75-1=0.171875\gt0\ \Rightarrow\ \text{root in }(0.5,\,0.75)$$
  3. Midpoint $0.625$:

    $$f(0.625)\approx0.244+0.625-1=-0.131\lt0\ \Rightarrow\ \text{root in }(0.625,\,0.75)$$
  4. The interval now has length $0.125$, so the root is $\approx0.6875\pm0.0625$. (True value $0.6823\ldots$)

Challenge Example 4: removing a discontinuity with two parameters
Find $a$ and $b$ so that $$f(x)=\begin{cases}\dfrac{\sqrt{x+a}-b}{x}, & x\neq0\\[2mm] 1, & x=0\end{cases}$$ is continuous at $0$.
  1. We need $\lim_{x\to0}f(x)=1$. Since the denominator $\to0$, the numerator must also $\to0$ (otherwise the limit is infinite):

    $$\sqrt{a}-b=0\quad\Longrightarrow\quad b=\sqrt a$$
  2. With $b=\sqrt a$, rationalise the numerator:

    $$\frac{\sqrt{x+a}-\sqrt a}{x}=\frac{(x+a)-a}{x(\sqrt{x+a}+\sqrt a)}=\frac{1}{\sqrt{x+a}+\sqrt a}$$
  3. Take the limit and set it equal to $f(0)=1$:

    $$\frac{1}{2\sqrt a}=1\quad\Longrightarrow\quad\sqrt a=\frac12$$
$a=\dfrac14,\ b=\dfrac12$
$f(x)=\dfrac{x^2-4}{x-2}$ at $x=2$ has a
$f(x)=x+2$ for $x\ne2$, so the limit is $4$ but $f(2)$ is undefined: a hole that can be "filled".

Exercises

  1. Where is $f(x)=\dfrac{x+1}{x^2-5x+6}$ continuous?
    Answer
    All $x$ except $2$ and $3$.
  2. Find $a,b$ such that $f(x)=\begin{cases}x+1 & x\lt1\\ ax+b & 1\le x\lt 3\\ 3x & x\ge3\end{cases}$ is continuous.
    Answer
    $a+b=2,\ 3a+b=9\Rightarrow a=\frac72,\ b=-\frac32$.
  3. Use the IVT to show $\cos x=x$ has a solution in $(0,\pi/2)$.
    Answer
    $g(x)=\cos x-x$: $g(0)=1\gt0$, $g(\pi/2)=-\pi/2\lt0$.
  4. Classify the discontinuity of $f(x)=\dfrac{1}{(x-1)^2}$ at $x=1$.
    Answer
    Infinite discontinuity.
1.4

Limits Involving Infinity

AsymptotesDemoQuiz

There are two kinds: infinite limits ($f(x)\to\pm\infty$ as $x\to a$), which give vertical asymptotes, and limits at infinity ($x\to\pm\infty$), which give horizontal asymptotes.

Vertical asymptote $x=a$ is a vertical asymptote if $\displaystyle\lim_{x\to a^\pm}f(x)=\pm\infty$ (any one side).
Horizontal asymptote $y=L$ is a horizontal asymptote if $\displaystyle\lim_{x\to\infty}f(x)=L$ or $\displaystyle\lim_{x\to-\infty}f(x)=L$.
Rational functions $\frac{p(x)}{q(x)}$ as $x\to\pm\infty$ Divide numerator and denominator by the highest power of $x$ in the denominator.
  • $\deg p\lt\deg q$: limit $0$.
  • $\deg p=\deg q$: limit $=$ ratio of leading coefficients.
  • $\deg p\gt\deg q$: limit is $\pm\infty$ (no horizontal asymptote).
Useful facts $\displaystyle\lim_{x\to\infty}\frac1{x^r}=0\ (r\gt0)$, $\displaystyle\lim_{x\to\infty}e^{-x}=0$, $\displaystyle\lim_{x\to\infty}\ln x=\infty$, $\displaystyle\lim_{x\to\infty}\arctan x=\frac\pi2$.

Worked examples

Example 1
Find $\displaystyle\lim_{x\to\infty}\frac{2x^2+3x+1}{x^2-4}$ and all asymptotes.
  1. Divide by $x^2$: $$\dfrac{2+3/x+1/x^2}{1-4/x^2}\to\dfrac{2+0+0}{1-0}=2$$ Horizontal asymptote $y=2$.
  2. Denominator is zero at $x=\pm2$; numerator $2x^2+3x+1=(2x+1)(x+1)$ is not zero there.
  3. Near $x=2^+$: numerator $\to15$, denominator $\to0^+$, so $f\to+\infty$. Similarly at $x=-2$. Vertical asymptotes $x=\pm2$.
HA: $y=2$; VA: $x=2,\ x=-2$.
Example 2
Find $\displaystyle\lim_{x\to-\infty}\frac{\sqrt{4x^2+1}}{x-3}$.
  1. For $x\lt0$, $\sqrt{x^2}=|x|=-x$. So $$\sqrt{4x^2+1}=-x\sqrt{4+1/x^2}$$
  2. $$\dfrac{-x\sqrt{4+1/x^2}}{x(1-3/x)}=\dfrac{-\sqrt{4+1/x^2}}{1-3/x}\to-\dfrac{2}{1}$$
$-2$
Going deeper

Who wins at infinity? As $x\to\infty$ the standard functions grow at very different rates: $$\ln x\ \ll\ x^{p}\ (p\gt0)\ \ll\ a^x\ (a\gt1)\ \ll\ x!\ \ll\ x^x .$$ In a quotient, the faster-growing function decides the limit. Section 3.3 proves these comparisons with L’Hôpital’s rule.

Slant asymptotes. When $\deg p=\deg q+1$, long division gives $\frac{p}{q}=mx+b+\frac{r(x)}{q(x)}$ with $\frac{r}{q}\to0$. The line $y=mx+b$ is then a slant (oblique) asymptote.

Remark A graph can cross its horizontal asymptote, even infinitely often: $y=\frac{\sin x}{x}$ crosses $y=0$ at every multiple of $\pi$. It can never cross a vertical asymptote, since the function is undefined there.
Remark Be careful with $\sqrt{x^2}=|x|$. As $x\to-\infty$, $\sqrt{x^2}=-x$, which is a common source of sign errors.
Example 3: slant asymptote
Find all asymptotes of $$f(x)=\frac{x^2+1}{x-1}.$$
  1. Long division of $x^2+1$ by $x-1$:

    $$\frac{x^2+1}{x-1}=x+1+\frac{2}{x-1}$$
  2. The remainder term vanishes at infinity, so the slant asymptote is the line that is left:

    $$\frac{2}{x-1}\to0\ \text{ as } x\to\pm\infty\quad\Longrightarrow\quad y=x+1$$
  3. Vertical asymptote where the denominator is zero but the numerator is not ($2\neq0$):

    $$x=1:\quad\lim_{x\to1^+}f=+\infty,\qquad\lim_{x\to1^-}f=-\infty$$
Slant asymptote $y=x+1$; vertical asymptote $x=1$; no horizontal asymptote
Challenge Example 4: ∞ − ∞ with a conjugate
Find $$\lim_{x\to\infty}\left(\sqrt{x^2+4x}-\sqrt{x^2-2x}\right).$$
  1. This is $\infty-\infty$. Multiply and divide by the conjugate:

    $$\frac{(x^2+4x)-(x^2-2x)}{\sqrt{x^2+4x}+\sqrt{x^2-2x}}=\frac{6x}{\sqrt{x^2+4x}+\sqrt{x^2-2x}}$$
  2. Factor $x$ (positive, since $x\to+\infty$) out of each root, $\sqrt{x^2+4x}=x\sqrt{1+4/x}$:

    $$\frac{6x}{x\left(\sqrt{1+\frac4x}+\sqrt{1-\frac2x}\right)}=\frac{6}{\sqrt{1+\frac4x}+\sqrt{1-\frac2x}}$$
  3. Let $x\to\infty$:

    $$\frac{6}{1+1}=3$$
$3$
$\displaystyle\lim_{x\to\infty}\frac{5x^3-x}{2x^3+7}=$
Equal degrees: ratio of leading coefficients $5/2$.
$\displaystyle\lim_{x\to3^-}\frac{1}{x-3}=$
For $x\lt3$, $x-3$ is a small negative number, so its reciprocal is a large negative number.

Exercises

  1. $\displaystyle\lim_{x\to\infty}\frac{3x+2}{x^2+1}$
    Answer
    $0$
  2. $\displaystyle\lim_{x\to\infty}\left(\sqrt{x^2+x}-x\right)$
    Answer
    $\frac12$ (conjugate)
  3. Find all asymptotes of $f(x)=\dfrac{x^2}{x^2-1}$.
    Answer
    VA $x=\pm1$; HA $y=1$.
  4. $\displaystyle\lim_{x\to\infty}e^{-x}\cos x$
    Answer
    $0$ (squeeze)
Chapter 2

The Derivative

The derivative measures instantaneous rate of change: the slope of a tangent line, the velocity of a moving object, the sensitivity of an output to its input.

f′
2.1

Tangent Lines and Velocity

Secant → tangentAnimationQuiz

The secant line through $P(a,f(a))$ and $Q(a+h,f(a+h))$ has slope $\dfrac{f(a+h)-f(a)}{h}$. As $Q$ slides towards $P$ ($h\to0$), the secant turns into the tangent line.

Slope of the tangent line at $x=a$ $$m=\lim_{h\to0}\frac{f(a+h)-f(a)}{h}=\lim_{x\to a}\frac{f(x)-f(a)}{x-a},\qquad y-f(a)=m(x-a).$$
Velocity If $s(t)$ is position, then average velocity on $[a,a+h]$ is $\dfrac{s(a+h)-s(a)}{h}$ and $$v(a)=\lim_{h\to0}\frac{s(a+h)-s(a)}{h}\quad\text{(instantaneous velocity).}$$

Worked examples

Example 1
Find the tangent line to $y=x^2$ at $(3,9)$.
  1. $$m=\lim_{h\to0}\frac{(3+h)^2-9}{h}=\lim_{h\to0}\frac{6h+h^2}{h}$$
  2. $$=\lim_{h\to0}(6+h)=6$$
  3. Point–slope form: $y-9=6(x-3)$, i.e. $y=6x-9$.
$y=6x-9$
Example 2: falling ball
A ball is dropped and falls $s(t)=4.9t^2$ metres in $t$ seconds. Find its velocity at $t=2$.
  1. $$\dfrac{s(2+h)-s(2)}{h}=\dfrac{4.9(4+4h+h^2)-19.6}{h}=\dfrac{19.6h+4.9h^2}{h}=19.6+4.9h$$
  2. Let $h\to0$: $v(2)=19.6$.
$19.6\ \text{m/s}$
Going deeper

One idea, many names. The same limit $\lim_{h\to0}\frac{f(a+h)-f(a)}{h}$ appears as:

Context$f$ is…The limit is…
Geometrya curveslope of the tangent line
Physicsposition $s(t)$velocity $v(t)$
Biologypopulation $P(t)$growth rate
Economicscost $C(q)$marginal cost

The difference quotient is an average rate over an interval of length $h$. The limit turns it into an instantaneous rate.

Remark A tangent line can cross the curve (for $y=x^3$ at the origin), and a line touching the curve at one point need not be tangent (a vertical line through a parabola's vertex). "Touches at exactly one point" is not the definition of a tangent.
Example 3: tangent to a rational function
Find the tangent line to $y=\dfrac{2}{x+1}$ at the point $(1,1)$.
  1. Write the difference quotient at $a=1$:

    $$m=\lim_{h\to0}\frac{\frac{2}{2+h}-1}{h}$$
  2. Simplify the numerator over the common denominator $2+h$:

    $$\frac{2}{2+h}-1=\frac{2-(2+h)}{2+h}=\frac{-h}{2+h}$$
  3. Divide by $h$ and let $h\to0$:

    $$m=\lim_{h\to0}\frac{-1}{2+h}=-\frac12$$
  4. Point–slope form through $(1,1)$:

    $$y-1=-\tfrac12(x-1)\quad\Longleftrightarrow\quad y=-\tfrac12x+\tfrac32$$
Challenge Example 4: tangent lines from an outside point
Find the lines through $(1,-3)$ that are tangent to the parabola $y=x^2$.
  1. The point $(1,-3)$ is not on the parabola. Call the unknown tangency point $(a,a^2)$. The slope there is $2a$ (from $\lim_{h\to0}\frac{(a+h)^2-a^2}{h}$), so the tangent line is

    $$y=a^2+2a(x-a)=2ax-a^2$$
  2. This line must pass through $(1,-3)$:

    $$-3=2a(1)-a^2\quad\Longleftrightarrow\quad a^2-2a-3=0\quad\Longleftrightarrow\quad(a-3)(a+1)=0$$
  3. Two tangency points, $a=3$ and $a=-1$, give two lines:

    $$a=3:\ y=6x-9,\qquad a=-1:\ y=-2x-1$$
$y=6x-9$ and $y=-2x-1$
The average velocity of $s(t)=t^2$ on $[1,3]$ is
$\frac{s(3)-s(1)}{3-1}=\frac{9-1}{2}=4$.

Exercises

  1. Find the tangent line to $y=\dfrac1x$ at $(1,1)$.
    Answer
    $y=-x+2$
  2. Find the slope of the tangent to $y=\sqrt x$ at $x=4$ using the limit definition.
    Answer
    $\frac14$
  3. $s(t)=t^3-2t$. Find the velocity at $t=1$.
    Answer
    $1$
2.2

The Derivative

DefinitionDemoQuiz
Definition The derivative of $f$ is the function $$f'(x)=\lim_{h\to0}\frac{f(x+h)-f(x)}{h}$$ wherever the limit exists. Notations: $f'(x)=\dfrac{dy}{dx}=\dfrac{d}{dx}f(x)=Df(x)$.
Theorem If $f$ is differentiable at $a$, then $f$ is continuous at $a$. The converse is false: $f(x)=|x|$ is continuous at $0$ but not differentiable there (corner).

A function fails to be differentiable at a corner, a cusp, a vertical tangent, or a discontinuity. Higher derivatives: $f''=(f')'$, $f'''$, $f^{(n)}$.

Worked examples

Example 1
Use the definition to find $f'(x)$ for $f(x)=x^2-3x$.
  1. $f(x+h)=x^2+2xh+h^2-3x-3h$.
  2. $f(x+h)-f(x)=2xh+h^2-3h$, so $$\dfrac{f(x+h)-f(x)}{h}=2x+h-3$$
  3. Let $h\to0$.
$f'(x)=2x-3$
Example 2
Use the definition to find $f'(x)$ for $f(x)=\sqrt{x}$.
  1. $$\dfrac{\sqrt{x+h}-\sqrt x}{h}\cdot\dfrac{\sqrt{x+h}+\sqrt x}{\sqrt{x+h}+\sqrt x}=\dfrac{h}{h(\sqrt{x+h}+\sqrt x)}$$
  2. $$=\dfrac{1}{\sqrt{x+h}+\sqrt x}\to\dfrac{1}{2\sqrt x}$$ as $h\to0$.
$f'(x)=\dfrac1{2\sqrt x},\ x\gt0$
Going deeper

The derivative is a function. At each $x$ it outputs the slope of $f$ there. Reading graphs:

  • Where $f$ has a horizontal tangent, the graph of $f'$ crosses the $x$-axis.
  • Where $f$ is steepest, $f'$ has an extreme value.
  • A corner in $f$ produces a jump in $f'$.

Units. $f'(x)$ has units of $\frac{\text{units of }f}{\text{units of }x}$. If $T(t)$ is temperature (°C) at time $t$ (min), then $T'(t)$ is in °C/min.

Remark Leibniz notation $\frac{dy}{dx}$ is not a fraction of numbers, but it often behaves like one (chain rule, substitution, related rates). That is exactly why the notation is so useful.
Example 3: one-sided derivatives
Is $f(x)=\begin{cases}x^2, & x\le1\\ 2x-1, & x\gt1\end{cases}$ differentiable at $x=1$?
  1. First check continuity: both formulas give $1$ at $x=1$, so $f$ is continuous.

  2. Left derivative, using $x^2$:

    $$f'_-(1)=\lim_{h\to0^-}\frac{(1+h)^2-1}{h}=\lim_{h\to0^-}(2+h)=2$$
  3. Right derivative, using $2x-1$ (note $f(1)=1$):

    $$f'_+(1)=\lim_{h\to0^+}\frac{2(1+h)-1-1}{h}=\lim_{h\to0^+}\frac{2h}{h}=2$$
  4. The one-sided derivatives agree, so $f'(1)$ exists. The pieces join smoothly, with no corner.

Yes, $f'(1)=2$
Challenge Example 4: continuous but not differentiable
Show that $f(x)=x^{1/3}$ is continuous at $0$ but not differentiable there.
  1. Continuity: cube roots are continuous, and $\lim_{x\to0}x^{1/3}=0=f(0)$.

  2. Difference quotient at $0$:

    $$\frac{f(0+h)-f(0)}{h}=\frac{h^{1/3}}{h}=\frac{1}{h^{2/3}}$$
  3. Since $h^{2/3}\gt0$ and $h^{2/3}\to0$, the quotient grows without bound:

    $$\lim_{h\to0}\frac{1}{h^{2/3}}=+\infty$$
  4. The tangent line exists but is vertical, with infinite slope, so $f'(0)$ does not exist.

Where is $f(x)=|x-2|$ not differentiable?
The graph has a corner at $x=2$: left slope $-1$, right slope $+1$.
$\displaystyle\lim_{h\to0}\frac{(1+h)^{10}-1}{h}$ equals
This is $f'(1)$ for $f(x)=x^{10}$, and $f'(x)=10x^9$, so $f'(1)=10$.

Exercises

  1. Use the definition to find $f'(x)$ for $f(x)=\dfrac1{x+1}$.
    Answer
    $-\dfrac1{(x+1)^2}$
  2. Use the definition to find $f'(x)$ for $f(x)=x^3$.
    Answer
    $3x^2$
  3. Sketch the graph of $f'$ given that $f$ increases on $(-\infty,1)$ and decreases on $(1,\infty)$.
    Answer
    $f'\gt0$ for $x\lt1$, $f'(1)=0$, $f'\lt0$ for $x\gt1$.
2.3

Computation of Derivatives: The Power Rule

RulesDemoQuiz
RuleFormula
Constant$\dfrac{d}{dx}c=0$
Power rule ($n$ any real)$\dfrac{d}{dx}x^n=n\,x^{n-1}$
Constant multiple$\dfrac{d}{dx}[c f]=c f'$
Sum / difference$\dfrac{d}{dx}[f\pm g]=f'\pm g'$
Tip Rewrite roots and reciprocals as powers first: $\sqrt[3]{x^2}=x^{2/3}$, $\dfrac{1}{x^4}=x^{-4}$.

Worked examples

Example 1
Differentiate $y=4x^5-3x^2+7x-9$.
  1. Term by term: $20x^4-6x+7-0$.
$y'=20x^4-6x+7$
Example 2
Differentiate $y=\dfrac{3}{x^2}+2\sqrt x-\dfrac{1}{\sqrt[3]{x}}$.
  1. Rewrite: $$y=3x^{-2}+2x^{1/2}-x^{-1/3}$$
  2. Power rule: $$y'=-6x^{-3}+x^{-1/2}+\tfrac13x^{-4/3}$$
$y'=-\dfrac6{x^3}+\dfrac1{\sqrt x}+\dfrac1{3x^{4/3}}$
Example 3
Find the points on $y=x^3-12x$ where the tangent is horizontal.
  1. $$y'=3x^2-12=0\iff x^2=4\iff x=\pm2$$
  2. $y(2)=-16,\ y(-2)=16$.
$(2,-16)$ and $(-2,16)$
Going deeper

Why the power rule works (positive integers). Expand with the binomial theorem: $$(x+h)^n=x^n+nx^{n-1}h+\binom n2x^{n-2}h^2+\dots+h^n .$$ Subtract $x^n$ and divide by $h$: every term except $nx^{n-1}$ still contains a factor $h$ and vanishes as $h\to0$. For general real $n$, the proof uses logarithmic differentiation (Section 2.7).

Remark The power rule needs a constant exponent and a variable base. $\frac{d}{dx}x^\pi=\pi x^{\pi-1}$, but $\frac{d}{dx}\pi^x=\pi^x\ln\pi$ and $\frac{d}{dx}\pi^\pi=0$.
Example 4: normal line
Find the equation of the normal line to $y=x\sqrt x$ at $(4,8)$.
  1. Rewrite as a power and differentiate:

    $$y=x^{3/2}\quad\Rightarrow\quad y'=\tfrac32x^{1/2}$$
  2. Slope of the tangent at $x=4$:

    $$m_T=\tfrac32\cdot2=3$$
  3. The normal is perpendicular to the tangent, so $m_N=-1/m_T$:

    $$m_N=-\frac13,\qquad y-8=-\frac13(x-4)$$
$y=-\tfrac13x+\tfrac{28}3$
Challenge Example 5: a tangent with a prescribed slope and intercept
Find the constant $c$ so that the line $y=4x+c$ is tangent to the parabola $y=x^2+3x$.
  1. At the point of tangency $(a,f(a))$, the slopes must agree:

    $$f'(a)=2a+3=4\quad\Rightarrow\quad a=\tfrac12$$
  2. The point lies on both the curve and the line:

    $$f\!\left(\tfrac12\right)=\tfrac14+\tfrac32=\tfrac74=4\cdot\tfrac12+c$$
  3. Solve for $c$:

    $$c=\tfrac74-2=-\tfrac14$$
$c=-\tfrac14$
$\dfrac{d}{dx}\left(x^{3/2}\right)=$
$\frac32x^{3/2-1}=\frac32x^{1/2}$.

Exercises

  1. $y=x^7-5x^3+\pi^2$
    Answer
    $7x^6-15x^2$
  2. $y=\dfrac{x^2+4x+3}{\sqrt x}$
    Answer
    $\tfrac32x^{1/2}+2x^{-1/2}-\tfrac32x^{-3/2}$
  3. Find the equation of the tangent to $y=x^4-2x$ at $x=1$.
    Answer
    $y=2x-3$
  4. Find $y''$ for $y=x^5-x^{-1}$.
    Answer
    $20x^3-2x^{-3}$
2.4

The Product and Quotient Rules

RulesArea modelQuiz
Product rule $$(fg)'=f'g+fg'$$
Quotient rule $$\left(\frac fg\right)'=\frac{f'g-fg'}{g^2}$$
Common mistake $(fg)'\neq f'g'$ and $\left(\frac fg\right)'\neq\frac{f'}{g'}$. Mnemonic for the quotient rule: "low d-high minus high d-low, over low squared".

Why the product rule? Picture $f\cdot g$ as the area of a rectangle with sides $f$ and $g$. When the sides grow by $\Delta f$ and $\Delta g$, the area grows by $g\,\Delta f+f\,\Delta g+\Delta f\,\Delta g$. Divide by $\Delta x$ and let $\Delta x\to0$: the corner piece vanishes.

Worked examples

Example 1
Differentiate $y=(x^2+1)(x^3-2x)$.
  1. $f=x^2+1,\ f'=2x$; $g=x^3-2x,\ g'=3x^2-2$.
  2. $$y'=2x(x^3-2x)+(x^2+1)(3x^2-2)$$
  3. $$=2x^4-4x^2+3x^4+x^2-2=5x^4-3x^2-2$$
$y'=5x^4-3x^2-2$
Example 2
Differentiate $y=\dfrac{x^2}{x+1}$.
  1. $f=x^2,\ f'=2x$; $g=x+1,\ g'=1$.
  2. $$y'=\dfrac{2x(x+1)-x^2\cdot1}{(x+1)^2}$$
  3. Simplify the numerator: $x^2+2x$.
$y'=\dfrac{x^2+2x}{(x+1)^2}$
Going deeper

Proof of the product rule. Add and subtract $f(x+h)g(x)$ in the numerator: $$\frac{f(x+h)g(x+h)-f(x)g(x)}{h}=f(x+h)\,\frac{g(x+h)-g(x)}{h}+g(x)\,\frac{f(x+h)-f(x)}{h}.$$ As $h\to0$: $f(x+h)\to f(x)$ (differentiable implies continuous), and the two quotients tend to $g'(x)$ and $f'(x)$.

Extended product rule. $(fgh)'=f'gh+fg'h+fgh'$: differentiate one factor at a time.

Remark Before using the quotient rule, see whether you can simplify. $\frac{x^3+2x}{x}=x^2+2$ (for $x\ne0$) differentiates instantly to $2x$.
Example 3: three factors
Differentiate $y=x^2(x+1)(x-3)$ using the extended product rule.
  1. Label $f=x^2$, $g=x+1$, $h=x-3$, with $f'=2x$, $g'=1$, $h'=1$:

    $$y'=f'gh+fg'h+fgh'$$
  2. Substitute:

    $$y'=2x(x+1)(x-3)+x^2(x-3)+x^2(x+1)$$
  3. Expand and collect: $2x(x^2-2x-3)+x^3-3x^2+x^3+x^2$:

    $$y'=4x^3-6x^2-6x$$
Challenge Example 4: horizontal tangents of a quotient
Find the points where $y=\dfrac{x}{x^2+4}$ has a horizontal tangent.
  1. Quotient rule, with "low d-high minus high d-low":

    $$y'=\frac{(1)(x^2+4)-x(2x)}{(x^2+4)^2}=\frac{4-x^2}{(x^2+4)^2}$$
  2. A fraction is zero exactly when its numerator is zero (the denominator is never $0$):

    $$4-x^2=0\quad\Rightarrow\quad x=\pm2$$
  3. Compute the $y$-values:

    $$y(2)=\frac{2}{8}=\frac14,\qquad y(-2)=-\frac14$$
$\left(2,\tfrac14\right)$ and $\left(-2,-\tfrac14\right)$
If $f(2)=3,\ f'(2)=-1,\ g(2)=4,\ g'(2)=5$, then $(fg)'(2)=$
$f'g+fg'=(-1)(4)+(3)(5)=11$.
Same data: $\left(\frac fg\right)'(2)=$
$\frac{f'g-fg'}{g^2}=\frac{(-1)(4)-(3)(5)}{16}=-\frac{19}{16}$.

Exercises

  1. $y=x^3\sqrt x\,(2x-1)$
    Answer
    $y=2x^{9/2}-x^{7/2}$, so $y'=9x^{7/2}-\tfrac72x^{5/2}$
  2. $y=\dfrac{3x-1}{2x+5}$
    Answer
    $\dfrac{17}{(2x+5)^2}$
  3. $y=\dfrac{x^2+1}{x^2-1}$
    Answer
    $\dfrac{-4x}{(x^2-1)^2}$
  4. Derive the rule $\left(\frac1g\right)'=-\frac{g'}{g^2}$ from the quotient rule.
    Answer
    $f=1,\ f'=0$: $\frac{0\cdot g-1\cdot g'}{g^2}$.
2.5

The Chain Rule

CompositionDemoQuiz
Chain rule If $y=f(u)$ and $u=g(x)$, then $$\frac{dy}{dx}=\frac{dy}{du}\cdot\frac{du}{dx},\qquad\text{i.e.}\qquad (f\circ g)'(x)=f'(g(x))\,g'(x).$$ "Derivative of the outside, evaluated at the inside, times the derivative of the inside."
General power rule $\dfrac{d}{dx}[g(x)]^n=n[g(x)]^{n-1}g'(x)$.

Rates multiply. If $u$ changes 3 times as fast as $x$, and $y$ changes 2 times as fast as $u$, then $y$ changes $2\cdot3=6$ times as fast as $x$.

Worked examples

Example 1
Differentiate $y=(3x^2+1)^{10}$.
  1. Outside $u^{10}$, inside $u=3x^2+1$ with $u'=6x$.
  2. $y'=10(3x^2+1)^9\cdot6x$.
$y'=60x(3x^2+1)^9$
Example 2
Differentiate $y=\sqrt{x^2+5x}$.
  1. $y=(x^2+5x)^{1/2}$.
  2. $$y'=\tfrac12(x^2+5x)^{-1/2}(2x+5)$$
$y'=\dfrac{2x+5}{2\sqrt{x^2+5x}}$
Example 3: a double chain
Differentiate $y=\sin^3(4x)$.
  1. Layers: $(\,\cdot\,)^3$, then $\sin(\,\cdot\,)$, then $4x$.
  2. $$y'=3\sin^2(4x)\cdot\cos(4x)\cdot4$$
$y'=12\sin^2(4x)\cos(4x)$
Going deeper

Peeling an onion. For a nested function, work from the outside in. Write down each layer's derivative, evaluated at what is inside it, then multiply: $$\frac{d}{dx}f\big(g(h(x))\big)=f'\big(g(h(x))\big)\cdot g'\big(h(x)\big)\cdot h'(x).$$

Units check. If $y$ is in metres, $u$ in seconds and $x$ in kilograms, then $\frac{dy}{du}\cdot\frac{du}{dx}$ has units $\frac{\text{m}}{\text{s}}\cdot\frac{\text{s}}{\text{kg}}=\frac{\text{m}}{\text{kg}}$, exactly the units of $\frac{dy}{dx}$.

Remark The most common chain-rule error is forgetting the inner derivative: $\frac{d}{dx}\sin(x^2)\neq\cos(x^2)$. Always ask "what is inside, and what is its derivative?"
Example 4: chain inside a quotient
Differentiate $y=\dfrac{(2x+1)^3}{x^2}$.
  1. Quotient rule, with the chain rule for the numerator: $\frac{d}{dx}(2x+1)^3=3(2x+1)^2\cdot2$:

    $$y'=\frac{6(2x+1)^2x^2-(2x+1)^3\cdot2x}{x^4}$$
  2. Factor out the common $2x(2x+1)^2$:

    $$y'=\frac{2x(2x+1)^2\big[3x-(2x+1)\big]}{x^4}$$
  3. Simplify the bracket and cancel $x$:

    $$y'=\frac{2(2x+1)^2(x-1)}{x^3}$$
Challenge Example 5: four layers
Differentiate $y=\sqrt{1+\sin^2(3x)}$.
  1. Layers from outside to inside: $\sqrt{\ \cdot\ }$, then $1+(\cdot)^2$, then $\sin(\cdot)$, then $3x$.

  2. Outer layer: $\frac{d}{du}\sqrt u=\frac{1}{2\sqrt u}$:

    $$y'=\frac{1}{2\sqrt{1+\sin^2(3x)}}\cdot\frac{d}{dx}\big[\sin^2(3x)\big]$$
  3. Square layer, then sine layer, then the linear layer:

    $$\frac{d}{dx}\sin^2(3x)=2\sin(3x)\cdot\cos(3x)\cdot3$$
  4. Multiply everything together and simplify:

    $$y'=\frac{3\sin(3x)\cos(3x)}{\sqrt{1+\sin^2(3x)}}$$
$\dfrac{d}{dx}(1-x^2)^5=$
$5(1-x^2)^4\cdot(-2x)$.

Exercises

  1. $y=(x^3-4x)^{-2}$
    Answer
    $-2(x^3-4x)^{-3}(3x^2-4)$
  2. $y=\dfrac{1}{\sqrt{1-x^2}}$
    Answer
    $\dfrac{x}{(1-x^2)^{3/2}}$
  3. $y=\left(\dfrac{x-1}{x+1}\right)^3$
    Answer
    $3\left(\frac{x-1}{x+1}\right)^2\cdot\frac{2}{(x+1)^2}$
  4. If $h(x)=f(g(x))$, $g(1)=2$, $g'(1)=3$, $f'(2)=-4$, find $h'(1)$.
    Answer
    $-12$
2.6

Derivatives of Trigonometric Functions

TableAnimationQuiz
$f(x)$$f'(x)$$f(x)$$f'(x)$
$\sin x$$\cos x$$\csc x$$-\csc x\cot x$
$\cos x$$-\sin x$$\sec x$$\sec x\tan x$
$\tan x$$\sec^2x$$\cot x$$-\csc^2x$
Where $(\sin x)'=\cos x$ comes from $$\frac{\sin(x+h)-\sin x}{h}=\sin x\,\frac{\cos h-1}{h}+\cos x\,\frac{\sin h}{h}\ \xrightarrow{h\to0}\ \sin x\cdot0+\cos x\cdot1 .$$
Angles in radians These formulas hold only when $x$ is measured in radians.

Worked examples

Example 1
Differentiate $y=x^2\sin x$.
  1. Product rule: $y'=2x\sin x+x^2\cos x$.
Example 2
Differentiate $y=\tan(3x^2)$.
  1. Chain rule: $y'=\sec^2(3x^2)\cdot6x$.
$y'=6x\sec^2(3x^2)$
Example 3
Derive $(\tan x)'$ from the quotient rule.
  1. $$\tan x=\dfrac{\sin x}{\cos x}$$ so $$(\tan x)'=\dfrac{\cos x\cos x-\sin x(-\sin x)}{\cos^2x}$$
  2. $$=\dfrac{\cos^2x+\sin^2x}{\cos^2x}=\dfrac{1}{\cos^2x}=\sec^2x$$
Going deeper

Why radians? The key limit $\lim_{x\to0}\frac{\sin x}{x}=1$ holds only in radians, because it comes from the arc length $x$ on the unit circle. In degrees, $\frac{d}{dx}\sin(x^\circ)=\frac{\pi}{180}\cos(x^\circ)$, an awkward extra factor.

Memory aid. Every co-function ($\cos,\cot,\csc$) has a minus sign in its derivative. The pairs $\tan\leftrightarrow\sec^2$ and $\cot\leftrightarrow-\csc^2$ mirror each other.

Remark $\sin^2x$ means $(\sin x)^2$, but $\sin^{-1}x$ means $\arcsin x$, not $\frac1{\sin x}$. Read the notation carefully.
Example 4: simple harmonic motion
A mass on a spring has position $s(t)=4\cos t$ (cm). Find velocity and acceleration, and describe the motion.
  1. Velocity is the first derivative:

    $$v(t)=s'(t)=-4\sin t$$
  2. Acceleration is the second derivative:

    $$a(t)=v'(t)=-4\cos t=-s(t)$$
  3. Interpretation: the acceleration always points back towards the rest position $s=0$. Speed is greatest ($4$ cm/s) at $s=0$, and zero at the extremes $s=\pm4$.

Challenge Example 5: a trigonometric limit as a derivative
Evaluate $$\lim_{x\to\pi/3}\frac{\cos x-\frac12}{x-\frac\pi3}.$$
  1. Recognise the form $\displaystyle\lim_{x\to a}\frac{f(x)-f(a)}{x-a}=f'(a)$ with $f(x)=\cos x$ and $a=\frac\pi3$, since $\cos\frac\pi3=\frac12$.

  2. So the limit is a derivative value:

    $$f'\!\left(\tfrac\pi3\right)=-\sin\tfrac\pi3=-\frac{\sqrt3}{2}$$
$-\dfrac{\sqrt3}{2}$
$\dfrac{d}{dx}\cos(5x)=$
$-\sin(5x)\cdot5$.
$\dfrac{d^{99}}{dx^{99}}\sin x=$
Derivatives of $\sin$ repeat with period 4: $\sin,\cos,-\sin,-\cos$. Since $99=4\cdot24+3$, the answer is the 3rd: $-\cos x$.

Exercises

  1. $y=\sec x\tan x$
    Answer
    $\sec x\tan^2x+\sec^3x$
  2. $y=\dfrac{\sin x}{1+\cos x}$
    Answer
    $\dfrac{1}{1+\cos x}$
  3. $y=\sqrt{\sin x}$
    Answer
    $\dfrac{\cos x}{2\sqrt{\sin x}}$
  4. Find the tangent line to $y=\cos x$ at $x=\pi/3$.
    Answer
    $y-\tfrac12=-\tfrac{\sqrt3}{2}(x-\tfrac\pi3)$
2.7

Derivatives of Exponential and Logarithmic Functions

e and lnDemoQuiz
$f(x)$$f'(x)$With chain rule
$e^x$$e^x$$\left(e^{u}\right)'=e^{u}u'$
$a^x$$a^x\ln a$$\left(a^{u}\right)'=a^{u}\ln a\cdot u'$
$\ln x$$\dfrac1x$$(\ln u)'=\dfrac{u'}{u}$
$\log_a x$$\dfrac1{x\ln a}$$(\log_a u)'=\dfrac{u'}{u\ln a}$
$\ln|x|$$\dfrac1x$
The number $e$ $e\approx2.71828$ is the unique base for which the tangent to $y=a^x$ at $x=0$ has slope exactly $1$: $\displaystyle\lim_{h\to0}\frac{e^h-1}{h}=1$.
Logarithmic differentiation For $y=f(x)^{g(x)}$ or messy products: take $\ln$, differentiate implicitly, multiply by $y$.

Worked examples

Example 1
Differentiate $y=e^{x^2}\ln x$.
  1. Product rule: $$y'=(e^{x^2})'\ln x+e^{x^2}(\ln x)'$$
  2. $$=2xe^{x^2}\ln x+\dfrac{e^{x^2}}{x}$$
Example 2: logarithmic differentiation
Differentiate $y=x^{x}$, $x\gt0$.
  1. $\ln y=x\ln x$.
  2. Differentiate: $$\dfrac{y'}{y}=\ln x+x\cdot\dfrac1x=\ln x+1$$
  3. $y'=y(\ln x+1)$.
$y'=x^x(\ln x+1)$
Going deeper

The exponential is its own derivative. For $f(x)=e^x$: $$\frac{e^{x+h}-e^x}{h}=e^x\cdot\frac{e^h-1}{h}\ \xrightarrow{h\to0}\ e^x\cdot1 .$$ So the rate of growth equals the current size. That is why $e^x$ models populations, compound interest and radioactive decay.

The log derivative from the inverse. If $y=\ln x$, then $e^y=x$. Differentiate implicitly: $e^y y'=1$, so $y'=\frac1{e^y}=\frac1x$.

Remark Simplify with log laws before differentiating: $\ln\frac{x^3\sqrt{x+1}}{(2x-1)^4}=3\ln x+\tfrac12\ln(x+1)-4\ln(2x-1)$ turns a nightmare into three easy terms.
Example 3: logarithmic differentiation of a product
Differentiate $y=\dfrac{x^{3/4}\sqrt{x^2+1}}{(3x+2)^5}$.
  1. Take $\ln$ of both sides and expand with log laws:

    $$\ln y=\tfrac34\ln x+\tfrac12\ln(x^2+1)-5\ln(3x+2)$$
  2. Differentiate implicitly. The left side gives $\frac{y'}{y}$:

    $$\frac{y'}{y}=\frac{3}{4x}+\frac{x}{x^2+1}-\frac{15}{3x+2}$$
  3. Multiply by $y$ to solve:

    $$y'=\frac{x^{3/4}\sqrt{x^2+1}}{(3x+2)^5}\left(\frac{3}{4x}+\frac{x}{x^2+1}-\frac{15}{3x+2}\right)$$
Challenge Example 4: the limit that defines e
Use the derivative of $\ln x$ at $x=1$ to show $$\lim_{h\to0}(1+h)^{1/h}=e .$$
  1. For $f(x)=\ln x$, $f'(1)=1$. By the definition of the derivative:

    $$1=\lim_{h\to0}\frac{\ln(1+h)-\ln1}{h}=\lim_{h\to0}\frac1h\ln(1+h)=\lim_{h\to0}\ln\left[(1+h)^{1/h}\right]$$
  2. The exponential is continuous, so we may move the limit inside it:

    $$\lim_{h\to0}(1+h)^{1/h}=\lim_{h\to0}e^{\ln[(1+h)^{1/h}]}=e^{1}$$
$e$
$\dfrac{d}{dx}\ln(x^2+1)=$
$\frac{u'}{u}$ with $u=x^2+1$.
$\dfrac{d}{dx}2^x=$
$(a^x)'=a^x\ln a$. The power rule does not apply because the exponent is the variable.

Exercises

  1. $y=e^{-3x}\cos x$
    Answer
    $-e^{-3x}(3\cos x+\sin x)$
  2. $y=\ln\!\left(\dfrac{x^2}{\sqrt{x+1}}\right)$
    Answer
    $\frac2x-\frac{1}{2(x+1)}$
  3. $y=\log_{10}(3x)$
    Answer
    $\dfrac{1}{x\ln10}$
  4. $y=(\sin x)^{x}$
    Answer
    $(\sin x)^x(\ln\sin x+x\cot x)$
2.8

Implicit Differentiation and Inverse Trigonometric Functions

ImplicitAnimationQuiz

When $y$ is defined implicitly by an equation $F(x,y)=0$, differentiate both sides with respect to $x$, treating $y$ as a function of $x$ (so $\frac{d}{dx}y^2=2y\,y'$), then solve for $y'$.

Procedure (1) Differentiate both sides in $x$. (2) Every time you differentiate an expression in $y$, multiply by $y'$. (3) Collect $y'$ terms on one side. (4) Solve.
$f(x)$$f'(x)$$f(x)$$f'(x)$
$\arcsin x$$\dfrac{1}{\sqrt{1-x^2}}$$\arccos x$$-\dfrac{1}{\sqrt{1-x^2}}$
$\arctan x$$\dfrac{1}{1+x^2}$$\operatorname{arccot} x$$-\dfrac{1}{1+x^2}$
$\operatorname{arcsec} x$$\dfrac{1}{|x|\sqrt{x^2-1}}$$\operatorname{arccsc} x$$-\dfrac{1}{|x|\sqrt{x^2-1}}$

Worked examples

Example 1
Find $y'$ if $x^3+y^3=6xy$ (folium of Descartes), and the tangent at $(3,3)$.
  1. Differentiate: $3x^2+3y^2y'=6y+6xy'$.
  2. Collect: $y'(3y^2-6x)=6y-3x^2$, so $y'=\dfrac{2y-x^2}{y^2-2x}$.
  3. At $(3,3)$: $y'=\dfrac{6-9}{9-6}=-1$. Tangent: $y-3=-(x-3)$.
$y'=\dfrac{2y-x^2}{y^2-2x}$; tangent $y=-x+6$
Example 2: derivative of arcsin
Show that $\dfrac{d}{dx}\arcsin x=\dfrac{1}{\sqrt{1-x^2}}$.
  1. Let $y=\arcsin x$, so $\sin y=x$ with $$-\tfrac\pi2\le y\le\tfrac\pi2$$
  2. Differentiate implicitly: $$\cos y\cdot y'=1\Rightarrow y'=\dfrac1{\cos y}$$
  3. On this interval $\cos y\ge0$, so $$\cos y=\sqrt{1-\sin^2y}=\sqrt{1-x^2}$$
Going deeper

When is implicit differentiation needed? Some curves, like $x^3+y^3=6xy$ or $\sin(xy)=x+y$, cannot be solved for $y$ in closed form. Implicit differentiation finds the slope anyway, as a formula in both $x$ and $y$.

Derivative of an inverse function. If $g=f^{-1}$, then $f(g(x))=x$. Differentiating gives $f'(g(x))\,g'(x)=1$, so $$g'(x)=\frac{1}{f'(g(x))}.$$ Geometrically, the graph of the inverse is a reflection in $y=x$, which turns a slope $m$ into $1/m$.

Remark Remember the factor $y'$ every time you differentiate a $y$-term: $\frac{d}{dx}(y^3)=3y^2y'$, and $\frac{d}{dx}(xy)=y+xy'$ (product rule!).
Example 3: second derivative implicitly
Find $y''$ for $x^4+y^4=16$.
  1. First derivative:

    $$4x^3+4y^3y'=0\quad\Rightarrow\quad y'=-\frac{x^3}{y^3}$$
  2. Differentiate $y'$ again with the quotient rule, remembering that $y$ depends on $x$:

    $$y''=-\frac{3x^2y^3-x^3\cdot3y^2y'}{y^6}$$
  3. Substitute $y'=-x^3/y^3$ and simplify:

    $$y''=-\frac{3x^2y^4+3x^6}{y^7}=-\frac{3x^2(y^4+x^4)}{y^7}$$
  4. Use the original equation $x^4+y^4=16$:

    $$y''=-\frac{48x^2}{y^7}$$
Challenge Example 4: derivative of an inverse at a point
Let $f(x)=x^3+x+1$ and $g=f^{-1}$. Find $g'(3)$ without finding a formula for $g$.
  1. Find $g(3)$, i.e. solve $f(x)=3$. By inspection, $x=1$: $1+1+1=3$. So $g(3)=1$.

  2. Compute $f'$ at that point:

    $$f'(x)=3x^2+1,\qquad f'(1)=4$$
  3. Inverse function rule:

    $$g'(3)=\frac{1}{f'(g(3))}=\frac{1}{f'(1)}=\frac14$$
$g'(3)=\dfrac14$
If $x^2+y^2=25$, then $y'$ at $(3,4)$ is
$2x+2yy'=0\Rightarrow y'=-x/y=-3/4$.
$\dfrac{d}{dx}\arctan(2x)=$
$\frac{1}{1+(2x)^2}\cdot2$.

Exercises

  1. Find $y'$ if $x^2y+y^3=5$.
    Answer
    $y'=\dfrac{-2xy}{x^2+3y^2}$
  2. Find $y'$ if $\sin(xy)=x$.
    Answer
    $y'=\dfrac{1-y\cos(xy)}{x\cos(xy)}$
  3. $y=x\arcsin x+\sqrt{1-x^2}$
    Answer
    $\arcsin x$
  4. Find $y''$ if $x^2+y^2=1$.
    Answer
    $y''=-\dfrac{1}{y^3}$
Chapter 3

Applications of the Derivative

The derivative tells us where a function rises and falls, where it bends, how to approximate it, and how to find the best possible design.

max
3.1

The Mean Value Theorem

TheoremDemoQuiz
Rolle's Theorem If $f$ is continuous on $[a,b]$, differentiable on $(a,b)$ and $f(a)=f(b)$, then there is $c\in(a,b)$ with $f'(c)=0$.
Mean Value Theorem (MVT) If $f$ is continuous on $[a,b]$ and differentiable on $(a,b)$, then there is $c\in(a,b)$ with $$f'(c)=\frac{f(b)-f(a)}{b-a}.$$ Geometrically: some tangent line is parallel to the secant line through the endpoints.
Consequences If $f'(x)=0$ on an interval, $f$ is constant there. If $f'=g'$ on an interval, then $f=g+C$.

Worked examples

Example 1
Find all $c$ satisfying the MVT for $f(x)=x^3-x$ on $[0,2]$.
  1. $f$ is a polynomial: continuous and differentiable everywhere.
  2. Secant slope: $$\dfrac{f(2)-f(0)}{2-0}=\dfrac{6-0}{2}=3$$
  3. $$f'(c)=3c^2-1=3\Rightarrow c^2=\tfrac43\Rightarrow c=\pm\tfrac{2}{\sqrt3}$$ Only $$c=\tfrac2{\sqrt3}\approx1.155$$ lies in $(0,2)$.
$c=\dfrac{2}{\sqrt3}$
Example 2: a speeding ticket
A car travels 150 km in 1.5 hours. Show that at some moment its speed was exactly 100 km/h.
  1. Average speed $=150/1.5=100$ km/h.
  2. Position $s(t)$ is differentiable, so by the MVT there is $c$ with $s'(c)=100$.
Example 3: exactly one root
Show that $x^3+x-1=0$ has exactly one real root.
  1. Existence: the IVT gives a root in $(0,1)$ (Section 1.3).
  2. Uniqueness: if there were two roots $a\lt b$, Rolle's theorem would give $f'(c)=0$. But $f'(x)=3x^2+1\gt0$ always. Contradiction.
Going deeper

The MVT is the bridge from local to global. The derivative is local information (a slope at one point). The MVT converts it into global information about $f(b)-f(a)$: $$f(b)-f(a)=f'(c)\,(b-a)\quad\text{for some } c\in(a,b).$$ Almost every theorem in Sections 3.4 to 3.6 (increasing/decreasing test, "$f'=0\Rightarrow f$ constant") is proved with this one identity.

Proof idea. Subtract the secant line from $f$. The new function $g(x)=f(x)-\left[f(a)+\frac{f(b)-f(a)}{b-a}(x-a)\right]$ has $g(a)=g(b)=0$, so Rolle's theorem gives $g'(c)=0$, which is exactly the MVT.

Remark The MVT is an existence theorem: it says $c$ exists, not how to find it. Its power lies in the inequalities it produces, such as $|\sin a-\sin b|\le|a-b|$.
Example 4: proving an inequality
Show that $|\sin a-\sin b|\le|a-b|$ for all real $a,b$.
  1. Apply the MVT to $f(x)=\sin x$ on the interval between $a$ and $b$:

    $$\sin a-\sin b=\cos(c)\,(a-b)\quad\text{for some } c$$
  2. Take absolute values and use $|\cos c|\le1$:

    $$|\sin a-\sin b|=|\cos c|\,|a-b|\le|a-b|$$
Challenge Example 5: an identity via "derivative zero"
Prove that $\arctan x+\arctan\dfrac1x=\dfrac\pi2$ for all $x\gt0$.
  1. Let $F(x)=\arctan x+\arctan(1/x)$. Differentiate, using the chain rule on the second term:

    $$F'(x)=\frac{1}{1+x^2}+\frac{1}{1+\frac{1}{x^2}}\cdot\left(-\frac1{x^2}\right)$$
  2. Simplify the second term: $\frac{1}{1+1/x^2}\cdot\frac{1}{x^2}=\frac{1}{x^2+1}$:

    $$F'(x)=\frac{1}{1+x^2}-\frac{1}{1+x^2}=0$$
  3. By the MVT consequence, $F$ is constant on $(0,\infty)$. Evaluate at a convenient point:

    $$F(1)=\arctan1+\arctan1=\frac\pi4+\frac\pi4=\frac\pi2 .\qquad\blacksquare$$
For $f(x)=x^2$ on $[1,3]$, the MVT number $c$ is
Secant slope $(9-1)/2=4=2c\Rightarrow c=2$.

Exercises

  1. Verify Rolle's theorem for $f(x)=x^2-4x+1$ on $[0,4]$.
    Answer
    $f(0)=f(4)=1$; $c=2$.
  2. Find $c$ for the MVT: $f(x)=\sqrt x$ on $[0,4]$.
    Answer
    $c=1$
  3. Why does the MVT not apply to $f(x)=|x|$ on $[-1,2]$?
    Answer
    Not differentiable at $0$.
  4. If $f(1)=10$ and $f'(x)\ge2$ for all $x$, how small can $f(4)$ be?
    Answer
    $f(4)\ge10+2\cdot3=16$
3.2

Linear Approximations

Tangent lineZoom demoQuiz

Near a point $a$, a differentiable function looks like its tangent line. The linearization of $f$ at $a$ is

Linearization $$L(x)=f(a)+f'(a)(x-a),\qquad f(x)\approx L(x)\ \text{for } x\approx a .$$
Differentials $dy=f'(x)\,dx$ estimates the actual change $\Delta y=f(x+dx)-f(x)$.
Common approximations near 0 $\sin x\approx x$, $\ \tan x\approx x$, $\ e^x\approx1+x$, $\ \ln(1+x)\approx x$, $\ (1+x)^k\approx1+kx$.

Worked examples

Example 1
Approximate $\sqrt{4.1}$.
  1. $f(x)=\sqrt x$, $a=4$: $f(4)=2$, $f'(x)=\dfrac1{2\sqrt x}$, $f'(4)=\dfrac14$.
  2. $L(x)=2+\tfrac14(x-4)$.
  3. $$\sqrt{4.1}\approx L(4.1)=2+\tfrac14(0.1)=2.025$$ (True value $2.02485\ldots$)
$\sqrt{4.1}\approx2.025$
Example 2: differentials and error
The radius of a sphere is measured as $10$ cm with possible error $0.1$ cm. Estimate the error in the volume.
  1. $V=\tfrac43\pi r^3$, so $dV=4\pi r^2\,dr$.
  2. $$dV=4\pi(100)(0.1)=40\pi\approx125.7\ \text{cm}^3$$
Going deeper

How good is the approximation? The error $E(x)=f(x)-L(x)$ is controlled by the second derivative. If $|f''|\le M$ near $a$, then $$|f(x)-L(x)|\le\frac{M}{2}(x-a)^2 .$$ So the error is quadratic in the distance $x-a$: halving the step cuts the error by a factor of 4. This is why the tangent line is the "best" linear approximation.

Over- or underestimate? If $f$ is concave up near $a$, the tangent lies below the graph, so $L(x)$ underestimates. If concave down, it overestimates.

Remark Relative error $\frac{dy}{y}$ is often more meaningful than absolute error. For $V=\frac43\pi r^3$: $\frac{dV}{V}=3\frac{dr}{r}$, so a $1\%$ error in the radius gives about a $3\%$ error in the volume.
Example 3: sin of a small angle
Approximate $\sin(0.1)$ and decide whether the estimate is too big or too small.
  1. Linearize $\sin x$ at $a=0$: $f(0)=0$, $f'(0)=\cos0=1$:

    $$L(x)=0+1\cdot(x-0)=x$$
  2. Apply it:

    $$\sin(0.1)\approx0.1$$
  3. On $(0,\pi)$, $f''(x)=-\sin x\lt0$, so the graph is concave down, the tangent lies above it, and the estimate is too large. (True value: $0.0998334\ldots$)

Challenge Example 4: percentage error
The side of a cube is measured as $30$ cm with a possible error of $0.1$ cm. Estimate the maximum error and the percentage error in the computed volume.
  1. Volume $V=x^3$. The differential estimates the change:

    $$dV=3x^2\,dx$$
  2. Substitute $x=30$, $dx=\pm0.1$:

    $$dV=3(900)(0.1)=270\ \text{cm}^3$$
  3. Relative error:

    $$\frac{dV}{V}=\frac{3x^2dx}{x^3}=3\frac{dx}{x}=3\cdot\frac{0.1}{30}=0.01$$
Maximum error $\approx270\ \text{cm}^3$, about $1\%$ (three times the $\tfrac13\%$ error in the side)
The linearization of $f(x)=e^x$ at $a=0$ is
$f(0)=1,\ f'(0)=1$.

Exercises

  1. Use a linearization to approximate $\sqrt[3]{8.06}$.
    Answer
    $2+\tfrac{1}{12}(0.06)=2.005$
  2. Approximate $\ln(1.05)$.
    Answer
    $\approx0.05$
  3. Approximate $\cos(61^\circ)$ using $a=60^\circ$.
    Answer
    $\tfrac12-\tfrac{\sqrt3}{2}\cdot\tfrac{\pi}{180}\approx0.4849$
  4. Find $dy$ for $y=x^2\sin x$.
    Answer
    $dy=(2x\sin x+x^2\cos x)\,dx$
3.3

Indeterminate Forms and L’Hôpital’s Rule

0/0, ∞/∞DemoQuiz
L’Hôpital’s Rule If $\displaystyle\lim\frac{f(x)}{g(x)}$ has the form $\frac00$ or $\frac{\pm\infty}{\pm\infty}$, then $$\lim\frac{f(x)}{g(x)}=\lim\frac{f'(x)}{g'(x)}$$ provided the right-hand limit exists (or is $\pm\infty$).
Check the form first Using the rule on a non-indeterminate limit gives wrong answers. Also note: it is $\frac{f'}{g'}$, not the derivative of the quotient.
FormWhat to do
$0\cdot\infty$Rewrite $fg=\dfrac{f}{1/g}$ to get $\tfrac00$ or $\tfrac\infty\infty$
$\infty-\infty$Common denominator, conjugate, or factor
$1^\infty,\ 0^0,\ \infty^0$Let $y=f^g$, find $\lim\ln y=\lim g\ln f$, then $\lim y=e^{\lim \ln y}$

Worked examples

Example 1
$\displaystyle\lim_{x\to0}\frac{e^x-1-x}{x^2}$
  1. Form $\tfrac00$. Apply L’Hôpital: $$\lim_{x\to0}\frac{e^x-1}{2x}$$ still $\tfrac00$.
  2. Apply again: $$\lim_{x\to0}\frac{e^x}{2}=\frac12$$
$\dfrac12$
Example 2: form $0\cdot\infty$
$\displaystyle\lim_{x\to0^+}x\ln x$
  1. Rewrite: $\dfrac{\ln x}{1/x}$, form $\tfrac{-\infty}{\infty}$.
  2. L’Hôpital: $$\dfrac{1/x}{-1/x^2}=-x\to0$$
$0$
Example 3: form $1^\infty$
$\displaystyle\lim_{x\to\infty}\left(1+\frac1x\right)^{x}$
  1. Let $$y=\left(1+\tfrac1x\right)^x$$ so $$\ln y=x\ln\!\left(1+\tfrac1x\right)=\dfrac{\ln(1+1/x)}{1/x}$$ form $\tfrac00$.
  2. L’Hôpital: $$\dfrac{\frac{1}{1+1/x}\cdot(-1/x^2)}{-1/x^2}=\dfrac{1}{1+1/x}\to1$$
  3. So $\ln y\to1$ and $y\to e^1$.
$e$
Going deeper

Why L’Hôpital works (the simple case). If $f(a)=g(a)=0$ and $g'(a)\neq0$: $$\frac{f(x)}{g(x)}=\frac{f(x)-f(a)}{g(x)-g(a)}=\frac{\frac{f(x)-f(a)}{x-a}}{\frac{g(x)-g(a)}{x-a}}\ \longrightarrow\ \frac{f'(a)}{g'(a)}.$$ Near $a$, both functions look like their tangent lines through the origin, and the ratio of two such lines is the ratio of their slopes.

Growth rates, proved. Repeated L’Hôpital shows $\lim_{x\to\infty}\frac{x^n}{e^x}=0$ for every $n$, and $\lim_{x\to\infty}\frac{\ln x}{x^p}=0$ for every $p\gt0$.

Remark L’Hôpital can loop forever. For $\lim_{x\to\infty}\frac{\sqrt{x^2+1}}{x}$, each application swaps the quotient for its reciprocal. Algebra is faster here: divide by $x$ to get $1$.
Example 4: ∞ − ∞
Find $$\lim_{x\to1^+}\left(\frac{x}{x-1}-\frac{1}{\ln x}\right).$$
  1. Combine into a single fraction (form $\infty-\infty$ becomes $\tfrac00$):

    $$\frac{x\ln x-(x-1)}{(x-1)\ln x}$$
  2. L’Hôpital, differentiating the numerator and denominator separately:

    $$\frac{\ln x+1-1}{\ln x+\frac{x-1}{x}}=\frac{\ln x}{\ln x+1-\frac1x}$$
  3. Still $\tfrac00$. Apply L’Hôpital again:

    $$\frac{\frac1x}{\frac1x+\frac1{x^2}}\ \xrightarrow{x\to1}\ \frac{1}{1+1}$$
$\dfrac12$
Challenge Example 5: the form ∞⁰
Find $$\lim_{x\to\infty}x^{1/x}.$$
  1. Let $y=x^{1/x}$ and take logarithms to bring down the exponent:

    $$\ln y=\frac{\ln x}{x}\qquad\left(\text{form }\tfrac{\infty}{\infty}\right)$$
  2. L’Hôpital:

    $$\lim_{x\to\infty}\frac{\ln x}{x}=\lim_{x\to\infty}\frac{1/x}{1}=0$$
  3. Undo the logarithm, using the continuity of $e^x$:

    $$\lim_{x\to\infty}y=e^{0}=1$$
$1$
$\displaystyle\lim_{x\to\infty}\frac{\ln x}{x}=$
$\frac{1/x}{1}\to0$: $x$ grows faster than $\ln x$.
Can L’Hôpital be used for $\displaystyle\lim_{x\to0}\frac{\cos x}{x+1}$?
Substitution gives $\frac{1}{1}=1$. L’Hôpital would wrongly give $\frac{-\sin0}{1}=0$.

Exercises

  1. $\displaystyle\lim_{x\to0}\frac{\sin3x}{\tan5x}$
    Answer
    $\frac35$
  2. $\displaystyle\lim_{x\to\infty}\frac{x^3}{e^x}$
    Answer
    $0$
  3. $\displaystyle\lim_{x\to0}\left(\frac1x-\frac1{\sin x}\right)$
    Answer
    $0$
  4. $\displaystyle\lim_{x\to0^+}x^{x}$
    Answer
    $1$
  5. $\displaystyle\lim_{x\to\infty}\left(1+\frac3x\right)^{2x}$
    Answer
    $e^6$
3.4

Maximum and Minimum Values

Closed interval methodDemoQuiz
Absolute (global) extrema $f(c)$ is the absolute maximum if $f(c)\ge f(x)$ for all $x$ in the domain (minimum: $\le$).
Local (relative) extrema $f(c)$ is a local maximum if $f(c)\ge f(x)$ for all $x$ near $c$.
Fermat's Theorem If $f$ has a local extremum at $c$ and $f'(c)$ exists, then $f'(c)=0$. A critical number is a $c$ in the domain where $f'(c)=0$ or $f'(c)$ does not exist.
Closed Interval Method To find the absolute extrema of a continuous $f$ on $[a,b]$: (1) find $f$ at the critical numbers in $(a,b)$; (2) find $f(a)$ and $f(b)$; (3) the largest is the absolute max, the smallest is the absolute min.

Worked examples

Example 1
Find the absolute extrema of $f(x)=x^3-3x^2+1$ on $[-\tfrac12,4]$.
  1. $$f'(x)=3x^2-6x=3x(x-2)=0\Rightarrow x=0,2$$ (both in the interval).
  2. $f(0)=1$, $f(2)=8-12+1=-3$.
  3. Endpoints: $$f(-\tfrac12)=-\tfrac18-\tfrac34+1=\tfrac18$$ $f(4)=64-48+1=17$.
  4. Compare: largest $17$, smallest $-3$.
Absolute max $f(4)=17$; absolute min $f(2)=-3$
Example 2: a non-differentiable critical number
Find the critical numbers of $f(x)=x^{2/3}(x-5)$.
  1. $f(x)=x^{5/3}-5x^{2/3}$, $$f'(x)=\tfrac53x^{2/3}-\tfrac{10}{3}x^{-1/3}=\dfrac{5(x-2)}{3x^{1/3}}$$
  2. $f'(x)=0$ at $x=2$; $f'$ does not exist at $x=0$.
Critical numbers $0$ and $2$
Going deeper

Where can extreme values hide? On a closed interval there are only three kinds of candidates: points where $f'=0$, points where $f'$ does not exist, and the endpoints. Fermat's theorem rules out every other point, because a nonzero slope means the function still goes up on one side and down on the other.

Closed and continuous both matter. $f(x)=x$ on $(0,1)$ has no maximum (an open interval). $f(x)=1/x$ on $[-1,1]$ has none either (not continuous). The Extreme Value Theorem needs both hypotheses.

Remark $f'(c)=0$ does not guarantee an extremum: $f(x)=x^3$ has $f'(0)=0$ but is increasing. Critical numbers are only candidates.
Example 3: trigonometric
Find the absolute extrema of $f(x)=\sin x+\cos x$ on $[0,\pi]$.
  1. Critical numbers:

    $$f'(x)=\cos x-\sin x=0\iff\tan x=1\iff x=\frac\pi4$$
  2. Evaluate at the critical number and at both endpoints:

    $$f(0)=1,\qquad f\!\left(\tfrac\pi4\right)=\tfrac{\sqrt2}2+\tfrac{\sqrt2}2=\sqrt2,\qquad f(\pi)=-1$$
Max $\sqrt2$ at $x=\frac\pi4$; min $-1$ at $x=\pi$
Challenge Example 4: a non-smooth function
Find the absolute extrema of $f(x)=x^{2/3}(5-2x)$ on $[-1,2]$.
  1. Expand to differentiate easily:

    $$f(x)=5x^{2/3}-2x^{5/3}$$
  2. Differentiate and factor out the lowest power:

    $$f'(x)=\frac{10}{3}x^{-1/3}-\frac{10}{3}x^{2/3}=\frac{10}{3}\cdot\frac{1-x}{x^{1/3}}$$
  3. Critical numbers: $f'=0$ at $x=1$, and $f'$ is undefined at $x=0$ (a cusp). Evaluate all the candidates:

    $$f(-1)=1\cdot7=7,\quad f(0)=0,\quad f(1)=3,\quad f(2)=2^{2/3}\approx1.587$$
Absolute max $7$ at $x=-1$ (an endpoint); absolute min $0$ at $x=0$ (a cusp)
The critical numbers of $f(x)=x^4-8x^2$ are
$f'=4x^3-16x=4x(x^2-4)$.

Exercises

  1. Absolute extrema of $f(x)=2x^3-3x^2-12x+1$ on $[-2,3]$.
    Answer
    Max $f(-1)=8$; min $f(2)=-19$
  2. Absolute extrema of $f(x)=x-2\sin x$ on $[0,2\pi]$.
    Answer
    Min $f(\pi/3)=\frac\pi3-\sqrt3$; max $f(5\pi/3)=\frac{5\pi}3+\sqrt3$
  3. Critical numbers of $f(x)=|x^2-1|$.
    Answer
    $-1,0,1$
3.5

Increasing and Decreasing Functions

First derivative testDemoQuiz
Increasing / decreasing test On an interval: if $f'(x)\gt0$ then $f$ is increasing; if $f'(x)\lt0$ then $f$ is decreasing.
First Derivative Test Let $c$ be a critical number of a continuous $f$.
  • $f'$ changes from $+$ to $-$ at $c$: local maximum.
  • $f'$ changes from $-$ to $+$ at $c$: local minimum.
  • $f'$ does not change sign: no local extremum.
Sign chart Mark the critical numbers on a number line, test one point in each interval, record the sign of $f'$.

Worked example

Example
Find the intervals of increase/decrease and the local extrema of $f(x)=x^3-6x^2+9x+1$.
  1. $$f'(x)=3x^2-12x+9=3(x-1)(x-3)$$ Critical numbers: $1,3$.
  2. Sign chart: on $(-\infty,1)$ test $x=0$: $f'(0)=9\gt0$. On $(1,3)$ test $x=2$: $f'(2)=-3\lt0$. On $(3,\infty)$ test $x=4$: $f'(4)=9\gt0$.
  3. Increasing on $(-\infty,1)$ and $(3,\infty)$; decreasing on $(1,3)$.
  4. $f'$ goes $+\to-$ at $1$: local max $f(1)=5$. $f'$ goes $-\to+$ at $3$: local min $f(3)=1$.
Local max $(1,5)$, local min $(3,1)$
Going deeper

Why the sign of $f'$ decides monotonicity. Take $x_1\lt x_2$. By the MVT, $f(x_2)-f(x_1)=f'(c)(x_2-x_1)$. If $f'\gt0$, the right side is positive, so $f(x_2)\gt f(x_1)$, which means $f$ is increasing. This short argument is the whole proof.

Sign charts and factored derivatives. Once $f'$ is factored, each linear factor changes sign at its root, while squared factors do not. Reading signs factor by factor avoids plugging in test points.

Remark Include points where $f$ itself is undefined (vertical asymptotes, domain endpoints) on the sign chart. The sign can change there, even though they are not critical numbers.
Example 2: a rational function
Find the intervals of monotonicity of $f(x)=\dfrac{x^2}{x-1}$.
  1. Quotient rule:

    $$f'(x)=\frac{2x(x-1)-x^2}{(x-1)^2}=\frac{x(x-2)}{(x-1)^2}$$
  2. Sign chart. The numerator changes sign at $0$ and $2$; the denominator is always positive (but $x\neq1$):

    $$\begin{array}{c|cccc} & (-\infty,0) & (0,1) & (1,2) & (2,\infty)\\\hline f' & + & - & - & +\end{array}$$
  3. Conclusion: local max $f(0)=0$, local min $f(2)=4$.

Increasing on $(-\infty,0)$ and $(2,\infty)$; decreasing on $(0,1)$ and $(1,2)$
Challenge Example 3: proving an inequality by monotonicity
Show that $e^x\gt1+x$ for all $x\gt0$.
  1. Move everything to one side: let $g(x)=e^x-1-x$. We want $g(x)\gt0$ for $x\gt0$.

  2. Start value and derivative:

    $$g(0)=0,\qquad g'(x)=e^x-1\gt0\ \text{ for } x\gt0$$
  3. So $g$ is increasing on $[0,\infty)$, and for $x\gt0$:

    $$g(x)\gt g(0)=0\quad\Longrightarrow\quad e^x\gt1+x .\qquad\blacksquare$$
If $f'(x)=(x-2)^2(x+1)$, then at $x=2$, $f$ has
$(x-2)^2\ge0$, so $f'$ keeps the sign of $x+1$ (positive) on both sides of $2$: no sign change.

Exercises

  1. $f(x)=x^4-2x^2$: intervals of increase/decrease and local extrema.
    Answer
    Dec on $(-\infty,-1),(0,1)$; inc on $(-1,0),(1,\infty)$; local min $-1$ at $x=\pm1$, local max $0$ at $x=0$
  2. $f(x)=xe^{-x}$
    Answer
    Inc on $(-\infty,1)$, dec on $(1,\infty)$; local max $1/e$ at $x=1$
  3. $f(x)=\dfrac{x}{x^2+1}$
    Answer
    Inc on $(-1,1)$; dec on $(-\infty,-1),(1,\infty)$; min $-\tfrac12$, max $\tfrac12$
3.6

Concavity and the Second Derivative Test

f″DemoQuiz
Concave up $f''\gt0$: graph lies above its tangents, slopes increase ("holds water" ∪).
Concave down $f''\lt0$: graph lies below its tangents, slopes decrease (∩).
Inflection point A point where $f$ is continuous and the concavity changes. Candidates: $f''=0$ or $f''$ undefined.
Second Derivative Test Suppose $f'(c)=0$. If $f''(c)\gt0$, $f$ has a local min at $c$. If $f''(c)\lt0$, a local max. If $f''(c)=0$, the test is inconclusive.

Worked example

Example
For $f(x)=x^3-6x^2+9x+1$, find concavity, inflection points, and classify the critical points with the second derivative test.
  1. $f''(x)=6x-12$: $f''\lt0$ for $x\lt2$ (concave down), $f''\gt0$ for $x\gt2$ (concave up).
  2. Inflection point at $x=2$: $(2,f(2))=(2,3)$.
  3. $f''(1)=-6\lt0$: local max at $x=1$. $f''(3)=6\gt0$: local min at $x=3$.
Going deeper

$f''$ measures how the slope changes. If $f''\gt0$, then $f'$ is increasing: slopes go from very negative, through zero, to very positive, so the graph bends upward like a cup. In physics, $f''$ is acceleration. Concave up means the velocity is increasing.

Second derivative test: why it works. If $f'(c)=0$ and $f''(c)\gt0$, then $f'$ is increasing through $c$, so it changes from $-$ to $+$. That is exactly a local minimum by the first derivative test.

Remark $f''(c)=0$ does not guarantee an inflection point. $f(x)=x^4$ has $f''(0)=0$ but is concave up on both sides. You must check that the concavity actually changes.
Example 2: full concavity analysis
Analyse the concavity of $f(x)=xe^{-x}$.
  1. First derivative (product rule):

    $$f'(x)=e^{-x}-xe^{-x}=(1-x)e^{-x}$$
  2. Second derivative (product rule again):

    $$f''(x)=-e^{-x}-(1-x)e^{-x}=(x-2)e^{-x}$$
  3. Since $e^{-x}\gt0$ always, the sign of $f''$ is the sign of $x-2$.

Concave down on $(-\infty,2)$, concave up on $(2,\infty)$; inflection point $(2,2e^{-2})$
Challenge Example 3: designing a cubic
Find $a,b$ such that $f(x)=x^3+ax^2+bx$ has an inflection point at $x=1$ and a local extremum at $x=3$. Is it a max or a min?
  1. Derivatives:

    $$f'(x)=3x^2+2ax+b,\qquad f''(x)=6x+2a$$
  2. An inflection point at $x=1$ requires $f''(1)=0$:

    $$6+2a=0\quad\Rightarrow\quad a=-3$$
  3. A local extremum at $x=3$ requires $f'(3)=0$:

    $$27+6a+b=27-18+b=0\quad\Rightarrow\quad b=-9$$
  4. Classify with the second derivative test:

    $$f''(3)=18-6=12\gt0\quad\Rightarrow\quad\text{local minimum}$$
$a=-3,\ b=-9$; local minimum at $x=3$
For $f(x)=x^4$, at $x=0$:
$f''(x)=12x^2$, so $f''(0)=0$. The first derivative test ($-\to+$) shows a minimum. No concavity change, so no inflection.

Exercises

  1. Concavity and inflection points of $f(x)=x^4-4x^3$.
    Answer
    $f''=12x(x-2)$: CU on $(-\infty,0),(2,\infty)$, CD on $(0,2)$; IP at $(0,0),(2,-16)$
  2. Use the second derivative test on $f(x)=x+\dfrac4x$.
    Answer
    Local min at $x=2$ ($f=4$), local max at $x=-2$ ($f=-4$)
  3. Inflection points of $f(x)=e^{-x^2}$.
    Answer
    $x=\pm\tfrac1{\sqrt2}$
3.7

Overview of Curve Sketching

ChecklistAnalyzerQuiz
Curve sketching checklist
  1. Domain
  2. Intercepts ($x=0$ and $f(x)=0$)
  3. Symmetry (even $f(-x)=f(x)$, odd $f(-x)=-f(x)$, periodic)
  4. Asymptotes (vertical, horizontal, slant)
  5. $f'$: intervals of increase/decrease, local extrema
  6. $f''$: concavity, inflection points
  7. Sketch using all of the above

Worked example

Example
Sketch $f(x)=\dfrac{x^2}{x^2-1}$.
  1. Domain: $x\neq\pm1$. Intercept: $(0,0)$. Symmetry: even.
  2. Asymptotes: VA $x=\pm1$; HA $y=1$ (equal degrees).
  3. $$f'(x)=\dfrac{2x(x^2-1)-x^2(2x)}{(x^2-1)^2}=\dfrac{-2x}{(x^2-1)^2}$$: increasing for $x\lt0$, decreasing for $x\gt0$ (avoiding $\pm1$). Local max $f(0)=0$.
  4. $$f''(x)=\dfrac{6x^2+2}{(x^2-1)^3}$$: numerator always $\gt0$, so CU for $|x|\gt1$, CD for $|x|\lt1$. No inflection point (since $\pm1$ are not in the domain).
  5. Combine: the graph has three branches, a "cap" through the origin between the asymptotes, and two outer branches above $y=1$ approaching it.
Going deeper

Sketching is a puzzle with many clues. Each item on the checklist rules out wrong shapes. Asymptotes fix the behaviour far away; intercepts fix where the graph meets the axes; $f'$ fixes the hills and valleys; $f''$ fixes the bending. Combine them in one table:

$$\begin{array}{c|ccccc} x & (-\infty,-1) & -1 & (-1,0) & 0 & \dots\\\hline f' & + & 0 & - & \dots\\ f'' & - & \cdot & - & \dots\\ \text{shape} & \nearrow\ \frown & \max & \searrow\ \frown & \dots\end{array}$$
Remark Always cross-check. If your sign chart says "increasing" but two plotted points say "decreasing", there is an algebra error. The checklist is self-correcting when you compare the pieces.
Challenge Example 2: full sketch with a cusp
Sketch $f(x)=x^{2/3}(6-x)^{1/3}$.
  1. Domain: all reals (odd roots). Intercepts: $(0,0)$ and $(6,0)$.

  2. First derivative: take logs, $\ln|f|=\tfrac23\ln|x|+\tfrac13\ln|6-x|$, then differentiate:

    $$f'(x)=f(x)\left(\frac{2}{3x}-\frac{1}{3(6-x)}\right)=\frac{4-x}{x^{1/3}(6-x)^{2/3}}$$
  3. Critical numbers: $x=4$ ($f'=0$); $x=0$ and $x=6$ ($f'$ undefined). Signs: $f'\lt0$ on $(-\infty,0)$, $\gt0$ on $(0,4)$, $\lt0$ on $(4,6)$, $\lt0$ on $(6,\infty)$.

    $$\text{local min } f(0)=0\ \text{(cusp)},\qquad\text{local max } f(4)=2^{5/3}\approx3.17$$
  4. Second derivative (after simplification):

    $$f''(x)=\frac{-8}{x^{4/3}(6-x)^{5/3}}$$

    This is negative for $x\lt6$ and positive for $x\gt6$, so there is an inflection point at $(6,0)$, where the tangent is vertical.

  5. End behaviour: $f(x)\approx -x$ for large $|x|$ (slant asymptote $y=-x+2$).

$f(x)=\dfrac{x^2+1}{x}$ has which slant asymptote?
$\frac{x^2+1}{x}=x+\frac1x$, and $\frac1x\to0$.

Exercises

  1. Sketch $f(x)=x^3-3x^2$.
    Answer
    Local max $(0,0)$, local min $(2,-4)$, IP $(1,-2)$, intercepts $0,3$
  2. Sketch $f(x)=xe^{x}$.
    Answer
    Min $(-1,-1/e)$, IP $(-2,-2/e^2)$, HA $y=0$ as $x\to-\infty$
  3. Sketch $f(x)=\dfrac{2x}{x^2+1}$.
    Answer
    Odd; max $(1,1)$, min $(-1,-1)$; IPs at $0,\pm\sqrt3$; HA $y=0$
3.8

Optimization: Min Distance, Max Volume, Max Area

AppliedAnimationQuiz
Strategy (1) Read and draw a picture. (2) Name the quantity $Q$ to optimize and the variables. (3) Use the constraint to write $Q$ as a function of one variable. (4) Find the domain. (5) Find critical numbers; check endpoints or use the first/second derivative test. (6) Answer the question asked, with units.

Worked examples

Example 1: maximum volume
Squares of side $x$ are cut from the corners of a $12\times12$ sheet and the sides folded up. Find the largest possible volume.
  1. $V(x)=x(12-2x)^2$, domain $0\le x\le6$.
  2. $$V'(x)=(12-2x)^2-4x(12-2x)=(12-2x)(12-6x)$$
  3. $V'=0\Rightarrow x=6$ or $x=2$. $V(0)=V(6)=0$, $V(2)=2\cdot8^2=128$.
Max volume $128$ at $x=2$
Example 2: maximum area
A farmer has 2400 m of fencing to enclose a rectangle along a straight river (no fence on the river side). Maximize the area.
  1. Let $x$ be the two sides perpendicular to the river and $y$ the side parallel: $2x+y=2400$.
  2. $$A=xy=x(2400-2x)=2400x-2x^2$$ $0\le x\le1200$.
  3. $$A'=2400-4x=0\Rightarrow x=600$$ $y=1200$. $A''=-4\lt0$: maximum.
$600\times1200$ m, area $720\,000\ \text{m}^2$
Example 3: minimum distance
Find the point on the parabola $y^2=2x$ closest to $(1,4)$.
  1. A point on the curve is $(y^2/2,\ y)$. Minimize $$D^2=d(y)=\left(\tfrac{y^2}{2}-1\right)^2+(y-4)^2$$
  2. $$d'(y)=2\left(\tfrac{y^2}2-1\right)y+2(y-4)=y^3-8$$
  3. $d'=0\Rightarrow y=2$; $d'$ changes from $-$ to $+$, so this is the minimum. Then $x=2$.
$(2,2)$, at distance $\sqrt5$
Going deeper

The hardest step is the model, not the calculus. Most errors come from step 3: expressing the quantity in one variable. Draw a picture, label every length, and look for a constraint (fixed perimeter, fixed volume, a point on a curve, similar triangles, Pythagoras).

Absolute vs local. If the domain is a closed interval, compare the critical values with the endpoints. If it is open or infinite, show that the critical point is the only one and use the first/second derivative test. Then the local extremum is also absolute.

Distance trick. To minimise a distance $D$, minimise $D^2$ instead. Both are smallest at the same point, and $D^2$ has no square root.

Remark Always check that the answer makes physical sense: positive lengths, a volume inside the allowed range, and units included.
Example 4: largest rectangle under a curve
A rectangle has its base on the $x$-axis and its upper corners on the parabola $y=12-x^2$. Find the largest possible area.
  1. By symmetry, the corners are $(\pm x,\,12-x^2)$ with $0\lt x\lt\sqrt{12}$. Width $2x$, height $12-x^2$:

    $$A(x)=2x(12-x^2)=24x-2x^3$$
  2. Critical numbers:

    $$A'(x)=24-6x^2=0\quad\Rightarrow\quad x=2$$
  3. Check it is a maximum: $A''(x)=-12x\lt0$ at $x=2$. Evaluate:

    $$A(2)=4\cdot8=32$$
Maximum area $32$ (a $4\times8$ rectangle)
Challenge Example 5: the shortest ladder over a fence
A 2 m fence stands 1 m from a tall wall. Find the length of the shortest ladder that reaches from the ground, over the fence, to the wall.
  1. Let $\theta$ be the angle between the ladder and the ground. The ladder has two parts: from the ground to the top of the fence (vertical rise $2$) and from the fence to the wall (horizontal run $1$):

    $$L(\theta)=\frac{2}{\sin\theta}+\frac{1}{\cos\theta},\qquad 0\lt\theta\lt\frac\pi2$$
  2. Differentiate:

    $$L'(\theta)=-\frac{2\cos\theta}{\sin^2\theta}+\frac{\sin\theta}{\cos^2\theta}$$
  3. Set $L'=0$ and cross-multiply:

    $$\sin^3\theta=2\cos^3\theta\quad\Longrightarrow\quad\tan\theta=\sqrt[3]{2}$$
  4. Since $L\to\infty$ at both ends of the interval, this single critical point is the minimum. With $t=\tan\theta=2^{1/3}$, use $\frac1{\sin\theta}=\frac{\sqrt{1+t^2}}{t}$ and $\frac1{\cos\theta}=\sqrt{1+t^2}$:

    $$L=\sqrt{1+t^2}\left(\frac2t+1\right)=\left(1+2^{2/3}\right)^{3/2}\approx4.16\ \text{m}$$
$L_{\min}=\left(1+2^{2/3}\right)^{3/2}\approx4.16$ m
Challenge Example 6: cone of maximum volume in a sphere
Find the volume of the largest right circular cone that can be inscribed in a sphere of radius $R$.
  1. Put the vertex at the top of the sphere and the base at distance $y$ below the centre. Then the cone height is $h=R+y$, and the base radius satisfies $r^2+y^2=R^2$ (Pythagoras):

    $$V=\frac13\pi r^2h=\frac\pi3(R^2-y^2)(R+y),\qquad 0\le y\lt R$$
  2. Differentiate with respect to $y$ (product rule):

    $$V'(y)=\frac\pi3\big[-2y(R+y)+(R^2-y^2)\big]=\frac\pi3(R+y)(R-3y)$$
  3. The only critical number in the domain is $y=R/3$. Then $h=\frac{4R}3$ and $r^2=\frac{8R^2}9$:

    $$V_{\max}=\frac\pi3\cdot\frac{8R^2}{9}\cdot\frac{4R}{3}=\frac{32\pi R^3}{81}$$
$V_{\max}=\dfrac{32}{81}\pi R^3$, which is $\dfrac{8}{27}$ of the sphere's volume
Among rectangles with perimeter $40$, the maximum area is
$A=x(20-x)$, $A'=20-2x=0\Rightarrow x=10$: a $10\times10$ square.

Exercises

  1. Find two positive numbers whose product is $100$ and whose sum is minimal.
    Answer
    $10$ and $10$
  2. A cylindrical can must hold $1000\ \text{cm}^3$. Find the radius that minimizes the surface area.
    Answer
    $r=\sqrt[3]{500/\pi}\approx5.42$ cm, $h=2r$
  3. Find the largest rectangle that can be inscribed in a semicircle of radius $r$.
    Answer
    Area $r^2$ (dimensions $\sqrt2 r\times r/\sqrt2$)
  4. Find the point on the line $y=2x+3$ closest to the origin.
    Answer
    $(-\tfrac65,\tfrac35)$
3.9

Related Rates

AppliedAnimationQuiz

When two or more quantities that depend on time are related by an equation, differentiating with respect to $t$ relates their rates.

Strategy (1) Draw and label with variables (not numbers that change). (2) Write given and wanted rates. (3) Find an equation relating the variables. (4) Differentiate with respect to $t$ (chain rule!). (5) Substitute the numbers after differentiating and solve.

Worked examples

Example 1: sliding ladder
A 10 m ladder slides away from a wall. The bottom moves at 1 m/s. How fast is the top sliding down when the bottom is 6 m from the wall?
  1. $x^2+y^2=100$. Given $\frac{dx}{dt}=1$, find $\frac{dy}{dt}$ when $x=6$.
  2. Differentiate: $$2x\frac{dx}{dt}+2y\frac{dy}{dt}=0\Rightarrow\frac{dy}{dt}=-\frac{x}{y}\frac{dx}{dt}$$
  3. When $x=6$, $y=8$: $$\frac{dy}{dt}=-\frac68(1)=-\frac34$$
The top slides down at $0.75$ m/s
Example 2: expanding balloon
Air is pumped into a spherical balloon at $100\ \text{cm}^3/\text{s}$. How fast is the radius increasing when $r=25$ cm?
  1. $$V=\tfrac43\pi r^3\Rightarrow\frac{dV}{dt}=4\pi r^2\frac{dr}{dt}$$
  2. $$100=4\pi(625)\frac{dr}{dt}\Rightarrow\frac{dr}{dt}=\frac{1}{25\pi}$$
$\dfrac{1}{25\pi}\approx0.0127$ cm/s
Example 3: conical tank
Water drains from a conical tank (vertex down, radius 2 m, height 4 m) at $2\ \text{m}^3/\text{min}$. How fast is the level falling when the water is 3 m deep?
  1. Similar triangles: $$\frac rh=\frac24\Rightarrow r=\frac h2$$ so $$V=\frac13\pi r^2h=\frac{\pi}{12}h^3$$
  2. $$\frac{dV}{dt}=\frac\pi4h^2\frac{dh}{dt}$$ With $\frac{dV}{dt}=-2$, $h=3$: $$-2=\frac{9\pi}{4}\frac{dh}{dt}$$
$\dfrac{dh}{dt}=-\dfrac{8}{9\pi}\approx-0.28$ m/min
Going deeper

Why substitute numbers last? If you substitute $x=6$ before differentiating, $x$ becomes a constant and its rate disappears ($\frac{d}{dt}6=0$). The equation must hold for all times, so differentiate it first. Then freeze the moment you care about.

Every related-rates problem is the chain rule. Writing $\frac{d}{dt}(x^2)=2x\frac{dx}{dt}$ is just the chain rule with $x=x(t)$.

Remark Watch the signs. A decreasing quantity has a negative rate. If water drains at 2 m³/min, write $\frac{dV}{dt}=-2$.
Example 4: angle of elevation
A rocket rises vertically at 300 m/s. An observer stands 1200 m from the launch pad. How fast is the angle of elevation increasing when the rocket is 1600 m high?
  1. Relate the height $y$ and the angle $\theta$ through the right triangle:

    $$\tan\theta=\frac{y}{1200}$$
  2. Differentiate with respect to $t$:

    $$\sec^2\theta\,\frac{d\theta}{dt}=\frac{1}{1200}\frac{dy}{dt}$$
  3. At $y=1600$, the hypotenuse is $2000$, so $\cos\theta=\frac{1200}{2000}=0.6$ and $\sec^2\theta=\frac{1}{0.36}$:

    $$\frac{d\theta}{dt}=0.36\cdot\frac{300}{1200}=0.09\ \text{rad/s}$$
Challenge Example 5: filling a trough
A trough is 10 m long, and its ends are isosceles triangles 2 m across the top and 1 m high (vertex down). Water flows in at 0.5 m³/min. How fast is the level rising when the water is 0.4 m deep?
  1. At depth $h$, the water surface has width $w$. By similar triangles, $\frac{w}{h}=\frac{2}{1}$, so $w=2h$. Volume = cross-section × length:

    $$V=\tfrac12\,w\,h\cdot10=\tfrac12(2h)h\cdot10=10h^2$$
  2. Differentiate with respect to $t$:

    $$\frac{dV}{dt}=20h\,\frac{dh}{dt}$$
  3. Substitute $\frac{dV}{dt}=0.5$ and $h=0.4$:

    $$0.5=20(0.4)\frac{dh}{dt}\quad\Rightarrow\quad\frac{dh}{dt}=\frac{0.5}{8}=0.0625$$
$\dfrac{dh}{dt}=\dfrac1{16}$ m/min $=6.25$ cm/min
The side of a square grows at 2 cm/s. How fast does its area grow when the side is 5 cm?
$A=s^2$, $A'=2s\,s'=2(5)(2)=20\ \text{cm}^2/\text{s}$.

Exercises

  1. The radius of a circle grows at 3 cm/s. How fast is the area changing when $r=10$?
    Answer
    $60\pi\ \text{cm}^2/\text{s}$
  2. Two cars leave an intersection, one north at 60 km/h, one east at 80 km/h. How fast is the distance between them increasing after 1 h?
    Answer
    $100$ km/h
  3. A 1.8 m tall person walks away from a 6 m lamppost at 1.5 m/s. How fast does the tip of the shadow move?
    Answer
    $\frac{15}{7}\approx2.14$ m/s
Chapter 4

Integrals

Integration reverses differentiation and measures accumulated quantities: areas, distances, totals. The Fundamental Theorem of Calculus links the two ideas.

∫
4.1

Antiderivatives

TableSlope fieldQuiz

$F$ is an antiderivative of $f$ on an interval if $F'(x)=f(x)$. If $F$ is one antiderivative, then all antiderivatives are $F(x)+C$. We write $\displaystyle\int f(x)\,dx=F(x)+C$ (indefinite integral).

$f(x)$$\int f(x)\,dx$$f(x)$$\int f(x)\,dx$
$x^n\ (n\ne-1)$$\dfrac{x^{n+1}}{n+1}+C$$\dfrac1x$$\ln|x|+C$
$e^x$$e^x+C$$a^x$$\dfrac{a^x}{\ln a}+C$
$\cos x$$\sin x+C$$\sin x$$-\cos x+C$
$\sec^2x$$\tan x+C$$\sec x\tan x$$\sec x+C$
$\dfrac{1}{1+x^2}$$\arctan x+C$$\dfrac1{\sqrt{1-x^2}}$$\arcsin x+C$
Initial value problems Given $F'(x)=f(x)$ and one value $F(x_0)=y_0$, the condition determines $C$.

Worked examples

Example 1
Find $\displaystyle\int\left(3x^2-\frac{4}{x}+2\cos x\right)dx$.
  1. Term by term: $x^3-4\ln|x|+2\sin x+C$.
Example 2: initial value problem
Find $f$ if $f'(x)=6x^2-4$ and $f(1)=5$.
  1. $f(x)=2x^3-4x+C$.
  2. $$f(1)=2-4+C=5\Rightarrow C=7$$
$f(x)=2x^3-4x+7$
Example 3: motion
A stone is thrown upward at 20 m/s from a 25 m cliff, with $a(t)=-9.8$. Find $s(t)$.
  1. $v(t)=-9.8t+C_1$, $$v(0)=20\Rightarrow v=-9.8t+20$$
  2. $s(t)=-4.9t^2+20t+C_2$, $s(0)=25$.
$s(t)=-4.9t^2+20t+25$
Going deeper

Why "$+C$"? If $F'=G'$ on an interval, the MVT shows that $F-G$ is constant. So knowing a derivative determines a function only up to a vertical shift, and one extra piece of information (an initial condition) pins it down.

Always check by differentiating. Integration is guessing an antiderivative; differentiation is the test. If $\frac{d}{dx}[\text{answer}]$ returns the integrand, you are right.

Remark There is no product rule for antiderivatives: $\int x\cos x\,dx\neq\frac{x^2}{2}\sin x$. Products need substitution (Section 4.6) or integration by parts (Calculus II).
Remark $\int\frac1x\,dx=\ln|x|+C$. The absolute value matters: $\frac{d}{dx}\ln(-x)=\frac{-1}{-x}=\frac1x$, so negative $x$ is covered too.
Example 4: rewrite first
Find $$\int\frac{x^3-2\sqrt x+5}{x}\,dx .$$
  1. Divide each term by $x$ to turn the quotient into a sum of powers:

    $$\frac{x^3-2x^{1/2}+5}{x}=x^2-2x^{-1/2}+\frac5x$$
  2. Integrate term by term (power rule, plus the $\ln$ rule for $\frac1x$):

    $$\int\left(x^2-2x^{-1/2}+\frac5x\right)dx=\frac{x^3}{3}-4x^{1/2}+5\ln|x|+C$$
  3. Check: differentiating gives $x^2-2x^{-1/2}+\frac5x$ ✓.

Challenge Example 5: braking distance
A car travelling at 30 m/s brakes with constant deceleration and stops after 90 m. Find the deceleration and the stopping time.
  1. Let $a(t)=-k$ (constant). Integrate twice, with $v(0)=30$ and $s(0)=0$:

    $$v(t)=30-kt,\qquad s(t)=30t-\tfrac12kt^2$$
  2. The car stops when $v=0$:

    $$t_s=\frac{30}{k}$$
  3. The distance at that moment is 90 m:

    $$s(t_s)=\frac{900}{k}-\frac12k\frac{900}{k^2}=\frac{450}{k}=90\quad\Rightarrow\quad k=5$$
Deceleration $5\ \text{m/s}^2$; stopping time $6$ s
$\displaystyle\int\frac{1}{\sqrt x}\,dx=$
$\int x^{-1/2}dx=\frac{x^{1/2}}{1/2}+C=2\sqrt x+C$.

Exercises

  1. $\displaystyle\int(x^3-2x+5)\,dx$
    Answer
    $\frac{x^4}{4}-x^2+5x+C$
  2. $\displaystyle\int\frac{x^2+1}{x}\,dx$
    Answer
    $\frac{x^2}2+\ln|x|+C$
  3. $\displaystyle\int(e^x+\sec^2x)\,dx$
    Answer
    $e^x+\tan x+C$
  4. Find $f$ if $f''(x)=12x$, $f'(0)=1$, $f(0)=2$.
    Answer
    $f(x)=2x^3+x+2$
4.2

Sums and Sigma Notation

FormulasVisualQuiz

$\displaystyle\sum_{i=m}^{n}a_i=a_m+a_{m+1}+\dots+a_n$. The index $i$ is a dummy variable.

Properties $$\sum ca_i=c\sum a_i,\qquad \sum(a_i\pm b_i)=\sum a_i\pm\sum b_i,\qquad \sum_{i=1}^n c=nc$$
Power sums $$\sum_{i=1}^n i=\frac{n(n+1)}2,\quad \sum_{i=1}^n i^2=\frac{n(n+1)(2n+1)}6,\quad \sum_{i=1}^n i^3=\left[\frac{n(n+1)}2\right]^2$$

Gauss's trick: write $S=1+2+\dots+n$ forwards and backwards and add. Each of the $n$ columns sums to $n+1$, so $2S=n(n+1)$.

Worked examples

Example 1
Evaluate $\displaystyle\sum_{i=1}^{10}(3i^2-2i+1)$.
  1. $$3\sum i^2-2\sum i+\sum1=3\cdot\frac{10\cdot11\cdot21}{6}-2\cdot\frac{10\cdot11}{2}+10$$
  2. $=3(385)-110+10=1055$.
$1055$
Example 2: a limit of sums
Find $\displaystyle\lim_{n\to\infty}\sum_{i=1}^{n}\frac{i^2}{n^3}$.
  1. $$\frac{1}{n^3}\sum_{i=1}^n i^2=\frac{n(n+1)(2n+1)}{6n^3}$$
  2. $$=\dfrac16\left(1+\frac1n\right)\left(2+\frac1n\right)\to\dfrac{2}{6}=\dfrac13$$
$\dfrac13$, which is the area under $y=x^2$ on $[0,1]$ (Section 4.3)
Going deeper

Proof of the sum of squares by telescoping. Write $(i+1)^3-i^3=3i^2+3i+1$ and add for $i=1,\dots,n$. The left side telescopes to $(n+1)^3-1$: $$(n+1)^3-1=3\sum i^2+3\frac{n(n+1)}{2}+n .$$ Solving for $\sum i^2$ gives $\frac{n(n+1)(2n+1)}{6}$.

Proof by induction is the other standard method: check $n=1$, then show that if the formula holds for $n$, it holds for $n+1$.

Remark Shifting the index changes the terms, not the sum: $\sum_{i=1}^{n}a_i=\sum_{j=0}^{n-1}a_{j+1}$. Rewrite sums so that they start at $i=1$ before applying the formulas.
Example 3: shifting the index
Evaluate $$\sum_{i=3}^{12}(2i+1).$$
  1. Write it as the sum from $1$ to $12$ minus the sum from $1$ to $2$:

    $$\sum_{i=1}^{12}(2i+1)-\sum_{i=1}^{2}(2i+1)$$
  2. Use $\sum i=\frac{n(n+1)}2$ and $\sum1=n$:

    $$\left(2\cdot78+12\right)-(3+5)=168-8$$
$160$
Challenge Example 4: a Riemann-sum limit in disguise
Evaluate $$\lim_{n\to\infty}\sum_{i=1}^{n}\frac{n+i}{n^2}.$$
  1. Split the sum and pull out the constants:

    $$\sum_{i=1}^n\frac{n+i}{n^2}=\frac{1}{n^2}\left(n\cdot n+\frac{n(n+1)}{2}\right)$$
  2. Simplify:

    $$=1+\frac{n+1}{2n}\ \xrightarrow{n\to\infty}\ 1+\frac12$$
  3. Interpretation: this is $\sum\left(1+\frac in\right)\frac1n$, a right Riemann sum for $\int_0^1(1+x)\,dx=\frac32$.

$\dfrac32$
$\displaystyle\sum_{k=1}^{100}k=$
$\frac{100\cdot101}{2}=5050$.

Exercises

  1. Write in sigma notation: $2+4+6+\dots+40$.
    Answer
    $\sum_{i=1}^{20}2i$
  2. $\displaystyle\sum_{i=1}^{20}(2i-1)$
    Answer
    $400$
  3. $\displaystyle\sum_{i=1}^{n}(i+1)^2$ in closed form.
    Answer
    $\frac{n(n+1)(2n+1)}6+n(n+1)+n$
  4. $\displaystyle\sum_{i=1}^{n}\left(\frac1i-\frac1{i+1}\right)$ (telescoping)
    Answer
    $1-\frac1{n+1}$
4.3

Area under a Curve

Riemann sumsAnimationQuiz

Divide $[a,b]$ into $n$ subintervals of width $\Delta x=\dfrac{b-a}{n}$ with endpoints $x_i=a+i\Delta x$. Approximate the area by rectangles:

Riemann sums $$L_n=\sum_{i=1}^{n}f(x_{i-1})\Delta x,\qquad R_n=\sum_{i=1}^{n}f(x_i)\Delta x,\qquad M_n=\sum_{i=1}^{n}f\!\left(\tfrac{x_{i-1}+x_i}{2}\right)\Delta x$$ For continuous $f\ge0$: $\displaystyle A=\lim_{n\to\infty}R_n=\lim_{n\to\infty}L_n$.

Worked example

Example
Find the area under $y=x^2$ on $[0,1]$ as a limit of right sums.
  1. $\Delta x=\frac1n$, $x_i=\frac in$, $f(x_i)=\frac{i^2}{n^2}$.
  2. $$R_n=\sum_{i=1}^n\frac{i^2}{n^2}\cdot\frac1n=\frac{1}{n^3}\cdot\frac{n(n+1)(2n+1)}6$$
  3. $$\lim_{n\to\infty}R_n=\frac{2}{6}=\frac13$$
$A=\dfrac13$
Going deeper

Upper and lower sums trap the area. On each strip, use the largest value of $f$ (upper sum $U_n$) or the smallest (lower sum $L_n$). Then $$L_n\le A\le U_n .$$ For an increasing function, $U_n-L_n=\big[f(b)-f(a)\big]\Delta x\to0$, so both sums squeeze the same number. That number is the area.

Midpoint is usually best. Its error shrinks like $\frac{1}{n^2}$, while left and right sums shrink like $\frac1n$. Try it in the demo: doubling $n$ cuts the midpoint error by about a factor of 4.

Remark The trapezoidal rule is just the average of the left and right sums: $T_n=\frac{L_n+R_n}{2}$.
Example 2: a sum written out
Estimate the area under $f(x)=\dfrac1x$ on $[1,2]$ using $M_4$.
  1. $\Delta x=\frac14$. The midpoints are $1.125,\ 1.375,\ 1.625,\ 1.875$:

    $$M_4=\frac14\left(\frac1{1.125}+\frac1{1.375}+\frac1{1.625}+\frac1{1.875}\right)$$
  2. Compute:

    $$M_4=\frac14(0.8889+0.7273+0.6154+0.5333)=0.6912$$
  3. The exact area is $\ln2=0.6931\ldots$ (Section 4.5), so the error is only about $0.002$.

Challenge Example 3: area as a limit for a cubic
Compute the area under $y=x^3$ on $[0,2]$ as $\lim_{n\to\infty}R_n$.
  1. $\Delta x=\frac2n$, $x_i=\frac{2i}n$, $f(x_i)=\frac{8i^3}{n^3}$:

    $$R_n=\sum_{i=1}^n\frac{8i^3}{n^3}\cdot\frac2n=\frac{16}{n^4}\sum_{i=1}^n i^3$$
  2. Use $\sum i^3=\left[\frac{n(n+1)}{2}\right]^2$:

    $$R_n=\frac{16}{n^4}\cdot\frac{n^2(n+1)^2}{4}=4\left(1+\frac1n\right)^2$$
  3. Let $n\to\infty$:

    $$A=\lim_{n\to\infty}4\left(1+\frac1n\right)^2=4$$
$A=4$, which agrees with $\left[\tfrac{x^4}{4}\right]_0^2=4$ (FTC)
For an increasing function $f\ge0$, the left sum $L_n$
Left endpoints give the lowest value of an increasing function on each subinterval, so each rectangle sits below the curve.

Exercises

  1. Compute $L_4$ and $R_4$ for $f(x)=x^2$ on $[0,2]$.
    Answer
    $L_4=1.75,\ R_4=3.75$ (exact $8/3$)
  2. Compute $M_2$ for $f(x)=\frac1x$ on $[1,3]$.
    Answer
    $\frac23+\frac25=\frac{16}{15}$
  3. Find the area under $y=2x+1$ on $[0,3]$ using $\lim R_n$.
    Answer
    $12$
4.4

The Definite Integral

PropertiesDemoQuiz
Definition $$\int_a^b f(x)\,dx=\lim_{n\to\infty}\sum_{i=1}^n f(x_i^*)\,\Delta x$$ It is the net signed area: area above the $x$-axis minus area below.
PropertyFormula
Reversed limits$\int_b^a f=-\int_a^b f,\quad \int_a^a f=0$
Linearity$\int_a^b(cf\pm g)=c\int_a^b f\pm\int_a^b g$
Additivity$\int_a^c f+\int_c^b f=\int_a^b f$
Comparison$f\le g\Rightarrow\int_a^b f\le\int_a^b g$; $\ m(b-a)\le\int_a^b f\le M(b-a)$
Constant$\int_a^b c\,dx=c(b-a)$

Worked examples

Example 1: using geometry
Evaluate $\displaystyle\int_{-2}^{2}\sqrt{4-x^2}\,dx$.
  1. $y=\sqrt{4-x^2}$ is the upper half of the circle of radius 2.
  2. Area $=\tfrac12\pi(2)^2=2\pi$.
$2\pi$
Example 2: properties
Given $\int_0^5 f=7$ and $\int_0^2 f=3$, find $\int_2^5 f$ and $\int_5^2(2f+1)\,dx$.
  1. $\int_2^5 f=7-3=4$.
  2. $$\int_5^2(2f+1)=-\int_2^5(2f+1)=-(2\cdot4+3)=-11$$
Going deeper

Integrable functions. Every continuous function on $[a,b]$ is integrable, and so is any bounded function with finitely many jumps. The definite integral is a number, while the indefinite integral is a family of functions.

Average value. The average height of $f$ on $[a,b]$ is $$f_{\text{avg}}=\frac{1}{b-a}\int_a^bf(x)\,dx .$$ The Mean Value Theorem for integrals says a continuous $f$ actually attains this value at some $c\in[a,b]$.

Remark The variable of integration is a dummy: $\int_0^1x^2\,dx=\int_0^1t^2\,dt=\frac13$. The answer does not depend on the letter.
Example 3: average value
Find the average value of $f(x)=1+x^2$ on $[-1,2]$, and a point where it is attained.
  1. Apply the formula with $b-a=3$:

    $$f_{\text{avg}}=\frac13\int_{-1}^2(1+x^2)\,dx=\frac13\Big[x+\frac{x^3}3\Big]_{-1}^{2}$$
  2. Evaluate:

    $$=\frac13\left[\left(2+\tfrac83\right)-\left(-1-\tfrac13\right)\right]=\frac13\cdot6=2$$
  3. Solve $f(c)=2$:

    $$1+c^2=2\quad\Rightarrow\quad c=\pm1$$
$f_{\text{avg}}=2$, attained at $c=\pm1$
Challenge Example 4: integral of a piecewise function using geometry
Evaluate $$\int_{-3}^{3}\left(|x|-\sqrt{9-x^2}\right)dx .$$
  1. Linearity: split into two integrals:

    $$\int_{-3}^3|x|\,dx-\int_{-3}^3\sqrt{9-x^2}\,dx$$
  2. The first is two triangles, each with base 3 and height 3:

    $$\int_{-3}^3|x|\,dx=2\cdot\tfrac12\cdot3\cdot3=9$$
  3. The second is the area of a half-disc of radius 3:

    $$\int_{-3}^3\sqrt{9-x^2}\,dx=\tfrac12\pi(3)^2=\tfrac{9\pi}2$$
$9-\dfrac{9\pi}{2}\approx-5.14$ (negative: the semicircle lies above $|x|$)
$\displaystyle\int_{0}^{2\pi}\sin x\,dx=$
The positive area on $[0,\pi]$ cancels the negative area on $[\pi,2\pi]$.

Exercises

  1. $\displaystyle\int_{0}^{3}(2-x)\,dx$ using geometry.
    Answer
    $2-\tfrac12=\tfrac32$
  2. $\displaystyle\int_{-1}^{2}|x|\,dx$
    Answer
    $\tfrac12+2=\tfrac52$
  3. Show that $2\le\displaystyle\int_0^1\sqrt{4+x^2}\,dx\le\sqrt5$.
    Answer
    On $[0,1]$: $2\le\sqrt{4+x^2}\le\sqrt5$; multiply by length 1.
  4. Express $\displaystyle\lim_{n\to\infty}\sum_{i=1}^n\frac{3}{n}\sqrt{1+\frac{3i}{n}}$ as an integral.
    Answer
    $\int_0^3\sqrt{1+x}\,dx$ (or $\int_1^4\sqrt{x}\,dx$)
4.5

The Fundamental Theorem of Calculus

FTC I & IIAnimationQuiz
FTC, Part 1 If $f$ is continuous on $[a,b]$ and $g(x)=\displaystyle\int_a^x f(t)\,dt$, then $g'(x)=f(x)$. With the chain rule: $\dfrac{d}{dx}\displaystyle\int_a^{u(x)}f(t)\,dt=f(u(x))\,u'(x)$.
FTC, Part 2 (Evaluation Theorem) If $F'=f$ on $[a,b]$, then $$\int_a^b f(x)\,dx=F(b)-F(a)=\Big[F(x)\Big]_a^b .$$
Net change theorem $\displaystyle\int_a^b F'(x)\,dx=F(b)-F(a)$. Example: displacement $=\int_a^b v(t)\,dt$, distance travelled $=\int_a^b|v(t)|\,dt$.

Worked examples

Example 1
Evaluate $\displaystyle\int_1^3(x^2-2x)\,dx$.
  1. Antiderivative: $F(x)=\frac{x^3}{3}-x^2$.
  2. $$F(3)-F(1)=(9-9)-\left(\frac13-1\right)=\frac23$$
$\dfrac23$
Example 2: FTC 1 with chain rule
Find $\dfrac{d}{dx}\displaystyle\int_1^{x^3}\cos(t^2)\,dt$.
  1. $u=x^3$, $u'=3x^2$.
  2. Result: $$\cos\!\big((x^3)^2\big)\cdot3x^2$$
$3x^2\cos(x^6)$
Example 3
$\displaystyle\int_0^{\pi/2}\cos x\,dx$ and $\displaystyle\int_1^e\frac{dx}{x}$.
  1. $[\sin x]_0^{\pi/2}=1-0=1$.
  2. $[\ln x]_1^e=1-0=1$.
Going deeper

Why FTC 1 is true. With $g(x)=\int_a^xf$: $$\frac{g(x+h)-g(x)}{h}=\frac1h\int_x^{x+h}f(t)\,dt\approx\frac1h\cdot f(x)\cdot h=f(x).$$ The extra area added by a thin strip of width $h$ is about its height times its width. Divide by the width, and the height $f(x)$ remains.

Why FTC 2 follows. $g$ and any antiderivative $F$ have the same derivative, so $F=g+C$. Then $F(b)-F(a)=g(b)-g(a)=\int_a^bf-0$.

Together they say that differentiation and integration are inverse operations, the central fact of calculus.

Remark When both limits are functions of $x$, split at a constant: $\frac{d}{dx}\int_{u(x)}^{v(x)}f=f(v)v'-f(u)u'$.
Example 4: both limits variable
Find $\dfrac{d}{dx}\displaystyle\int_{\sqrt x}^{x^2}\frac{dt}{1+t^3}$.
  1. Upper limit $v=x^2$ with $v'=2x$; lower limit $u=\sqrt x$ with $u'=\frac1{2\sqrt x}$:

    $$\frac{d}{dx}\int_{u}^{v}f(t)\,dt=f(v)\,v'-f(u)\,u'$$
  2. Substitute $f(t)=\frac1{1+t^3}$:

    $$=\frac{2x}{1+x^6}-\frac{1}{2\sqrt x\,(1+x^{3/2})}$$
Challenge Example 5: finding a function from an integral equation
Find a function $f$ and a number $a$ such that $$6+\int_a^x\frac{f(t)}{t^2}\,dt=2\sqrt x\quad\text{for all } x\gt0.$$
  1. Differentiate both sides. By FTC 1, the left side gives $\frac{f(x)}{x^2}$:

    $$\frac{f(x)}{x^2}=\frac{1}{\sqrt x}\quad\Rightarrow\quad f(x)=x^{3/2}$$
  2. Put $x=a$: the integral from $a$ to $a$ is $0$:

    $$6+0=2\sqrt a\quad\Rightarrow\quad a=9$$
$f(x)=x^{3/2}$, $a=9$
Challenge Example 6: total distance travelled
A particle moves with $v(t)=\cos t$ m/s for $0\le t\le\frac{3\pi}{2}$. Find the displacement and the total distance.
  1. Displacement, the net change in position:

    $$\int_0^{3\pi/2}\cos t\,dt=\Big[\sin t\Big]_0^{3\pi/2}=-1-0=-1$$
  2. Distance: $v\ge0$ on $[0,\frac\pi2]$ and $v\le0$ on $[\frac\pi2,\frac{3\pi}2]$, so split at $\frac\pi2$:

    $$\int_0^{\pi/2}\cos t\,dt-\int_{\pi/2}^{3\pi/2}\cos t\,dt=1-(-2)=3$$
Displacement $-1$ m; distance $3$ m
If $g(x)=\displaystyle\int_0^x\sqrt{1+t^3}\,dt$, then $g'(2)=$
FTC 1: $g'(x)=\sqrt{1+x^3}$, so $g'(2)=\sqrt9=3$.
What is wrong with $\displaystyle\int_{-1}^{1}\frac{dx}{x^2}=\Big[-\tfrac1x\Big]_{-1}^{1}=-2$?
A positive integrand cannot give a negative area. The function blows up at $0$; this is an improper integral (it diverges).

Exercises

  1. $\displaystyle\int_0^4\sqrt x\,dx$
    Answer
    $\frac{16}3$
  2. $\displaystyle\int_0^1(e^x+x^e)\,dx$
    Answer
    $e-1+\frac{1}{e+1}$
  3. $\dfrac{d}{dx}\displaystyle\int_x^{2}\frac{dt}{1+t^4}$
    Answer
    $-\frac1{1+x^4}$
  4. A particle has $v(t)=t^2-2t-3$ on $[0,4]$. Find the displacement and the distance travelled.
    Answer
    Displacement $-\frac{20}3$; distance $\frac{34}3$
4.6

Integration by Substitution

u-substitutionDemoQuiz

Substitution reverses the chain rule. Look for a function $g(x)$ whose derivative $g'(x)$ also appears in the integrand.

Substitution rule With $u=g(x)$, $du=g'(x)\,dx$: $$\int f(g(x))\,g'(x)\,dx=\int f(u)\,du,\qquad \int_a^b f(g(x))g'(x)\,dx=\int_{g(a)}^{g(b)}f(u)\,du .$$
Symmetry On $[-a,a]$: if $f$ is even, $\int_{-a}^af=2\int_0^af$; if $f$ is odd, $\int_{-a}^af=0$.

Worked examples

Example 1
$\displaystyle\int x^2\sqrt{x^3+1}\,dx$
  1. $u=x^3+1$, $$du=3x^2dx\Rightarrow x^2dx=\tfrac13du$$
  2. $$\int\sqrt u\cdot\tfrac13du=\tfrac13\cdot\tfrac23u^{3/2}+C$$
$\tfrac29(x^3+1)^{3/2}+C$
Example 2
$\displaystyle\int\tan x\,dx$
  1. $$\tan x=\dfrac{\sin x}{\cos x}$$ $u=\cos x$, $du=-\sin x\,dx$.
  2. $$\int-\frac{du}{u}=-\ln|u|+C$$
$-\ln|\cos x|+C=\ln|\sec x|+C$
Example 3: definite integral, change the limits
$\displaystyle\int_0^2\frac{x}{(1+x^2)^2}\,dx$
  1. $u=1+x^2$, $du=2x\,dx$. Limits: $x=0\to u=1$, $x=2\to u=5$.
  2. $$\frac12\int_1^5u^{-2}du=\frac12\Big[-\frac1u\Big]_1^5=\frac12\left(-\frac15+1\right)$$
$\dfrac25$
Going deeper

How to choose $u$. Look for an "inside function" whose derivative appears as a factor, up to a constant:

Integrand contains…Try
$f(ax+b)$$u=ax+b$
$g(x^n)\cdot x^{n-1}$$u=x^n$
$g(\ln x)\cdot\frac1x$$u=\ln x$
$g(e^x)\cdot e^x$$u=e^x$
$g(\sin x)\cos x$$u=\sin x$

After substituting, no $x$ may remain. If one does, either solve $u=g(x)$ for $x$ (back-substitution) or choose another $u$.

Remark In a definite integral, either change the limits to $u$-values (and never go back to $x$), or keep the $x$-limits and substitute back before evaluating. Mixing the two is the classic error.
Example 4: back-substitution
Find $$\int x\sqrt{x+1}\,dx .$$
  1. Let $u=x+1$, so $du=dx$. The leftover $x$ must be written in terms of $u$: $x=u-1$:

    $$\int(u-1)\sqrt u\,du=\int\left(u^{3/2}-u^{1/2}\right)du$$
  2. Power rule:

    $$=\frac25u^{5/2}-\frac23u^{3/2}+C$$
  3. Return to $x$:

    $$=\frac25(x+1)^{5/2}-\frac23(x+1)^{3/2}+C$$
Challenge Example 5: substitution + symmetry
Evaluate $$\int_{-\pi/2}^{\pi/2}\left(x^5\cos x+\sin x\cos^3x+\cos x\right)dx .$$
  1. $x^5\cos x$ and $\sin x\cos^3x$ are odd (odd × even), so their integrals over a symmetric interval vanish:

    $$\int_{-\pi/2}^{\pi/2}x^5\cos x\,dx=0,\qquad\int_{-\pi/2}^{\pi/2}\sin x\cos^3x\,dx=0$$
  2. $\cos x$ is even, so double the integral from $0$:

    $$\int_{-\pi/2}^{\pi/2}\cos x\,dx=2\int_0^{\pi/2}\cos x\,dx=2\Big[\sin x\Big]_0^{\pi/2}=2$$
$2$
Challenge Example 6: a hidden substitution
Find $$\int\frac{dx}{x\ln x\,\ln(\ln x)} .$$
  1. Let $u=\ln(\ln x)$. By the chain rule:

    $$du=\frac{1}{\ln x}\cdot\frac1x\,dx=\frac{dx}{x\ln x}$$
  2. The whole integrand is $\frac{1}{u}\,du$:

    $$\int\frac{du}{u}=\ln|u|+C$$
$\ln\big|\ln(\ln x)\big|+C$
For $\displaystyle\int e^{5x}dx$, the best substitution gives
$u=5x$, $dx=\frac15du$.

Exercises

  1. $\displaystyle\int\cos(3x)\,dx$
    Answer
    $\frac13\sin3x+C$
  2. $\displaystyle\int\frac{\ln x}{x}\,dx$
    Answer
    $\frac12(\ln x)^2+C$
  3. $\displaystyle\int\frac{e^x}{1+e^{2x}}\,dx$
    Answer
    $\arctan(e^x)+C$
  4. $\displaystyle\int_0^{\pi/4}\tan x\sec^2x\,dx$
    Answer
    $\frac12$
  5. $\displaystyle\int_{-1}^{1}x^3\cos x\,dx$
    Answer
    $0$ (odd integrand)
Chapter 5

Applications of Integration

Slice, approximate, add up, take a limit. The same idea computes areas between curves, volumes of solids of revolution, and lengths of curves.

π∫r²
5.1

Area between Curves

Top − bottomAnimationQuiz
Vertical strips If $f(x)\ge g(x)$ on $[a,b]$: $$A=\int_a^b\big[f(x)-g(x)\big]\,dx=\int_a^b(\text{top}-\text{bottom})\,dx .$$ If the curves cross, use $\int_a^b|f-g|\,dx$ and split at the intersection points.
Horizontal strips For regions bounded by $x=f(y)$ and $x=g(y)$: $\displaystyle A=\int_c^d(\text{right}-\text{left})\,dy$.
Steps (1) Sketch. (2) Find intersection points (these are often the limits). (3) Decide top/bottom or right/left. (4) Integrate.

Worked examples

Example 1
Find the area between $y=4-x^2$ and $y=x+2$.
  1. Intersections: $$4-x^2=x+2\Rightarrow x^2+x-2=0\Rightarrow x=-2,\ 1$$
  2. Top: $4-x^2$ (test $x=0$: $4\gt2$). $$A=\int_{-2}^{1}(2-x-x^2)\,dx$$
  3. $$=\Big[2x-\frac{x^2}2-\frac{x^3}3\Big]_{-2}^{1}=\left(2-\frac12-\frac13\right)-\left(-4-2+\frac83\right)=\frac76+\frac{10}3$$
$A=\dfrac92$
Example 2: horizontal strips
Find the area enclosed by $x=y^2$ and $x=y+2$.
  1. $y^2=y+2\Rightarrow y=-1,2$. Right curve: $x=y+2$.
  2. $$A=\int_{-1}^{2}(y+2-y^2)\,dy=\Big[\frac{y^2}2+2y-\frac{y^3}3\Big]_{-1}^{2}=\frac{10}3+\frac76$$
$\dfrac92$
Going deeper

The "slice and add" principle. A thin vertical strip at position $x$ has height $f(x)-g(x)$ and width $dx$, so its area is $\big[f(x)-g(x)\big]dx$. The integral adds up infinitely many such strips, from the leftmost to the rightmost. $$dA=(\text{top}-\text{bottom})\,dx\qquad\Longrightarrow\qquad A=\int_a^b dA .$$ This same principle gives volumes (Section 5.2), arc length (Section 5.3), work, mass and more.

Which way to slice? Choose the direction that gives one formula for the strip. If the top or bottom boundary changes formula partway, vertical strips need two integrals; horizontal strips may need only one.

Remark Area is always positive. If you get a negative answer, you subtracted top from bottom the wrong way round, or the curves cross inside the interval.
Example 3: curves that cross
Find the total area between $y=x^3$ and $y=x$ on $[-1,2]$.
  1. The curves meet where $x^3=x$, i.e. at $x=-1,0,1$. Find which is on top in each piece (test $x=-\tfrac12$, $\tfrac12$, $\tfrac32$):

    $$[-1,0]:\ x^3\ge x,\qquad[0,1]:\ x\ge x^3,\qquad[1,2]:\ x^3\ge x$$
  2. Integrate (top − bottom) on each piece:

    $$\int_{-1}^0(x^3-x)\,dx=\tfrac14,\qquad\int_0^1(x-x^3)\,dx=\tfrac14,\qquad\int_1^2(x^3-x)\,dx=\tfrac{15}4-\tfrac32=\tfrac94$$
  3. Add:

    $$A=\tfrac14+\tfrac14+\tfrac94=\tfrac{11}4$$
$A=\dfrac{11}{4}$ (whereas $\int_{-1}^2(x^3-x)\,dx=\frac94$ would miscount)
Challenge Example 4: a region needing horizontal strips
Find the area bounded by $y=\sqrt x$, $y=x-2$ and the $x$-axis.
  1. With vertical strips the bottom boundary changes (the $x$-axis until $x=2$, then the line), so we would need two integrals. Use horizontal strips instead: write each curve as $x$ in terms of $y$:

    $$x=y^2\ \ (\text{left}),\qquad x=y+2\ \ (\text{right})$$
  2. They meet where $y^2=y+2$, i.e. $y=2$ (we need $y\ge0$). The region runs from $y=0$ to $y=2$:

    $$A=\int_0^2\big[(y+2)-y^2\big]\,dy$$
  3. Evaluate:

    $$=\Big[\frac{y^2}2+2y-\frac{y^3}3\Big]_0^2=2+4-\frac83=\frac{10}3$$
$A=\dfrac{10}3$
The area between $y=x$ and $y=x^2$ on $[0,1]$ is
$\int_0^1(x-x^2)dx=\frac12-\frac13=\frac16$.

Exercises

  1. Area between $y=x^2$ and $y=2x$.
    Answer
    $\frac43$
  2. Area between $y=\sin x$ and $y=\cos x$ on $[0,\pi/2]$.
    Answer
    $2\sqrt2-2$
  3. Area enclosed by $y=x^3$ and $y=x$.
    Answer
    $\frac12$
5.2

Volumes: The Methods of Disks and Washers

Solids of revolution3D animationQuiz

Rotating a region about an axis produces a solid. Slicing perpendicular to the axis gives circular disks (or washers if there is a hole).

Disk method Rotating $y=R(x)\ge0$ on $[a,b]$ about the $x$-axis: $$V=\int_a^b\pi\,[R(x)]^2\,dx$$
Washer method Outer radius $R(x)$, inner radius $r(x)$: $$V=\int_a^b\pi\Big([R(x)]^2-[r(x)]^2\Big)dx$$
Common mistake $\pi(R^2-r^2)\neq\pi(R-r)^2$. Square each radius separately.
Other axes For rotation about $y=k$, the radius is the distance to the line: $R=|f(x)-k|$. For rotation about the $y$-axis, integrate in $y$.

Worked examples

Example 1: disks
Rotate the region under $y=\sqrt x$, $0\le x\le4$, about the $x$-axis.
  1. $R(x)=\sqrt x$, so the area of a slice is $\pi x$.
  2. $$V=\int_0^4\pi x\,dx=\pi\Big[\frac{x^2}2\Big]_0^4=8\pi$$
$V=8\pi$
Example 2: washers
Rotate the region between $y=\sqrt x$ and $y=\tfrac x2$ about the $x$-axis.
  1. Intersections: $$\sqrt x=\tfrac x2\Rightarrow x=0,4$$ Outer $R=\sqrt x$, inner $r=\tfrac x2$.
  2. $$V=\pi\int_0^4\left(x-\frac{x^2}{4}\right)dx=\pi\Big[\frac{x^2}2-\frac{x^3}{12}\Big]_0^4=\pi\left(8-\frac{16}3\right)$$
$V=\dfrac{8\pi}3$
Example 3: volume of a sphere
Derive $V=\tfrac43\pi r^3$.
  1. Rotate $y=\sqrt{r^2-x^2}$, $-r\le x\le r$, about the $x$-axis.
  2. $$V=\pi\int_{-r}^{r}(r^2-x^2)\,dx=\pi\Big[r^2x-\frac{x^3}3\Big]_{-r}^{r}=\pi\left(\frac{4r^3}{3}\right)$$
Going deeper: where the washer formula comes from

Cut the solid with a plane perpendicular to the axis of rotation at position $x$. The cross-section is a washer: a disc of radius $R(x)$ with a concentric hole of radius $r(x)$. Its area is $$A(x)=\pi R(x)^2-\pi r(x)^2 .$$ A slab of thickness $dx$ has volume $A(x)\,dx$, and adding the slabs gives the integral. Disks are the special case $r=0$.

How to find $R$ and $r$, whatever the axis. Both are distances from the axis of rotation:

Axis of rotationSlicesOuter radius $R$Inner radius $r$
$x$-axis ($y=0$)vertical, $dx$$y_{\text{far}}$$y_{\text{near}}$
horizontal line $y=k$ below the regionvertical, $dx$$y_{\text{top}}-k$$y_{\text{bottom}}-k$
horizontal line $y=k$ above the regionvertical, $dx$$k-y_{\text{bottom}}$$k-y_{\text{top}}$
$y$-axis ($x=0$)horizontal, $dy$$x_{\text{far}}$$x_{\text{near}}$
vertical line $x=h$horizontal, $dy$$|x_{\text{far}}-h|$$|x_{\text{near}}-h|$

Rule of thumb: slice perpendicular to the axis. Rotating about a horizontal axis means integrating in $x$; about a vertical axis, in $y$.

Remark When the region touches the axis, the inner radius is $0$ and washers become disks. When the region does not touch the axis, there is always a hole, even if the region is bounded by only one curve and a line.
Remark A quick sanity check: the volume must lie between the volumes of the two cylinders built from the smallest and largest values of $R$. A formula that gives something outside this range contains an error.
Example 4: washers about the x-axis
The region between $y=x$ and $y=x^2$ is rotated about the $x$-axis. Find the volume.
  1. Intersections: $x^2=x$ gives $x=0,1$. On $[0,1]$, $x\ge x^2$, so the line is farther from the axis:

    $$R(x)=x,\qquad r(x)=x^2$$
  2. Washer area times thickness, summed:

    $$V=\pi\int_0^1\left(x^2-x^4\right)dx$$
  3. Integrate:

    $$=\pi\Big[\frac{x^3}{3}-\frac{x^5}{5}\Big]_0^1=\pi\left(\frac13-\frac15\right)=\frac{2\pi}{15}$$
$V=\dfrac{2\pi}{15}$
Example 5: washers about the line y = −1 (axis below the region)
Rotate the region under $y=\sqrt x$, $0\le x\le4$, about the line $y=-1$.
  1. The axis $y=-1$ lies below the region, so measure distances upward from $-1$. The far boundary is the curve; the near boundary is the $x$-axis:

    $$R(x)=\sqrt x-(-1)=\sqrt x+1,\qquad r(x)=0-(-1)=1$$
  2. There is a hole of radius 1 because the region does not touch the axis:

    $$V=\pi\int_0^4\Big[(\sqrt x+1)^2-1^2\Big]dx=\pi\int_0^4\left(x+2\sqrt x\right)dx$$
  3. Integrate:

    $$=\pi\Big[\frac{x^2}{2}+\frac43x^{3/2}\Big]_0^4=\pi\left(8+\frac{32}{3}\right)=\frac{56\pi}{3}$$
$V=\dfrac{56\pi}{3}\approx58.6$
Example 6: washers about the line y = 2 (axis above the region)
Rotate the region between $y=\sqrt x$ and $y=\dfrac x2$ about the line $y=2$.
  1. Intersections at $x=0$ and $x=4$. Now the axis is above the region, so distances are measured downward from 2. The lower curve $y=\frac x2$ is farther away:

    $$R(x)=2-\frac x2,\qquad r(x)=2-\sqrt x$$
  2. Expand the squares carefully:

    $$R^2-r^2=\left(4-2x+\frac{x^2}4\right)-\left(4-4\sqrt x+x\right)=-3x+\frac{x^2}{4}+4\sqrt x$$
  3. Integrate:

    $$V=\pi\int_0^4\left(-3x+\frac{x^2}4+4x^{1/2}\right)dx=\pi\Big[-\frac{3x^2}{2}+\frac{x^3}{12}+\frac83x^{3/2}\Big]_0^4$$
  4. Evaluate at $4$:

    $$=\pi\left(-24+\frac{16}3+\frac{64}3\right)=\pi\left(-24+\frac{80}{3}\right)=\frac{8\pi}{3}$$
$V=\dfrac{8\pi}{3}$
Example 7: washers about the y-axis (integrate in y)
The region between $y=x$ and $y=x^2$ is rotated about the $y$-axis. Find the volume.
  1. The axis is vertical, so slice horizontally and integrate in $y$. Solve each curve for $x$: $y=x\Rightarrow x=y$, and $y=x^2\Rightarrow x=\sqrt y$. For $0\le y\le1$, $\sqrt y\ge y$:

    $$R(y)=\sqrt y\ \ (\text{far}),\qquad r(y)=y\ \ (\text{near})$$
  2. Set up and integrate:

    $$V=\pi\int_0^1\left(y-y^2\right)dy=\pi\left(\frac12-\frac13\right)$$
$V=\dfrac{\pi}{6}$
Challenge Example 8: washers about the line x = −1
Rotate the same region (between $y=x$ and $y=x^2$) about the vertical line $x=-1$.
  1. Integrate in $y$. Distances are measured from $x=-1$, so add $1$ to each $x$-value:

    $$R(y)=\sqrt y+1,\qquad r(y)=y+1$$
  2. Expand:

    $$R^2-r^2=(y+2\sqrt y+1)-(y^2+2y+1)=2\sqrt y-y-y^2$$
  3. Integrate:

    $$V=\pi\int_0^1\left(2y^{1/2}-y-y^2\right)dy=\pi\left(\frac43-\frac12-\frac13\right)=\frac{\pi}{2}$$
  4. Compare with Example 7: the same region gives a larger volume ($\frac\pi2\gt\frac\pi6$) because it now sweeps a larger circle.

$V=\dfrac{\pi}{2}$
Challenge Example 9: a washer with a curved hole
The region bounded by $y=4-x^2$ and $y=3$ is rotated about the line $y=1$. Find the volume.
  1. Intersections: $4-x^2=3$ gives $x=\pm1$. On $[-1,1]$ the parabola is on top. The axis $y=1$ lies below the whole region:

    $$R(x)=(4-x^2)-1=3-x^2,\qquad r(x)=3-1=2$$
  2. Use symmetry (an even integrand) to integrate over $[0,1]$ and double:

    $$V=2\pi\int_0^1\Big[(3-x^2)^2-4\Big]dx=2\pi\int_0^1\left(5-6x^2+x^4\right)dx$$
  3. Integrate:

    $$=2\pi\left(5-2+\frac15\right)=2\pi\cdot\frac{16}{5}=\frac{32\pi}{5}$$
$V=\dfrac{32\pi}{5}$
Challenge Example 10: the volume of a torus (doughnut)
The disc $x^2+(y-b)^2\le a^2$ (with $0\lt a\lt b$) is rotated about the $x$-axis. Show that the volume is $2\pi^2a^2b$.
  1. For each $x\in[-a,a]$, the vertical slice of the disc runs from $y=b-\sqrt{a^2-x^2}$ up to $y=b+\sqrt{a^2-x^2}$. These are the near and far distances from the axis. Write $s=\sqrt{a^2-x^2}$:

    $$R=b+s,\qquad r=b-s$$
  2. Difference of squares makes this neat: $(b+s)^2-(b-s)^2=4bs$:

    $$V=\pi\int_{-a}^{a}4b\sqrt{a^2-x^2}\,dx=4\pi b\int_{-a}^a\sqrt{a^2-x^2}\,dx$$
  3. The remaining integral is the area of a half-disc of radius $a$, namely $\frac{\pi a^2}2$:

    $$V=4\pi b\cdot\frac{\pi a^2}{2}=2\pi^2a^2b$$
  4. Interpretation: $V=(\pi a^2)\cdot(2\pi b)$, the area of the disc times the distance its centre travels (Pappus's theorem).

$V=2\pi^2a^2b$
Challenge Example 11: a solid with known cross-sections
The base of a solid is the disc $x^2+y^2\le r^2$. Cross-sections perpendicular to the $x$-axis are squares. Find the volume.
  1. The same "slice and add" idea works with any cross-section, not only circles. At position $x$, the square's side runs across the disc:

    $$s(x)=2\sqrt{r^2-x^2}$$
  2. Area of the square cross-section:

    $$A(x)=s^2=4(r^2-x^2)$$
  3. Integrate:

    $$V=\int_{-r}^{r}4(r^2-x^2)\,dx=4\left(2r^3-\frac{2r^3}{3}\right)=\frac{16r^3}{3}$$
$V=\dfrac{16}{3}r^3$
Checklist for washer problems
  1. Sketch the region and the axis. Draw a typical slice perpendicular to the axis.
  2. Decide: horizontal axis → $dx$; vertical axis → $dy$.
  3. Find the limits (intersection points).
  4. $R=$ distance from the axis to the far curve; $r=$ distance to the near curve.
  5. $V=\pi\int(R^2-r^2)$. Square before subtracting.
  6. Check: positive answer, plausible size, correct units (cubic).
Rotating $y=x$, $0\le x\le3$, about the $x$-axis gives a cone of volume
$\pi\int_0^3x^2dx=9\pi$, which matches $\frac13\pi r^2h=\frac13\pi\cdot9\cdot3$.

Exercises

  1. Rotate $y=x^2$, $0\le x\le2$, about the $x$-axis.
    Answer
    $\frac{32\pi}5$
  2. Rotate the region between $y=x$ and $y=x^2$ about the $x$-axis.
    Answer
    $\frac{2\pi}{15}$
  3. Rotate $y=e^{x}$, $0\le x\le1$, about the $x$-axis.
    Answer
    $\frac\pi2(e^2-1)$
  4. Rotate the region under $y=x^2$, $0\le x\le1$, about the line $y=-1$.
    Answer
    $\pi\int_0^1[(x^2+1)^2-1]dx=\frac{13\pi}{15}$
  5. Rotate the region under $y=x^2$, $0\le x\le1$, about the line $y=-2$.
    Answer
    $R=x^2+2,\ r=2$: $\pi\int_0^1(x^4+4x^2)\,dx=\frac{23\pi}{15}$
  6. Rotate the region between $y=x^2$ and $y=1$ about the line $y=1$.
    Answer
    Disks, $R=1-x^2$: $\pi\int_{-1}^1(1-x^2)^2dx=\frac{16\pi}{15}$
  7. Rotate the region between $y=x^2$ and $y=2x$ about the $y$-axis.
    Answer
    $R=\sqrt y,\ r=\frac y2$: $\pi\int_0^4\left(y-\frac{y^2}{4}\right)dy=\frac{8\pi}{3}$
  8. Rotate the region between $y=x$ and $y=\sqrt x$ about the line $x=2$.
    Answer
    $R=2-y^2,\ r=2-y$: $\pi\int_0^1(4y-5y^2+y^4)\,dy=\frac{8\pi}{15}$
  9. Rotate the region between $y=x^2$ and $y=2x$ about the line $y=4$.
    Answer
    $R=4-x^2,\ r=4-2x$: $\pi\int_0^2\big[(4-x^2)^2-(4-2x)^2\big]dx=\frac{32\pi}{5}$
5.3

Arc Length

FormulaAnimationQuiz

Approximate the curve by a polygon. A small piece has length $\sqrt{\Delta x^2+\Delta y^2}=\sqrt{1+(\Delta y/\Delta x)^2}\,\Delta x$. Letting $\Delta x\to0$:

Arc length formula If $f'$ is continuous on $[a,b]$, $$L=\int_a^b\sqrt{1+[f'(x)]^2}\,dx,\qquad\text{or}\qquad L=\int_c^d\sqrt{1+[g'(y)]^2}\,dy\ \text{ for } x=g(y).$$
Nice integrands Most arc-length integrals cannot be done by hand. Textbook examples are designed so that $1+(f')^2$ is a perfect square.

Worked examples

Example 1
Find the length of $y=x^{3/2}$ from $x=0$ to $x=4$.
  1. $y'=\tfrac32x^{1/2}$, so $1+(y')^2=1+\tfrac94x$.
  2. $$L=\int_0^4\sqrt{1+\tfrac94x}\,dx$$ Let $u=1+\tfrac94x$, $dx=\tfrac49du$, $u:1\to10$.
  3. $$L=\frac49\int_1^{10}u^{1/2}du=\frac49\cdot\frac23\Big[u^{3/2}\Big]_1^{10}=\frac{8}{27}\left(10\sqrt{10}-1\right)$$
$L=\dfrac{8}{27}\left(10\sqrt{10}-1\right)\approx9.073$
Example 2: a perfect square
Find the length of $y=\dfrac{x^3}{6}+\dfrac{1}{2x}$ on $[1,2]$.
  1. $$y'=\dfrac{x^2}2-\dfrac1{2x^2}$$ so $$1+(y')^2=\dfrac{x^4}4+\dfrac12+\dfrac1{4x^4}=\left(\dfrac{x^2}2+\dfrac{1}{2x^2}\right)^2$$
  2. $$L=\int_1^2\left(\frac{x^2}2+\frac1{2x^2}\right)dx=\Big[\frac{x^3}6-\frac1{2x}\Big]_1^2=\left(\frac86-\frac14\right)-\left(\frac16-\frac12\right)$$
$L=\dfrac{17}{12}$
Going deeper

The arc-length element. Zoom in on the curve until it looks straight. A tiny piece is the hypotenuse of a right triangle with legs $dx$ and $dy$: $$ds=\sqrt{dx^2+dy^2}=\sqrt{1+\left(\frac{dy}{dx}\right)^2}\,dx .$$ The arc length is $L=\int ds$. The same element $ds$ is used for surface areas of revolution in Calculus II.

Why polygons work. By the MVT, each chord has slope $f'(x_i^*)$ for some point in its interval, so its length is exactly $\sqrt{1+f'(x_i^*)^2}\,\Delta x$. The polygon length is therefore a Riemann sum, and its limit is the integral.

Remark The arc length of a straight line from the formula is the usual distance. Always test a new formula on a case you can do by hand.
Example 3: integrating in y
Find the length of $x=\tfrac13y^{3/2}$ (equivalently $x=\tfrac13\sqrt{y^3}$) from $y=0$ to $y=12$.
  1. Here $x$ is a function of $y$, so use the $dy$ form:

    $$\frac{dx}{dy}=\frac12y^{1/2},\qquad1+\left(\frac{dx}{dy}\right)^2=1+\frac y4$$
  2. Set up the integral:

    $$L=\int_0^{12}\sqrt{1+\frac y4}\,dy$$
  3. Substitute $u=1+\frac y4$, $dy=4\,du$, $u:1\to4$:

    $$L=4\int_1^4u^{1/2}du=4\cdot\frac23\Big[u^{3/2}\Big]_1^4=\frac83(8-1)=\frac{56}3$$
$L=\dfrac{56}{3}$
Challenge Example 4: the catenary (hanging cable)
Find the length of $y=\dfrac{e^x+e^{-x}}{2}$ (the shape of a hanging chain) from $x=-1$ to $x=1$.
  1. Derivative:

    $$y'=\frac{e^x-e^{-x}}{2}$$
  2. Expand $1+(y')^2$. The cross terms combine into a perfect square:

    $$1+\frac{e^{2x}-2+e^{-2x}}{4}=\frac{e^{2x}+2+e^{-2x}}{4}=\left(\frac{e^x+e^{-x}}{2}\right)^2$$
  3. So the square root disappears (the expression is positive):

    $$L=\int_{-1}^{1}\frac{e^x+e^{-x}}2\,dx=\Big[\frac{e^x-e^{-x}}2\Big]_{-1}^{1}=e-\frac1e$$
$L=e-e^{-1}\approx2.350$
Challenge Example 5: circumference of a circle
Use the arc length formula to show that a quarter circle of radius $r$ has length $\frac{\pi r}2$.
  1. Upper semicircle: $y=\sqrt{r^2-x^2}$, so $y'=\dfrac{-x}{\sqrt{r^2-x^2}}$:

    $$1+(y')^2=1+\frac{x^2}{r^2-x^2}=\frac{r^2}{r^2-x^2}$$
  2. Quarter circle from $x=0$ to $x=r$:

    $$L=\int_0^{r}\frac{r}{\sqrt{r^2-x^2}}\,dx=r\Big[\arcsin\frac xr\Big]_0^{r}$$
  3. Evaluate (an improper integral at $x=r$, but convergent):

    $$L=r\left(\frac\pi2-0\right)=\frac{\pi r}{2}$$
$\dfrac{\pi r}{2}$, so the full circumference is $2\pi r$ ✓
The arc length of $y=2x+1$ from $x=0$ to $x=3$ is
$\int_0^3\sqrt{1+4}\,dx=3\sqrt5$, which matches the distance from $(0,1)$ to $(3,7)$.

Exercises

  1. Length of $y=\tfrac23(x-1)^{3/2}$ on $[1,4]$.
    Answer
    $\frac{14}3$
  2. Length of $y=\ln(\cos x)$ on $[0,\pi/4]$.
    Answer
    $\ln(\sqrt2+1)$
  3. Set up (do not evaluate) the length of $y=x^2$ on $[0,1]$.
    Answer
    $\int_0^1\sqrt{1+4x^2}\,dx\approx1.479$
WS

Worksheet Generator

PrintableAnswer key

Choose the topics, then generate a printable worksheet built from the exercises in these notes. An answer key is added on a separate page.

↑