🌌 Calculus Kingdom · Calculus

The Definition of the Derivative

Build the derivative from scratch: an average rate over an interval, the difference quotient, and the limit that turns a secant into a tangent — then estimate it from a table or a graph, and see where a graph has no derivative at all.

In short

  • An average rate of change is the slope of the secant line through two points, (f(b) - f(a))/(b - a). A derivative is the slope of the tangent line at one point, and it is the limit of those secant slopes as the two points slide together.
  • The difference quotient (f(x + h) - f(x))/h is an expression in x and h; the derivative f'(x), its limit as h goes to 0, is an expression in x alone. An h in the final answer means the limit has not been taken.
  • The algebra always runs in the same order: expand (or take a common denominator, or multiply by the conjugate), cancel the h, and only then let h go to 0. Setting h = 0 first gives 0/0 and nothing else.
  • Differentiable implies continuous, but continuous does not imply differentiable: a corner, a cusp, a vertical tangent line or a jump each leaves a point with no derivative.

The odometer and the speedometer

Archmage Newt's spire measures not where a thing is, but how fast it is becoming something else. Every question in this craft is one of two measurements, and telling them apart is most of the work.

An average rate of change looks at two moments and divides. If a cart is at s(2) = 14 metres and at s(6) = 46 metres, then over those four seconds it covered 32 metres, so

average rate = (46 - 14) / (6 - 2) = 32 / 4 = 8 metres per second

That is an odometer reading. It says nothing about what happened in between — the cart may have crawled, then bolted. The number is honest about the whole interval and silent about every instant inside it.

Geometrically, an average rate of change is the slope of the secant line: the straight line through the two points (a, f(a)) and (b, f(b)) of the curve. Rise over run, exactly as for any other line.

average rate of change of f on [a, b] = (f(b) - f(a)) / (b - a)

An instantaneous rate of change is a speedometer reading: how fast the cart is going at one single moment. And that is a strange thing to ask for, because a rate needs two points and an instant offers only one. Divide the change at a single instant by the time it took and you get 0/0, which says nothing at all.

The whole of this craft is the escape from that trap. Instead of asking for the rate at a point, take the average rate over a short interval starting at that point — then shorter, then shorter still — and watch what the answers approach. The number they close in on is the instantaneous rate. It is called the derivative, written f'(a), and it is the slope of the tangent line at that point.

One small marvel worth knowing: for a parabola, the average rate of change over an interval is exactly the instantaneous rate at the midpoint of that interval. For a cubic the two disagree, and the sign of the leading coefficient decides which of them is larger. So the two ideas are related, but they are never the same idea.

The difference quotient

To shrink an interval you need a way of writing "an interval of any width" in one expression. That is what the letter h is for. Start at x, step forward by h, and land at x + h. The interval has width h, the rise is f(x + h) - f(x), and the slope is

(f(x + h) - f(x)) / h

This is the difference quotient. It is not yet a derivative — it is an ordinary secant slope with both ends left as letters, and its value depends on x (where you started) and on h (how far you stepped).

Simplifying it is pure algebra, and it always runs the same way. Take f(x) = 3x2 - 4x + 1.

Step one: write f(x + h). Every x in the rule becomes (x + h), brackets and all.

f(x + h) = 3(x + h)2 - 4(x + h) + 1

Step two: expand. The one expansion that matters is (x + h)2 = x2 + 2xh + h2. That middle term, 2xh, is where the whole subject comes from.

f(x + h) = 3x2 + 6xh + 3h2 - 4x - 4h + 1

Step three: subtract f(x). Everything without an h in it cancels — the 3x2, the -4x, the +1 — and that cancellation is no coincidence. It happens for every function, and it is what rescues the calculation.

f(x + h) - f(x) = 6xh + 3h2 - 4h

Step four: divide by h. Every surviving term carries exactly one factor of h, so take it outside and cancel.

(6xh + 3h2 - 4h) / h = h(6x + 3h - 4) / h = 6x + 3h - 4

