TExcelTAD
Home › Calculus in Depth › Related Rates

Related Rates

In a related-rates problem two or more quantities are linked by an equation and all change with time. Differentiating the equation with respect to time links their rates, so a rate you can measure gives you a rate you cannot. This lesson gives a reliable procedure, works through geometric examples in SymPy and checks them by simulation.

The gentle version is in Related Rates; here we lean on Implicit Differentiation and the chain rule.

Why it works

If x=x(t)x = x(t) and y=y(t)y = y(t) satisfy F(x,y)=0F(x, y) = 0 for every tt, then the function t↦F(x(t),y(t))t \mapsto F(x(t), y(t)) is identically zero, so its derivative is zero. The chain rule turns that derivative into a linear equation in dxdt\frac{dx}{dt} and dydt\frac{dy}{dt}:

x2+y2=25for all t  ⟹   2x⋅dxdt+2y⋅dydt=0\begin{aligned} &x^2 + y^2 = 25 \qquad \text{for all } t \\ \implies\ &2x \cdot \frac{dx}{dt} + 2y \cdot \frac{dy}{dt} = 0 \end{aligned}

Given xx, yy and one rate at a single instant, solve for the other rate.

The procedure

  1. Draw a picture; name every quantity that changes with time as a function of tt.
  2. Write the given rates and the wanted rate as derivatives (dVdt=3\frac{dV}{dt} = 3, find dhdt\frac{dh}{dt}).
  3. Write an equation linking the quantities that holds at every time. Use geometry (Pythagoras, similar triangles, volume formulas) to eliminate quantities whose rate you don't know.
  4. Differentiate both sides with respect to tt (chain rule).
  5. Only now substitute the values at the instant of interest, and solve.

Tip: The classic mistake is substituting numbers before differentiating. If you set h=4h = 4 first, hh becomes a constant and its rate vanishes.

Example: filling a conical tank

A tank shaped like an inverted cone has height 6 m and top radius 2 m. Water flows in at 0.5 m3/min0.5\ \text{m}^3/\text{min}. How fast is the water level rising when the water is 3 m deep?

By similar triangles r/h=2/6r/h = 2/6, so r=h/3r = h/3 at every time. Then

V=13πr2h=13π(h/3)2h=πh327dVdt=πh29⋅dhdtdhdt=9⋅(dV/dt)πh2\begin{aligned} V &= \tfrac{1}{3}\pi r^2 h = \tfrac{1}{3}\pi (h/3)^2 h = \frac{\pi h^3}{27} \\ \frac{dV}{dt} &= \frac{\pi h^2}{9} \cdot \frac{dh}{dt} \\ \frac{dh}{dt} &= \frac{9 \cdot (dV/dt)}{\pi h^2} \end{aligned}
python · try it yourself
import sympy as sp

t = sp.symbols('t')
h = sp.Function('h')(t)
V = sp.pi * h**3 / 27
dVdt = sp.diff(V, t)
print("dV/dt =", dVdt)
rate = sp.solve(sp.Eq(dVdt, sp.Rational(1, 2)), sp.diff(h, t))[0]
at3 = rate.subs(h, 3)
print("dh/dt at h = 3:", at3, "≈", round(float(at3), 5), "m/min")
dV/dt = pi*h(t)**2*Derivative(h(t), t)/9
dh/dt at h = 3: 1/(2*pi) ≈ 0.15915 m/min

SymPy prints Derivative(h(t), t) for dhdt\frac{dh}{dt}; h(t) is an unknown function of time, which is exactly how we treat it by hand.

Example: a sliding ladder, checked by simulation

A 5 m ladder leans against a wall. Its foot slides away at 0.4 m/s0.4\ \text{m/s}. How fast is the top sliding down when the foot is 3 m from the wall?

x2+y2=25  ⟹  2x⋅x′+2y⋅y′=0  ⟹  y′=−x⋅x′/yat x=3: y=4, so y′=−3⋅0.4/4=−0.3 m/s\begin{aligned} &x^2 + y^2 = 25 \implies 2x \cdot x' + 2y \cdot y' = 0 \implies y' = -x \cdot x'/y \\ &\text{at } x = 3{:}\ y = 4, \text{ so } y' = -3 \cdot 0.4/4 = -0.3\ \text{m/s} \end{aligned}

A simulation does not need calculus at all: move the foot in tiny time steps, recompute the top, and difference.

python · try it yourself
import math

L, speed = 5.0, 0.4
def top(t):
    x = 3.0 + speed * t          # foot position, x = 3 at t = 0
    return math.sqrt(L**2 - x**2)

for dt in [0.1, 0.01, 0.001]:
    central = (top(dt) - top(-dt)) / (2 * dt)
    print(f"dt = {dt:<6} dy/dt ≈ {central:.6f}")
print("formula:", round(-3 * speed / 4, 6))
dt = 0.1    dy/dt ≈ -0.300023
dt = 0.01   dy/dt ≈ -0.300000
dt = 0.001  dy/dt ≈ -0.300000
formula: -0.3

Notice that y′=−x⋅x′/yy' = -x \cdot x'/y blows up as y→0y \to 0: the model claims the top falls infinitely fast at the end. In reality the top leaves the wall before that, so the equation stops describing the physics. Always check that a model's assumptions still hold at the instant you care about.

Example: angle of elevation

A drone rises vertically at 3 m/s3\ \text{m/s} from a point 40 m from an observer. How fast is the angle of elevation θ\theta changing when the drone is 30 m up?

