Rates of Change in the Natural and Social Sciences
A derivative is one idea with many names: velocity in physics, reaction rate in chemistry, growth rate in biology, marginal cost in economics, current in electronics. This lesson works through those interpretations, shows how the units of tell you what the derivative means, and computes each rate exactly with SymPy and numerically from data.
For a gentler first look at derivatives as rates, see The Derivative. The definition used here is the one from Derivatives and Rates of Change.
One definition, many readings
If , the average rate of change over and the instantaneous rate at are
The units of are always "units of per unit of ". That single fact is the fastest way to read a derivative in any field.
| Field | means | Units | ||
|---|---|---|---|---|
| Physics | position | time | velocity | m/s |
| Physics | velocity | time | acceleration | |
| Physics | mass of a rod up to | position | linear density | kg/m |
| Electricity | charge | time | current | C/s = A |
| Chemistry | concentration | time | rate of reaction | mol/(L·s) |
| Biology | population | time | growth rate | individuals/day |
| Economics | cost | units produced | marginal cost | $/unit |
| Thermodynamics | volume | pressure |
Physics: motion, density, current
Take a particle with position metres. Then and . The particle moves forward on , backward on , forward again after . Distance travelled is not displacement: you must add the absolute lengths of each leg.
import sympy as sp
t = sp.symbols('t', real=True)
s = t**3 - 9*t**2 + 24*t
v = sp.diff(s, t)
a = sp.diff(v, t)
print("v(t) =", sp.factor(v))
print("a(t) =", a)
print("turning times:", sp.solve(v, t))
legs = [(0, 2), (2, 4), (4, 6)]
dist = sum(abs(s.subs(t, b) - s.subs(t, a0)) for a0, b in legs)
print("displacement 0..6:", s.subs(t, 6) - s.subs(t, 0))
print("distance 0..6:", dist)v(t) = 3*(t - 4)*(t - 2)
a(t) = 6*t - 18
turning times: [2, 4]
displacement 0..6: 36
distance 0..6: 44
The speed is increasing exactly when and have the same sign. On the velocity is negative and the acceleration is negative, so the particle speeds up while moving backward.
For a rod whose mass from the left end to position is , the linear density is . For charge, the current is . These are the same limit, just with different letters.
Chemistry: reaction rates
For a reaction , the rate of reaction is , which equals because each unit of C consumes one unit of A. For a second-order reaction with equal starting concentrations , one model gives
Differentiate with the quotient rule:
A short check shows , which is the rate law: the rate is proportional to the product of the remaining reactant concentrations.
Biology and economics: rates from data
Real data arrive as tables, not formulas. The best estimate of a derivative at an interior sample point is the central difference ; its error shrinks like , while a one-sided difference errs like .
import numpy as np
day = np.array([0, 2, 4, 6, 8, 10])
cells = np.array([100, 170, 290, 490, 830, 1410]) # bacteria count
rate = np.gradient(cells, day) # central differences inside, one-sided at ends
for d, n, r in zip(day, cells, rate):
print(f"day {int(d):2d}: n = {int(n):5d}, dn/dt ≈ {float(r):7.1f}/day, relative {float(r/n):.3f}")day 0: n = 100, dn/dt ≈ 35.0/day, relative 0.350
day 2: n = 170, dn/dt ≈ 47.5/day, relative 0.279
day 4: n = 290, dn/dt ≈ 80.0/day, relative 0.276
day 6: n = 490, dn/dt ≈ 135.0/day, relative 0.276
day 8: n = 830, dn/dt ≈ 230.0/day, relative 0.277
day 10: n = 1410, dn/dt ≈ 290.0/day, relative 0.206
At the interior days the relative rate is almost constant (about 0.28 per day; the two end values use less accurate one-sided differences), a sign of exponential growth, the model of Exponential Growth and Decay.
In economics, if is the cost of producing items, the marginal cost approximates the cost of the next item: . Marginal revenue and marginal profit work the same way, and profit is maximised where marginal revenue equals marginal cost.
import sympy as sp
x = sp.symbols('x')
C = 2000 + 8*x - sp.Rational(1, 50)*x**2 + sp.Rational(1, 30000)*x**3
Cp = sp.diff(C, x)
print("C'(x) =", Cp)
print("C'(300) =", Cp.subs(x, 300))
print("C(301) - C(300) =", C.subs(x, 301) - C.subs(x, 300), "≈", float(C.subs(x, 301) - C.subs(x, 300)))C'(x) = x**2/10000 - x/25 + 8
C'(300) = 5
C(301) - C(300) = 150301/30000 ≈ 5.010033333333333
In software
- Telemetry and monitoring: a request counter is ; the dashboard's "requests per second" is its derivative estimated by a difference over a time window (Prometheus'
rate()is exactly ). - Game physics: velocity and acceleration are read off positions sampled each frame; see Game Physics.
- Finance code: marginal cost and price sensitivities ("Greeks" like ) are derivatives estimated by bumping an input and re-pricing.
- Numerical differentiation of noisy data amplifies noise by roughly , so real pipelines smooth before differencing.
Tip: Before interpreting a derivative, write down its units. If the units are "dollars per item" or "mol per litre per second", the meaning usually follows.
Exercises
Exercise 1: Speeding up or slowing down
A particle has (metres, ). On which intervals is it slowing down?
Answer
Slowing down on and (where and have opposite signs).
Solution
Exercise 2: Linear density
The mass of the first metres of a cable is kg. Find its linear density at .
Answer
5 kg/m
Solution
Exercise 3: Current from charge
The charge through a wire is coulombs for . When is the current 1 A?
Answer
s
Solution
Exercise 4: Central versus forward difference
For at with , compute the forward difference and the central difference . Which is closer to the true value 1?
Answer
Forward , central ; the central difference is about 30 times closer.
Solution
The forward error is about , the central error about .
import math
h = 0.1
fwd = (math.exp(h) - 1) / h
cen = (math.exp(h) - math.exp(-h)) / (2 * h)
print(f"forward {fwd:.6f} error {fwd - 1:.6f}")
print(f"central {cen:.6f} error {cen - 1:.6f}")forward 1.051709 error 0.051709
central 1.001668 error 0.001668
Test yourself
If is volume as a function of pressure, what are the units of ?
A particle has and . What is happening?
- It is moving backward and speeding up
- It is moving backward and slowing down
- It is at rest
- It is moving forward and slowing down
Why is marginal cost a good estimate of ?
- They are always equal
- Because is small compared with typical , so the difference quotient is close to the derivative
- Because cost functions are linear
- Because is an integral