Home Notes Research CV Projects Outside of Math

← Back to Course Resources

MATH 1071 — Calculus for Business & Economics

Lecture Notes. This is NOT meant to be a substitute for coming to lecture or consulting the textbook directly, but rather a helpful resource to review for exams/ review what was discussed in lecture. Each section ends with a Self-Check taken from the in-class activity — try the problem first, then click the button to see the answer.

Preview of Calculus

↑ Back to top
Goals Learn about secant lines, tangent lines, and their connection; see the need for limits in finding tangent lines, and the connection with instantaneous velocity; introduce "the area problem," which is covered later in the course.

What Is Calculus?

Calculus is the study of how things change. It has two halves:

Both halves are built on limits. In this course, the main business applications include marginal cost, revenue and profit, optimization, and elasticity of demand.

Slopes

Recall that to find the slope of a line, we need two points \((x_1,y_1)\) and \((x_2,y_2)\):

\[ m = \frac{y_2-y_1}{x_2-x_1} = \frac{\Delta y}{\Delta x} = \frac{\text{rise}}{\text{run}}. \]

The slope tells us the rate of change of the line. If a line has slope 4, then every time \(x\) goes up by 1, \(y\) goes up by 4. A line has the same slope everywhere.

What if we have a curve instead? A curve such as \(y=x^2\) is flat at the bottom, gets less steep as you approach the bottom from the left, and gets steeper and steeper as you move to the right. So a curve does not have one single slope; its steepness changes from point to point. We measure the steepness at one point using the tangent line: the line that just touches the curve at that point and points in the same direction as the curve there.

The Goal Find the slope of the tangent line to a function at a given point. (This will be called the derivative of the function at that point.)

Secant Lines to Tangent Lines

Definition A secant line is a line that passes through a function's graph at two points. The secant line to \(f\) between \(x=a\) and \(x=b\) is the line through \((a,f(a))\) and \((b,f(b))\). Its slope is \[ m_{\text{sec}} = \frac{\Delta y}{\Delta x} = \frac{f(b)-f(a)}{b-a}. \]

The slope of the secant line measures how fast the function values are changing between \(a\) and \(b\) on average, so it is also called the average rate of change of \(f\) on \([a,b]\). If the function measures distance traveled, then \(\dfrac{\Delta\text{distance}}{\Delta\text{time}}\) is the average velocity on the time interval \([a,b]\).

Idea: to find the slope of the tangent line at \(x=a\), find the slope of the secant line from \(a\) to \(b\) and let \(b\) get really close to \(a\). We can't just plug in \(b=a\): that gives \(\frac{f(a)-f(a)}{a-a} = \frac00\), and we can't divide by 0. Making "let \(b\) get really close to \(a\)" precise is exactly what limits are for.

121234xy
\(y=x^2\) with the secant line through \((1,1)\) and \((2,4)\) (dashed, slope 3) and the tangent line at \((1,1)\) (solid gray, slope 2)
Definition The slope of the tangent line at \(x=a\) gives the instantaneous rate of change of \(f\) at \(a\). If the function is distance traveled, it gives the instantaneous velocity. We will see that this is the same as the derivative of the function at that point.
Example Find the average rate of change of \(f(x) = x^2\) on each interval below, and use the results to estimate the instantaneous rate of change at \(x = 1\). \[ \begin{aligned} [1,2]&: \ \frac{f(2)-f(1)}{2-1} = \frac{4-1}{1} = 3\\ [1,1.1]&: \ \frac{f(1.1)-f(1)}{1.1-1} = \frac{1.21-1}{0.1} = 2.1\\ [1,1.01]&: \ \frac{f(1.01)-f(1)}{1.01-1} = \frac{1.0201-1}{0.01} = 2.01\\ [1,1.001]&: \ \frac{f(1.001)-f(1)}{1.001-1} = \frac{1.002001-1}{0.001} = 2.001 \end{aligned} \]

As the interval shrinks, the average rates of change get closer and closer to \(2\). So the instantaneous rate of change of \(f(x) = x^2\) at \(x = 1\) (the slope of the tangent line at \(x=1\)) is approximately \(2\). Next we will use limits to show it is exactly 2.

The "Other Half" of Calculus

The second big question in calculus is: how do we find the area under a curve, and why would we want to? To find area under a curve we use integrals. One business reason: integrals let us go from marginal profit back to total profit. We will come back to this later in the course.

Self-Check

From the Exam 2 Review (Problem 1), plus a practice problem in the style of the lecture example

(a) Let \(f(x) = x^3+2x^2+1\). Find the average rate of change of \(f\) from \(x=1\) to \(x=3\).

(b) For the same \(f\), find the average rate of change on \([2,2.1]\), \([2,2.01]\) and \([2,2.001]\). Use your answers to estimate the instantaneous rate of change of \(f\) at \(x=2\).

Introduction to Limits

↑ Back to top
Goals Learn what a limit is and how to evaluate limits and one-sided limits from tables and graphs.

Exploring with Tables

We want to describe the behavior of functions that might be undefined at a point (or defined to be some other value at that point) but whose \(y\)-values are approaching a certain number as \(x\) gets close to some number. Let's look at two examples.

Example What happens to \(f(x) = \dfrac{x^2-4}{x-2}\) near \(x = 2\)?

Plugging in \(x=2\) gives \(\frac{4-4}{2-2} = \frac00\), which is undefined. So instead we plug in numbers close to 2:

\(x\)1.91.991.99922.0012.012.1
\(f(x)\)3.93.993.999undefined4.0014.014.1

From both sides, the outputs are getting closer and closer to 4. In fact \(\frac{x^2-4}{x-2} = \frac{(x+2)(x-2)}{x-2} = x+2\) for \(x\neq2\), so the graph is the line \(y = x+2\) with a hole at \((2,4)\).

Example What happens to \(g(x) = \dfrac{x-1}{x-2}\) near \(x = 2\)?

Plugging in \(x=2\) gives \(\frac10\), which is undefined. Plugging in numbers close to 2:

\(x\)1.91.991.99999922.0000012.012.1
\(g(x)\)\(-9\)\(-99\)\(-999{,}999\)undefined\(1{,}000{,}001\)\(101\)\(11\)

This time the outputs do not settle down. As \(x\to2\) from the left (numbers less than 2), \(g(x)\) heads to \(-\infty\); from the right (numbers bigger than 2), \(g(x)\) heads to \(+\infty\). The graph has a vertical asymptote at \(x = 2\).

The Definition of a Limit

Definition We say \[ \lim_{x\to a} f(x) = L \] ("the limit of \(f(x)\) as \(x\) approaches \(a\) is \(L\)") if \(f(x)\) gets really close to \(L\) as \(x\) gets close to, but not equal to, \(a\). If the values do not approach one single number, or they approach \(+\infty\) or \(-\infty\), we say the limit does not exist (DNE).

Sometimes the function approaches one number from one side and a different number from the other side. We use one-sided limits to express this.

Definition (One-Sided Limits) The little \(-\) or \(+\) is not a negative or positive number; it only tells you which side you approach from.
When Does a Limit Exist? \[ \lim_{x\to a} f(x) \text{ exists} \quad\Longleftrightarrow\quad \lim_{x\to a^-} f(x) = \lim_{x\to a^+} f(x), \] and in that case \(\lim_{x\to a} f(x)\) equals this common value. If \(\lim_{x\to a^-} f(x) \neq \lim_{x\to a^+} f(x)\), then \(\lim_{x\to a}f(x)\) does not exist.
Remark A limit only cares about what happens near \(a\), never at \(a\). The value \(f(a)\) can be different from the limit, or \(f(a)\) might not exist at all. On a graph, the limit is the \(y\)-value the curve is heading toward; \(f(a)\) is the \(y\)-value of the filled-in dot at \(x = a\).

Limits from a Graph

Example Use the graph of \(f\) below to evaluate the limits at \(a = 1,\ 2,\ 3\).
1231234xy
Open circles at \((1,2)\) and \((3,1)\); a filled dot at \((1,3)\)
\(a=1\)\(a=2\)\(a=3\)
\(\lim_{x\to a^-}f(x)\)241
\(\lim_{x\to a^+}f(x)\)341
\(\lim_{x\to a}f(x)\)DNE (\(2\neq3\))41
\(f(a)\)34undefined

At \(a=1\) the curve coming from the left heads to the open circle at height 2, while the piece on the right starts at the filled dot at height 3. At \(a = 3\) both sides head to height 1, so the limit is 1, even though there is no dot there (the point is not filled in).

Example Use the graph of \(g\) below to evaluate the limits.
−1123123xy
\(y=g(x)\): open circles at \((0,1)\) and \((1,0)\); filled dots at \((0,2)\) and \((1,2)\)
\[ \lim_{x\to0^-}g(x) = 1, \quad \lim_{x\to0^+}g(x) = 1, \quad \lim_{x\to0}g(x) = 1, \quad g(0) = 2, \] \[ \lim_{x\to1^-}g(x) = 2, \quad \lim_{x\to1^+}g(x) = 0, \quad \lim_{x\to1}g(x) \text{ DNE}, \quad g(1) = 2. \]