tan⁡θ=y/40  ⟹  sec⁡2θ⋅θ′=y′/40at y=30: the hypotenuse is 50, so sec⁡θ=50/40 and sec⁡2θ=25/16θ′=340⋅1625=0.048 rad/s\begin{aligned} &\tan\theta = y/40 \implies \sec^2\theta \cdot \theta' = y'/40 \\ &\text{at } y = 30{:}\ \text{the hypotenuse is 50, so } \sec\theta = 50/40 \text{ and } \sec^2\theta = 25/16 \\ &\theta' = \tfrac{3}{40} \cdot \tfrac{16}{25} = 0.048\ \text{rad/s} \end{aligned}

Angles must be in radians for d(tan⁡θ)/dθ=sec⁡2θd(\tan\theta)/d\theta = \sec^2\theta to hold.

In software

  • Cameras in games: a camera tracking a moving target needs the rate at which the bearing angle changes, the same computation as the drone example; it drives smooth turret or camera rotation.
  • Robotics: inverse kinematics relates joint-angle rates to end-effector velocity through the Jacobian, a many-variable related-rates equation.
  • Physics engines: constraints such as "rope length stays LL" are enforced by differentiating the constraint in time (ddt∣p1−p2∣2=0\frac{d}{dt} \lvert p_1 - p_2 \rvert^2 = 0), exactly step 4 of the procedure.
  • Autodiff frameworks compute these time derivatives mechanically with the chain rule.

Exercises

Exercise 1: Growing circle

A ripple's radius grows at 2 cm/s2\ \text{cm/s}. How fast is the enclosed area growing when the radius is 10 cm?

Answer

40π≈125.66 cm2/s40\pi \approx 125.66\ \text{cm}^2/\text{s}

Solution
A=πr2  ⟹  A′=2πr⋅r′=2π⋅10⋅2=40π cm2/sA = \pi r^2 \implies A' = 2\pi r \cdot r' = 2\pi \cdot 10 \cdot 2 = 40\pi\ \text{cm}^2/\text{s}

Exercise 2: Shadow

A 1.8 m person walks away from a 6 m street lamp at 1.5 m/s1.5\ \text{m/s}. How fast does the tip of the shadow move?

Answer

15/7≈2.143 m/s15/7 \approx 2.143\ \text{m/s} (away from the lamp)

Solution

Let xx be the person's distance from the lamp and ss the tip's distance. Similar triangles:

6s=1.8s−x  ⟹  6s−6x=1.8s  ⟹  s=6x/4.2=10x/7s′=107⋅x′=107⋅1.5=15/7 m/s\begin{aligned} &\frac{6}{s} = \frac{1.8}{s - x} \implies 6s - 6x = 1.8s \implies s = 6x/4.2 = 10x/7 \\ &s' = \tfrac{10}{7} \cdot x' = \tfrac{10}{7} \cdot 1.5 = 15/7\ \text{m/s} \end{aligned}

The answer does not depend on where the person is.

Exercise 3: Inflating balloon

Air is pumped into a spherical balloon at 100 cm3/s100\ \text{cm}^3/\text{s}. How fast is the radius increasing when the diameter is 20 cm? Check with SymPy.

Answer

1/(4π)≈0.0796 cm/s1/(4\pi) \approx 0.0796\ \text{cm/s}

Solution
V=43πr3  ⟹  V′=4πr2⋅r′  ⟹  r′=1004π⋅102=14πV = \tfrac{4}{3}\pi r^3 \implies V' = 4\pi r^2 \cdot r' \implies r' = \frac{100}{4\pi \cdot 10^2} = \frac{1}{4\pi}
python · try it yourself
import sympy as sp

t = sp.symbols('t')
r = sp.Function('r')(t)
eq = sp.Eq(sp.diff(sp.Rational(4, 3) * sp.pi * r**3, t), 100)
rp = sp.solve(eq, sp.diff(r, t))[0].subs(r, 10)
print(rp, round(float(rp), 4))
1/(4*pi) 0.0796

Exercise 4: Two ships

Ship A sails north at 12 km/h, ship B sails east at 16 km/h, both leaving the same port at noon. How fast is the distance between them changing at 2 pm?

Answer

20 km/h (constant at every time).

Solution
at time t: a=12t, b=16t, D2=a2+b22D⋅D′=2a⋅a′+2b⋅b′at t=2: a=24, b=32, D=40D′=24⋅12+32⋅1640=288+51240=20 km/h\begin{aligned} &\text{at time } t{:}\ a = 12t,\ b = 16t,\ D^2 = a^2 + b^2 \\ &2D \cdot D' = 2a \cdot a' + 2b \cdot b' \\ &\text{at } t = 2{:}\ a = 24,\ b = 32,\ D = 40 \\ &D' = \frac{24 \cdot 12 + 32 \cdot 16}{40} = \frac{288 + 512}{40} = 20\ \text{km/h} \end{aligned}

Indeed D=20tD = 20t, so D′=20D' = 20 always.

Test yourself

In a related-rates problem, when should you substitute the numerical values of the changing quantities?

  1. Before writing the equation
  2. Before differentiating
  3. After differentiating with respect to time
  4. Never

x2+y2=100x^2 + y^2 = 100 with x=6x = 6, y=8y = 8 and dxdt=4\frac{dx}{dt} = 4. What is dydt\frac{dy}{dt}?

  1. −3-3
  2. 33
  3. −4-4
  4. −163-\frac{16}{3}