TExcelTAD
Home › Calculus in Depth › Rates of Change in the Natural and Social Sciences

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 dydx\frac{dy}{dx} 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 y=f(x)y = f(x), the average rate of change over [x1,x2][x_1, x_2] and the instantaneous rate at x1x_1 are

average rateΔyΔx=f(x2)−f(x1)x2−x1instantaneousdydx=lim⁡h→0f(x1+h)−f(x1)h\begin{aligned} &\text{average rate} && \frac{\Delta y}{\Delta x} = \frac{f(x_2) - f(x_1)}{x_2 - x_1} \\ &\text{instantaneous} && \frac{dy}{dx} = \lim_{h \to 0} \frac{f(x_1 + h) - f(x_1)}{h} \end{aligned}

The units of dydx\frac{dy}{dx} are always "units of yy per unit of xx". That single fact is the fastest way to read a derivative in any field.

Field yy xx dydx\frac{dy}{dx} means Units
Physics position ss time tt velocity vv m/s
Physics velocity vv time tt acceleration aa m/s2\text{m/s}^2
Physics mass mm of a rod up to xx position xx linear density ρ\rho kg/m
Electricity charge QQ time tt current II C/s = A
Chemistry concentration [C][C] time tt rate of reaction mol/(L·s)
Biology population nn time tt growth rate individuals/day
Economics cost CC units produced xx marginal cost $/unit
Thermodynamics volume VV pressure PP −V⋅(compressibility)-V \cdot (\text{compressibility}) m3/Pa\text{m}^3/\text{Pa}

Physics: motion, density, current

Take a particle with position s(t)=t3−9t2+24ts(t) = t^3 - 9t^2 + 24t metres. Then v=s′=3t2−18t+24=3(t−2)(t−4)v = s' = 3t^2 - 18t + 24 = 3(t - 2)(t - 4) and a=v′=6t−18a = v' = 6t - 18. The particle moves forward on [0,2)[0, 2), backward on (2,4)(2, 4), forward again after t=4t = 4. Distance travelled is not displacement: you must add the absolute lengths of each leg.

python · try it yourself
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 ∣v∣\lvert v \rvert is increasing exactly when vv and aa have the same sign. On (2,3)(2, 3) 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 xx is m(x)m(x), the linear density is ρ(x)=m′(x)\rho(x) = m'(x). For charge, the current is I=dQ/dtI = dQ/dt. These are the same limit, just with different letters.

Chemistry: reaction rates

For a reaction A+B→CA + B \to C, the rate of reaction is d[C]/dtd[C]/dt, which equals −d[A]/dt-d[A]/dt because each unit of C consumes one unit of A. For a second-order reaction with equal starting concentrations aa, one model gives

[C](t)=a2ktakt+1[C](t) = \frac{a^2kt}{akt + 1}

Differentiate with the quotient rule:

d[C]dt=a2k(akt+1)−a2kt⋅ak(akt+1)2=a2k(akt+1)2\frac{d[C]}{dt} = \frac{a^2k(akt + 1) - a^2kt \cdot ak}{(akt + 1)^2} = \frac{a^2k}{(akt + 1)^2}

A short check shows a2k(akt+1)2=k(a−[C])2\frac{a^2k}{(akt+1)^2} = k(a - [C])^2, 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 (y[i+1]−y[i−1])/(x[i+1]−x[i−1])(y[i+1] - y[i-1]) / (x[i+1] - x[i-1]); its error shrinks like h2h^2, while a one-sided difference errs like hh.

python · try it yourself
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 (dn/dt)/n(dn/dt)/n 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 C(x)C(x) is the cost of producing xx items, the marginal cost C′(x)C'(x) approximates the cost of the next item: C(x+1)−C(x)≈C′(x)C(x + 1) - C(x) \approx C'(x). Marginal revenue R′(x)R'(x) and marginal profit P′(x)=R′(x)−C′(x)P'(x) = R'(x) - C'(x) work the same way, and profit is maximised where marginal revenue equals marginal cost.