At \(x=0\) both sides head to the open circle at height 1, so the limit is 1, even though the dot (the actual value \(g(0)\)) is at height 2.

Self-Check

From Activity 9: Intro to Limits

(a) Let \(f(x) = \dfrac{x^2+x-6}{x-2}\).

  1. Find the domain of \(f(x)\).
  2. Fill in a table of values of \(f(x)\) for \(x = 1.9,\ 1.99,\ 1.999,\ 2.001,\ 2.01,\ 2.1\).
  3. Based on your table, what is \(\lim_{x\to2}f(x)\)? Use algebra to confirm your answer.
  4. Is \(x = 2\) a vertical asymptote or a hole for \(f(x)\)?

(b) Use the graph of \(y=f(x)\) below (a different function) to evaluate each of the following:

−1123123xy
\(y=f(x)\): filled dots at \((0,2)\) and \((1,3)\); open circles at \((0,3)\), \((1,1)\) and \((1,0)\)
\[ \lim_{x\to0^-}f(x), \quad \lim_{x\to0^+}f(x), \quad \lim_{x\to0}f(x), \quad f(0), \quad \lim_{x\to1^-}f(x), \quad \lim_{x\to1^+}f(x), \quad \lim_{x\to1}f(x), \quad f(1). \]
Computing Limits

↑ Back to top
Goals Learn algebraic techniques for evaluating limits, such as direct substitution, factoring, multiplying out, common denominators, and multiplying by the conjugate; evaluate one-sided limits of rational functions and determine whether there are vertical asymptotes and whether the limit is \(+\infty\) or \(-\infty\); evaluate one-sided limits of piecewise functions.

Direct Substitution

The first thing to try is always to plug the value \(x\) is approaching into the function. As long as the function is defined at the point and near the point, the limit equals the function value.

Example \[ \lim_{x\to3}\left(3x^2+2x-1\right) = 3(3)^2 + 2(3) - 1 = 27+6-1 = 32, \qquad \lim_{x\to3}\frac{x+2}{x+3} = \frac{5}{6}. \]

But \(\displaystyle\lim_{x\to3}\frac{x+2}{x-3}\) gives \(\frac{5}{0}\) on direct substitution, so we need to do more work.

After direct substitution, there are three possibilities:

  1. You get a number: that's the limit.
  2. You get \(\dfrac{\text{non-zero}}{0}\): the function is blowing up to \(\pm\infty\) (see below).
  3. You get \(\dfrac00\): this is called an indeterminate form. It doesn't tell you the answer — you have to use algebra to rewrite the function first (see below).

Infinite Limits and Vertical Asymptotes

Non-Zero over Zero If direct substitution gives \(\dfrac{\text{non-zero number}}{0}\), then the limit is \(\pm\infty\) (a special case of "does not exist"), and the function has a vertical asymptote at \(x=a\). To decide between \(+\infty\) and \(-\infty\), compute the one-sided limits: plug in a number a bit smaller than \(a\) (for \(a^-\)) and a bit bigger than \(a\) (for \(a^+\)), and just track the signs of the top and bottom.
Definition If \(\lim_{x\to a}f(x) = \pm\infty\), or either one-sided limit is \(\pm\infty\), then \(f\) has a vertical asymptote at \(x = a\).
Example Evaluate \(\displaystyle\lim_{x\to3^-}\frac{x+2}{x-3}\) and \(\displaystyle\lim_{x\to3^+}\frac{x+2}{x-3}\).

Direct substitution gives \(\frac50\), so each one-sided limit is \(+\infty\) or \(-\infty\).

So \(\frac{x+2}{x-3}\) has a vertical asymptote at \(x=3\), and the two-sided limit does not exist.

Example Evaluate the one-sided limits of \(\dfrac{x-3}{x-2}\) at \(x=2\).

Direct substitution gives \(\frac{-1}{0}\). Near \(x = 2\) the top is about \(-1\) (negative).

\[ \lim_{x\to2^-}\frac{x-3}{x-2} = \frac{(-)}{(-)} = +\infty, \qquad \lim_{x\to2^+}\frac{x-3}{x-2} = \frac{(-)}{(+)} = -\infty. \]

There is a vertical asymptote at \(x = 2\): the graph shoots up on the left of the asymptote and down on the right.

Example Where are the vertical asymptotes of \(f(x) = \dfrac{x^2+6x+5}{x^2+4x+3}\)?

Possible vertical asymptotes are where the denominator is zero. Factoring, \(x^2+4x+3 = (x+1)(x+3)\), so the candidates are \(x=-1\) and \(x = -3\). Check each one with a limit:

\[ \lim_{x\to-1}\frac{(x+1)(x+5)}{(x+1)(x+3)} = \lim_{x\to-1}\frac{x+5}{x+3} = \frac{4}{2} = 2. \]

The limit is a finite number, so \(x = -1\) is a hole, not a vertical asymptote.

\[ \lim_{x\to-3}\frac{x^2+6x+5}{x^2+4x+3} = \frac{9-18+5}{0} = \frac{-4}{0} = \pm\infty. \]

This is non-zero over zero, so \(x = -3\) is a vertical asymptote.

The \(\tfrac00\) Case: Use Algebra

Often (especially in calculus) direct substitution gives \(\frac00\). Then we use algebra — multiplying out, factoring, a common denominator, or multiplying by the conjugate — to cancel the factor causing the zero on the bottom, then try direct substitution again.

Remark Keep writing "\(\lim\)" on every line until you actually plug in. Once the problem factor is gone and you substitute, the "\(\lim\)" goes away.

Factoring

Example Evaluate \(\displaystyle\lim_{x\to3}\frac{x^2-2x-3}{x^2-9}\).

Direct substitution gives \(\frac{9-6-3}{9-9} = \frac00\). Factor the top and bottom, and cancel:

\[ \lim_{x\to3}\frac{(x-3)(x+1)}{(x-3)(x+3)} = \lim_{x\to3}\frac{x+1}{x+3} = \frac46 = \frac23. \]

Common Denominator

Example Evaluate \(\displaystyle\lim_{x\to3}\frac{\frac13-\frac1x}{3-x}\).

Direct substitution gives \(\frac{\frac13-\frac13}{0} = \frac00\). Our goal is to remove the \(3-x\) from the bottom. First combine the small fractions on top using the common denominator \(3x\):

\[ \frac13-\frac1x = \frac{x}{3x} - \frac{3}{3x} = \frac{x-3}{3x}. \]

Dividing by \(3-x\) is the same as multiplying by \(\frac{1}{3-x}\), and \(3-x = -(x-3)\):

\[ \lim_{x\to3}\frac{x-3}{3x}\cdot\frac{1}{3-x} = \lim_{x\to3}\frac{x-3}{3x\cdot(-(x-3))} = \lim_{x\to3}\frac{1}{-3x} = -\frac19. \]
Example Evaluate \(\displaystyle\lim_{x\to0}\left(\frac1x + \frac{5}{x(x-5)}\right)\).

Each piece blows up as \(x\to0\), giving "\(\pm\infty \pm\infty\)," which is another indeterminate form. Our goal is to cancel the \(x\) on the bottom. Use the common denominator \(x(x-5)\):

\[ \lim_{x\to0}\left(\frac{x-5}{x(x-5)} + \frac{5}{x(x-5)}\right) = \lim_{x\to0}\frac{x-5+5}{x(x-5)} = \lim_{x\to0}\frac{x}{x(x-5)} = \lim_{x\to0}\frac{1}{x-5} = -\frac15. \]

Multiplying by the Conjugate

Definition The conjugate of \(a + b\) is \(a - b\) (change one sign). When one of the terms is a square root, multiplying an expression by its conjugate gets rid of the square root, because \((a+b)(a-b) = a^2-b^2\).
Example The conjugate of \(1+\sqrt3\) is \(1-\sqrt3\), and \[ (1+\sqrt3)(1-\sqrt3) = 1 - \sqrt3 + \sqrt3 - \sqrt3\cdot\sqrt3 = 1-3 = -2, \]

with no more radicals. To clear the radical from the numerator of \(\frac{5-\sqrt3}{6}\) ("rationalize the numerator"), multiply by the "special 1" \(\frac{5+\sqrt3}{5+\sqrt3}\):

\[ \frac{5-\sqrt3}{6}\cdot\frac{5+\sqrt3}{5+\sqrt3} = \frac{25-3}{6(5+\sqrt3)} = \frac{22}{6(5+\sqrt3)}. \]
Example Evaluate \(\displaystyle\lim_{x\to5}\frac{\sqrt x-\sqrt5}{x-5}\).

Direct substitution gives \(\frac00\), and there are square roots on top, so multiply top and bottom by the conjugate \(\sqrt x+\sqrt5\). Don't multiply out the bottom — we want to keep the \(x-5\) so it can cancel:

\[ \lim_{x\to5}\frac{(\sqrt x-\sqrt5)(\sqrt x+\sqrt5)}{(x-5)(\sqrt x+\sqrt5)} = \lim_{x\to5}\frac{x-5}{(x-5)(\sqrt x+\sqrt5)} = \lim_{x\to5}\frac{1}{\sqrt x+\sqrt5} = \frac{1}{\sqrt5+\sqrt5} = \frac{1}{2\sqrt5}. \]

