Skip to content

Differential Equations: Laws Written as Rates

A cup of coffee cools, a capacitor charges, a car bounces over a bump, a fish stock collapses. Each follows a rule that says how fast things change, not where they will be. Solving it is the whole course.

11 min readReadInteractive

Pour coffee and watch it cool. It loses heat fast at first, when it is far hotter than the room, and ever more slowly as it approaches room temperature. Nobody wrote down the temperature at every minute in advance. All you need is a rule: the hotter the cup is above the room, the faster it cools. That sentence, turned into an equation, is a differential equation, and it predicts the whole curve.

This is the secret structure of physics. Nature rarely says "the position will be this". It says "the rate of change is that, given the state right now". Newton's second law is such a rule. So are the equations of electrical circuits, chemical reactions, populations, heat, and the flow of air over a wing. A differential equations course teaches how to read these rules and how to turn them into predictions, either exactly or step by step on a computer.

The course in one box

Who takes it: second-year Mechanical & Aerospace Engineering students. It is not on the Computer Science route in this series, but CS students meet the same ideas whenever they simulate, animate or train anything that evolves in time.

What it is for: predicting how a system evolves when you only know the rule for its rate of change.

Comes after: Calculus I (34/01).

Leads to: Dynamics (34/12), Fluid Mechanics (34/15), Heat Transfer (34/16), Vibrations (34/17), Control Systems (34/20).

Honest line: you will not learn the solution tricks that fill the textbook. You will see the three behaviours that recur everywhere (settling, oscillating, tipping) and why a simulation can lie to you.

An equation about a rate hands you a direction at every point

An ordinary differential equation, an ODE, is an equation that mentions a quantity and how fast it is changing. The simplest useful kind says the rate depends on how far the quantity is from a target:

dy/dt = k (target − y)

Read it aloud: the further I am from the target, the faster I move towards it. Coffee towards the room's temperature, a capacitor towards the supply voltage, a medicine level towards zero. The picture is a slope field: at every point of the plane the equation fixes the direction a solution must go through, drawn as a tiny segment. A solution is any curve that follows those segments the whole way, like a leaf carried along a stream. Different starting points give different curves, all flowing toward the target.

Interactive · Follow the arrows
Pull strength k
Target value
Starting value

Notice that the segments get flatter as you approach the dashed line: the rate shrinks with the distance. That is why the curve approaches the target but never quite arrives. The exact solution is the target plus the starting gap times a decaying exponential, e−kt.

The time constant: how fast a first-order system forgets

The rule dy/dt = k(target − y) has one number that sums it up: the time constant, τ = 1/k. In one τ the system covers about 63.2% of the remaining gap; after about 4.6 τ it has covered 99%. Engineers read response speed from that single number.

fraction of the gap covered after time t = 1 − e−t/τ

In an electrical circuit, a resistor R in series with a capacitor C charges towards the supply with τ = R × C. A 10 kΩ resistor and a 100 µF capacitor give τ = 10,000 Ω × 0.0001 F = 1 second: after 1 s the capacitor holds 63.2% of the supply (3.16 V of 5 V), after 4.6 s, 99%. A cooling coffee follows the same curve; only the story and the units change.

Interactive · Charge a capacitor
Resistance R
Capacitance C

Notice what the sliders do: double either one and the curve stretches twice as wide, but keeps exactly the same shape. The same shape is why a thermometer takes a while to read a fever, and why a control engineer (Control Systems, 34/20) asks first: "what is the time constant?"

Solving it step by step: Euler's method

Most differential equations have no neat formula. The fall-back is to walk along the slope field in small steps. At the current point read the slope, move a short time h in that direction, and repeat. This is Euler's method, set out by Leonhard Euler in his Institutionum calculi integralis (1768), and it is the ancestor of every physics engine, weather model and circuit simulator.

ynext = y + h × (the rate at y)

Test it on a rule we can also solve exactly, dy/dt = −y, starting from 1. Each Euler step multiplies the value by (1 − h). Small steps follow the true curve e−t closely. But raise h and something stranger happens.

Interactive · Euler versus the exact answer
Step size h

At h = 1 the first step lands exactly on zero. Beyond 1 the steps overshoot, and past h = 2 each step makes the number bigger in size, so the "answer" explodes even though the real one decays. That is numerical instability: a stepping rule has its own stability limit, and a simulation that ignores it will happily print nonsense. At h = 0.5 Euler gets 0.000244 at t = 6, where the true value is 0.00248: right shape, ten times too small. Smaller steps, or smarter methods (the Runge–Kutta family), fix that.

