From First Principles

Slide two points together and read the gradient.

Two points h apart

To find the gradient of a curve y = f(x) at a point, start with a chord. Take the point (x, f(x)) and a second point a distance h further along, (x + h, f(x + h)). The run between them is h and the rise is f(x + h) − f(x), so the gradient of the chord is (f(x + h) − f(x)) / h.

On y = x² at x = 1, with h = 1.4, the two points are (1, 1) and (2.4, 5.76). The rise is 5.76 − 1 = 4.76 and the run is 1.4, so the chord gradient is 4.76 ÷ 1.4 = 3.4.

hrise

A chord on y = x² from x = 1 to x = 2.4, with its run h and its rise marked. Its gradient, the rise divided by the run, is 3.4.

The algebra for x²

For f(x) = x², the chord gradient is ((x + h)² − x²) / h. Expand the bracket: (x + h)² = x² + 2xh + h². The x² cancels with the − x², so the numerator is 2xh + h².

Each term of the numerator has a factor h, and h is not 0 for a chord, so divide through by h: (2xh + h²) / h = 2x + h. Check it on the chord above: with x = 1 and h = 1.4, 2x + h = 2 + 1.4 = 3.4.

Shrink h

Keep x = 1 and move the second point closer. With h = 0.9 the chord gradient is 2 + 0.9 = 2.9; with h = 0.45 it is 2.45; with h = 0.2 it is 2.2; with h = 0.01 it is 2.01. Each chord lies closer to the tangent at (1, 1) than the one before.

Check one without the formula: with h = 0.2 the second point is (1.2, 1.44), and (1.44 − 1) ÷ 0.2 = 0.44 ÷ 0.2 = 2.2.

Chords from x = 1 with h = 1.4, 0.9, 0.45 and 0.2, each fainter than the last. Their gradients are 3.4, 2.9, 2.45 and 2.2, closing in on the tangent.

At the limit

As h tends to 0, 2x + h tends to 2x. The chords settle onto the tangent, so the gradient of y = x² at any x is 2x. At x = 1 it is 2, and at x = 3 it is 6: the tangent at (3, 9) has gradient 6.

This limit is called the derivative of f, and it is written f'(x) or dy/dx: f'(x) = the limit of (f(x + h) − f(x)) / h as h tends to 0. Working it out from the chord, as here, is called differentiating from first principles. For f(x) = x², f'(x) = 2x.

At the limit only the tangent at (1, 1) is left. Its gradient is 2x with x = 1, which is 2.

At x = 2

At x = 2 the chord gradient is 2x + h = 4 + h. Slide h down to 0 and the chord becomes the tangent at (2, 4), with gradient 2 × 2 = 4.

12345510152025xyh = 2(4, 16)(2, 4)

the chord’s gradient exceeds f ′(2) by exactly h

Drag the upper point along the curve

Drag the upper point down the curve toward (2, 4). The gap h shrinks, the dashed chord turns toward the tangent, and at h = 0 the gradient is f'(2) = 4.

Two more functions

For the straight line f(x) = 3x + 1, the rise is 3(x + h) + 1 − (3x + 1) = 3h, and 3h / h = 3. No h is left to shrink, so f'(x) = 3 at every x: a straight line has the same gradient everywhere.

For f(x) = x² − 4x, the rise is (x + h)² − 4(x + h) − (x² − 4x) = 2xh + h² − 4h. Dividing by h gives 2x + h − 4, which tends to 2x − 4. At x = 2 the gradient is 0: this is the bottom of the curve, where the tangent is level. Check with h = 0.01: f(2.01) = 4.0401 − 8.04 = −3.9999 and f(2) = −4, so the chord gradient is 0.0001 ÷ 0.01 = 0.01, close to 0.

Why h goes to 0 last

Putting h = 0 into ((x + h)² − x²) / h at the start gives 0 ÷ 0, which has no value: with h = 0 there is only one point, and no chord. The h in the denominator has to be divided out first, while h is still not 0. Only then can h be let tend to 0.

The usual mistakes

Giving the height for the gradient. At x = 3 on y = x² the height is 9, but the gradient is 2x = 6.

Giving x for the gradient of x². The 2 in 2x comes from the 2xh term of the expansion, and it cannot be dropped: at x = 3 the gradient is 6, not 3.

Expanding (x + h)² as x² + h². The middle term 2xh is the one the derivative comes from.

Putting h = 0 before dividing through by h, which gives 0 ÷ 0.

A heated cube

In the application below, a metal cube has volume V = x³ when its edge is x. First principles on x³ gives the rate at which the volume grows with the edge, and that rate estimates the growth for a small change.