One-Sided Limits of Piecewise Functions

For a piecewise function, the left-hand limit at a break point uses the piece for \(x\) values less than the break point, and the right-hand limit uses the piece for \(x\) values greater than it.

Example Let \[ f(x) = \begin{cases} 3x-2 & x \ge 2,\\[1mm] \dfrac{x^2-4}{x-2} & x < 2.\end{cases} \]

Find \(\lim_{x\to2^+}f(x)\), \(\lim_{x\to2^-}f(x)\), and \(\lim_{x\to2}f(x)\).

For \(x\to2^+\) (numbers bigger than 2), use the top piece: \(\lim_{x\to2^+}f(x) = 3(2)-2 = 4\).

For \(x\to2^-\) (numbers less than 2), use the bottom piece. Plugging in gives \(\frac00\), so do more work:

\[ \lim_{x\to2^-}\frac{x^2-4}{x-2} = \lim_{x\to2^-}\frac{(x+2)(x-2)}{x-2} = \lim_{x\to2^-}(x+2) = 4. \]

The one-sided limits are equal, so \(\lim_{x\to2}f(x) = 4\).

Example Find \(b\) so that \(\lim_{x\to2}f(x)\) exists, where \[ f(x) = \begin{cases} 3x+b & x < 2,\\ x^2+4x & x > 2,\\ 5 & x = 2.\end{cases} \]

The limit exists when the two one-sided limits are equal.

\[ \lim_{x\to2^-}f(x) = 3(2)+b = 6+b, \qquad \lim_{x\to2^+}f(x) = 2^2+4(2) = 12. \]

We need \(6 + b = 12\), so \(b = 6\). With this value, \(\lim_{x\to2}f(x) = 12\). Notice that \(f(2) = 5\) has nothing to do with the limit: the graph has two pieces meeting at an open circle at \((2,12)\), and a lone dot at \((2,5)\).

Self-Check

From the Limits In-Class Worksheet (Problems 6 and 7)

(a) Evaluate \[ \lim_{x\to2}\frac{x-1}{x-2}, \qquad \lim_{x\to2^-}\frac{x-1}{x-2}, \qquad \lim_{x\to2^+}\frac{x-1}{x-2}. \] Where is the vertical asymptote?

(b) Evaluate \(\displaystyle\lim_{x\to0}\frac{(2+x)^2-4}{x}\).

(c) Evaluate \(\displaystyle\lim_{x\to7}\frac{\sqrt{x+2}-3}{x-7}\).

Continuity

↑ Back to top
Goals Learn what it means for a function to be continuous and how we can define continuity using limits; learn about the three types of discontinuities; learn how to make piecewise functions continuous.

The Definition of Continuity

The idea: a function is continuous if you can draw its graph without lifting your pencil. A graph can have sharp corners and still be continuous; what is not allowed is a hole, a jump, or a vertical asymptote.

Definition A function \(f\) is continuous at \(x = a\) if all three of the following hold:
  1. \(f(a)\) is defined;
  2. \(\lim_{x\to a}f(x)\) exists (that is, \(\lim_{x\to a^-}f(x) = \lim_{x\to a^+}f(x)\));
  3. \(\lim_{x\to a}f(x) = f(a)\).
In one line: \(\displaystyle\lim_{x\to a^-}f(x) = \lim_{x\to a^+}f(x) = f(a)\). If any condition fails, \(f\) is discontinuous at \(a\).
Remark Polynomials are continuous everywhere. Rational functions, roots, exponentials and logarithms are continuous everywhere on their domains. So for a formula with no pieces, the only places to check are where the function is undefined (for example, where a denominator is zero). For a piecewise function, also check the break points.
Example Is \(f(x) = \dfrac{x^2-4}{x-2}\) continuous at \(x=2\)?

