TactivergeLite

Lite / Engineering Complex Systems / 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 · Full interactive version

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.

Predict

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

  1. x²
  2. 3x²
  3. 3x³
  4. x⁴/4
Guess first, then reveal

(x + h)³ − x³ = 3x²h + 3xh² + h³. Divide by h: 3x² + 3xh + h². As h → 0, only 3x² survives. The derivative function is f′(x) = 3x².

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?

What the interactive shows (text version)

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.

You can also open the interactive on the full site when you have a faster connection.

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

Intuitive

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.

Technical

Differentiability implies continuity, but not the other way round: |x| is continuous at 0 but its difference quotient tends to +1 from the right and −1 from the left.

Mathematical

For a polynomial, f(x + h) = f(x) + f′(x)·h + (terms in h², h³, …). The derivative is the coefficient of h: the best linear approximation f(x + h) ≈ f(x) + f′(x)·h.

Applied

The linear approximation f(x + h) ≈ f(x) + f′(x)·h is how engineers estimate sensitivity: if a resistor's value drifts by 1%, how much does the circuit's output change? The derivative is the sensitivity.

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

Practice

Practice, not a test. Answers are checked on our server; a wrong answer gets a hint and another try. Nothing is saved.

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

s

m/s

rad/s

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.

Reflect

What role does the limit play in the definition of the derivative, and what would go wrong without it?

Write your answer on paper or in your own notes. Lite never stores what you write.

Go further

← From average speed to speed at an instantThe power rule and friends →