python · try it yourself
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 Q(t)Q(t); the dashboard's "requests per second" is its derivative estimated by a difference over a time window (Prometheus' rate() is exactly Δcount/Δt\Delta\text{count}/\Delta t).
  • Game physics: velocity and acceleration are read off positions sampled each frame; see Game Physics.
  • Finance code: marginal cost and price sensitivities ("Greeks" like delta=∂ price/∂ underlying\text{delta} = \partial\,\text{price}/\partial\,\text{underlying}) are derivatives estimated by bumping an input and re-pricing.
  • Numerical differentiation of noisy data amplifies noise by roughly 1/h1/h, 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 s(t)=t3−6t2+9ts(t) = t^3 - 6t^2 + 9t (metres, t≥0t \ge 0). On which intervals is it slowing down?

Answer

Slowing down on 0≤t<10 \le t < 1 and 2<t<32 < t < 3 (where vv and aa have opposite signs).

Solution
v=3t2−12t+9=3(t−1)(t−3)a=6t−12=6(t−2)t∈[0,1): v>0, a<0→slowingt∈(1,2): v<0, a<0→speeding upt∈(2,3): v<0, a>0→slowingt>3: v>0, a>0→speeding up\begin{aligned} &v = 3t^2 - 12t + 9 = 3(t - 1)(t - 3) && a = 6t - 12 = 6(t - 2) \\ &t \in [0,1){:}\ v > 0,\ a < 0 && \to \text{slowing} \\ &t \in (1,2){:}\ v < 0,\ a < 0 && \to \text{speeding up} \\ &t \in (2,3){:}\ v < 0,\ a > 0 && \to \text{slowing} \\ &t > 3{:}\ v > 0,\ a > 0 && \to \text{speeding up} \end{aligned}

Exercise 2: Linear density

The mass of the first xx metres of a cable is m(x)=3x+0.2x2m(x) = 3x + 0.2x^2 kg. Find its linear density at x=5x = 5.

Answer

5 kg/m

Solution
ρ(x)=m′(x)=3+0.4xρ(5)=3+2=5 kg/m\begin{aligned} \rho(x) &= m'(x) = 3 + 0.4x \\ \rho(5) &= 3 + 2 = 5\ \text{kg/m} \end{aligned}

Exercise 3: Current from charge

The charge through a wire is Q(t)=4t−t2Q(t) = 4t - t^2 coulombs for 0≤t≤20 \le t \le 2. When is the current 1 A?

Answer

t=1.5t = 1.5 s

Solution
I=dQdt=4−2t=1  ⟹  t=1.5 sI = \frac{dQ}{dt} = 4 - 2t = 1 \implies t = 1.5\ \text{s}

Exercise 4: Central versus forward difference

For f(x)=exf(x) = e^x at x=0x = 0 with h=0.1h = 0.1, compute the forward difference (f(h)−f(0))/h(f(h) - f(0))/h and the central difference (f(h)−f(−h))/(2h)(f(h) - f(-h))/(2h). Which is closer to the true value 1?

Answer

Forward ≈1.0517\approx 1.0517, central ≈1.0017\approx 1.0017; the central difference is about 30 times closer.

Solution

The forward error is about h⋅f′′/2=0.05h \cdot f''/2 = 0.05, the central error about h2⋅f′′′/6≈0.0017h^2 \cdot f'''/6 \approx 0.0017.

python · try it yourself
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 V(P)V(P) is volume as a function of pressure, what are the units of dV/dPdV/dP?

  1. Pa/m3\text{Pa}/\text{m}^3
  2. m3⋅Pa\text{m}^3 \cdot \text{Pa}
  3. m3/Pa\text{m}^3/\text{Pa}
  4. m3/s\text{m}^3/\text{s}

A particle has v(t)<0v(t) < 0 and a(t)<0a(t) < 0. What is happening?

  1. It is moving backward and speeding up
  2. It is moving backward and slowing down
  3. It is at rest
  4. It is moving forward and slowing down

Why is marginal cost C′(x)C'(x) a good estimate of C(x+1)−C(x)C(x + 1) - C(x)?

  1. They are always equal
  2. Because Δx=1\Delta x = 1 is small compared with typical xx, so the difference quotient is close to the derivative
  3. Because cost functions are linear
  4. Because C′C' is an integral