Step 11: The Derivative from First Principles
- The gradient of a chord is an average rate of change. Slide one end towards the other and the chord gradients settle on the gradient of the tangent: the instantaneous rate of change.
- That limit is the derivative: \( f'(a) = \displaystyle\lim_{h \to 0} \frac{f(a+h)-f(a)}{h} \). It is written \( f'(x) \), \( \dfrac{dy}{dx} \) or \( \dfrac{d}{dx}(\ldots) \).
- A function is differentiable at \( a \) only if the chord gradients from both sides agree on one finite number. Differentiable implies continuous, but a corner, a cusp or a vertical tangent can be continuous and still not differentiable.
- Exam point: from a table you cannot take a limit, so estimate \( f'(a) \) with the chord that straddles \( a \), and always give the units (units of \( y \) per unit of \( x \)).
From chords to tangents
A straight line has one gradient everywhere. A curve does not: \( y = x^2 + 2x \) is gentle near \( x = -1 \) and steep by \( x = 3 \). So what can “the gradient at a point” mean? This step answers that question, and the answer is the single most important idea in calculus.
Start with something you can already measure. A chord joins two points on a curve, and its gradient is rise over run. If the two points are at \( x = a \) and \( x = b \), the chord gradient is
which is the average rate of change of \( f \) over the interval from \( a \) to \( b \). A car that travels 150 km in 2 hours has an average speed of 75 km per hour, even if it sat at traffic lights for part of the time.
Now take the curve \( y = x^2 + 2x \) and the point \( P(1, 3) \). Put the second point at \( x = 1 + h \), a little to the right. The chord gradient is
(Expand the top to get \( 4h + h^2 \), then cancel the \( h \), which is allowed because \( h \neq 0 \).)
With \( h = 2, 1, 0.5, 0.1, 0.01 \) the chord gradients are \( 6, 5, 4.5, 4.1, 4.01 \). They close in on 4, and the chords themselves swing round towards one line through \( P \): the tangent, \( y = 4x-1 \). The gradient of the curve at \( P \) is 4. You never put \( h = 0 \), which would give the meaningless \( \tfrac{0}{0} \); you ask what the chord gradients approach.
Repeat this at a general point \( a \) and you have the definition.
There is a second, equivalent form, which AP Calculus uses often. Call the moving point \( x \) instead of \( a + h \):
Both say the same thing: chord gradient, then limit.
Notation, and reading a limit as a derivative
Write \( y = f(x) \). Three notations are in everyday use, and you need all of them.
| Notation | Read as | Best used for |
|---|---|---|
| \( f'(x) \), \( f'(3) \) | “f dash of x” | the derivative as a function, or its value at a point |
| \( \dfrac{dy}{dx} \) | “dee y by dee x” | naming both variables, for example \( \dfrac{dP}{dt} \) for price over time |
| \( \dfrac{d}{dx}(x^2 + 2x) \) | “the derivative of” | an instruction: differentiate this with respect to \( x \) |
Leibniz’s \( \dfrac{dy}{dx} \) grows out of the chord gradient \( \dfrac{\Delta y}{\Delta x} \): as the change \( \Delta x \) shrinks to nothing, the \( \Delta \)s become \( d \)s. Treat it as one symbol, not a fraction, for now. Because the derivative has a value at every \( x \), it is itself a function, called the derivative function or gradient function.
A favourite AP multiple-choice question runs the definition backwards. You are shown a limit and asked for its value. Spot the pattern “\( f(a+h)-f(a) \) over \( h \)” and the limit is just \( f'(a) \).
Evaluate \( \displaystyle\lim_{h \to 0} \frac{(4+h)^2 + 2(4+h)-24}{h} \) by recognising it as a derivative.
The value of the limit is 10: the gradient of \( y = x^2 + 2x \) at the point \( (4, 24) \).
Differentiation from first principles
Using the definition directly to find \( f'(x) \) is called differentiating from first principles. The method never changes:
| Step | What you do |
|---|---|
| 1 | Write the difference quotient \( \dfrac{f(x+h)-f(x)}{h} \). |
| 2 | Expand, combine fractions or use a conjugate until every term on top has a factor of \( h \). |
| 3 | Cancel the \( h \), which is allowed because \( h \neq 0 \). |
| 4 | Only now let \( h \to 0 \). |
Find \( f'(x) \) from first principles when \( f(x) = 3x^2-x \).
So the gradient at \( x = 2 \) is 11, and the gradient is zero at \( x = \tfrac{1}{6} \), the bottom of this parabola.
When \( f \) is a fraction, combine the two fractions in the numerator over a common denominator before you do anything else.
Differentiate \( f(x) = \dfrac{2}{x} \) from first principles, for \( x \neq 0 \).
The derivative is negative for every \( x \neq 0 \), which fits the graph of \( y = \tfrac{2}{x} \): both branches fall from left to right. For a square root, such as \( \sqrt{x} \), multiply top and bottom by the conjugate \( \sqrt{x+h} + \sqrt{x} \) instead; Q4 below uses this.
An economics example: marginal cost. A firm’s total cost of producing \( Q \) units is \( TC = 200 + 6Q + 0.2Q^2 \) dollars. The cost of raising output from \( Q \) to \( Q + h \) is \( TC(Q+h)-TC(Q) = 6h + 0.4Qh + 0.2h^2 \). Divide by \( h \) and let \( h \to 0 \): the rate at which cost rises is \( 6 + 0.4Q \) dollars per unit. This is marginal cost, \( MC = \dfrac{d(TC)}{dQ} \). At \( Q = 20 \) it is $14 per unit, so the 21st unit costs roughly $14 to make. Notice that the fixed cost of $200 cancelled out completely. That is good economics as well as good algebra: a cost you pay whatever you produce cannot change the cost of one more unit.
Differentiability and continuity
A derivative exists only if the chord gradients settle on the same finite number whether \( h \) shrinks through positive values or through negative ones. Smooth curves pass this test easily. Three kinds of point fail it, even though the curve is unbroken:
| Type | Example at \( x = 0 \) | What the chord gradients do |
|---|---|---|
| Corner | \( |x| \) | \( \dfrac{|h|}{h} \) is \( +1 \) from the right and \( -1 \) from the left: two different limits |
| Cusp | \( x^{2/3} \) | \( h^{-1/3} \) heads to \( +\infty \) from the right and \( -\infty \) from the left |
| Vertical tangent | \( x^{1/3} \) | \( h^{-2/3} \to +\infty \) from both sides: the tangent is the line \( x = 0 \), whose gradient is undefined |
Figure 2 shows a corner in a less obvious place. For \( y = |x^2-4| \), the part of the parabola below the axis is reflected upwards. Just left of \( x = 2 \) the curve is \( 4-x^2 \), with gradient \( -2x \to -4 \); just right of it the curve is \( x^2-4 \), with gradient \( 2x \to 4 \). The two sides disagree, so there is no derivative at \( x = 2 \).
The reason takes one line. For \( h \neq 0 \), \( f(a+h)-f(a) = h \times \dfrac{f(a+h)-f(a)}{h} \). As \( h \to 0 \) this tends to \( 0 \times f'(a) = 0 \), so \( f(a+h) \to f(a) \), which is exactly continuity. Turn it round and you get a useful test: if a function has a jump, a hole or an asymptote at \( a \), it cannot be differentiable there (continuity was covered in Step 10).
\( f(x) = x^2 + 1 \) for \( x \le 2 \) and \( f(x) = ax + b \) for \( x > 2 \). Find \( a \) and \( b \) so that \( f \) is differentiable at \( x = 2 \).
The line \( y = 4x-3 \) is the tangent to \( y = x^2 + 1 \) at \( (2, 5) \), so the join is perfectly smooth. Matching only the values (Step 1) would give a continuous function with a corner.
Estimating derivatives from tables and graphs
Real data rarely come with a formula. When all you have is a table, you cannot let \( h \to 0 \); the best you can do is the gradient of a short chord. The most accurate simple choice is the symmetric (or central) chord, which uses one data point on each side of \( a \):
AP questions say “use the data in the table to estimate” and accept any chord that straddles the point, but the answer must come with units and, often, a sentence of interpretation.
A firm records its total cost \( TC \) (in dollars) at five output levels \( Q \).
| \( Q \) | 10 | 20 | 30 | 40 | 50 |
|---|---|---|---|---|---|
| \( TC \) ($) | 400 | 520 | 670 | 860 | 1100 |
Estimate the marginal cost at \( Q = 30 \), and interpret your answer.
At an output of 30 units, total cost is rising at about $17 per additional unit of output.
A graph lets you go further and sketch the whole derivative function. Read off the gradient of \( y = f(x) \) at many points and plot those gradients as a new curve. Where \( f \) is increasing, \( f’ \) is above the axis. Where \( f \) is decreasing, \( f’ \) is below it. Where \( f \) has a horizontal tangent, such as the top of a hill, \( f’ \) crosses zero. And where \( f \) has a corner, \( f’ \) jumps: for \( |x^2-4| \) in Figure 2, \( f’ \) jumps from \( -4 \) to \( +4 \) at \( x = 2 \).
Practise: 6 questions
Try each one on paper first, then check the worked answer.
EasyQ1. For \( y = x^2 \), find the gradient of the chord from \( x = 3 \) to \( x = 3.1 \). What does this suggest about the gradient of the curve at \( x = 3 \)? Show worked answer
Chord gradient: \( \dfrac{9.61-9}{0.1} = \dfrac{0.61}{0.1} = 6.1 \).
In general the chord from \( 3 \) to \( 3 + h \) has gradient \( \dfrac{(3+h)^2-9}{h} = 6 + h \), which tends to 6.
So the gradient of the curve at \( x = 3 \) is 6.
EasyQ2. Find the average rate of change of \( f(x) = x^3 \) over the interval \( 1 \le x \le 3 \). Show worked answer
\( = \dfrac{27-1}{2} = 13 \).
This is the gradient of the chord joining \( (1, 1) \) to \( (3, 27) \).
MediumQ3. Differentiate \( f(x) = x^2-5x + 2 \) from first principles. Show worked answer
\( f(x+h)-f(x) = 2xh + h^2-5h \).
\( f'(x) = \displaystyle\lim_{h \to 0} \frac{2xh + h^2-5h}{h} = \lim_{h \to 0} (2x + h-5) \).
So \( f'(x) = 2x-5 \).
MediumQ4. Differentiate \( f(x) = \sqrt{x + 3} \) from first principles, for \( x > -3 \). Show worked answer
Multiply top and bottom by the conjugate \( \sqrt{x + h + 3} + \sqrt{x + 3} \).
Top becomes \( (x + h + 3)-(x + 3) = h \), so the quotient is \( \dfrac{1}{\sqrt{x + h + 3} + \sqrt{x + 3}} \).
Let \( h \to 0 \): \( f'(x) = \dfrac{1}{2\sqrt{x + 3}} \).
MediumQ5. The volume of water \( V \) litres in a tank is recorded every 5 minutes: at \( t = 0, 5, 10, 15, 20 \) the readings are \( V = 120, 150, 172, 186, 194 \). Estimate \( V'(10) \), with units, and say what it means. Show worked answer
\( V'(10) \approx \dfrac{186-150}{15-5} = \dfrac{36}{10} = 3.6 \).
Units: litres per minute.
At \( t = 10 \) minutes, the volume of water is increasing at about 3.6 litres per minute.
ExamQ6. The function \( f \) is defined by \( f(x) = kx^2 \) for \( x \le 1 \) and \( f(x) = 3x + m \) for \( x > 1 \), where \( k \) and \( m \) are constants. (a) Given that \( f \) is continuous at \( x = 1 \), write an equation relating \( k \) and \( m \). [1] (b) Given also that \( f \) is differentiable at \( x = 1 \), find \( k \) and \( m \). [3] (c) Using your answers, find the value of \( \displaystyle\lim_{h \to 0} \frac{f(1+h)-f(1)}{h} \). [1] (d) Explain why a function that is differentiable at \( x = 1 \) must be continuous there. [2] Show worked answer
(b) Gradient from the left: \( \dfrac{d}{dx}(kx^2) = 2kx \), which is \( 2k \) at \( x = 1 \). Gradient from the right: 3. [M1]
So \( 2k = 3 \), giving \( k = \tfrac{3}{2} \). [A1]
Then \( m = k-3 = -\tfrac{3}{2} \). [A1]
(c) The limit is \( f'(1) = 3 \). [B1]
(d) \( f(1+h)-f(1) = h \times \dfrac{f(1+h)-f(1)}{h} \). [M1]
As \( h \to 0 \) this tends to \( 0 \times f'(1) = 0 \), so \( f(1+h) \to f(1) \), which is the definition of continuity at \( x = 1 \). [A1]
Total: 7 marks.
Check yourself
1. What is the value of \( \displaystyle\lim_{h \to 0} \frac{(2+h)^3-8}{h} \)?
2. Which function is continuous at \( x = 0 \) but not differentiable there?
3. If \( f \) is differentiable at \( x = a \), which statement must be true?
Your score: 0 out of 3
The short version
- A chord gradient \( \dfrac{f(b)-f(a)}{b-a} \) is an average rate of change; its limit as the chord shrinks is the instantaneous rate of change, the gradient of the tangent.
- \( f'(a) = \displaystyle\lim_{h \to 0} \frac{f(a+h)-f(a)}{h} = \lim_{x \to a} \frac{f(x)-f(a)}{x-a} \). Notation: \( f'(x) \), \( \dfrac{dy}{dx} \), \( \dfrac{d}{dx} \).
- First principles: simplify the difference quotient until the \( h \) cancels, then let \( h \to 0 \). Keep the limit sign on every line.
- Differentiable implies continuous, not the other way round. Corners, cusps and vertical tangents are continuous but not differentiable.
- From a table, estimate \( f'(a) \) with the chord that straddles \( a \), and give units of \( y \) per unit of \( x \).
- The full chapter in Mathematics Made Simple has many more worked examples and a full set of practice questions with a complete answer key.
Further reading on EconTutorials
Related in-depth articles from our blog:
