try
←

Differentiating From First Principles

Practice this lesson in the app →

Expanding the difference quotient and letting h vanish gives the derivative

The difference quotient

Every derivation from first principles starts in the same place. Take a point x on the curve y = f(x) and a second point a step h further along, at x + h. The rise between them is f(x + h) − f(x), and the run is h.

Dividing the rise by the run gives the gradient of the chord: . This is called the difference quotient. The derivative is its limit as h tends to 0: as .

The method has four moves, always in this order: write the rise out in full, simplify it, divide by h, and only then let h tend to 0.

xyh = 1.5rise 5.25(1, 1)(2.5, 6.25)

On , the step from x = 1 to x = 2.5 has run h = 1.5. The rise is f(2.5) − f(1) = 6.25 − 1 = 5.25, so the difference quotient is 5.25 ÷ 1.5 = 3.5, the gradient of the chord.

Write the difference out in full

For , the rise is . Expand the bracket: , and the cancels with the , leaving .

Every term that is left has a factor h. A chord has h not equal to 0, so dividing by h is allowed: . Check it on the chord above: with x = 1 and h = 1.5, 2x + h = 2 + 1.5 = 3.5, the gradient found from the two points.

Only now let h vanish

The chord gradient is now 2x + h, with no h in a denominator. As h tends to 0 it tends to 2x, so f′(x) = 2x. At x = 1 the chord gradients 3.5, 3 and 2.5, for h = 1.5, 1 and 0.5, close in on 2.

The order matters. Putting h = 0 into at the start gives , which is not a number. Dividing first removes the h that makes the denominator 0, and after that, putting h = 0 into 2x + h is safe.

Chords of from x = 1 with h = 1.5, 1 and 0.5, each fainter than the last. Their gradients are 2x + h = 3.5, 3 and 2.5, and they close on the tangent at (1, 1), whose gradient is 2.

A cube

For , the rise is . Expand: , so the rise is once the cancels.

Divide by h: . Every term after the first still carries an h, so as h tends to 0 they tend to 0, and .

Check it at x = 2, where . With h = 0.1 the quotient is , which is . The table shows both sides closing in on 12.

2 to 2 + h2 − h to 20.112.6111.410.0112.060111.94010.00112.00600111.994001

Chord gradients of for chords of width h with one end at x = 2. Each row is one width h; the first column has the chord to the right of 2 and the second the chord to the left. They close in on 12 from above and from below, as says they must.

A line, and a curve lifted by 1

For f(x) = 3x, the rise is 3(x + h) − 3x = 3h, and . No h is left, so there is nothing to wait for: the derivative is 3 at every x. It is not 0, because 3x climbs 3 for every 1 across.

For , the rise is . The two 1s cancel, leaving , exactly as for . So the derivative is 2x again: the + 1 lifts the curve and does not change its gradient anywhere.

A reciprocal

For , the rise is . Put it over the common denominator x(x + h): .

Divide by h: . As h tends to 0, x + h tends to x, so . The minus sign says the curve falls everywhere, for x positive or negative.

Check it at x = 2, where . With h = 0.1 the quotient is ; with h = 0.01 it is −0.248756; with h = 0.001 it is −0.249875.

xy(2, 0.5)

The curve and its tangent at (2, 0.5), the line y = −0.25x + 1. Its gradient is at x = 2, which is −0.25.

A square root

For , the quotient is , and no expansion clears the h. Multiply the numerator and the denominator by . The numerator becomes a difference of two squares: .

So the quotient is , and as h tends to 0 this tends to . At x = 4 that is . With h = 0.1 the quotient is 0.248457, with h = 0.01 it is 0.249844, and with h = 0.001 it is 0.249984.

The usual mistakes

Putting h = 0 before dividing by h. That gives , which decides nothing; the h in the denominator must be divided out first.

Expanding as . The middle term 2xh is lost, and it is the term the derivative comes from.

Writing f(x) + h for f(x + h). For that gives a rise of and a quotient of 1, which is wrong: f(x + h) means x + h put in place of x.

Multiplying by the power without lowering it. For the surviving term is 2xh, one power of x down, so the answer is 2x and not .

Leaving h in the answer. 2x + h is the gradient of a chord; the derivative is its limit, 2x.

A reservoir

In the application below, the depth of a reservoir in a dry spell is centimeters on day x. The rise over a step h is worked out in full, divided by h, and only then is h let tend to 0, giving the rate the depth falls. On day 6 the rain starts, and the quotients from the two sides of day 6 tend to two different numbers.

Rules of Differentiation · A Reservoir Through a Dry Spell and Then Rain: a Derivative from First Principles, and a Day That Has None

QuestionA reservoir is measured every day. For the first 6 days its depth is D = 120 − 0.5x2 centimeters, where x is the number of days since the measurements began. Rain then sets in, and from day 6 onwards the depth is D = 102 + 5(x − 6) centimeters. (a) Differentiate the dry-spell depth from first principles and give the rate on day 4. (b) Show that the depth has no derivative on day 6.

  1. 1.Let f(x) = 120 − 0.5x2 be the depth during the dry spell. Then f(x + h) − f(x) = −0.5[(x + h)2 − x2] = −xh − 0.5h2.

    90100110120130140024681012days, xdepth, cm(4, 112)f(x) = 120 − 0.5x2on the dry days
    For the first six days the depth is f(x) = 120 − 0.5x2, and the dot is day 4.
  2. 2.Divide by the step: f(x + h) − f(x)h = −x − 0.5h.

    90100110120130140024681012days, xdepth, cm(4, 112)hquotient at x = 40.1−4.050.01−4.0050.001−4.0005f(x + h) − f(x) = −xh − 0.5h2divide by h: −x − 0.5h
    The difference over a step h is −xh − 0.5h2, so the quotient is −x − 0.5h.
  3. 3.Let h tend to zero: f'(x) = −x. At x = 4 the quotient is −4.05 for h = 0.1, −4.005 for h = 0.01 and −4.0005 for h = 0.001, closing in on −4.

    90100110120130140024681012days, xdepth, cm(4, 112)hquotient at x = 40.1−4.050.01−4.0050.001−4.0005as h tends to 0, the quotient tends to −x
    The table shows the quotient at x = 4 closing in on −4 as the step shrinks: f'(x) = −x.
  4. 4.(a) On day 4 the depth is falling at 4 centimeters a day, so dDdx = −4 there.

    90100110120130140024681012days, xdepth, cm(4, 112)day 4: the depth falls 4 cm a day
    (a) On day 4 the tangent falls 4 cm for each day: dDdx = −4.
  5. 5.On day 6 the dry-spell piece gives a left-hand quotient tending to f'(6) = −6, while the rain line D = 102 + 5(x − 6) is straight and gives a right-hand quotient of exactly 5.

    90100110120130140024681012days, xdepth, cm−6 cm a day5 cm a day(6, 102)from the left the quotient tends to −6from the right it is exactly 5
    At the corner the dry-spell piece arrives with gradient −6 and the rain line leaves with gradient 5.
  6. 6.(b) The two one-sided rates, −6 and 5 centimeters a day, are different, so there is no derivative on day 6: the graph has a corner. The depth itself is unbroken, because both pieces give 102 centimeters there.

    90100110120130140024681012days, xdepth, cm−6 cm a day5 cm a day(6, 102)the two rates differ: no derivativethe depth is 102 cm from both sides
    (b) The one-sided rates differ, so there is no derivative on day 6. The depth itself is unbroken at 102 cm.

Answer: (a) f'(x) = −x, so the depth is falling at −4 centimeters a day on day 4; (b) the one-sided rates are −6 and 5 centimeters a day, so there is no derivative on day 6

Watch out for

  • Putting h = 0 into the difference quotient before it is simplified. That gives 00, which is no number at all; the h in the denominator must be canceled first.
  • Saying the depth jumps on day 6 because the derivative fails there. A corner and a jump are different: the depth is 102 centimeters from both sides, so it is unbroken, and only its rate disagrees.

Your turn

1.From first principles, differentiate  

through the difference quotient
Practice Differentiating From First Principles in the app