That is the simplified difference quotient. Notice what it is: an expression in both x and h. Put x = 2 and h = 0.5 into it and you get the slope of one particular short secant; put in a smaller h and you get another. The h is still there, and it is meant to be.

Notice also what you may not do. You may not set h = 0 before the cancelling, because before the cancelling the expression reads 0/0. Cancel first, then look at h.

Letting h go to zero

Once h has been cancelled out of the denominator the expression is perfectly well behaved at h = 0 — so let h shrink to nothing and see what survives. That limit is the definition of the derivative.

f'(x) = lim h -> 0 (f(x + h) - f(x)) / h

For the example above, 6x + 3h - 4 becomes 6x - 4 as h goes to 0. That is f'(x), a function of x alone: feed it any x and it hands back the slope of the tangent line there.

The h vanishing is the whole point. A difference quotient answers in x and h; a derivative answers in x. If an h survives to your final answer, the limit has not been taken yet.

Three shapes worth practising, because the algebra differs in each.

A cubic needs the fuller expansion (x + h)3 = x3 + 3x2 h + 3x h2 + h3. Subtracting x3 leaves 3x2 h + 3x h2 + h3; dividing by h leaves 3x2 + 3xh + h2; letting h go to 0 leaves 3x2.

A reciprocal, f(x) = c/x, needs a common denominator instead of an expansion.

c/(x + h) - c/x = (cx - c(x + h)) / (x(x + h)) = -ch / (x(x + h))

Dividing by h gives -c / (x(x + h)), and as h goes to 0 the denominator becomes x times x, so f'(x) = -c/x2. The minus sign is not optional: a larger denominator makes the smaller fraction, so the first term really is the smaller of the two.

A square root, f(x) = sqrt(x), has nothing to expand and nothing to factor, so use the conjugate. Multiply top and bottom by sqrt(x + h) + sqrt(x); the top becomes (x + h) - x = h, which cancels the h underneath.

(sqrt(x + h) - sqrt(x)) / h = 1 / (sqrt(x + h) + sqrt(x)) -> 1 / (2 sqrt(x))

Reading the definition backwards. Because the definition has such a rigid shape, a limit that matches it can be recognised on sight. In the limit as h approaches 0 of ((3 + h)2 - 9)/h there is a + h inside a bracket, so a = 3; the bracket is squared, so f(x) = x2; and the number subtracted is 9, which is f(3), so both halves check out. The limit is therefore f'(3), which is 6. There is a second form of the definition worth recognising too,

f'(a) = lim x -> a (f(x) - f(a)) / (x - a)

so the limit as x approaches 2 of (x3 - 8)/(x - 2) is f'(2) for f(x) = x3, which is 12. Recognising the pattern is faster than any factoring.

Estimating from a table or a graph

Real measurements do not arrive as formulas. A cistern's depth is read off a gauge every hour; a graph is handed over with no rule attached. You can still estimate a derivative, because a derivative is a limit of ordinary slopes and a table is full of ordinary slopes.

From a table. Take the rows closest to the point and work out rise over run. If a table gives f(3) = 24 and f(5) = 58, then

f'(4) is about (58 - 24) / (5 - 3) = 34 / 2 = 17

That is the symmetric estimate: one row each side of the point, straddling it. It is the better estimate, because the error contributed by the row on the left leans one way and the error from the row on the right leans the other, so the two partly cancel.

At the end of a table there is no row on one side, so a one-sided estimate is all that is available: the nearest single neighbour, and rise over run again. It is a weaker estimate, and it is the best that can be had.

Two habits keep this honest. The run is the change in x between the two rows you actually used — if you straddled the point, that is two steps of the table, not one. And the answer is a rate, not a reading: f(4) is a height, f'(4) is a slope, and they are different kinds of number entirely.

From a graph. Where the graph is a straight segment the derivative is simply the slope of that segment, and it is the same at every point inside it. So to find f'(2), locate the segment that x = 2 lies inside — not the one next door — and take its rise over its run. Where two segments meet, the graph has a corner and there is no derivative at all, which is the next section.

