# Chapter 2: The Derivative

**Note: The videos for sections 2.1-2.5 were recorded based on an older edition of the book. This means that some of the section numbers I mention will no longer correspond to the same material, and screen-shots may look different. However, the content is essentially the same, and I've tried to put the videos in the correct location based on where the material was moved.**

## Introduction

### Precalculus Idea: Slope and Rate of Change

The slope of a line measures how fast a line rises or falls as we move from left to right along the line. It measures the rate of change of the y-coordinate with respect to changes in the x-coordinate. If the line represents the distance traveled over time, for example, then its slope represents the velocity. In the figure, you can remind yourself of how we calculate slope using two points on the line:

We would like to be able to get that same sort of information (how fast the curve rises or falls, velocity from distance) even if the graph is not a straight line. But what happens if we try to find the slope of a curve, as in the figure below?

We need two points in order to determine the slope of a line. How can we find a slope of a curve, at just one point? The answer, as suggested in the figure, is to find the slope of the tangent line to the curve at that point. Most of us have an intuitive idea of what a tangent line is. Unfortunately, “tangent line” is hard to define precisely.

#### Definition (Secant Line)

A **secant line** is a line between two points on a curve

See the image below:

#### Can't-quite-do-it-yet Definition (Tangent Line)

A **tangent line** is a line at one point on a curve… that does its best to be the curve at that point?

As you may be able to see in the image below, the closer the point \(Q\) is to the point \(P\), the closer the secant slope gets to the tangent slope. This will be key to finding the tangent slope, but first we need to more carefully define the idea of getting closer to.

# Section 2.1: Limits and Continuity

## Limits

In the last section, we saw that as the interval over which we calculated got smaller, the secant slopes approached the tangent slope. The **limit** gives us better language with which to discuss the idea of “approaches.”

The limit of a function describes the behavior of the function when the variable is near, but does not equal, a specified number (see the figure below).

#### Definition (Limit)

If the values of \(f(x)\) get closer and closer, as close as we want, to one number \(L\) as we take values of \(x\) very close to (but not equal to) a number \(c\), then we say "**the limit of \(f(x)\) as \(x\) approaches \(c\) is \(L\)**" and we write \[\lim\limits_{x\to c} f(x)=L.\] The symbol "\( \to \)" means "approaches" or, less formally, "gets very close to".

