Related Rates
When several quantities are linked by an equation and they all change over time, their rates of change are linked too. Related-rates problems use that link: if you know how fast one quantity changes, you can find how fast another one does. The method is implicit differentiation with respect to time.
The method
- Draw a picture and name the changing quantities as functions of time .
- Write an equation relating them (geometry, physics, Pythagoras).
- Differentiate both sides with respect to (implicit differentiation), using the chain rule on every term.
- Substitute the values at the moment you care about, and solve for the unknown rate.
Tip: Only plug in numbers after differentiating. If you substitute a value that is changing before you differentiate, you freeze it into a constant and its rate disappears.
Example 1: a growing ripple
A stone hits a pond and a circular ripple spreads with radius growing at 0.5 m/s. How fast is the enclosed area growing when the radius is 3 m?
The area grows faster and faster even though the radius grows steadily, because the edge () keeps getting longer.
Example 2: the sliding ladder
A 5 m ladder leans against a wall. Its foot slides away from the wall at 0.4 m/s. How fast does the top slide down when the foot is 3 m from the wall?
The top moves down at 0.3 m/s. As the formula says , which is the point where the model (a ladder that stays on the wall) breaks down.
import sympy as sp
t = sp.symbols('t')
x, y = sp.Function('x')(t), sp.Function('y')(t)
eq = sp.Eq(x**2 + y**2, 25)
d = sp.diff(eq.lhs - eq.rhs, t) # differentiate both sides w.r.t. t
dy = sp.solve(d, sp.diff(y, t))[0]
print("dy/dt =", dy)
print("at x = 3, y = 4, dx/dt = 0.4:", dy.subs(sp.diff(x, t), 0.4).subs({x: 3, y: 4}))dy/dt = -x(t)*Derivative(x(t), t)/y(t)
at x = 3, y = 4, dx/dt = 0.4: -0.300000000000000
Numeric evidence: simulate it
We can check Example 2 without any calculus: move the foot along in tiny time steps, recompute the height from Pythagoras, and measure how fast it changes.
import math
def height(t):
x = 3 + 0.4 * t # foot position, t seconds after the moment x = 3
return math.sqrt(25 - x * x)
for dt in [0.5, 0.1, 0.01, 0.001]:
rate = (height(dt) - height(-dt)) / (2 * dt)
print(f"dt = {dt:<6} measured dy/dt = {rate:.6f} m/s")
print("related rates: -0.300000 m/s")dt = 0.5 measured dy/dt = -0.300588 m/s
dt = 0.1 measured dy/dt = -0.300023 m/s
dt = 0.01 measured dy/dt = -0.300000 m/s
dt = 0.001 measured dy/dt = -0.300000 m/s
related rates: -0.300000 m/s
Example 3: filling a conical tank
Water flows at into a cone-shaped tank (point down) 6 m tall with top radius 3 m. How fast does the water level rise when the water is 4 m deep?
The trick is eliminating using the fixed shape before differentiating, since is changing too.
In software
- Cameras and screens: an object moving at speed at distance from a camera moves on screen at roughly pixels per second (differentiate the projection ). It is why distant objects seem slow and why level-of-detail systems care about screen-space velocity (projection).
- Systems metrics: if a queue holds requests (Little's law) and traffic rises by while latency stays at 0.2 s, the queue grows by requests per second. Capacity planning is related rates with dashboards.
- Physics constraints: for a rope or a pendulum rod of fixed length, differentiating in time gives the velocity constraint that constraint solvers enforce every frame (distance constraints).
Exercises
Exercise 1: Inflating balloon
Air is pumped into a spherical balloon at . How fast does the radius grow when ? ()
Answer
Solution
Exercise 2: Two cars
Car A drives north at 60 km/h, car B drives east at 80 km/h, both starting from the same crossing at the same time. How fast is the distance between them growing after 1 hour?
Answer
Solution
(Here all the time, so the answer is constant.)
Exercise 3: Shadow of a walker
A street lamp is 6 m high. A 1.8 m tall person walks away from it at 1.4 m/s. How fast does the tip of their shadow move?
Answer
(the shadow itself lengthens at ).
Solution
Exercise 4: Check the tank numerically
Simulate the conical tank from Example 3: compute the depth and estimate when using a central difference in time. Compare with .
Answer
Both are about .
Solution
import math
V4 = math.pi * 4**3 / 12 # volume when h = 4
h = lambda V: (12 * V / math.pi) ** (1 / 3)
dt = 1e-4
rate = (h(V4 + 2 * dt) - h(V4 - 2 * dt)) / (2 * dt) # V changes by 2 per minute
print(round(rate, 6), round(1 / (2 * math.pi), 6))0.159155 0.159155
Test yourself
A square's side grows at 2 cm/s. How fast does its area grow when the side is 10 cm?
When should you substitute the numerical values in a related-rates problem?
- Before writing the equation
- Before differentiating
- After differentiating
- Never
For with and depending on , what does differentiating with respect to give?