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$.
Orange: y = x². Blue dashed: the secant through x = a and x = a + h.
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
Differentiate $f(x) = 2x^2 + x$ from first principles.
Differentiate $f(x) = \dfrac1x$ from first principles.
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.
For $f(x) = x^2 - 5x$, the derivative is $f'(x) = 2x - 5$. Find the point where the tangent has gradient $3$.
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$.
Find the gradient of the secant to $y = x^2$ through the points where $x = 1$ and $x = 3$.
The points are $(1, 1)$ and $(3, 9)$. Gradient $= \dfrac{9 - 1}{3 - 1} = 4$.
The derivative from first principles is defined as:
Rise $f(x + h) - f(x)$ over run $h$, then take the limit as $h \to 0$. Putting $h = 0$ directly gives $\frac00$.
For $f(x) = x^2$, $\dfrac{f(2 + h) - f(2)}{h}$ simplifies to $4 + h$. Find $f'(2)$.
As $h \to 0$, $4 + h \to 4$. So $f'(2) = 4$.
For $f(x) = 3x^2$, the expression $f(x + h) - f(x)$ simplifies to:
$3(x + h)^2 - 3x^2 = 3x^2 + 6xh + 3h^2 - 3x^2 = 6xh + 3h^2$. Dividing by $h$ and letting $h \to 0$ then gives $6x$.
From first principles, $f(x) = x^2 + 5x$ has $f'(x) = 2x + 5$. Find $f'(-1)$.
$f'(-1) = 2(-1) + 5 = 3$.
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.
$2x - 6 = 2$ gives $x = 4$. The $y$-coordinate is $f(4) = 16 - 24 = -8$.
Which function is not differentiable at $x = 0$?
$y = |x|$ has a sharp corner at the origin: gradient $-1$ on the left and $1$ on the right, so no single tangent.
From first principles, $f(x) = x^3$ has $\dfrac{f(x + h) - f(x)}{h} = 3x^2 + 3xh + h^2$. Find $f'(2)$.
As $h \to 0$, $f'(x) = 3x^2$. So $f'(2) = 3 \times 4 = 12$.
Exam style: from first principles, $f(x) = \dfrac1x$ has $f'(x) = -\dfrac{1}{x^2}$. Find the gradient of the tangent at $x = 2$.
$f'(2) = -\dfrac{1}{4} = -0.25$.
Exam style: for $f(x) = x^2 - 4x$, the gradient of the secant between $x = a$ and $x = a + h$ is:
$f(a + h) - f(a) = 2ah + h^2 - 4h$. Dividing by $h$ gives $2a + h - 4$. Only after $h \to 0$ do we get the tangent gradient $2a - 4$.
Coaching Centre