Where the graph is curved, the best that can be done by eye is to draw the tangent line at the point and read its slope from two convenient points on it. That is an estimate, and it should be reported as one.

Where there is no derivative

A derivative is a limit, and limits do not always exist. So there are graphs, and points on them, where f'(a) simply has no value. Four shapes cause it, and each is worth being able to name.

A corner. The graph is joined up, but the slope arriving is not the slope leaving. f(x) = |x - 3| is the standard example: to the left of 3 the slope is -1, to the right it is +1, and no single tangent line fits both. A piecewise rule whose two branches meet at the same height but with different slopes has a corner at the join.

A cusp. A sharper version of the same trouble: the branches are not straight, and their slopes run off to opposite ends as the point is approached. f(x) = (x - 3)2/3 has a cusp at x = 3.

A vertical tangent line. The tangent exists as a line, but it stands vertically, and a vertical line has no slope to report. f(x) = (x - 3)1/3, the cube root, does this at x = 3: the graph climbs steeply through the point with both branches leaning the same way.

A jump. The graph is not even joined up. A piecewise rule whose two branches arrive at different heights at x = a breaks there, and nothing can be tangent to a break.

That last case points straight at the one theorem to remember.

if f is differentiable at x = a, then f is continuous at x = a

Having a tangent line already forces the graph to be joined up, so differentiability is the stronger condition of the two. The reverse does not hold, and the counterexample is the corner: |x - 3| is perfectly continuous at x = 3 and has no derivative there. So "differentiable implies continuous" is a theorem and "continuous implies differentiable" is not, and remembering which way the arrow points is worth more than remembering either sentence on its own.

Worked examples

Example 1

f(x) = 2x2 - 5x + 4. Use the limit definition to find f'(x).

  1. Write f(x + h) by replacing every x with (x + h): f(x + h) = 2(x + h)2 - 5(x + h) + 4.
  2. Expand, using (x + h)2 = x2 + 2xh + h2: f(x + h) = 2x2 + 4xh + 2h2 - 5x - 5h + 4.
  3. Subtract f(x) = 2x2 - 5x + 4. The 2x2, the -5x and the +4 all cancel, leaving f(x + h) - f(x) = 4xh + 2h2 - 5h.
  4. Every surviving term has a factor of h, so divide by h: (4xh + 2h2 - 5h)/h = 4x + 2h - 5.
  5. Now let h go to 0. The 2h term vanishes, so f'(x) = 4x - 5.
  6. Check the shape of the answer: an expression in x alone, with no h left anywhere in it. That is what a derivative looks like.

Example 2

Find the limit as h approaches 0 of ((2 + h)4 - 16)/h.

  1. Compare it with the definition f'(a) = lim h -> 0 (f(a + h) - f(a))/h and read the parts off.
  2. The bracket is (2 + h), so a = 2. The bracket is raised to the fourth power, so f(x) = x4.
  3. Check the other half: f(2) = 24 = 16, which is exactly the number being subtracted. Both halves match, so the limit is f'(2).
  4. For f(x) = x4 the derivative is f'(x) = 4x3, so f'(2) = 4 x 23 = 32.
  5. The limit is 32. Note that 16 was the tempting wrong answer: that is f(2), a height, not a slope.

Example 3

A gauge reads the depth D of a cistern, in metres, at t = 0, 1, 2, 3, 4 hours: 4.2, 5.1, 6.4, 8.1, 10.2. Estimate D'(2) in metres per hour.

  1. A table gives average rates, never instantaneous ones, so use the rows closest to t = 2 and take rise over run.
  2. Straddle the point: use the row before it, D(1) = 5.1, and the row after it, D(3) = 8.1.
  3. Rise: 8.1 - 5.1 = 3.0. Run: 3 - 1 = 2, because two steps of the table were crossed, not one.
  4. D'(2) is about 3.0 / 2 = 1.5 metres per hour.
  5. Sanity check: the depth is climbing, and climbing faster as time goes on, so an estimate sitting between the neighbouring one-hour rises of 1.3 and 1.7 is exactly what to expect.