(1) \(f(2) = \frac{4-4}{2-2} = \frac00\) is undefined (with no limit in front, \(\frac00\) just means we can't evaluate). Condition (1) fails, so \(f\) is not continuous at \(x=2\). Its graph is the line \(y = x+2\) with a hole at \((2,4)\).

Example Is \(f(x) = \begin{cases}-x^2+4 & x\le3,\\ 4x-8 & x>3\end{cases}\) continuous at \(x = 3\)?

(1) \(f(3) = -3^2+4 = -9+4 = -5\). (Use the top piece, since \(3\le3\).)

(2) Does \(\lim_{x\to3}f(x)\) exist?

\[ \lim_{x\to3^-}f(x) = -3^2+4 = -5, \qquad \lim_{x\to3^+}f(x) = 4(3)-8 = 4. \]

Since \(-5\neq4\), the limit does not exist, so \(f\) is not continuous at \(x=3\). (The graph is a downward parabola that jumps up at \(x = 3\).)

Example Compare \[ f(x) = \begin{cases}\dfrac{x^2-4x+3}{x-1} & x\neq1,\\[2mm] 2 & x = 1\end{cases} \qquad\text{and}\qquad g(x) = \begin{cases}\dfrac{x^2-4x+3}{x-1} & x\neq1,\\[2mm] -2 & x = 1.\end{cases} \]

Are they continuous at \(x=1\)? Both have the same formula near \(x = 1\), so they have the same limit:

\[ \lim_{x\to1}\frac{x^2-4x+3}{x-1} = \lim_{x\to1}\frac{(x-1)(x-3)}{x-1} = \lim_{x\to1}(x-3) = -2. \]
Example Is \(f(x) = \begin{cases}\dfrac{1}{x-3} & x\neq3,\\[2mm] 5 & x = 3\end{cases}\) continuous at \(x = 3\)?

(1) \(f(3) = 5\) is defined. (2) \(\lim_{x\to3}\frac{1}{x-3}\) gives \(\frac10 = \pm\infty\), so the limit does not exist. Hence \(f\) is not continuous at \(x = 3\); it has a vertical asymptote there.

Types of Discontinuities

NameSituationPicture
Hole (removable discontinuity)\(\lim_{x\to a}f(x)\) exists, but \(f(a)\) is undefined or \(f(a)\neq\lim_{x\to a}f(x)\)an open circle on an otherwise unbroken curve (possibly with the dot somewhere else)
Jump discontinuity\(\lim_{x\to a^-}f(x)\neq\lim_{x\to a^+}f(x)\) (both finite)the graph jumps to a different height
Infinite discontinuity (vertical asymptote)\(\lim_{x\to a}f(x) = \pm\infty\), or either one-sided limit is \(\pm\infty\)the graph shoots up or down along a vertical line
Remark Jump discontinuities only happen with piecewise functions. For a single formula like a rational function, the only possible discontinuities are holes (factor cancels) and vertical asymptotes (non-zero over zero).

Making Piecewise Functions Continuous

Example Find the values of \(a\) and \(b\) that make the function below continuous at \(x = 3\). \[ f(x) = \begin{cases} x^2+2a & x<3,\\ b & x = 3,\\ 5-2x & x>3.\end{cases} \]

Go through the three conditions.

Step 1. \(f(3)\) exists: \(f(3) = b\).
Step 2. The limit exists: the one-sided limits must be equal.
\[ \lim_{x\to3^-}f(x) = 3^2+2a = 9+2a, \qquad \lim_{x\to3^+}f(x) = 5-2(3) = -1. \] \[ 9+2a = -1 \;\Longrightarrow\; 2a = -10 \;\Longrightarrow\; a = -5. \]
Step 3. The limit equals the function value.
\[ \lim_{x\to3}f(x) = f(3) \;\Longrightarrow\; -1 = b. \]

So \(a = -5\) and \(b = -1\). (Check: the left piece is \(x^2-10\), which equals \(-1\) at \(x=3\); the right piece \(5-2x\) also equals \(-1\) at \(x = 3\).)

Self-Check

From Activity 11: Limits/Continuity

(a) Given the piecewise function \[ f(x) = \begin{cases}\dfrac{x^2+x-2}{x+2} & \text{if } x<-2,\\[2mm] 3x+b & \text{if } x\ge-2,\end{cases} \] where \(b\) is some constant, find the value of \(b\) so that \(f(x)\) is continuous at \(x=-2\). Once computed, what is the domain of \(f(x)\)?

(b) Let \[ g(x) = \begin{cases}\dfrac{-x}{x^2+x} & \text{if } x<0,\\[2mm] 2x-1 & \text{if } 0\le x\le4,\\ x-1 & \text{if } x>4.\end{cases} \] Find every \(x\)-value where \(g(x)\) has a discontinuity, and classify each one (hole, vertical asymptote, or jump). Be sure to check the break points \(x = 0\) and \(x=4\).

Defining the Derivative

↑ Back to top
Goals Revisit the idea of getting tangent lines from a limit of secant lines; define the derivative at a point as the slope of the tangent line at that point; see applications of derivatives such as marginal cost and velocity.

Tangent Lines as Limits of Secant Lines

In Preview of Calculus we found the slope of a secant line and used it to estimate the slope of the tangent line:

\[ m_{\text{sec}} = \frac{f(b)-f(a)}{b-a}. \]

Now we let the second point slide toward the first. Calling the moving point \(x\) and letting \(x\) get close to \(a\):

Definition (Slope of the Tangent Line) The slope of the tangent line to \(f(x)\) at \(x = a\) is \[ m_{\tan} = \lim_{x\to a}\frac{f(x)-f(a)}{x-a}. \]

Alternate form: write the nearby point as \(x = a+h\), where \(h\) is small. Then \(x - a = h\), and \(x\to a\) is the same as \(h\to0\):

\[ m_{\tan} = \lim_{h\to0}\frac{f(a+h)-f(a)}{h}. \]
Example Find the equation of the tangent line to the graph of \(f(x) = x^2\) at \(x=3\).

To write the equation of a line we need a point and a slope.

Point: \((3, f(3)) = (3,9)\).

Slope: use the alternate form with \(a = 3\):

\[ \lim_{h\to0}\frac{f(3+h)-f(3)}{h} = \lim_{h\to0}\frac{(3+h)^2-3^2}{h} = \lim_{h\to0}\frac{9+6h+h^2-9}{h} = \lim_{h\to0}\frac{h(6+h)}{h} = \lim_{h\to0}(6+h) = 6. \]

(Recall \((3+h)^2 = (3+h)(3+h) = 9+6h+h^2\), not \(9 + h^2\).) Using point-slope form:

\[ y - 9 = 6(x-3) \quad\Longrightarrow\quad y = 6x - 18 + 9 = 6x-9. \]
Example Find the slope of the tangent line to the graph of \(f(x) = \dfrac1x\) at \(x=2\). \[ \lim_{h\to0}\frac{f(2+h)-f(2)}{h} = \lim_{h\to0}\frac{\frac{1}{2+h}-\frac12}{h}. \]

Plugging in \(h = 0\) gives \(\frac00\). Combine the fractions on top with the common denominator \(2(2+h)\):

\[ \frac{1}{2+h}-\frac12 = \frac{2}{2(2+h)} - \frac{2+h}{2(2+h)} = \frac{2-2-h}{2(2+h)} = \frac{-h}{2(2+h)}. \]

Dividing by \(h\) is the same as multiplying by \(\frac1h\):

\[ \lim_{h\to0}\frac{-h}{2(2+h)}\cdot\frac1h = \lim_{h\to0}\frac{-1}{2(2+h)} = \frac{-1}{2(2)} = -\frac14. \]

This makes sense: \(\frac1x\) is decreasing at \(x = 2\), so the slope is negative.

The Derivative at a Point

Definition (Important!) The derivative of a function at a point is the slope of the tangent line at that point. We denote the derivative of \(f(x)\) at \(x = a\) by \(f'(a)\) (read "\(f\) prime of \(a\)"). So \[ f'(a) = \lim_{x\to a}\frac{f(x)-f(a)}{x-a} \qquad\text{or}\qquad f'(a) = \lim_{h\to0}\frac{f(a+h)-f(a)}{h}. \] This is called the limit definition of the derivative at the point \(x=a\).
Example Let \(f(x) = 3x^2+2x\). Find \(f'(1)\).

Here \(a = 1\) and \(f(1) = 3+2 = 5\). Using the first form:

\[ f'(1) = \lim_{x\to1}\frac{f(x)-f(1)}{x-1} = \lim_{x\to1}\frac{3x^2+2x-5}{x-1} = \lim_{x\to1}\frac{(3x+5)(x-1)}{x-1} = \lim_{x\to1}(3x+5) = 8. \]
Example Let \(f(x) = \sqrt{2x}\). Find \(f'(2)\). \[ f'(2) = \lim_{h\to0}\frac{f(2+h)-f(2)}{h} = \lim_{h\to0}\frac{\sqrt{2(2+h)}-\sqrt{2\cdot2}}{h} = \lim_{h\to0}\frac{\sqrt{4+2h}-\sqrt4}{h}. \]

This is \(\frac00\) with square roots, so multiply by the conjugate:

\[ \lim_{h\to0}\frac{(\sqrt{4+2h}-\sqrt4)(\sqrt{4+2h}+\sqrt4)}{h(\sqrt{4+2h}+\sqrt4)} = \lim_{h\to0}\frac{(4+2h)-4}{h(\sqrt{4+2h}+\sqrt4)} = \lim_{h\to0}\frac{2h}{h(\sqrt{4+2h}+\sqrt4)} \] \[ = \lim_{h\to0}\frac{2}{\sqrt{4+2h}+\sqrt4} = \frac{2}{2+2} = \frac12. \]

What Does the Derivative Tell Us?

Marginal Cost

Let \(C(x)\) be the cost (in dollars) to produce \(x\) gallons of paint. What does each quantity tell us?

Letting the 0.1 shrink to 0 turns this secant slope into the derivative \(C'(20)\).

Interpretation (Marginal Cost) If \(C(x)\) is the cost to produce \(x\) items, then \(C'(20)\) means: after producing 20 items, the cost to produce the next item (the 21st item) is about \(C'(20)\) dollars. We call \(C'(x)\) the marginal cost.

Velocity

Example Let \(d(t)\) be the distance (in meters) a car has traveled \(t\) seconds after the start of a race. What are \(d(60)\) and \(d'(60)\)?
\(t\)0106061
\(d(t)\)050 m1500 m1503 m

\(d(60) = 1500\): the car has traveled 1500 meters after 60 seconds.

\[ d'(60) \approx \frac{d(61)-d(60)}{61-60} = \frac{1503-1500}{1} = \frac{\text{distance traveled in 1 second}}{1 \text{ second}} = 3 \text{ m/s}. \]

\(d'(60)\) is the velocity (speed) of the car at 60 seconds, in meters per second; here about 3 m/s.

Self-Check

From Activities 12 and 13: Derivatives

(a) Given \(f(x) = x^2-2\), use the limit definition \(f'(a) = \displaystyle\lim_{h\to0}\frac{f(a+h)-f(a)}{h}\) to find \(f'(1)\) and \(f'(2)\).

(b) Suppose a revenue function \(R(x)\) has \(R(20) = 100\), and we have the following data:

\(x\)151617181920
\(\dfrac{R(20)-R(x)}{20-x}\)18.419.0119.819.8519.94undefined

The curve of best fit for \(R(x)\) predicts \(R(20.1) = 102.1\). Use this information to guess the value of \(R'(20)\). What does \(R'(20)\) mean in the context of the problem?

The Derivative as a Function

↑ Back to top
Goals Define the derivative function; sketch the graph of a function's derivative from the graph of the function; determine when a function does not have a derivative at a point; explore higher-order derivatives.

From a Point to a Function

Example Suppose we want the derivative of \(f(x) = 5x^2\) at \(x=1\), \(2\) and \(3\). Using \(f'(a) = \lim_{h\to0}\frac{f(a+h)-f(a)}{h}\) with \(a = 1\): \[ f'(1) = \lim_{h\to0}\frac{5(1+h)^2-5(1)^2}{h} = \lim_{h\to0}\frac{5+10h+5h^2-5}{h} = \lim_{h\to0}\frac{5h(2+h)}{h} = \lim_{h\to0}5(2+h) = 10. \]

Repeating the same work with \(a = 2\) and \(a = 3\) gives \(f'(2) = 20\) and \(f'(3) = 30\). That's a lot of repeated work! Instead, do it once with a general \(x\):

\[ \begin{aligned} f'(x) &= \lim_{h\to0}\frac{f(x+h)-f(x)}{h} = \lim_{h\to0}\frac{5(x+h)^2-5x^2}{h} = \lim_{h\to0}\frac{5(x^2+2xh+h^2)-5x^2}{h}\\ &= \lim_{h\to0}\frac{5x^2+10xh+5h^2-5x^2}{h} = \lim_{h\to0}\frac{h(10x+5h)}{h} = \lim_{h\to0}(10x+5h) = 10x. \end{aligned} \]

Now plug in: \(f'(1) = 10\), \(f'(2) = 20\), \(f'(3) = 30\), all at once.

Definition Let \(f(x)\) be a function. Its derivative function \(f'(x)\) is \[ f'(x) = \lim_{h\to0}\frac{f(x+h)-f(x)}{h}, \] when the limit exists. We say \(f\) is differentiable at \(x = a\) when this limit exists at \(a\).
Using the Limit Definition
  1. Find \(f(x+h)\) by plugging \(x+h\) in for every \(x\) in the formula, and replace \(f(x)\) with the given formula. Put parentheses around \(f(x)\) so the minus sign distributes.
  2. Multiply out (or get a common denominator, or multiply by the conjugate) and simplify. Everything without an \(h\) should cancel.
  3. Factor an \(h\) out of the top and cancel it with the \(h\) on the bottom.
  4. Now plug in \(h = 0\). (Keep writing "\(\lim_{h\to0}\)" until this step.)
Example Let \(f(x) = \sqrt x\). Find \(f'(x)\). \[ f'(x) = \lim_{h\to0}\frac{\sqrt{x+h}-\sqrt x}{h}\cdot\frac{\sqrt{x+h}+\sqrt x}{\sqrt{x+h}+\sqrt x} = \lim_{h\to0}\frac{(x+h)-x}{h(\sqrt{x+h}+\sqrt x)} = \lim_{h\to0}\frac{h}{h(\sqrt{x+h}+\sqrt x)} \] \[ = \lim_{h\to0}\frac{1}{\sqrt{x+h}+\sqrt x} = \frac{1}{\sqrt x+\sqrt x} = \frac{1}{2\sqrt x}. \]

(Multiplying out the top: \((\sqrt{x+h}-\sqrt x)(\sqrt{x+h}+\sqrt x) = (x+h) + \sqrt{x+h}\sqrt x - \sqrt x\sqrt{x+h} - x = h\); the middle terms cancel.)

Example Let \(f(x) = 6\). Find \(f'(x)\). Since \(f(x+h) = 6\) too (there is no \(x\) to replace), \[ f'(x) = \lim_{h\to0}\frac{6-6}{h} = \lim_{h\to0}\frac0h = \lim_{h\to0}0 = 0. \]

(Inside the limit \(h\neq0\), so \(\frac0h = 0\).) This makes sense: the graph of \(y=6\) is a horizontal line, which has slope 0 everywhere.

Example Let \(f(x) = 4x+3\). Find \(f'(x)\). \[ f'(x) = \lim_{h\to0}\frac{4(x+h)+3-(4x+3)}{h} = \lim_{h\to0}\frac{4x+4h+3-4x-3}{h} = \lim_{h\to0}\frac{4h}{h} = 4. \]

Again this makes sense: \(y = 4x+3\) is a line with slope 4 everywhere.

Notation

If we write the function as \(f(x)\), we can write the derivative as

\[ f'(x), \qquad \frac{d}{dx}(f), \qquad \frac{df}{dx}. \]

If we write the function as \(y\) (like \(y = x^2\)), we can write the derivative as

\[ y', \qquad \frac{dy}{dx}. \]

The symbol \(\frac{d}{dx}\) means "take the derivative with respect to \(x\)."

Graphing the Derivative

The derivative \(f'(x)\) is the slope of \(f\) at each point. So to sketch \(f'\) from the graph of \(f\), estimate the slope at each point and plot that number as the \(y\)-value of \(f'\):

Example Below, the solid curve is \(f(x) = x^3-3x\) and the dashed curve is its derivative.
−2−112−224xy
\(f(x)=x^3-3x\) (solid) and \(f'(x)\) (dashed)

Reading \(f\) left to right: it rises (\(f'>0\)) up to a peak at \(x=-1\) (\(f'(-1) = 0\)), falls (\(f'<0\)) down to a valley at \(x = 1\) (\(f'(1) = 0\)), then rises again (\(f'>0\)). It falls most steeply at \(x = 0\), which is where \(f'\) is lowest. (Once we learn the power rule, we can check that \(f'(x) = 3x^2-3\).)

When Is a Function Not Differentiable?

A function fails to have a derivative at \(x = a\) in these situations:

Differentiable Implies Continuous If a function is differentiable at \(x = a\), then it must be continuous at \(x = a\). But not the other way around: \(y = |x|\) is continuous at \(0\) but not differentiable there.

Higher-Order Derivatives

Since \(f'(x)\) is a function, we can take its derivative too, and then take the derivative again, and again.

FunctionFirst derivativeSecond derivativeThird derivative
\(f(x)\)\(f'(x)\)\(f''(x)\)\(f'''(x)\)
\(y\)\(y'\)\(y''\)\(y'''\)
\(f\)\(\dfrac{df}{dx}\)\(\dfrac{d^2f}{dx^2}\)\(\dfrac{d^3f}{dx^3}\)
e.g. \(x^2\)\(2x\)\(2\)\(0\)

(Every derivative after the third derivative of \(x^2\) is also \(0\).) If \(f\) is distance, \(f'\) is velocity and \(f''\) is acceleration (the rate of change of the rate of change).

Self-Check

From Activities 12 and 13: Derivatives

(a) Let \(f(x) = x^2-2\). Determine where the function is continuous. Then use the limit definition \(f'(x) = \displaystyle\lim_{h\to0}\frac{f(x+h)-f(x)}{h}\) to compute \(f'(x)\).

(b) Let \(f(x) = \dfrac{1}{4x}\). Use the limit definition to find \(f'(x)\), and use it to find the equation of the tangent line to \(f(x)\) at \(x=2\).

Derivative Rules

↑ Back to top
Goals Learn the constant, power, sum/difference, and constant multiple rules for derivatives; use them to find tangent lines.

We've seen that (1) the derivative of a function tells us the slope of the tangent line at each point, and (2) we can find the derivative using \(f'(x) = \lim_{h\to0}\frac{f(x+h)-f(x)}{h}\). Now we learn some "short-cut" rules to find derivatives without having to use limits.

The Constant Rule

Constant Rule For any constant \(c\), \[ \frac{d}{dx}(c) = 0. \]

The graph of \(y = c\) is a horizontal line, which has slope 0. For example, if \(f(x) = 3\) then \(f'(x) = 0\); if \(y = 5\) then \(y' = 0\); if \(g(x) = 153e\) then \(g'(x) = 0\) (\(153e\) is just a number).

The Power Rule

We saw (using limits) that \(\frac{d}{dx}(x^2) = 2x\) and \(\frac{d}{dx}(\sqrt x) = \frac{1}{2\sqrt x}\). These are both cases of one rule.

Power Rule For any constant \(n\), \[ \frac{d}{dx}\left(x^n\right) = n\,x^{n-1}. \] "Bring the power down in front, then lower the power by one." This works when \(x\) is in the base and a constant is in the exponent.
Example
  1. \(\dfrac{d}{dx}(x^3) = 3x^2\).
  2. If \(f(x) = x^5\), then \(f'(x) = 5x^4\).
  3. \(\dfrac{d}{dx}\left(\sqrt[3]x\right) = \dfrac{d}{dx}\left(x^{1/3}\right) = \dfrac13x^{1/3-1} = \dfrac13x^{-2/3} = \dfrac{1}{3x^{2/3}} = \dfrac{1}{3\sqrt[3]{x^2}}\).
  4. If \(g(x) = \sqrt[3]{x^5} = x^{5/3}\) (power on top, root on bottom), then \(g'(x) = \dfrac53x^{2/3}\), since \(\frac53-1 = \frac53-\frac33 = \frac23\).
  5. \(\dfrac{d}{dx}(x) = \dfrac{d}{dx}(x^1) = 1\cdot x^0 = 1\). This matches the slope of the line \(y = x\).
Remark Before using the power rule, rewrite roots and fractions as powers of \(x\) (using the exponent rules from Unit 1): \(\sqrt[n]{x^m} = x^{m/n}\) and \(\frac{1}{x^n} = x^{-n}\). For a negative power, subtracting 1 makes it more negative: \(\frac{d}{dx}(x^{-2}) = -2x^{-3}\).

Sum, Difference, and Constant Multiple Rules

Sum and Difference Rules \[ \frac{d}{dx}(f+g) = \frac{df}{dx}+\frac{dg}{dx}, \qquad \frac{d}{dx}(f-g) = \frac{df}{dx}-\frac{dg}{dx}. \]
Constant Multiple Rule For any constant \(c\), \[ \frac{d}{dx}\big[c\,f(x)\big] = c\,\frac{d}{dx}f(x). \]
Remark Constants added or subtracted go away (their derivative is 0). Constants multiplied come along for the ride.
Example \[ \frac{d}{dx}\left[x^2+x-1\right] = \frac{d}{dx}(x^2) + \frac{d}{dx}(x) - \frac{d}{dx}(1) = 2x+1-0 = 2x+1. \] \[ \frac{d}{dx}\left[3x^2\right] = 3\cdot\frac{d}{dx}(x^2) = 3\cdot2x = 6x, \qquad \frac{d}{dx}\left[5x^3\right] = 15x^2, \qquad \frac{d}{dx}\left[3x^2+5x-1\right] = 6x+5. \]
Example Find \(\dfrac{d}{dx}\left[\dfrac{2}{x^2}-2+\dfrac x2\right]\).

Rewrite first: \(\frac{2}{x^2} = 2x^{-2}\) and \(\frac x2 = \frac12x\).

\[ \frac{d}{dx}\left[2x^{-2}-2+\tfrac12x\right] = 2(-2x^{-3}) - 0 + \tfrac12(1) = -4x^{-3}+\frac12 = -\frac{4}{x^3}+\frac12. \]
Example Find the derivative of each function.
\(f(x)\)Rewrite\(f'(x)\)
\(x^{15}\)—\(15x^{14}\)
\(3x^2+4x\)—\(6x+4\)
\(2+\dfrac{5}{x^3}\)\(2+5x^{-3}\)\(-15x^{-4}\)
\(\dfrac{x^3}{8}-16\sqrt x\)\(\tfrac18x^3-16x^{1/2}\)\(\tfrac38x^2-8x^{-1/2}\)
Example Let \(f(x) = \dfrac{x^3+4x-3}{x^2}\). Find \(f'(x)\).

Split the fraction into separate terms (or multiply by \(x^{-2}\)) first:

\[ f(x) = \frac{x^3}{x^2}+\frac{4x}{x^2}-\frac{3}{x^2} = x+4x^{-1}-3x^{-2}, \qquad f'(x) = 1-4x^{-2}+6x^{-3}. \]
Example Let \(f(x) = (x+3)^2\). Find \(f'(x)\).

Multiply out first: \(f(x) = (x+3)(x+3) = x^2+6x+9\), so \(f'(x) = 2x+6\).

Warning: the power rule needs just \(x\) in the base, so don't apply it directly to \((x+3)^2\). For now, multiply out first. (The shortcut for powers of an expression like \((x+3)^2\) is the chain rule, covered later.)

Example Let \(f(x) = (x^2+2x)(x+1)\). Find \(f'(x)\).

We don't have a product rule yet, so multiply out first:

\[ f(x) = x^3+x^2+2x^2+2x = x^3+3x^2+2x, \qquad f'(x) = 3x^2+6x+2. \]

Tangent Lines with the Rules

Example Let \(f(x) = 3x^2+2x+1\).

(a) Find the equation of the tangent line at \(x=2\).

Point: \(f(2) = 3(4)+2(2)+1 = 17\), so \((2,17)\). Slope: \(f'(x) = 6x+2\), so \(f'(2) = 14\).

\[ y-17 = 14(x-2) \quad\Longrightarrow\quad y = 14x-11. \]

(b) Find where the tangent line is horizontal.

A horizontal line has slope 0, so we need the derivative to be 0:

\[ f'(x) = 6x+2 = 0 \;\Longrightarrow\; 6x = -2 \;\Longrightarrow\; x = -\frac13. \]

This is the vertex of the parabola (matching the vertex formula \(x = -\frac{b}{2a} = -\frac{2}{2(3)}\) from Unit 1).

Self-Check

From Activities 14 and 15: Derivatives; Derivative Interpretation and Chain Rule

Compute the derivative of each function.

\[ \text{(a)}\ f(x) = 5x^3+7x-4 \qquad \text{(b)}\ f(x) = 4\sqrt x+14x^2 \qquad \text{(c)}\ f(x) = \frac{x^2-7x}{x^3} \qquad \text{(d)}\ f(x) = 15x^4-\frac{4}{5x^3}+\sqrt[4]{x^3} \]
The Product and Quotient Rules

↑ Back to top
Goals Learn the product and quotient rules; learn to combine various derivative rules.

The Product Rule

Let \(f(x) = x(x^2+1)\). It is tempting to take the derivative of each factor and multiply: \(1\cdot2x = 2x\). This is wrong! How do we know? Multiply out first: \(f(x) = x^3+x\), so \(f'(x) = 3x^2+1\), which is not \(2x\). The derivative of a product is not the product of the derivatives.

Product Rule \[ \frac{d}{dx}\big[g(x)\cdot h(x)\big] = g(x)\cdot h'(x) + g'(x)\cdot h(x). \] "First times derivative of the second, plus derivative of the first times the second."
Example Use the product rule on \(f(x) = x(x^2+1)\). Here \(g(x) = x\), \(g'(x) = 1\), \(h(x) = x^2+1\), \(h'(x) = 2x\). \[ f'(x) = x\cdot\frac{d}{dx}(x^2+1)+\frac{d}{dx}(x)\cdot(x^2+1) = x(2x)+1(x^2+1) = 2x^2+x^2+1 = 3x^2+1. \ ✓ \]
Example \[ f(x) = (x^3+6x+1)(x^2+2x) \;\Longrightarrow\; f'(x) = (x^3+6x+1)(2x+2)+(3x^2+6)(x^2+2x). \] \[ f(x) = x^5(x^2+4x-5) \;\Longrightarrow\; f'(x) = x^5(2x+4)+5x^4(x^2+4x-5). \]

It is fine to leave answers like these unsimplified unless you are asked to simplify.

Example Let \(f(x) = g(x)\cdot h(x)\). What is \(f'(2)\), given the table below?
\(x\)\(g(x)\)\(g'(x)\)\(h(x)\)\(h'(x)\)
23145
\[ f'(2) = g(2)h'(2)+g'(2)h(2) = 3\cdot5+1\cdot4 = 15+4 = 19. \]

The Quotient Rule

Quotient Rule \[ \frac{d}{dx}\left[\frac{f(x)}{g(x)}\right] = \frac{g(x)f'(x)-f(x)g'(x)}{\big(g(x)\big)^2}. \] A way to remember it, calling the top "Hi" and the bottom "Lo": "Lo D-Hi minus Hi D-Lo, all over Lo squared." (D-Hi means the derivative of the top; D-Lo means the derivative of the bottom.)
Remark Order matters in the quotient rule because of the minus sign: always start with "Lo D-Hi." (In the product rule, order doesn't matter since we add.)
Example Find \(\dfrac{d}{dx}\left(\dfrac{x^2+1}{3x+2}\right)\).

Hi: \(x^2+1\); D-Hi: \(2x\); Lo: \(3x+2\); D-Lo: \(3\).

\[ \frac{d}{dx}\left(\frac{x^2+1}{3x+2}\right) = \frac{(3x+2)(2x)-(x^2+1)(3)}{(3x+2)^2} = \frac{6x^2+4x-3x^2-3}{(3x+2)^2} = \frac{3x^2+4x-3}{(3x+2)^2}. \]
Example \[ \frac{d}{dx}\left(\frac{x+1}{2x-5}\right) = \frac{(2x-5)(1)-(x+1)(2)}{(2x-5)^2} = \frac{2x-5-2x-2}{(2x-5)^2} = \frac{-7}{(2x-5)^2}. \]

Combining Rules

Example Let \(f(x) = 2x+x^2(3x+1)+\dfrac{5}{x+1}\). Find \(f'(x)\).

Take each term separately: \(2x\) uses the power rule, \(x^2(3x+1)\) is a product, and \(\frac{5}{x+1}\) is a quotient.

\[ f'(x) = 2+\Big[x^2(3)+(2x)(3x+1)\Big]+\frac{(x+1)(0)-5(1)}{(x+1)^2} = 2+3x^2+2x(3x+1)-\frac{5}{(x+1)^2}. \]
Example Find \(\dfrac{d}{dx}\left(\dfrac{(x+1)(x^2+3x)}{x^2+2x+1}\right)\).

This is a quotient, and the top is itself a product.

\[ \frac{d}{dx}(f) = \frac{(x^2+2x+1)\big[(x+1)(2x+3)+(x^2+3x)\big]-(x+1)(x^2+3x)(2x+2)}{(x^2+2x+1)^2}. \]
Example Take the derivative of each function.
  1. \(f(x) = x^2(3x-1)+2x\): \(\ f'(x) = (x^2)(3)+(2x)(3x-1)+2 = 9x^2-2x+2\).
  2. \(g(x) = \dfrac{3}{x+6}\): \(\ g'(x) = \dfrac{(x+6)(0)-3(1)}{(x+6)^2} = \dfrac{-3}{(x+6)^2}\).
  3. \(h(x) = \dfrac{17x^2+4}{2x+1}\): \(\ h'(x) = \dfrac{(2x+1)(34x)-(17x^2+4)(2)}{(2x+1)^2}\).
  4. \(y = \dfrac{x^2+4x+1}{(x^2+3)(x-2)}\): the bottom is a product, so D-Lo \(= (x^2+3)(1)+(2x)(x-2)\), and \[ y' = \frac{(x^2+3)(x-2)(2x+4)-(x^2+4x+1)\big[(x^2+3)(1)+(2x)(x-2)\big]}{\big((x^2+3)(x-2)\big)^2}. \]
Example Let \(f(x) = \dfrac{g(x)}{h(x)}\). Find \(f'(3)\), given the table below.
\(x\)\(g(x)\)\(g'(x)\)\(h(x)\)\(h'(x)\)
32145
\[ f'(3) = \frac{h(3)g'(3)-g(3)h'(3)}{\big(h(3)\big)^2} = \frac{4(1)-2(5)}{4^2} = \frac{4-10}{16} = -\frac{6}{16} = -\frac38. \]

Self-Check

Practice problems in the style of the lecture examples (no in-class activity for this lecture)

(a) Use the product rule to find the derivative of \(f(x) = (2x^3-x)(x^2+4)\). Check your answer by multiplying out first.

(b) Find the derivative of \(g(x) = \dfrac{x^2-3}{2x+1}\) and simplify the numerator.

(c) Use the table to find \(p'(1)\) and \(q'(1)\), where \(p(x) = f(x)g(x)\) and \(q(x) = \dfrac{f(x)}{g(x)}\).

\(x\)\(f(x)\)\(f'(x)\)\(g(x)\)\(g'(x)\)
12\(-1\)34
Derivatives as Rates of Change

↑ Back to top
Goals Use derivatives to calculate marginal cost, profit and revenue; interpret derivatives in various settings; use derivatives to find the approximate function value for the "next" item.

Marginal Cost, Revenue, and Profit

Example Let \(C(x) = 5x+3\) be the cost to produce \(x\) items. What is \(C'(x)\), and what does it represent?

\(C'(x) = 5\). When \(x\) increases by 1, \(C(x)\) goes up by 5: it costs $5 to produce each extra item. This is the variable (marginal) cost from Unit 1; the 3 is the fixed cost.

Example Now let \(C(x) = x^2+3x+2\). What are \(C'(x)\) and \(C'(2)\), and what do they represent? \[ C'(x) = 2x+3, \qquad C'(2) = 2(2)+3 = 7. \]

At \(x = 2\), the rate of change of cost is $7 per item. In words: after we've produced 2 items, the cost of the next item (the 3rd item) is approximately $7.

Why "the Next Item"?

Return to the limit definition. If we let \(h = 1\) instead of letting it go to 0, we get an approximation:

\[ f'(x) = \lim_{h\to0}\frac{f(x+h)-f(x)}{h} \approx \frac{f(x+1)-f(x)}{1} = f(x+1)-f(x). \]

When \(f\) is cost, \(C(x+1)\) is the cost to produce items \(1,2,\dots,x,x+1\), and \(C(x)\) is the cost to produce items \(1,2,\dots,x\). Subtracting leaves the cost of item number \(x+1\) alone.

Marginal Interpretation If \(C(x)\) is the cost to produce \(x\) items, then \(C'(x)\) is approximately the cost to produce the next, \((x+1)\)st, item. Similarly, \(R'(x)\) (marginal revenue) is approximately the revenue from the next item, and \(P'(x)\) (marginal profit) is approximately the profit from the next item.
Remark (Units) The units of \(f'(x)\) are always \(\dfrac{\text{output units}}{\text{input units}}\). If \(C\) is in dollars and \(x\) is in pounds, then \(C'(x)\) is in dollars per pound.

Approximating the Next Value

Example If \(C(3) = 4\) and \(C'(3) = 2\), where \(x\) is in pounds and \(C\) is in dollars, what is an approximation for \(C(4)\)?

\(C(3) = 4\): it costs $4 to produce 3 lbs. \(C'(3) = 2\): after producing 3 lbs, cost is increasing at a rate of $2 per pound, so the next pound costs about $2.

\[ C(4)\approx C(3)+C'(3) = 4+2 = 6. \]

This idea extends to other settings as well.

Example Let \(P(t)\) be the population of mosquitoes at time \(t\) in days, with \(P(0) = 1000\) and \(P'(0) = 75\).

(a) Approximate \(P(3)\). On day 0 there are 1000 mosquitoes, and the population is increasing by about 75 mosquitoes per day. So

\[ P(1)\approx1075, \qquad P(2)\approx1150, \qquad P(3)\approx1225. \]

(b) Find the equation of the tangent line to \(P(t)\) at \(t=0\). Point: \((0,1000)\). Slope: \(75\).

\[ y-1000 = 75(t-0) \quad\Longrightarrow\quad y = 1000+75t. \]

Notice the estimates in (a) are just points on this tangent line: the tangent line is the "straight-line" approximation of the function near \(t=0\).

Example Let \(p(x) = x^2+3x\) be the profit (in dollars) a company makes after selling \(x\) items. Find and interpret \(p(2)\) and \(p'(2)\).

\(p(2) = 2^2+3(2) = 10\): if we sell 2 items, the profit is $10.

\(p'(x) = 2x+3\), so \(p'(2) = 7\): after selling 2 items, profit is increasing at a rate of $7 per item, so the next (3rd) item will earn a profit of about $7.

Self-Check

From Activities 14 and 15: Derivatives; Derivative Interpretation and Chain Rule

(a) Given the demand function \(p_D(x) = 12-0.5x\), find the marginal revenue (the revenue from producing the next item) at \(x = 5\) items. (Hint: first find the revenue function \(R(x)\).)

(b) Given a cost function \(C(x) = x^2+4x+5\), find \(C'(4)\) and interpret its meaning in the context of the problem.

The Chain Rule

↑ Back to top
Goals State the chain rule; see how the chain rule works with the power rule; apply the chain rule together with the product and quotient rules.

Review: Composition of Functions

Recall from Unit 1 that \((f\circ g)(x) = f(g(x))\): plug the whole function \(g(x)\) in as the input of \(f\). For example, if \(f(x) = x^5\) and \(g(x) = x^2+2\), then \(f(g(x)) = (x^2+2)^5\).

For the chain rule we need to go the other way: given \(h(x)\), find an outside function \(f\) and an inside function \(g\) with \(h(x) = f(g(x))\).

\(h(x)\)Outside \(f(x)\)Inside \(g(x)\)
\((x^2+5x)^3\)\(x^3\)\(x^2+5x\)
\(\sqrt{x^2+5}\)\(\sqrt x\)\(x^2+5\)
\(e^{x^3+2x}\)\(e^x\)\(x^3+2x\)
\(\ln\!\left(\dfrac{x^2+1}{5x}\right)\)\(\ln(x)\)\(\dfrac{x^2+1}{5x}\)

The Chain Rule

Chain Rule The chain rule tells us how to take the derivative of a composition of functions: \[ \frac{d}{dx}\big[f(g(x))\big] = f'(g(x))\cdot g'(x). \] How to think about it: take the derivative of the outside, leave the inside as it is, then multiply by the derivative of what's inside.
Example Find \(\dfrac{d}{dx}\left[(x^2+5x)^3\right]\).

Outside: \(f(x) = x^3\), so \(f'(x) = 3x^2\) and \(f'(g(x)) = 3(x^2+5x)^2\). Inside: \(g(x) = x^2+5x\), so \(g'(x) = 2x+5\).

\[ \frac{d}{dx}\left[(x^2+5x)^3\right] = 3(x^2+5x)^2\cdot(2x+5). \]
Example Find \(\dfrac{d}{dx}\left(\sqrt{x^2+5}\right)\).

Rewrite as \((x^2+5)^{1/2}\). Outside: \(x^{1/2}\), with derivative \(\frac12x^{-1/2}\). Inside: \(x^2+5\), with derivative \(2x\).

\[ \frac{d}{dx}\left(x^2+5\right)^{1/2} = \frac12(x^2+5)^{-1/2}(2x) = \frac{2x}{2\sqrt{x^2+5}} = \frac{x}{\sqrt{x^2+5}}. \]

The Chain Rule with the Power Rule

The most common use of the chain rule is a power of some inside function.

Chain Rule with the Power Rule \[ \frac{d}{dx}\Big[\big(f(x)\big)^n\Big] = n\big(f(x)\big)^{n-1}\cdot f'(x). \]
Example Take the derivative of each function. \[ f(x) = (x^2+3)^5 \;\Longrightarrow\; f'(x) = 5(x^2+3)^4(2x), \qquad g(x) = (6x+1)^4 \;\Longrightarrow\; g'(x) = 4(6x+1)^3(6). \]

For \(h(x) = \dfrac{1}{(6x+3)^3}\), rewrite first so we can use the power rule: \(h(x) = (6x+3)^{-3}\), so

\[ h'(x) = -3(6x+3)^{-4}(6) = \frac{-18}{(6x+3)^4}. \]
Example More practice: \[ \frac{d}{dx}\left(\sqrt{x^2+3}\right) = \frac{d}{dx}(x^2+3)^{1/2} = \frac12(x^2+3)^{-1/2}(2x), \qquad \frac{d}{dx}\left[(x^2+5x)^{8/3}\right] = \frac83(x^2+5x)^{5/3}(2x+5), \] \[ \frac{d}{dx}\left[(x^2+3x+4)^6\right] = 6(x^2+3x+4)^5(2x+3), \qquad \frac{d}{dx}\left[\frac{(x^2+6x)^3}{5}\right] = \frac{d}{dx}\left[\frac15(x^2+6x)^3\right] = \frac35(x^2+6x)^2(2x+6). \]

In the last one, dividing by the constant 5 is the same as multiplying by \(\frac15\), so no quotient rule is needed.

Combining the Chain Rule with Other Rules

Example Find the derivative of each function.

(a) \(f(x) = \dfrac{(x^2+2)^8}{x+2}\). Quotient rule, where D-Hi needs the chain rule: Hi \(= (x^2+2)^8\), D-Hi \(= 8(x^2+2)^7(2x)\), Lo \(= x+2\), D-Lo \(= 1\).

\[ f'(x) = \frac{(x+2)\cdot8(x^2+2)^7(2x)-(x^2+2)^8(1)}{(x+2)^2}. \]

(b) \(g(x) = 16x^2(x+7)^{16}\). Product rule, where the second factor needs the chain rule: \(\frac{d}{dx}(x+7)^{16} = 16(x+7)^{15}(1)\).

\[ g'(x) = (16x^2)\cdot16(x+7)^{15}(1)+32x(x+7)^{16}. \]

(c) \(h(x) = \dfrac{1}{(6x+3)^2}\) — two ways.

Chain rule: \(h(x) = (6x+3)^{-2}\), so \(h'(x) = -2(6x+3)^{-3}(6) = \dfrac{-12}{(6x+3)^3}\).

Quotient rule:

\[ h'(x) = \frac{(6x+3)^2(0)-1\cdot2(6x+3)(6)}{\big((6x+3)^2\big)^2} = \frac{-12(6x+3)}{(6x+3)^4} = \frac{-12}{(6x+3)^3}. \]

Same answer! Rewriting with a negative exponent is usually faster.

Example Find \(\dfrac{d}{dx}\left(\dfrac{\sqrt{3x^2+6}}{2x}\right)\).

Hi: \((3x^2+6)^{1/2}\); D-Hi: \(\frac12(3x^2+6)^{-1/2}(6x)\); Lo: \(2x\); D-Lo: \(2\).

\[ \frac{d}{dx}\left(\frac{\sqrt{3x^2+6}}{2x}\right) = \frac{(2x)\cdot\frac12(3x^2+6)^{-1/2}(6x)-\sqrt{3x^2+6}\,(2)}{(2x)^2}. \]
Example Find \(\dfrac{d}{dx}\left(\dfrac{x^2(x+1)^6}{7x+4}\right)\).

Hi: \(x^2(x+1)^6\). D-Hi needs the product rule and the chain rule: \(x^2\cdot6(x+1)^5(1)+2x(x+1)^6\). Lo: \(7x+4\); D-Lo: \(7\).

\[ \frac{d}{dx}\left(\frac{x^2(x+1)^6}{7x+4}\right) = \frac{(7x+4)\big(x^2\cdot6(x+1)^5+2x(x+1)^6\big)-x^2(x+1)^6(7)}{(7x+4)^2}. \]

Self-Check

From Activities 15 and 16: Derivative Interpretation and Chain Rule; Derivative of Exponential Functions

Find the derivative of each function.

\[ \text{(a)}\ f(x) = \sqrt{3x^2-\frac7x} \qquad\qquad \text{(b)}\ h(x) = (4x^2-3x+2)^{-2} \]
Derivatives of Exponential & Logarithmic Functions

↑ Back to top
Goals Find the derivatives of \(e^x\) and \(\ln(x)\); use the chain rule (and other rules) with \(e^x\) and \(\ln(x)\).

The Derivative of \(e^x\)

Derivative of \(e^x\) \[ \frac{d}{dx}\left(e^x\right) = e^x. \] The function \(e^x\) is its own derivative!
Remark (Power Rule vs. Exponential) Don't mix these up. In \(x^n\) the variable is in the bottom (base) and a number is on top: use the power rule. In \(e^x\) the variable is on top and a number is on the bottom: use the exponential rule. So \(\frac{d}{dx}(e^x)\) is not \(xe^{x-1}\).
Example Find the derivative of each function.
  1. \(f(x) = e^x+5\): \(\ f'(x) = e^x\).
  2. \(f(x) = 3e^x\): \(\ f'(x) = 3e^x\).
  3. \(f(x) = e^{4x}\) (outside \(e^x\), inside \(4x\)): \(\ f'(x) = e^{4x}\cdot\dfrac{d}{dx}(4x) = 4e^{4x}\).
  4. \(f(x) = e^{6x^2+1}\): \(\ f'(x) = e^{6x^2+1}\cdot\dfrac{d}{dx}(6x^2+1) = 12x\,e^{6x^2+1}\).
\(e^x\) with the Chain Rule \[ \frac{d}{dx}\left(e^{f(x)}\right) = e^{f(x)}\cdot f'(x). \] "The exponential stays exactly the same; then multiply by the derivative of the exponent."
Example \[ \frac{d}{dx}\left(e^{x^2+4}\right) = e^{x^2+4}(2x), \qquad \frac{d}{dx}\left(5e^{3x+1}\right) = 5e^{3x+1}(3) = 15e^{3x+1}, \] \[ \frac{d}{dx}\left(\frac{e^{3x}}{x^3+1}\right) = \frac{(x^3+1)(3e^{3x})-e^{3x}(3x^2)}{(x^3+1)^2}. \]

Other Bases

What about an exponential like \(2^x\) with a base other than \(e\)? Since \(a = e^{\ln a}\), we can rewrite \(a^x = \left(e^{\ln a}\right)^x = e^{(\ln a)x}\). The chain rule then gives \(\frac{d}{dx}e^{(\ln a)x} = e^{(\ln a)x}\cdot\ln a\), that is:

Derivative of \(a^x\) \[ \frac{d}{dx}\left(a^x\right) = a^x\ln a, \qquad\text{and with the chain rule,}\qquad \frac{d}{dx}\left(a^{f(x)}\right) = a^{f(x)}\ln(a)\, f'(x). \] (When \(a = e\), \(\ln e = 1\) and we get back \(\frac{d}{dx}e^x = e^x\).)

Continuous Compounding

Recall from Unit 1 that with continuous compounding, \(F(t) = Pe^{rt}\). By the chain rule, \(F'(t) = Pe^{rt}\cdot r = rPe^{rt}\): the rate at which the account grows is \(r\) times the current balance.

The Derivative of \(\ln(x)\)

Derivative of \(\ln x\) \[ \frac{d}{dx}\ln(x) = \frac1x. \]
Example \[ \frac{d}{dx}\left(\ln(x)+x^2\right) = \frac1x+2x, \qquad \frac{d}{dx}\ln(x^2+4) = \frac{1}{x^2+4}\cdot(2x) = \frac{2x}{x^2+4}, \] \[ \frac{d}{dx}\big(\ln(3x+1)+2x\big) = \frac{1}{3x+1}\cdot3+2 = \frac{3}{3x+1}+2. \]
\(\ln x\) with the Chain Rule \[ \frac{d}{dx}\ln\big(f(x)\big) = \frac{f'(x)}{f(x)}. \] "The derivative of the inside, over the inside."
Example Find \(\dfrac{d}{dx}\ln\!\left(\dfrac{x+1}{x-1}\right)\) — two ways.

Chain rule, then quotient rule for the inside:

\[ \frac{1}{\frac{x+1}{x-1}}\cdot\frac{d}{dx}\left(\frac{x+1}{x-1}\right) = \frac{x-1}{x+1}\cdot\frac{(x-1)(1)-(x+1)(1)}{(x-1)^2} = \frac{x-1}{x+1}\cdot\frac{-2}{(x-1)^2} = \frac{-2}{(x+1)(x-1)}. \]

Log rules first: \(\ln\!\left(\frac{x+1}{x-1}\right) = \ln(x+1)-\ln(x-1)\), so the derivative is

\[ \frac{1}{x+1}-\frac{1}{x-1} = \frac{(x-1)-(x+1)}{(x+1)(x-1)} = \frac{-2}{(x+1)(x-1)}. \]

Using log rules first is often much easier.

Example \[ \frac{d}{dx}\ln(3x^2+2) = \frac{6x}{3x^2+2}, \qquad \frac{d}{dx}\left(\ln(x^2+7x)+3x^2\right) = \frac{2x+7}{x^2+7x}+6x, \] \[ \frac{d}{dx}\left(\ln(5x^2+2)\cdot x^3\right) = \ln(5x^2+2)\cdot3x^2+\frac{10x}{5x^2+2}\cdot x^3 \quad\text{(product rule)}. \]

All the Rules in One

Example Find \(f'(x)\) if \(f(x) = \dfrac{(3x+2)^2\ln(x^2+1)}{e^{4x}+1}\).

This is a quotient whose top is a product.

\[ f'(x) = \frac{(e^{4x}+1)\left[(3x+2)^2\dfrac{2x}{x^2+1}+2(3x+2)(3)\ln(x^2+1)\right]-(3x+2)^2\ln(x^2+1)\cdot4e^{4x}}{(e^{4x}+1)^2}. \]
Derivative Rules Summary
\[ \begin{aligned} &\frac{d}{dx}(c) = 0, \qquad \frac{d}{dx}(x^n) = nx^{n-1}, \qquad \frac{d}{dx}\big[cf(x)\big] = cf'(x), \qquad \frac{d}{dx}\big[f\pm g\big] = f'\pm g',\\ &\frac{d}{dx}\big[f(x)g(x)\big] = f(x)g'(x)+f'(x)g(x), \qquad \frac{d}{dx}\left[\frac{f(x)}{g(x)}\right] = \frac{g(x)f'(x)-f(x)g'(x)}{\big(g(x)\big)^2},\\ &\frac{d}{dx}\big[f(g(x))\big] = f'(g(x))\,g'(x), \qquad \frac{d}{dx}\left(e^{f(x)}\right) = e^{f(x)}f'(x), \qquad \frac{d}{dx}\ln\big(f(x)\big) = \frac{f'(x)}{f(x)}. \end{aligned} \]

Self-Check

From Activity 16: Derivative of Exponential Functions

(a) Suppose you open an account with a $1000 initial payment at a 4% interest rate compounded continuously.

  1. Find the amount of money you will have in 10 years.
  2. Find the derivative of \(F(t)\), the function giving the amount in the account after \(t\) years.
  3. What is the interpretation of \(F'(10)\) in the context of the problem?

(b) Find the derivative of each function.

\[ \text{(i)}\ f(x) = \ln\!\left(1-5x^2+\sqrt x\right) \qquad\qquad \text{(ii)}\ g(x) = \frac{2^{5x+7}}{x^3-\frac9x} \]