(This definition of the limit isn't stated as formally as it could be, but it is sufficient for our purposes in this course.)

Note:

- \(f(c)\) is a single number that describes the behavior (value) of \(f(x)\)
**at**the point \(x = c\). - \(\lim\limits_{x\to c} f(x)\) is a single number that describes the behavior of \(f(x)\) near,
**but NOT at**, the point \(x = c\).

If we have a graph of the function near x = c, then it is usually easy to determine \( \lim\limits_{x\to c} f(x) \).

(Here is a link to the pictures used in the following video as well as elsewhere in this chapter: Graphs for Limits and Continuity Examples.)

#### Example 1

Use the graph of \(y = f(x)\) in the figure below to determine the following limits:

- \(\lim\limits_{x\to 1} f(x)\)
- \(\lim\limits_{x\to 2} f(x)\)
- \(\lim\limits_{x\to 3} f(x)\)
- \(\lim\limits_{x\to 4} f(x)\)

- When \(x\) is very close to 1, the values of \(f(x)\) are very close to \(y = 2\). In this example, it happens that \(f(1) = 2\), but that is
**irrelevant**for the limit. The only thing that matters is what happens for \(x\)*close to*1 but \(x \neq 1\). - \(f(2)\) is undefined, but we only care about the behavior of \(f(x)\) for \(x\)
*close to*2 but*not equal to*2. When \(x\) is close to 2, the values of \(f(x)\) are close to 3. If we restrict \(x\) close enough to 2, the values of \(y\) will be as close to 3 as we want, so \( \lim\limits_{x\to 2} f(x) = 3 \). - When \(x\) is close to 3 (or "as \(x\) approaches the value 3"), the values of \(f(x)\) are close to 1 (or "approach the value 1"), so \( \lim\limits_{x\to 3} f(x) = 1 \). For this limit it is completely irrelevant that \(f(3) = 2\), We only care about what happens to \(f(x)\) for \(x\) close to and not equal to 3.
- This one is harder and we need to be careful. When \(x\) is close to 4 and slightly less than 4 (\(x\) is just to the left of 4 on the \(x\)-axis), then the values of \(f(x)\) are close to 2. But if \(x\) is close to 4 and slightly larger than 4 then the values of \(f(x)\) are close to 3. If we only know that \(x\) is very close to 4, then we cannot say whether \(y = f(x)\) will be close to 2 or close to 3–it depends on whether \(x\) is on the right or the left side of 4. In this situation, the \(f(x)\) values are not close to a single number so we say \(f(x)\) does not exist. It is irrelevant that \(f(4) = 1\). The limit, as \(x\) approaches 4, would still be undefined if \(f(4)\) was 3 or 2 or anything else.

We can also explore limits using tables and using algebra.

#### Example 2

Find \( \lim\limits_{x\to 1} \dfrac{2x^2-x-1}{x-1} \).

You might try to evaluate at \(x = 1\), but \(f(x)\) is not defined at \(x = 1\). It is tempting, **but incorrect**, to conclude that this function does not have a limit as \(x\) approaches 1.

__Using tables:__ Trying some "test" values for x which get closer and closer to 1 from both the left and the right, we get

\( x \) | \( f(x) \) |

0.9 | 2.82 |

0.9998 | 2.9996 |

0.999994 | 2.999988 |

0.9999999 | 2.9999998 |

\( \to 1 \) | \( \to 3 \) |

\( x \) | \( f(x) \) |

1.1 | 3.2 |

1.003 | 3.006 |

1.0001 | 3.0002 |

1.000007 | 3.000014 |

\( \to 1 \) | \( \to 3 \) |

The function \(f\) is not defined at \(x = 1\), but when \(x\) is close to 1, the values of \(f(x)\) are getting very close to 3. We can get \(f(x)\) as close to 3 as we want by taking \(x\) very close to 1 so \[\lim\limits_{x\to 1} \dfrac{2x^2-x-1}{x-1}=3.\]

__Using algebra:__ We could have found the same result by noting that \[ f(x)= \dfrac{2x^2-x-1}{x-1} = \dfrac{(2x+1)(x-1)}{(x-1)} = 2x+1\] as long as \(x \neq 1\). (If \(x\neq 1\), then \(x–1 \neq 0\) so it is valid to divide the numerator and denominator by the factor \(x–1\).) The "\(x\to 1\)" part of the limit means that x is close to 1 but not equal to 1, so our division step is valid and \[ \lim\limits_{x\to 1}\dfrac{2x^2-x-1}{x-1} = \lim\limits_{x\to 1} 2x+1 = 3,\] which is our answer.

__Using a graph:__ We can graph \( y=f(x)= \dfrac{2x^2-x-1}{x-1} \) for \(x\) close to 1:

Notice that whenever \(x\) is close to 1, the values of \(y = f(x)\) are close to 3. Since \(f\) is not defined at \(x = 1\), the graph has a hole above \(x = 1\), but we only care about what \(f(x)\) is doing for \(x\) close to but **not equal to** 1.

### One Sided Limits

Sometimes, what happens to us at a place depends on the direction we use to approach that place. If we approach Niagara Falls from the upstream side, then we will be 182 feet higher and have different worries than if we approach from the downstream side. Similarly, the values of a function near a point may depend on the direction we use to approach that point.

#### Definition (Left and Right Limits)

The left limit of \(f(x)\) as \(x\) approaches \(c\) is \(L\) if the values of \(f(x)\) get as close to \(L\) as we want when \(x\) is very close to and **left of \(c\)** (i.e., \(x \lt c\)). We write \[\lim\limits_{x\to c^-} f(x)=L.\]

The right limit of \(f(x)\) as \(x\) approaches \(c\) is \(L\) if the values of \(f(x)\) get as close to \(L\) as we want when \(x\) is very close to and **right of \(c\)** (i.e., \(x \gt c\)). We write \[\lim\limits_{x\to c^+} f(x)=L.\]

#### Example 3

Evaluate the one sided limits of the function \(f(x)\) graphed below at \(x = 0\) and \(x = 1\).

As \(x\) approach 0 from the *left*, the value of the function is getting closer to 1, so \( \lim\limits_{x\to 0^-} f(x) = 1. \)

As \(x\) approaches 0 from the *right*, the value of the function is getting closer to 2, so \( \lim\limits_{x\to 0^+} f(x) = 2. \)

Notice that since the limit from the left and limit from the right are different, the general limit, \( \lim\limits_{x\to 0} f(x) \), does not exit.

At \(x\) approaches 1 from either direction, the value of the function is approaching 1, so \[\lim\limits_{x\to 1^-} f(x) = \lim\limits_{x\to 1^+} f(x) = \lim\limits_{x\to 1} f(x) = 1. \]

## Continuity

A function that is "friendly" and doesn’t have any breaks or jumps in it is called continuous. More formally,

#### Definition (Continuity at a Point)

A function \(f(x)\) is continuous at \(x = a \) if and only if \( \lim\limits_{x\to a} f(x) = f(a)\).

The graph below illustrates some of the different ways a function can behave at and near a point, and the table contains some numerical information about the function and its behavior.

\( a \) | \( f(a) \) | \( \lim\limits_{x\to a} f(x) \) |

1 | 2 | 2 |

2 | 1 | 2 |

3 | 2 | Does not exist (DNE) |

4 | Undefined | 2 |

Based on the information in the table, we can conclude that \(f\) is continuous at 1 since \( \lim\limits_{x\to 1} f(x) = 2 = f(1)\). We can also conclude from the information in the table that \(f\) is not continuous at 2 or 3 or 4, because \( \lim\limits_{x\to 2} f(x) \neq f(2) \), \( \lim\limits_{x\to 3} f(x) \neq f(3) \), and \( \lim\limits_{x\to 4} f(x) \neq f(4) \).

The behaviors at \(x = 2\) and \(x = 4\) exhibit a **hole** in the graph, sometimes called a **removable discontinuity**, since the graph could be made continuous by changing the value of a single point. The behavior at \( x = 3 \) is called a **jump discontinuity**, since the graph jumps between two values. Jump discontinuities and vertial asymptotes are both **nonremovable discontinuities** because they cannot be fixed by changing the value of a single point.

So which functions are continuous? It turns out pretty much every function you’ve studied is continuous where it is defined: **polynomial, radical, rational, exponential, and logarithmic functions are all continuous where they are defined**. Moreover, **any combination of continuous functions is also continuous**.

This is helpful, because the definition of continuity says that for a continuous function, \( \lim\limits_{x\to a} f(x) = f(a) \). That means for a continuous function, we can find the limit by **direct substitution** (evaluating the function) if the function is continuous at \(a\).

#### Example 4

Evaluate using continuity, if possible:

- \( \lim\limits_{x\to 2} x^3-4x \)
- \( \lim\limits_{x\to 2} \dfrac{x-4}{x+3} \)
- \( \lim\limits_{x\to 2} \dfrac{x-4}{x-2} \)

- The given function is polynomial, and is defined for all values of x, so we can find the limit by direct substitution:\[ \lim\limits_{x\to 2} x^3-4x = 2^3-4(2) = 0. \]
- The given function is rational. It is not defined at x = -3, but we are taking the limit as x approaches 2, and the function is defined at that point, so we can use direct substitution:\[ \lim\limits_{x\to 2} \dfrac{x-4}{x+3} = \dfrac{2-4}{2+3}= -\dfrac{2}{5}. \]
- This function is not defined at x = 2, and so is not continuous at x = 2. We cannot use direct substitution.