Second order: the spring, the mass and the damper

Newton's second law says force equals mass times acceleration, and acceleration is the rate of change of the rate of change of position. So a mass on a spring obeys a second-order equation: the second derivative of position x depends on position and velocity.

m x″ + c x′ + k x = 0

The three terms are inertia (mass m), a damper that resists velocity (c) and a spring that pulls back with force proportional to displacement (k). Two numbers decide everything: the natural frequency, ω = √(k/m), and the damping ratio, ζ = c ÷ (2√(km)).

  • ζ below 1, underdamped: it rings, swinging past rest and fading.
  • ζ = 1, critically damped: the fastest return without overshoot.
  • ζ above 1, overdamped: no swing, but a sluggish crawl home.

Engineers tune for it. A door closer is aimed near critical damping so the door shuts without banging or bouncing. A shock absorber is a compromise: enough damping to stop the bouncing, not so much that the wheel can't follow the road.

Interactive · Tune the damper
Mass m
Spring stiffness k
Damping c

With m = 1 kg and k = 25 N/m the natural frequency is 5 rad/s, or about 0.8 Hz. Setting c = 10 N·s/m gives ζ = 1, critical. With c = 2, ζ = 0.2 and the first swing past rest reaches 52.7% of the starting displacement on the other side. This same equation, with different symbols, describes the RLC circuit, a building in an earthquake and a robot arm: that is the next courses (Vibrations, 34/17, and Control Systems, 34/20).

Equilibria: where things settle, and where they tip

Often you do not need the whole curve, only the places where change stops: the equilibria, where the rate equals zero. Two questions follow. Where are they? And is each one stable (nudge it and it comes back) or unstable (nudge it and it runs away)? The answer is the slope of the rate curve at that point, from Calculus I: negative slope means stable, positive means unstable.

A toy model shows why this matters. Fish regrow according to dy/dt = y(1 − y/100) per year (a standard logistic model), and a fleet takes a fixed catch H every year. For H = 20 there are two equilibria, at about 27.6 and 72.4 fish: the upper is stable, the lower unstable. Start just above 27.6 and the stock recovers to 72.4. Start just below it and the stock collapses to zero in a few years. Raise the catch above 25, the most the stock can regrow, and no equilibrium remains at all.

Interactive · A fishery on the edge
Fixed catch H per year
Starting population

The lesson generalises: a system can look healthy while it sits near an unstable tipping point, and a slow change in a parameter (here the catch) can make the stable state vanish suddenly. Bridges, power grids, aircraft and ecosystems are all analysed this way. The model is a classroom toy, not a description of any real fishery.

Why physics is written in differential equations

Why do laws come as rates? Because change is local. What a system does next depends only on what is happening here, now: the forces, the gradients, the current state. Newton's second law (second order in position), Maxwell's equations for electric and magnetic fields, the equations of heat flow and the equations of fluid motion all have this shape. Give the rule and the starting conditions and the future follows.

Two kinds appear. An ordinary equation (ODE) has one changing variable, usually time: a pendulum, a circuit, a rocket's trajectory. A partial differential equation (PDE) has several, such as time and position: the temperature along a rod, the pressure in the air around a wing. The Navier–Stokes equations of fluid flow (Fluid Mechanics, 34/15) are PDEs so hard that the Clay Mathematics Institute named a question about them one of its seven Millennium Prize problems in 2000. Most real ones are solved on computers using the stepping idea above.

A glimpse of PDEs: the heat equation

Joseph Fourier wrote the heat equation in his Théorie analytique de la chaleur (1822). It says: the temperature at a point changes at a rate proportional to how much its surroundings, on average, are hotter or cooler than it is, which is the curvature of the temperature curve.

∂u/∂t = α ∂²u/∂x²

A peak has negative curvature, so it cools; a dip has positive curvature, so it warms. Heat flows from hot to cold and the profile smooths out. The rod below is insulated at both ends, so the average temperature, the total heat, never changes, only its distribution. Fourier's great discovery (see the library's piece on the Fourier transform, 12/12) is that smooth wiggles of different sharpness die away at different rates: a wiggle five times sharper dies 25 times faster, because it decays like e−(n²π²)t.

