NOTE: You may view the original PDFs of the notes written in class by clicking on the link for the 1:30 Section or 2:30 Section, respectively.

Lecture 5: The Derivative

GOAL: Become familiar with the limit definition of the derivative. Be able to solve the Tangent Problem for various functions.

We say a line is tangent to an object if it touches it only once. Figures 1 and 2 show lines tangent to a circle and the graph of a function. One of the reasons Calculus was invented was to solve The Tangent Problem (stated below).

Hand-drawn circle centered on crossed axes, with a red dot and radius line on its lower right edge.
Figure 1
A simple hand-drawn diagram showing a rough, slightly irregular circle centered at the intersection of a horizontal and vertical axis, forming a plus-sign shape through the middle. On the lower right portion of the circle's boundary, there is a red dot marking a point on the circle. A red line segment extends diagonally from near the center of the circle outward through this red dot and slightly beyond the circle's edge, suggesting a radius being drawn from the center to the point on the circumference. Partial, cut-off text is visible at the top and bottom of the image, but it is illegible in this crop.
Hand-drawn graph of curve \(f\) with tangent line drawn at point \((c, f(c))\).
Figure 2
A hand-drawn diagram on white paper showing a coordinate axis system with a black horizontal x-axis and vertical y-axis. A black curve labeled \(f\) is plotted, starting from the lower left, rising to a small bump, dipping slightly, rising again to a small local peak near the y-axis, dipping into a shallow valley, and then rising steadily toward the upper right. A red dot marks a point on the curve during its rising portion on the right side, labeled \((c, f(c))\) in red handwriting. A red dashed vertical line drops from this point straight down to the x-axis, meeting it at a point labeled \(c\) in red. A red diagonal line is drawn through the red dot, representing the tangent line to the curve \(f\) at the point \((c, f(c))\), touching the curve at that location and extending slightly below and to the left as well as above and to the right. Additional faint handwriting is visible at the top of the image, partially cut off, including a symbol resembling the letter \(J\) and other markings, as well as a partially visible number at the bottom, possibly a \(0\).

The Tangent Problem

Given a function \( f \) and a point \( c \), determine the equation of the line tangent to \( f \) at the point \( (c, f(c)) \).

Curve with a secant line through the points (c, f(c)) and (c+h, f(c+h)), with horizontal distance h marked.
Figure 3
A hand-drawn graph shows a wavy curve on a set of axes: the curve dips sharply below the horizontal axis on the left, then rises steeply to the right. Two points are marked on the rising portion of the curve. The left point is a red dot labeled \( (c, f(c)) \) and the right point is a black dot labeled \( (c+h, f(c+h)) \). A straight line drawn through both points extends beyond them with arrowheads, representing the secant line. A red horizontal double arrow drawn through the left point represents a new secant direction, labeled New. Below the curve, brackets on the horizontal axis mark the interval from c to \( c+h \), with the width of the interval labeled h and a smaller red bracket labeled h indicating a shorter distance.

We can approximate the solution using a secant line. The slope of the secant line (often called the difference quotient) is the following:

\[ \text{Slope} = \frac{y_2 - y_1}{x_2 - x_1} = \frac{f(c+h) - f(c)}{(c+h) - c} = \frac{f(c+h) - f(c)}{h} \approx \text{Slope of the tangent line} \]

NOTICE:

We get a better approximation by moving closer to \( c \) (make \( h \) smaller). So, to get an exact answer we want to see what the difference quotient approaches as \(h\) gets really really small. I.e., take a limit.

Definition: The derivative of \( f \) at \( x = c \) is defined by

