Skip to content
Tactiverge

School/□ Systems Engineer/Week 3

The derivative from first principles

You can find the slope of x³ at any point with nothing but algebra and one limit. Do it once properly and every derivative rule stops being magic.

About 40 min · 3 goals · Checked by automated tests

1.Why should I care?

Rules are fast, but the definition is what you fall back on when a rule does not apply, when you write code that estimates a derivative, or when you need to know why a result is true. It is also exactly what a numerical differentiator computes, just without the limit.

  • ◇ State the definition f′(x) = lim (h→0) [f(x + h) − f(x)]/h.
  • ◇ Differentiate x², x³ and simple polynomials from first principles.
  • ◇ Interpret the derivative as a new function: the slope at every point.

2.Predict

From first principles, what is the derivative of f(x) = x³?

Guess first. Being wrong here is how the surprise works.

3.Discover

Choose the shuttle s = t³ − 6t² + 9t. Put a at 1, then 3: the tangent is flat at both. Shrink h and compare the secant slope with 3a² − 12a + 9 worked by hand. Where is the shuttle momentarily stopped?

Loading the interactive…

Can't use the interactive? Read a description instead

The secant lab plots the shuttle position t³ − 6t² + 9t. At a = 1 and a = 3 the tangent is horizontal (slope zero). As h shrinks, the table's secant slope approaches 3a² − 12a + 9, the slope found from first principles.

4.Checkpoint: guided practice

Check what you just discovered before going on. Hints appear after a wrong answer.

Practice 1

From first principles, find the derivative of f(x) = x² at x = 3. (Hint: simplify [(3 + h)² − 9]/h first.)

5.Understand

The definition

f′(x) = lim (h→0) [f(x + h) − f(x)]/h. The recipe: write f(x + h), subtract f(x), simplify until you can divide every term by h, then let h → 0. If the limit exists, f is differentiable at x.

The derivative is a function

Doing the algebra with a general x gives a new function f′(x) that returns the slope at every point. For the shuttle s = t³ − 6t² + 9t, v(t) = 3t² − 12t + 9 = 3(t − 1)(t − 3), so it stops at t = 1 s and t = 3 s and moves backwards in between.

Notation

f′(x), dy/dx, ds/dt, d/dx[f]: all the same idea. Leibniz's dy/dx reminds you it came from Δy/Δx and carries units: if y is metres and x is seconds, dy/dx is metres per second. ẋ (x with a dot) is used in physics and control for a time derivative.

Explain it another way

Nudge the input by a tiny h, see how much the output moves, and divide. The derivative is that ratio when the nudge is vanishingly small.

Derivation: Differentiating x³ from the definition
  1. Definition: f′(x) = lim (h→0) [f(x + h) − f(x)]/h with f(x) = x³.

  2. Expand (x + h)³ = x³ + 3x²h + 3xh² + h³ (binomial expansion).

  3. Subtract f(x): f(x + h) − f(x) = 3x²h + 3xh² + h³.

  4. Divide by h (h ≠ 0): 3x² + 3xh + h².

  5. Take the limit h → 0: f′(x) = 3x². The extra terms are the secant's error, which shrinks like h.

  6. Same steps for xⁿ: (x + h)ⁿ = xⁿ + n·xⁿ⁻¹h + (terms with h² or higher), so the derivative is n·xⁿ⁻¹: the power rule.

Worked example 1

From first principles, differentiate f(x) = 5x² − x and evaluate at x = 2.

f(x + h) − f(x) = 5(2xh + h²) − h = 10xh + 5h² − h. Divide by h: 10x + 5h − 1 → 10x − 1. At x = 2: 19.

Common mix-ups

  • You can set h = 0 at the start.
    ✓ Setting h = 0 first gives 0/0. You must simplify and cancel h first, then take the limit.
  • The derivative of a function is a single number.
    ✓ f′(a) at one point is a number; f′(x) is a whole function giving the slope everywhere.

6.Practice on your own

Practice, not a test. Wrong answers get a hint and another try.

Practice 2

f(x) = 5x² − x. Using the first-principles result f′(x) = 10x − 1, what is f′(2)?

Practice 3

Which expression is the definition of f′(a)?

Practice 4

The shuttle s = t³ − 6t² + 9t has v = 3t² − 12t + 9. At which time after t = 1 s does it stop again, in seconds?

s

Practice 5 · a fresh version every time

A trolley's position is s(t) = 5t² + 1t metres. What is its average velocity between t = 1 s and t = 1.1 s, in m/s?

m/s

Practice 6 · a fresh version every time

A joint angle follows θ(t) = 2t⁴ − 2t² + 2 radians. Using the power rule, find the angular velocity dθ/dt at t = 0.5 s, in rad/s.

rad/s

7.Apply it

Differentiate f(x) = 1/x from first principles. (Combine the fractions over a common denominator before dividing by h.) Check your answer numerically at x = 2 with h = 0.001.

8.Reflect

9.Go further

Concepts: Derivatives and rates of change · Limits and continuity