Worked example: A Metal Cube Expanding as It Is Heated: How Fast Its Volume Grows, from First Principles

Question A metal cube is heated, and its edge grows. When the edge is x cm long, the volume is V = x3 cm3. (a) Use first principles to show that dVdx = 3x2, and find the rate at which the volume grows with the edge when the edge is 10 cm. (b) Use your answer to estimate the increase in volume when the edge grows from 10 cm to 10.1 cm, and compare the estimate with the exact increase.

  1. 1.When the edge grows from x to x + h, the volume grows by (x + h)3 − x3 = x3 + 3x2h + 3xh2 + h3 − x3 = 3x2h + 3xh2 + h3.

    0600120018006789101112edge of the cube (cm), xvolume in cubic cm, V(10, 1000)(x + h)3− x3= 3x2h + 3xh2+ h3
    0600120018006789101112edge of the cube (cm), xvolume in cubic cm, V(10, 1000)(x + h)3− x3= 3x2h + 3xh2+ h3
    When the edge grows from x to x + h, the volume grows by (x + h)3 − x3 = 3x2h + 3xh2 + h3.
  2. 2.The gradient of the chord is this increase divided by h: 3x2h + 3xh2 + h3h = 3x2 + 3xh + h2. At x = 10 it is 364 for h = 2, 331 for h = 1 and 303.01 for h = 0.1.

    0600120018006789101112edge of the cube (cm), xvolume in cubic cm, V(10, 1000)chord gradient = 3x2+ 3xh + h2x = 10: h = 2 gives 364, h = 1 gives 331
    0600120018006789101112edge of the cube (cm), xvolume in cubic cm, V(10, 1000)chord gradient = 3x2+ 3xh + h2x = 10: h = 2 gives 364, h = 1 gives 331
    Divide by h for the gradient of the chord: 3x2 + 3xh + h2. At x = 10 it is 364 for h = 2, 331 for h = 1 and 303.01 for h = 0.1.
  3. 3.As h tends to zero, 3xh and h2 both tend to zero, so dVdx = limh → 0 (3x2 + 3xh + h2) = 3x2.

    0600120018006789101112edge of the cube (cm), xvolume in cubic cm, V(10, 1000)as h tends to 0, 3xh and h2tend to 0dV/dx = 3x2
    0600120018006789101112edge of the cube (cm), xvolume in cubic cm, V(10, 1000)as h tends to 0, 3xh and h2tend to 0dV/dx = 3x2
    As h tends to zero the chords close in on the tangent, and dVdx = limh → 0 (3x2 + 3xh + h2) = 3x2.
  4. 4.(a) At x = 10, dVdx = 3 × 102 = 300. The volume is growing at 300 cm3 for each centimeter of edge.

    0600120018006789101112edge of the cube (cm), xvolume in cubic cm, Vrun 2rise 600(10, 1000)x = 10: dV/dx = 3 × 102= 300the tangent: a rise of 600 over a run of 2
    0600120018006789101112edge of the cube (cm), xvolume in cubic cm, Vrun 2rise 600(10, 1000)x = 10: dV/dx = 3 × 102= 300the tangent: a rise of 600 over a run of 2
    (a) At x = 10, dVdx = 300: the volume grows at 300 cm3 for each centimeter of edge, the gradient of the tangent at (10, 1000).
  5. 5.(b) For a small change δ x = 0.1, the increase is about dVdx × δ x = 300 × 0.1 = 30 cm3. The exact increase is 10.13 − 103 = 1030.301 − 1000 = 30.301 cm3, so the estimate is short by only 0.301 cm3, about 1%.

    0600120018006789101112edge of the cube (cm), xvolume in cubic cm, Vrun 2rise 600(10, 1000)estimate: 300 × 0.1 = 30 cubic cmexact: 10.13− 103= 30.301 cubic cm
    0600120018006789101112edge of the cube (cm), xvolume in cubic cm, Vrun 2rise 600(10, 1000)estimate: 300 × 0.1 = 30 cubic cmexact: 10.13− 103= 30.301 cubic cm
    (b) For δ x = 0.1 the increase is about 300 × 0.1 = 30 cm3. The exact increase is 30.301 cm3.

Answer: (a) dVdx = 3x2, which is 300 cm3 per cm when x = 10; (b) about 30 cm3, against an exact increase of 30.301 cm3

Common mistakes

  • Writing (x + h)3 = x3 + h3. A bracket cubed has four terms, x3 + 3x2h + 3xh2 + h3, and the derivative comes from the middle two.
  • Putting h = 0 into (x + h)3 − x3h straight away, which gives 00. Divide each term of the top by h first, and only then let h tend to zero.

More introduction to calculus problems, worked step by step →

Practice From First Principles in the app