Lite / Textbooks / The Mathematics of Machines / Chapter 6
6. Rates of change
Introduction
Speed is the rate at which position changes; current is the rate at which charge flows. The derivative makes "rate at an instant" precise. This chapter builds it from the slope of a secant line between two nearby points, takes the limit as the gap shrinks, and then collects the rules (power, product and chain) that make derivatives quick to compute.
Figure 6.1. From secant to tangent (described in words)
The curve y = x^2 from x = 0 to 2. A secant line through (1, 1) and (2, 4) has slope 3. The tangent line at (1, 1) has slope 2. As the second point slides towards the first, the secant slope approaches the tangent slope.
Explanation
Built from 5 School lessons. Each part is the lesson's own explanation.
6.1 Limits: where is it heading?
Put x = 0 into sin(x)/x and your calculator says error. Put in 0.001 and it says 0.9999998. What is the function trying to tell you?
What a limit says
lim (x→a) f(x) = L means: you can make f(x) as close to L as you like by taking x close enough to a, from both sides, never needing x = a itself. A limit is about the trend near a point, not the value at it.
Three ways to find one
Numerically: tabulate f(a − h) and f(a + h) for h = 0.1, 0.01, 0.001 and watch both columns. Graphically: zoom in; a smooth function looks like a straight line through the point. Algebraically: simplify (factorise, cancel, expand) until substituting a no longer gives 0/0.
When numbers lie
Computers store about 16 significant digits. For tiny h, f(a + h) − f(a) loses most of its digits to rounding (catastrophic cancellation), so tables go wrong for h around 10⁻⁸ and below. Use h down to about 10⁻⁴, then confirm with algebra.
Derivation: A 0/0 limit by factorising
f(x) = (x² − 4)/(x − 2). At x = 2 this is 0/0: not defined.
Factorise the top: x² − 4 = (x − 2)(x + 2).
For every x ≠ 2, f(x) = (x − 2)(x + 2)/(x − 2) = x + 2. Cancelling is allowed precisely because x − 2 is not zero.
As x → 2, x + 2 → 4. So lim (x→2) f(x) = 4, even though f(2) does not exist. The graph is the line y = x + 2 with a single hole at (2, 4).
Common mix-ups
If substituting gives 0/0, the limit is 0 (or does not exist).
✓ 0/0 is a signal to simplify; the limit can be any number.Smaller h on a computer always gives a better estimate.
✓ Below about 10⁻⁸, rounding error swamps the result. Use moderate h and confirm with algebra.
Open the Lite lesson: Limits: where is it heading?
6.2 From average speed to speed at an instant
Your phone's speedometer shows a speed at one instant. But speed is distance divided by time, and in one instant you travel no distance in no time. How?
Average rate = secant slope
Over an interval [a, a + h], the average rate of change is [f(a + h) − f(a)]/h. Graphically it is the slope of the secant line through the two points. Its units are output units per input unit: metres per second, volts per second, litres per minute.
Instantaneous rate = limit = tangent slope
The instantaneous rate at a is the limit of the average rate as h → 0. Graphically it is the slope of the tangent line, the line the curve hugs when you zoom in. Where the limit exists the function is differentiable at a. This limit is the derivative, written f′(a) or df/dt.
What the gap tells you
For a smooth curve, average minus instantaneous rate is roughly proportional to h: halve the interval, halve the error. That simple fact is what makes numerical rate estimates (week 4) and numerical integration (week 7) predictable, and it is something you can measure in the lab table.
Derivation: The average speed of a falling ball, then its limit
s(t) = 4.9t². Over the interval from t to t + h: Δs = 4.9(t + h)² − 4.9t².
Expand: 4.9(t² + 2th + h²) − 4.9t² = 9.8th + 4.9h².
Average speed = Δs/h = 9.8t + 4.9h (for h ≠ 0).
As h → 0 the second term vanishes: the instantaneous speed is v(t) = 9.8t m/s. At t = 1 s, 9.8 m/s; at 2 s, 19.6 m/s.
The gap between average and instantaneous speed is exactly 4.9h: proportional to h, just as the lab's table shows.
Common mix-ups
Instantaneous speed is 0/0, so it cannot be calculated.
✓ It is the limit of Δs/Δt as Δt → 0, which is a perfectly good number.Average speed over an interval equals the speed at its midpoint, always.
✓ That is only exactly true for quadratics like s = ct². In general they differ.
Open the Lite lesson: From average speed to speed at an instant
6.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.
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.
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.
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.
Open the Lite lesson: The derivative from first principles
6.4 The power rule and friends
One rule, d/dx xⁿ = n·xⁿ⁻¹, differentiates every polynomial you will ever meet. Add sin, cos and eˣ and you can differentiate most engineering models in your head.
Three rules for polynomials
Power: d/dx xⁿ = n·xⁿ⁻¹ (any real n, so √x = x^½ gives ½x^(−½)). Constant multiple: d/dx [c·f] = c·f′. Sum: d/dx [f + g] = f′ + g′. A constant on its own has derivative 0: it does not change.
Three functions to know by heart
d/dx sin x = cos x, d/dx cos x = −sin x (angles in radians), d/dx eˣ = eˣ. The sine result rests on the limit sin(h)/h → 1 from week 2; the exponential result on (eʰ − 1)/h → 1.
Reading f′ from a graph
Where f rises, f′ > 0; where it falls, f′ < 0; at peaks, troughs and flat spots, f′ = 0; where f is steepest, |f′| is largest. You can sketch f′ without any formula, and engineers do this constantly with sensor plots.
Common mix-ups
d/dx eˣ = x·eˣ⁻¹ by the power rule.
✓ The power rule is for xⁿ (variable base, fixed power). eˣ has a fixed base and variable power; its derivative is eˣ.Where f = 0, f′ = 0.
✓ Roots of f and stationary points are different things. Check the slope, not the height.
Open the Lite lesson: The power rule and friends
6.5 Product and chain rules
A capacitor's voltage is 12·e^(−t/2). How fast is it falling at t = 1 s? You need a rule for a function inside a function.
Product rule
d/dt [u·v] = u′·v + u·v′. Picture a rectangle of sides u and v: when both grow, the area gains a strip along each side. It is not u′·v′. Example: d/dt [t²·sin t] = 2t·sin t + t²·cos t.
Chain rule
If y = f(g(t)), then dy/dt = f′(g(t))·g′(t): the outer slope (evaluated at the inner value) times the inner slope. The workhorse cases: d/dt e^(kt) = k·e^(kt); d/dt sin(ωt) = ω·cos(ωt); d/dt (at + b)ⁿ = n·a·(at + b)ⁿ⁻¹.
Why e^(kt) matters so much
d/dt e^(kt) = k·e^(kt): the rate is k times the value. A capacitor V = V₀·e^(−t/τ) therefore falls at a rate −V/τ, proportional to the voltage left. Any quantity whose rate is proportional to itself must be an exponential: that is week 8 in one line.
Derivation: Where does t·e^(−t) peak?
f(t) = t·e^(−t) is a product of u = t and v = e^(−t). This shape models, for example, a drug concentration or the current pulse in some circuits.
u′ = 1. For v, the chain rule with inner function −t gives v′ = e^(−t)·(−1) = −e^(−t).
Product rule: f′ = u′v + uv′ = e^(−t) − t·e^(−t) = (1 − t)·e^(−t).
e^(−t) is never zero, so f′ = 0 only when 1 − t = 0: t = 1.
For t < 1, f′ > 0 (rising); for t > 1, f′ < 0 (falling): a maximum, f(1) = e⁻¹ ≈ 0.368.
Common mix-ups
(uv)′ = u′·v′.
✓ (uv)′ = u′v + uv′. Check with u = v = t: (t²)′ = 2t, but u′v′ = 1.d/dt sin(ωt) = cos(ωt).
✓ The chain rule adds a factor ω: ω·cos(ωt). Faster oscillation means bigger rates.
Open the Lite lesson: Product and chain rules
Worked examples
Limits: where is it heading?: example 1
Find lim (h→0) [(3 + h)² − 9]/h.
Solution
Expand: (9 + 6h + h²) − 9 = 6h + h². Divide by h (h ≠ 0): 6 + h. As h → 0 this tends to 6. (This is the slope of x² at x = 3: next week's derivative.)
From average speed to speed at an instant: example 1
A tank's volume is V(t) = 2t² + 3t litres (t in minutes). Find the average filling rate from t = 2 to t = 2.1 min, then the instantaneous rate at t = 2.
Solution
V(2.1) = 8.82 + 6.3 = 15.12 L; V(2) = 8 + 6 = 14 L. Average = 1.12/0.1 = 11.2 L/min. Algebraically the average over [2, 2 + h] is 2(4 + h) + 3 = 11 + 2h, which tends to 11 L/min.
The derivative from first principles: example 1
From first principles, differentiate f(x) = 5x² − x and evaluate at x = 2.
Solution
f(x + h) − f(x) = 5(2xh + h²) − h = 10xh + 5h² − h. Divide by h: 10x + 5h − 1 → 10x − 1. At x = 2: 19.
The power rule and friends: example 1
Differentiate f(x) = 4x³ − 2√x + 7 and evaluate at x = 4.
Solution
f′(x) = 12x² − 2·½x^(−½) = 12x² − 1/√x. At x = 4: 12 × 16 − 1/2 = 191.5.
Product and chain rules: example 1
V(t) = 12·e^(−t/2) volts. Find dV/dt at t = 1 s.
Solution
Chain rule with k = −½: dV/dt = 12 × (−½) × e^(−t/2) = −6·e^(−t/2). At t = 1: −6 × 0.607 = −3.64 V/s (falling).
Product and chain rules: example 2
Differentiate y = (3t + 1)⁴.
Solution
Outer u⁴ → 4u³; inner 3t + 1 → 3. dy/dt = 4(3t + 1)³ × 3 = 12(3t + 1)³.
Interactive figures, in words
Figure 6.2 from Limits: where is it heading?
Start with (x² − 4)/(x − 2). Zoom in step by step: the graph flattens into a line through a hollow point. Read the table: what value do both columns approach? Repeat with sin(x)/x and (eˣ − 1)/x. Then try 1/x: what is different?
The zoom lab shows a function near a chosen point with a table of values on both sides. For (x² − 4)/(x − 2) both sides approach 4 (3.9999 and 4.0001 at h = 0.0001) and the graph has a hollow point at (2, 4). sin(x)/x and (eˣ − 1)/x both approach 1. For 1/x the values grow without bound in opposite directions.
Figure 6.3 from From average speed to speed at an instant
Choose the dropped ball with a = 1. Start with h = 1, then drag h smaller. Watch the orange secant swing until it lies along the curve. Read the table: by how much does the gap fall each time h shrinks tenfold? Predict the limit, then reveal the tangent.
The secant lab draws s = 4.9t² with a secant line from t = 1 to t = 1 + h. As h shrinks from 1 to 0.001 the secant slope falls from 14.7 to 9.8049 m/s, approaching the tangent slope of 9.8 m/s; the table shows the gap shrinking tenfold each time h does.
Figure 6.4 from The power rule and friends
Choose x³ − 3x and hide f′. Slide the point from left to right and predict, out loud, whether the slope is positive, negative or zero. Sketch f′ on paper. Then show f′ and compare. Repeat with sin x: which familiar function appears below it?
The derivative grapher shows f on top and f′ below, linked by the chosen point. For x³ − 3x, f′ = 3x² − 3 is a parabola that crosses zero at x = −1 and x = 1, exactly where f has a peak and a trough. For sin x the lower graph is cos x. The readout states the value, the slope and whether f is rising, falling or stationary.
Laboratory
These run in a browser on the full site (they need a faster connection). Simulations are simplified educational models.
- Equation Lab: Derivatives (Equation Lab exploration)
Shrink the step size and watch the difference quotient settle, then make it so small that rounding error takes over.
Open on the full site - Code Lab (Studio)
Estimate a speed from logged positions with a forward and a central difference, and compare their errors.
Open on the full site
Practice
Each question links to its Lite lesson, where your answer is checked on our server and a wrong answer gets a hint. Answers are never sent to your device.
- Find lim (x→3) (x² − 9)/(x − 3).
Answer it in “Limits: where is it heading?” - f(2) is not defined but lim (x→2) f(x) = 4. Which statement is true?
Answer it in “Limits: where is it heading?” - A trolley's position is s(t) = 4.9t² + 0t metres. What is its average velocity between t = 3 s and t = 3.01 s, in m/s?
Answer it in “From average speed to speed at an instant” - Using average speed = 9.8t + 4.9h from the derivation, what is the instantaneous speed of the ball at t = 2 s, in m/s?
Answer it in “From average speed to speed at an instant” - From first principles, find the derivative of f(x) = x² at x = 3. (Hint: simplify [(3 + h)² − 9]/h first.)
Answer it in “The derivative from first principles” - The shuttle s = t³ − 6t² + 9t has v = 3t² − 12t + 9. At which time after t = 1 s does it stop again, in seconds?
Answer it in “The derivative from first principles” - A joint angle follows θ(t) = 2t³ + 5t + 7 radians. Using the power rule, find the angular velocity dθ/dt at t = 1 s, in rad/s.
Answer it in “The power rule and friends” - The charge on a plate is Q(t) = 0.002·sin(50t) coulombs. The current is I = dQ/dt. What is I at t = 0.02 s, in amps?
Answer it in “Product and chain rules”
Engineering applications
Velocity from encoders
A wheel encoder gives position samples. Dividing the change in position by the time between samples is a secant slope, an estimate of speed whose accuracy depends on the gap.
Finding the best setting
Where a smooth quantity such as efficiency reaches its peak, its derivative is zero. Engineers find optimum operating points by looking for that zero.
Watch (optional)
Streaming video uses a lot of data. Everything you need is in the text.
- “Limits, L'Hôpital's rule, and epsilon delta definitions | Chapter 7, Essence of calculus” by 3Blue1Brown
- “The paradox of the derivative | Chapter 2, Essence of calculus” by 3Blue1Brown
- “Derivative formulas through geometry | Chapter 3, Essence of calculus” by 3Blue1Brown
- “Visualizing the chain rule and product rule | Chapter 4, Essence of calculus” by 3Blue1Brown
Summary
- Average rate of change over an interval is the slope of the secant line.
- The derivative f′(x) is the limit of [f(x + h) − f(x)] / h as h approaches 0: the slope of the tangent.
- Power rule: the derivative of x^n is n·x^(n−1). Derivatives of sums are sums of derivatives.
- Product rule: (uv)′ = u′v + uv′. Chain rule: the derivative of f(g(x)) is f′(g(x))·g′(x).
Glossary
- Derivative (rate of change)
- The derivative of a quantity is its instantaneous rate of change: the gradient of its graph at a point. Field Guide
- Gradient of a straight line
- The gradient of a straight line is the change in y divided by the change in x between any two points on it; in y = mx + c it is m, and c is where the line crosses the y-axis. Field Guide
- Equations of uniform acceleration
- When acceleration is constant, displacement, initial velocity, final velocity, acceleration and time are linked by four short equations. Field Guide
Project: Speed from a position log
Record (or take from a lesson) a position log with time stamps. Estimate speed at every sample with forward and central differences, plot both, and explain where they disagree. State the sampling interval and how it limits your answer.
Deliverables
- The log with units
- Both speed estimates and a plot
- A paragraph on error and noise
Write it up on paper or in your own notes. Lite never stores what you write.
References
- Gilbert Strang and Edwin Herman (2016). Calculus Volume 1. OpenStax. Link
- MIT OpenCourseWare (2010). 18.01SC Single Variable Calculus (Fall 2010). Massachusetts Institute of Technology. Link
Further reading from the lessons
- 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.