\[ f'(c) \overset{\text{def}}{=} \lim_{h \to 0} \frac{f(c+h) - f(c)}{h} \]

If \( f'(c) \) exists, we say \( f \) is differentiable at \( c \). The symbol "\(f'(c)\)" is read as "\(f\) prime of \(c\)."

NOTE:

  1. Some textbooks use \( \Delta x \) as opposed to \( h \). In particular, our textbook uses \(\Delta x\) just for this and the next section, then uses \(h\) in the subsequent sections as well as the homework.

  2. If \( f'(c) \) exists, then the line with slope \( f'(c) \) containing the point \( (c, f(c)) \)

    \[ y - f(c) = f'(c)(x - c) \]

    is the solution to the Tangent Problem.

Example 1

Find \( f'(1) \) if \( f(x) = 2x + 3 \)

Small sketch of the line through the y-intercept 5 with a tangent arrow at the point where x equals 1.
Figure 4
A small hand-drawn sketch of coordinate axes. The value 5 is labeled on the vertical axis and the value 1 is labeled on the horizontal axis to the right of the origin. A straight line rises steeply from lower left to upper right, crossing the axes region. A dot marks a point on the line above x equals 1, and a red arrow drawn along the line through that dot indicates the tangent direction, with a short red arrowhead pointing down-left as well, showing the line has slope 2.
\[ \begin{gathered} f'(1) = \lim_{h \to 0} \frac{f(1+h) - f(1)}{h} = \lim_{h \to 0} \frac{2(1+h) + 3 - [2(1) + 3]}{h} \\[0.5em] = \lim_{h \to 0} \frac{2 + 2h + 3 - 2 - 3}{h} = \lim_{h \to 0} \frac{2h}{h} = 2 \end{gathered} \] This example highlights that the slope of the line tangent to a line...is the slope of the line itself (matching our intuition).

The Derivative As A Function

In a perfect world, we do not want to repeat the same calculation again whenever we want to find the derivative at a different point. We solve this issue by doing the calculation for an arbitrary \(x\) as opposed to a specific point.

That is, we define a function: \[ f'(x) \overset{\text{def}}{=} \lim_{h \to 0} \frac{f(x+h) - f(x)}{h} \] that has a point \(x\) as input and returns the slope of the tangent line at \(x\) as output.

Example 2(a)

If \( f(x) = x^2 \), find \( f'(x) \)

\begin{align*} f'(x) =&~ \lim_{h \to 0} \frac{(x+h)^2 - x^2}{h}\\ =&~ \lim_{h \to 0} \frac{x^2 + 2xh + h^2 - x^2}{h} \\ =&~ \lim_{h \to 0} \frac{2xh + h^2}{h}\\ =&~ \lim_{h \to 0} [2x + h]\\ =&~ 2x \end{align*}

Example 2(b)

Find the equation of the line tangent to \( x^2 \) at \( x = -1 \)

\begin{align*} \text{Slope: }& f'(-1) = 2(-1) = -2 \\[0.5em] \text{Point: }& (-1, f(-1)) = (-1, (-1)^2) = (-1, 1) \end{align*}
Sketch of the parabola \( x^2 \) with a blue tangent line touching it at the point where \( x = -1 \).
Figure 5
A small hand-drawn sketch in red showing horizontal and vertical axes with the upward-opening parabola labeled \( x^2 \) sitting above the horizontal axis with its vertex at the origin. A blue straight line crosses the graph from upper left to lower right and touches the left branch of the parabola at a single marked blue point, indicating the tangent line at \( x = -1 \). A short blue dashed vertical segment drops from the point of tangency to the horizontal axis, where the tick is labeled \( -1 \).

Now that we have the slope of the tangent and the point where it touches the graph, we can find the equation of the line.

\begin{align*} y - f(1) =&~ f'(1)(x - (-1))\\ y - 1 =&~ -2(x - (-1)) \\[0.5em] y - 1 =&~ -2(x+1) \\[0.5em] y - 1 =&~ -2x - 2 \\[0.5em] y =&~ -2x - 1 \end{align*}

NOTATION: There are many of representing the derivative for a function \( y = f(x) \).

Notation for the derivative and the derivative evaluated at \( c \)
Derivative Evaluated at \( c \)
\( f'(x) \) \( f'(c) \)
\( y' \) \( y'(c) = y' \big|_{x=c} \)
\( \dfrac{df}{dx} = \dfrac{d}{dx}(f(x))\) \( \dfrac{df}{dx} \Big|_{x=c} \)
\( \dfrac{dy}{dx} \) \( \dfrac{dy}{dx} \Big|_{x=c} \)

Example 3

Compute \( \dfrac{d}{dx}(x^3) \)

\[ \begin{array}{ccccccc} & & & 1 & & & \\ & & 1 & & 1 & & \\ & 1 & & 2 & & 1 & \\ 1 & & 3 & & 3 & & 1 \end{array} \]

Here we use the Binomial Theorem (or Pascal's Triangle shown above) to find the coefficients when we expand \((x+h)^3\). You could just compute \((x+h)(x+h)(x+h)\), but that takes a bit of time.

\begin{align*} \frac{d}{dx}(x^3) =&~ \lim_{h \to 0}\frac{(x+h)^3 - x^3}{h}\\ =&~ \lim_{h \to 0} \frac{x^3 + 3x^2h +3xh^2 + h^3 - x^3}{h} \\[0.5em] =&~ \lim_{h \to 0} \frac{3x^2h+ 3xh^2 + h^3}{h}\\ =&~\lim_{h \to 0} \left[ 3x^2 + 3xh + h^2 \right]\\ =&~ 3x^2 \end{align*}

Example 4

Find \( y' \) if \( y = \sqrt{x} \) \( (x > 0) \).

Note that in the difference of squares formula \(a^2 - b^2 = (a-b)(a+b)\), the factors \((a-b)\) and \((a+b)\) are each others' conjugates. So we multiply by the conjugate to get rid of the square roots.

\begin{align*} y' =&~ \lim_{h \to 0} \frac{\sqrt{x+h} - \sqrt{x}}{h}\\ =&~\lim_{h \to 0} \frac{\sqrt{x+h} - \sqrt{x}}{h} \left( \frac{\sqrt{x+h} + \sqrt{x}}{\sqrt{x+h} + \sqrt{x}} \right) \\[0.5em] =&~ \lim_{h \to 0} \frac{(x+h) - (x)}{h\left[\sqrt{x+h} + \sqrt{x}\right]} \\[0.5em] =&~ \lim_{h \to 0} \frac{h}{h\left[\sqrt{x+h} + \sqrt{x}\right]}\\ =&~ \lim_{h \to 0} \frac{1}{\sqrt{x+h} + \sqrt{x}} \\[0.5em] =&~ \frac{1}{2\sqrt{x}} \end{align*}

Question: When does differentiability fail?

Answer 1: If there is a vertical tangent line

Example 5

When is \( \sqrt[3]{x} \) differentiable?

Take for granted \( \dfrac{d}{dx}\left(\sqrt[3]{x}\right) = \dfrac{1}{3\sqrt[3]{x^2}} \). Hence, it is differentiable everywhere except \(0\).

Sketch of the cube root curve with a vertical tangent line at the origin.
Figure 6
A hand-drawn sketch in red showing a horizontal x-axis and the graph of the curve labeled cube root of x. The curve rises steeply through the origin, flattening out toward the upper right and lower left, so that it is nearly vertical at the origin. A dark blue double-headed vertical arrow is drawn through the origin, marking the vertical tangent line at that point, and a small dot marks the origin where the curve and the vertical tangent meet. The label for the curve, \( \sqrt[3]{x} \), is written at the upper right end of the curve.

In this case \(\sqrt[3]{x}\) has a tangent line at \(x=0\), but the slope is undefined since the tangent is completely vertical.

Answer 2: If there is a discontinuity

Theorem

  1. If \( f \) is differentiable at \( c \), then \( f \) is continuous at \( c \).
  2. If \( f \) is discontinuous at \( c \), then it is not differentiable at \( c \).

Example 6

Compute \( \dfrac{d}{dx}\left(\dfrac{1}{x}\right) \)

\begin{align*} \lim_{h \to 0} \frac{\frac{1}{x+h} - \frac{1}{x}}{h} =&~ \lim_{h \to 0} \frac{1}{h}\left[\frac{x}{(x+h)x} - \frac{x+h}{x(x+h)}\right] \\[0.5em] =&~ \lim_{h \to 0} \frac{1}{h}\left[\frac{x - x - h}{x(x+h)}\right]\\ =&~ \lim_{h\to 0} \frac{1}{h}\left[\frac{-h}{x(x+h)}\right]\\ =&~\frac{-1}{x^2} \\[0.5em] \end{align*}

Since \(\frac{1}{x}\) has an asymptote at \(x=0\), it is not differentiable at 0. The fact we divide by 0 if we try to plug 0 into the derivative reinforces this idea. So,

\[ \frac{d}{dx}\left(\frac{1}{x}\right) = \begin{cases} \dfrac{-1}{x^2} & x \ne 0 \\ \text{undefined} & x = 0 \end{cases}\]

Answer 3: If there is any kind of corner or kink

Example 7

Show \( |x|=\begin{cases}x~~\quad& x\geq0\\-x\quad& x<0 \end{cases}\) is not differentiable at \( 0 \).

Sketch of the graph of the absolute value function with a corner at the origin.
Figure 7
A freehand sketch in red of coordinate axes with a horizontal x-axis and a vertical y-axis crossing at the origin, which is marked with a small dot. Two straight rays rise from the origin, one going up and to the left and one going up and to the right, forming a sharp V-shaped corner at the origin. This is the graph of \( y = |x| \), which is continuous at \( 0 \) but has no tangent line there because of the corner.

Since the formula changes at 0, we need to break up the derivative into its left and right limits:

\begin{align*} \lim_{h \to 0^{+}} \frac{|0+h| - |0|}{h}=&~ \lim_{h \to 0^{+}}\frac{|h|}{h}\quad h\text{ is positive here}\\ =&~\lim_{h \to 0^{+}}\frac{h}{h}\\ =&~\lim_{h \to 0^{+}}1\\ =&~1\\ \lim_{h \to 0^{-}} \frac{|0+h| - |0|}{h}=&~ \lim_{h \to 0^{-}}\frac{|h|}{h}\quad h\text{ is negative here}\\ =&~\lim_{h \to 0^{-}}\frac{-h}{h}\\ =&~\lim_{h \to 0^{-}}-1\\ =&~-1 \end{align*}

The left and right limits are unequal, so the derivative does not exist at 0. This is an example of a function that is continuous at 0, but not differentiable at 0. For \(|x|\), 0 is the only trouble spot; redoing the calculation for when \(x>0\) and \(x<0\) we get

\[ \dfrac{d}{dx}(|x|) = \frac{|x|}{x} = \begin{cases}1~~\quad x>0\\\text{undefined}\quad x = 0\\-1\quad x <0 \end{cases} \]