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.
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.
Predict
From first principles, what is the derivative of f(x) = x³?
- x²
- 3x²
- 3x³
- 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.
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
Definition: f′(x) = lim (h→0) [f(x + h) − f(x)]/h with f(x) = x³.
Expand (x + h)³ = x³ + 3x²h + 3xh² + h³ (binomial expansion).
Subtract f(x): f(x + h) − f(x) = 3x²h + 3xh² + h³.
Divide by h (h ≠ 0): 3x² + 3xh + h².
Take the limit h → 0: f′(x) = 3x². The extra terms are the secant's error, which shrinks like h.
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.
Practice
Practice, not a test. Answers are checked on our server; a wrong answer gets a hint and another try. Nothing is saved.
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
- OpenStax Calculus Volume 1 (free, open textbook)
A complete first-year calculus text with worked examples and exercises, free to read online. - MIT OpenCourseWare 18.01SC Single Variable Calculus
Free university course notes, lectures and problem sets for single-variable calculus.