Interactive · Heat spreading along a rod
Time
Time step, as a fraction of the stability limit

Try the two waves at the same time. The gentle wave 1 + 0.8 cos(πx) has faded to 0.298 high at t = 0.1, matching the exact 0.8e−π²t. The sharp wave 1 + 0.8 cos(5πx) is gone almost at once, 25 times faster in the exponent. Then drag the time-step slider above 0.5 and watch the simulation explode: Euler's lesson again, now in a PDE. Real heat solvers (Heat Transfer, 34/16) must respect the same limit or use methods built to avoid it.

What a graduate just sees

  • A law about a rate is a direction at every point; a solution is a curve that follows those directions.
  • First-order systems approach their target by a time constant: 63% in one τ, 99% in about 4.6 τ.
  • Cooling, charging and decay are the same curve with different labels.
  • A step-by-step simulation has a stability limit: too big a step creates growth that is not in the physics.
  • Mass, spring and damper give three behaviours: ring, crawl, or the sweet spot at ζ = 1.
  • Equilibria matter, and slope tells stable from unstable. Systems tip.
  • Sharp features smooth out first in diffusion, and total heat is conserved.

Where it shows up next

  • Dynamics (34/12): every motion problem becomes an equation of the form above.
  • Vibrations (34/17): the damped spring is the building block of everything that shakes, from engines to aircraft wings.
  • Control Systems (34/20): a thermostat, cruise control or autopilot is a differential equation you shape with feedback; time constants and damping ratios are its vocabulary.
  • Heat Transfer (34/16) and Fluid Mechanics (34/15): the heat equation and Navier–Stokes are PDEs; the stepping and stability ideas carry straight over.
  • Computer science: physics engines in games, climate and weather models, and circuit simulators are loops of Euler-like steps; neural ODEs even treat a network as a flow.

If you want to go deeper

  • 📘 Textbook: William Boyce, Richard DiPrima and Douglas Meade, Elementary Differential Equations and Boundary Value Problems (12th ed., Wiley): the classic course text.
  • 📘 Textbook: Steven Strogatz, Nonlinear Dynamics and Chaos (3rd ed., CRC Press): an unusually readable treatment of equilibria, stability and tipping.
  • ▶️ Gentler: 3Blue1Brown's differential equations series, and Strogatz's Infinite Powers for the story of why calculus describes nature.
  • 🌐 Free course: MIT OpenCourseWare 18.03SC Differential Equations, with video lectures, notes and problem sets.
The takeaway

Physics speaks in rates. A differential equation gives a direction at every point and a solution follows it. First-order systems approach a target with a time constant (63% in one τ). Second-order systems, from springs and masses, ring, crawl or sit at the sweet spot of critical damping. Equilibria are where change stops and slope tells stable from unstable. When no formula exists, you step along on a computer, but only small enough steps tell the truth: past a limit, a simulation blows up even though nature does not.

Try this: take a hot drink and a thermometer (or just your hand) and note how long it takes to lose half its excess heat over the room. It will take about the same time again to lose half of what is left. That constant "half-life" is the time constant in disguise.

Sources & Further Reading

Sources. Euler's method: Institutionum calculi integralis, vol. 1 (1768); Encyclopedia of Mathematics, "Euler method". Newton's law of cooling originates in Newton's anonymous 1701 paper "Scala graduum caloris"; the modern differential form is not in the original (Wikipedia, "Newton's law of cooling", and history-of-science references). Fourier's Théorie analytique de la chaleur (1822). Millennium Prize problems announced by the Clay Mathematics Institute in 2000, Navier–Stokes among them. Computed in node: RC charging (τ = RC = 1 s for 10 kΩ and 100 µF, 63.2% at τ, 99.0% at 4.605τ); Euler at h = 0.5 gives 2.44 × 10−4 at t = 6 against the exact 2.48 × 10−3; spring closed-form solutions for the three regimes checked against a step-by-step integration (agreement to 5 decimals) and the first-swing overshoot e−πζ/√(1−ζ²) = 52.7% for ζ = 0.2; harvested logistic equilibria 50(1 ± √(1 − H/25)) = 27.64 and 72.36 for H = 20, with collapse after 4.3 years from a start of 25; the explicit heat scheme (100 cells, stable below 0.5) against the exact decay 0.8e−π²t = 0.2982 (numerical 0.2981) at t = 0.1.