Practice problems, with solutions

Three problems of increasing difficulty, each with the full working. In the game these are generated fresh every time; these three are fixed so this page always shows the same ones.

Problem 1

Difficulty 1 of 5

f(x) = 2x2 + 2 Find the average rate of change of f from x = 3 to x = 5.

Answer: 16

  1. f(3) = 2(3)2 + 2 = 20
  2. f(5) = 2(5)2 + 2 = 52
  3. Average rate = (52 - 20) / (5 - 3) = 32 / 2
  4. Average rate = 16

Problem 2

Difficulty 3 of 5

f(x) = 4x2 - 7x + 8 Simplify the difference quotient (f(x + h) - f(x))/h. Give your answer as an expression in x and h, with no h left in a denominator.

Answer: 8x + 4h - 7

  1. f(x + h) = 4x2 + 8xh + 4h2 - 7x - 7h + 8
  2. f(x + h) - f(x) = 8xh + 4h2 - 7h
  3. Every term has a factor of h: h(8x + 4h - 7)
  4. Divide by h: 8x + 4h - 7

Problem 3

Difficulty 4 of 5

f(x) = 4x3 - 9 Use the limit definition f'(x) = lim h -> 0 (f(x + h) - f(x))/h to find f'(x). Give your answer as an expression in x.

Answer: 12x2

  1. f(x + h) - f(x) = 4((x + h)3 - x3)
  2. (x + h)3 - x3 = 3x2h + 3xh2 + h3
  3. Divide by h: 12x2 + 12xh + 4h2
  4. Let h -> 0: f'(x) = 12x2

Common mistakes

  • Setting h = 0 too early. Before the h is cancelled the quotient reads 0/0, which carries no information at all. Cancel the h out of the denominator first, and let h go to 0 after that.
  • Leaving the h in the answer. 6x + 3h - 4 is the difference quotient; 6x - 4 is the derivative. When the question says 'using the limit definition', the h terms have to be gone by the end.
  • Losing the middle term of the expansion. (x + h)2 is x2 + 2xh + h2, not x2 + h2, and (x + h)3 carries 3x2 h and 3x h2 as well. Those middle terms are the only ones that survive the subtraction, so losing them loses the whole derivative.
  • Answering with a height instead of a slope. f(4) is where the curve is; f'(4) is how steeply it is climbing. This is the mistake behind answering 16 for the limit of ((2 + h)4 - 16)/h, and behind reading a table value where a rate was asked for.
  • Getting the run wrong in a table estimate. Straddling a point with one row each side crosses two steps of the table, so the run is the distance between those two rows, not the width of a single step.
  • Assuming that a graph with no break has a derivative everywhere. |x - 3| is perfectly joined up at x = 3 and still has no derivative there, because the slope arriving and the slope leaving disagree.

What you should be able to do

  • Find an average rate of change and simplify a difference quotient.
  • Find a derivative from the limit definition.
  • Estimate a derivative from a table of values or a graph, and recognise a limit as a derivative.
  • Tell where a function is not differentiable, and why differentiability implies continuity.

Where this fits in the curriculum

Common Core

  • CHA-2.A

    AP Calculus AB, Unit 2 — Determine average rates of change using difference quotients.

    The Common Core has no calculus standards; this is the AP Calculus AB learning objective.

  • CHA-2.B

    AP Calculus AB, Unit 2 — Represent the derivative of a function as the limit of a difference quotient.

    The Common Core has no calculus standards; this is the AP Calculus AB learning objective.

  • CHA-2.D

    AP Calculus AB, Unit 2 — Estimate derivatives of a function at a point, from a table or a graph.

    The Common Core has no calculus standards; this is the AP Calculus AB learning objective.

  • FUN-2.A

    AP Calculus AB, Unit 2 — Explain the relationship between differentiability and continuity.

    The Common Core has no calculus standards; this is the AP Calculus AB learning objective.

Learn these first