← All days ◀ Day 1Day 3 ▶
15-Day Differential Equations Course · Week 1 · Day 02

First-Order Equations: Separable and Linear

The two families of first-order equations you can always solve by hand — separable and linear — and the single idea that ties most engineering ones together: the time constant τ. See why every first-order lag reaches 63 % in one τ, whatever the size of the step.

⏱ about 2–3 hours🧪 Lab: Time-constant explorer❓ 5-question quiz

1Today's goals

  • Solve separable equations by separating and integrating
  • Solve linear equations with an integrating factor
  • Write a first-order system in standard form τ·y′ + y = K·u and read off τ and K
  • Use the 1τ / 3τ / 5τ rule and the initial-slope rule
  • Predict the lag and attenuation of a slow sensor reading a sine wave

2Separable equations

If the right-hand side splits into a function of t times a function of y, put all the y on one side and all the t on the other, then integrate both.

dy/dt = g(t)·h(y) → ∫ dy / h(y) = ∫ g(t) dt + C

Growth and decay. y′ = k·y → ∫dy/y = ∫k dt → ln|y| = k·t + C → y = y₀·ekt. For decay (k < 0) the half-life is t½ = ln 2/|k| ≈ 0.693/|k|.

Logistic growth. y′ = r·y·(1 − y/K). Separating with partial fractions gives

y(t) = K / (1 + (K/y₀ − 1)·e−rt)

An S-curve: exponential at first, fastest at y = K/2, then flattening onto the capacity K. Sales of a new product, a spreading rumour, a culture of bacteria and the adoption of a new technology all trace S-curves of this kind.

3Linear equations and the integrating factor

Every first-order linear equation can be written

y′ + p(t)·y = q(t)

Multiply by μ(t) = e∫p dt. The left side becomes the derivative of a product, (μ·y)′ = μ·q, because μ′ = p·μ. Integrate once and divide by μ:

y(t) = (1/μ)·( ∫ μ·q dt + C ), μ = e∫p dt
Example: y′ + 2y = e−t, y(0) = 0μ = e^(2t) → (y·e^(2t))′ = e^(2t)·e^(−t) = e^t y·e^(2t) = e^t + C, y(0) = 0 → C = −1 y = e^(−t) − e^(−2t) (rises, peaks at t = ln 2 = 0.693, then decays)
Why linear equations are special: superposition

For a linear equation L[y] = q, the difference of any two solutions solves L[y] = 0. So every solution = one particular solution + the general solution of the homogeneous equation. The homogeneous part carries the initial condition and dies away (if the system is stable) — it is the transient. The particular part follows the input — it is the steady state. And if inputs q₁ and q₂ give responses y₁ and y₂, input q₁ + q₂ gives y₁ + y₂. This one property is why Laplace transforms (Day 7), Fourier series (Day 12) and modal analysis (Day 8) work — and why none of them work for nonlinear systems.

4The time constant

A huge number of engineering processes are first-order lags. Written in standard form:

τ · y′ + y = K · u(t) τ = time constant, K = steady-state gain
Step response (u jumps from 0 to 1 at t = 0): y(t) = K + (y₀ − K)·e−t/τ
Time1τ2τ3τ4τ5τ
Fraction of the change completed63.2 %86.5 %95.0 %98.2 %99.3 %

The initial-slope rule: the tangent at t = 0 has slope (K − y₀)/τ, so if the change continued at its starting rate it would finish in exactly one τ. On a recorder trace, draw the tangent at the start and read τ where it hits the final value.

SystemτGain K (output per unit input)
RC circuit (capacitor voltage ← supply voltage)R·C1
Thermal mass with heat loss (oil sump, motor winding)m·c / (h·A)1/(h·A) — °C of rise per watt of heat input
Mixing tank (outlet ← inlet concentration)V / Q1
Thermocouple or RTD in a fluidρ·c·V / (h·A) — seconds for a bare bead, tens of seconds in a thermowell1
DC motor speed after a voltage stepJ·R / (b·R + Kt·Ke) — the back-EMF term usually dominates, so ≈ J·R/(Kt·Ke); J/b only if the motor is driven by a current (torque) sourceSpeed per volt

Sine input. Feed u = sin ωt into a lag and, after the transient, the output is a sine at the same frequency, smaller by 1/√(1 + (ωτ)²) and late by φ = arctan(ωτ). At ωτ = 1 the output is 71 % in amplitude and 45° behind. A slow sensor quietly under-reads fast fluctuations.

5Worked example

Newton cooling: tea at 85 °C in a 27 °C room reads 70 °C after 5 min. When will it be 50 °C?T − 27 = 58·e^(−k·t) (58 = 85 − 27) At t = 5: 43 = 58·e^(−5k) → k = ln(58/43)/5 = 0.0598 per min (τ = 1/k = 16.7 min) 50 °C: 23 = 58·e^(−k·t) → t = ln(58/23)/0.0598 = 15.5 min
Gearbox oil warming up on a test rig: τ = 25 min, final rise 45 °C above the roomRise after 25 min (1τ) = 0.632 × 45 = 28.4 °C Rise after 75 min (3τ) = 0.950 × 45 = 42.8 °C — within 2.2 °C of final Initial rate = 45/25 = 1.8 °C per min Practical rule: "thermally stable" readings need 3–5 τ, i.e. 75–125 min of running.
Where you meet thisRig warm-up and stabilisation criteria, sensor response times, RC filters in data acquisition (anti-aliasing), drug dosing intervals (half-life), carbon dating, charging a phone battery at constant voltage, a bank loan at continuous interest.

6Lab: time-constant explorer

Pick a process and an input. Watch three things: the dotted initial tangent hitting the final value at t = τ, the 63 / 95 / 99 % marks, and the derivative on the right — biggest at the start and dying with the same time constant. Then choose the thermocouple with a sine input and slide ω·τ: watch the response shrink and fall behind.

7Pro tips and common mistakes

  • Forgetting the absolute value and the constant when integrating 1/y loses solutions; check the sign case separately.
  • Always put a linear equation in the form y′ + p·y = q (coefficient of y′ equal to 1) before computing μ.
  • τ does not depend on the size of the step — a small and a large step take the same time to reach 63 %. If yours does not, the system is nonlinear.
  • Plot ln|y − yfinal| against t: a straight line confirms a first-order lag and its slope is −1/τ.

8Practice

  1. Solve y′ = −t·y², y(0) = 2 by separation.
  2. Solve y′ + y/t = t², y(1) = 0 (μ = t).
  3. A thermocouple with τ = 4 s is plunged from 25 °C into 200 °C oil. What does it read after 4 s and after 10 s?
  4. In the lab, choose a ramp input. How far behind the ramp does the output run once settled? Prove it from the equation.

9Quick quiz

5 questions. Click an answer — you get the explanation straight away.

Progress is kept in this browser (and in your account when signed in).