9B

The derivative as a limit

The tangent as the limit of secants, differentiating from first principles, finding points with a given gradient, and where a function is not differentiable.

In 10A we found tangents by eye or by geometry. That only works for lines and circles. To get the gradient of any curve we need algebra, and the trick is to use a secant, which we can calculate, and slide its second point towards the first.

The tangent as a limit of secants

Take the point $P(x, f(x))$ on a curve and a second point $Q$ a small horizontal distance $h$ further on, at $(x + h, f(x + h))$. The secant $PQ$ has gradient

$$\frac{\text{rise}}{\text{run}} = \frac{f(x + h) - f(x)}{h}$$

As $h$ shrinks, $Q$ slides along the curve towards $P$, and the secant swings round until it lines up with the tangent. We can't put $h = 0$, because the fraction would become $\dfrac00$. Instead we simplify first, and then see what happens as $h$ gets closer and closer to $0$.

The derivative from first principles
$$f'(x) = \lim_{h \to 0} \frac{f(x + h) - f(x)}{h}$$
Secants become the tangent

Orange: y = x². Blue dashed: the secant through x = a and x = a + h.

Try this

Keep $a = 1$. Write down the secant gradient for $h = 2$, $1$, $0.5$ and $0.1$. What number are they approaching? Now set $a = -1.5$ and predict the tangent gradient before you shrink $h$.

Differentiating from first principles

Example 1●●

Differentiate $f(x) = 2x^2 + x$ from first principles.

$f(x + h) = 2x^2 + 4xh + 2h^2 + x + h$
Replace every x with (x + h) and expand.
$f(x + h) - f(x) = 4xh + 2h^2 + h$
Subtract f(x) = 2x² + x. The terms with no h cancel, which always happens.
$\dfrac{f(x + h) - f(x)}{h} = 4x + 2h + 1$
Divide every term by h. Now there's nothing stopping us letting h shrink.
$f'(x) = \lim\limits_{h \to 0}(4x + 2h + 1) = 4x + 1$
As h → 0, the 2h term vanishes.
Example 2●●●

Differentiate $f(x) = \dfrac1x$ from first principles.

$f(x + h) - f(x) = \dfrac{1}{x + h} - \dfrac1x = \dfrac{x - (x + h)}{x(x + h)} = \dfrac{-h}{x(x + h)}$
Subtract the fractions over a common denominator.
$\dfrac{f(x + h) - f(x)}{h} = \dfrac{-1}{x(x + h)}$
Divide by h.
$f'(x) = \lim\limits_{h \to 0}\dfrac{-1}{x(x + h)} = -\dfrac{1}{x^2}$

Points with a given gradient

Once you have $f'(x)$, the question "where is the gradient $m$?" becomes the equation $f'(x) = m$. Solve it for $x$, then substitute into $f(x)$ (not $f'(x)$) for the $y$-coordinate.

Example 3●●

For $f(x) = x^2 - 5x$, the derivative is $f'(x) = 2x - 5$. Find the point where the tangent has gradient $3$.

$2x - 5 = 3$, so $x = 4$.
$f(4) = 16 - 20 = -4$, so the point is $(4, -4)$.
The y-coordinate comes from the curve, f(4).

Where a function is not differentiable

A function is differentiable (or smooth) at $x = a$ if the limit above exists there. This fails in three common ways:

  • A sharp corner, such as $y = |x|$ at $x = 0$. Secants from the right have gradient $1$ and from the left $-1$, so there is no single tangent.
  • A break in the graph (a jump or an asymptote). You can't draw a tangent where the curve isn't joined up.
  • A vertical tangent, such as $y = \sqrt[3]{x}$ at $x = 0$. The gradient would be infinite, which is not a number.

Your turn

Differentiate $f(x) = x^2 - 4x$ from first principles.

Show the working

$f(x + h) - f(x) = (x^2 + 2xh + h^2 - 4x - 4h) - (x^2 - 4x) = 2xh + h^2 - 4h$. Dividing by $h$ gives $2x + h - 4$. As $h \to 0$, $f'(x) = 2x - 4$.

Flashcards
First principles
$f'(x) = \lim\limits_{h \to 0} \dfrac{f(x + h) - f(x)}{h}$
Three ways to fail to be differentiable
A corner, a break, or a vertical tangent.
Practice
  1. Find the gradient of the secant to $y = x^2$ through the points where $x = 1$ and $x = 3$.

  2. The derivative from first principles is defined as:

  3. For $f(x) = x^2$, $\dfrac{f(2 + h) - f(2)}{h}$ simplifies to $4 + h$. Find $f'(2)$.

  4. For $f(x) = 3x^2$, the expression $f(x + h) - f(x)$ simplifies to:

  5. From first principles, $f(x) = x^2 + 5x$ has $f'(x) = 2x + 5$. Find $f'(-1)$.

  6. For $f(x) = x^2 - 6x$, $f'(x) = 2x - 6$. Find the point on the curve where the gradient is $2$, as an ordered pair.

  7. Which function is not differentiable at $x = 0$?

  8. From first principles, $f(x) = x^3$ has $\dfrac{f(x + h) - f(x)}{h} = 3x^2 + 3xh + h^2$. Find $f'(2)$.

  9. Exam style: from first principles, $f(x) = \dfrac1x$ has $f'(x) = -\dfrac{1}{x^2}$. Find the gradient of the tangent at $x = 2$.

  10. Exam style: for $f(x) = x^2 - 4x$, the gradient of the secant between $x = a$ and $x = a + h$ is:

Formula sheet