STEMviz
Mathematics · Differential Equations and Complex Analysis

Modelling with First-Order Differential Equations

Sets up first-order ODEs from growth, cooling and mixing models, introduces direction fields and equilibrium stability, and proves the Picard-Lindelof existence-uniqueness theorem.

Modelling with First-Order Differential Equations

A differential equation is an equation relating an unknown function to one or more of its derivatives. Where ordinary algebra solves for a number, a differential equation solves for a function — and the function it produces is usually the whole content of a physical, biological or economic law stated as a rate. This chapter sets up the vocabulary used for the rest of the block (order, linearity, initial-value problem), proves the theorem that tells you in advance whether a solution exists and is unique, and builds the qualitative tools — direction fields and equilibrium analysis — that let you read off the long-run behaviour of a model without solving it.

Have to hand: the mean value theorem, the definition of a Lipschitz condition (or willingness to meet one here), and comfort with separating variables from a first course in calculus — the actual solving techniques are developed in the next chapter. Here the emphasis is on setting up an equation correctly from a verbal description and on what it means for that equation to be well posed.

1. Basic Vocabulary

An ordinary differential equation (ODE) is an equation of the form

F(x,y,y′,y′′,…,y(n))=0F\bigl(x, y, y', y'', \dots, y^{(n)}\bigr) = 0

involving an unknown function y=y(x)y = y(x) of one independent variable and its derivatives. (A partial differential equation involves partial derivatives of a function of several variables; that is the subject of Chapter 8.) The order of an ODE is the order of the highest derivative appearing in it: y′=kyy' = ky is first order, y′′+ω2y=0y'' + \omega^2 y = 0 is second order.

An ODE is linear if FF is linear in y,y′,…,y(n)y, y', \dots, y^{(n)}, i.e. it can be written

an(x) y(n)+an−1(x) y(n−1)+⋯+a1(x) y′+a0(x) y=g(x)a_n(x)\,y^{(n)} + a_{n-1}(x)\,y^{(n-1)} + \cdots + a_1(x)\,y' + a_0(x)\,y = g(x)

for some functions a0,…,an,ga_0,\dots,a_n,g. Linearity is a statement about how yy and its derivatives occur, not about xx: y′=x2yy' = x^2 y is linear (a1=1, a0=−x2, g=0a_1=1,\,a_0=-x^2,\,g=0) even though it is far from a straight line in xx. An equation that is not linear — such as y′=y2y' = y^2 or y′y′′=xy'y'' = x — is called nonlinear.

A solution of an ODE on an interval II is a function y=φ(x)y=\varphi(x), differentiable enough times on II, that satisfies the equation identically for every x∈Ix\in I. The general solution of an nnth-order ODE is a family of solutions depending on nn arbitrary constants; fixing those constants by extra conditions produces a particular solution.

Initial-value problem (IVP). A first-order IVP is the pair

y′=f(x,y),y(x0)=y0.y' = f(x,y), \qquad y(x_0) = y_0.

The differential equation alone has a whole family of solution curves; the initial condition selects the one curve through the point (x0,y0)(x_0,y_0).

2. Where First-Order Equations Come From

Three classical models recur throughout the chapter and the exercises.

Exponential growth/decay. If a quantity P(t)P(t) changes at a rate proportional to its current size (population with unlimited resources, radioactive decay, unconstrained compound interest), then by definition

dPdt=kP,k∈R constant.\frac{dP}{dt} = kP, \qquad k \in \mathbb{R} \text{ constant.}

k>0k>0 gives growth, k<0k<0 gives decay.

Newton's law of cooling. An object at temperature T(t)T(t) in surroundings held at constant temperature TaT_a loses or gains heat at a rate proportional to the temperature difference:

dTdt=−k(T−Ta),k>0.\frac{dT}{dt} = -k\bigl(T - T_a\bigr), \qquad k>0.

The minus sign encodes the physics directly: when T>TaT>T_a the object is warmer than its surroundings, so dTdt<0\frac{dT}{dt}<0 and it cools; when T<TaT<T_a the right side is positive and it warms. Writing the law with the correct sign before solving is itself part of the modelling step.

Mixing problems. A tank holds V(t)V(t) litres of brine containing y(t)y(t) grams of salt. Brine of concentration cinc_{\text{in}} flows in at rate rinr_{\text{in}} and the (well-stirred) mixture flows out at rate routr_{\text{out}}. The salt balance is

dydt=rin cin⏟rate in−rout⋅yV(t)⏟rate out,\frac{dy}{dt} = \underbrace{r_{\text{in}}\,c_{\text{in}}}_{\text{rate in}} - \underbrace{r_{\text{out}}\cdot\frac{y}{V(t)}}_{\text{rate out}},

where the outflow concentration y/V(t)y/V(t) is the current concentration, not cinc_{\text{in}} — the single most common sign-up error students make with this model (Section 7).

Worked example (setting up, not yet solving). A 200200 L tank starts full of pure water. Brine with concentration 0.5 kg L−10.5\ \mathrm{kg\,L^{-1}} enters at 4 L min−14\ \mathrm{L\,min^{-1}} and the well-mixed solution leaves at the same rate, so V(t)=200V(t)=200 is constant. With y(t)y(t) the mass of salt (kg) at time tt (min),

dydt=(4)(0.5)−4⋅y200=2−y50,y(0)=0.\frac{dy}{dt} = (4)(0.5) - 4\cdot\frac{y}{200} = 2 - \frac{y}{50}, \qquad y(0) = 0.

This is a linear first-order IVP; Chapter 2 supplies the integrating factor that solves it. The point here is only that the rate-in minus rate-out bookkeeping is what turns a verbal description into an equation.

3. Direction Fields

Even before solving y′=f(x,y)y'=f(x,y), the equation itself assigns a slope f(x,y)f(x,y) to every point of the plane: at (x,y)(x,y), any solution curve passing through that point must have that tangent slope. Plotting a short line segment of slope f(x,y)f(x,y) at a grid of points produces the direction field (or slope field) of the equation. A solution curve is then any curve that is tangent to the field everywhere along its length — you can sketch the qualitative shape of solutions without any algebra, which is indispensable when ff is too complicated to integrate in closed form (most ff, in fact).

For the logistic-type equation y′=y(1−y)y' = y(1-y), the slope is zero along y=0y=0 and y=1y=1 (horizontal segments — these are the equilibrium solutions of Section 4), positive and large for yy near 0.50.5, and negative above y=1y=1 or below y=0y=0. Sketching a handful of segments already shows every solution starting in (0,1)(0,1) rising monotonically toward y=1y=1.

4. Autonomous Equations, Equilibria and Stability

A first-order ODE is autonomous if ff does not depend explicitly on xx: y′=f(y)y' = f(y). The growth/decay and cooling models, and the constant-volume mixing model, are autonomous. A constant solution y(x)≡y∗y(x) \equiv y^* is called an equilibrium (or critical) solution; it is one precisely when f(y∗)=0f(y^*) = 0, since then y′=0y'=0 is consistent with y≡y∗y\equiv y^*.

Definition (stability). An equilibrium y∗y^* is asymptotically stable if every solution starting sufficiently close to y∗y^* converges to y∗y^* as x→∞x\to\infty; it is unstable if nearby solutions move away from it.

Theorem (linearised stability test). Let ff be continuously differentiable and f(y∗)=0f(y^*)=0. If f′(y∗)<0f'(y^*)<0 then y∗y^* is asymptotically stable; if f′(y∗)>0f'(y^*)>0 then y∗y^* is unstable.

Proof sketch. Near y∗y^*, Taylor's theorem gives f(y)=f′(y∗)(y−y∗)+o(y−y∗)f(y) = f'(y^*)(y-y^*) + o(y-y^*). Let u=y−y∗u = y-y^*; then u′≈f′(y∗) uu' \approx f'(y^*)\,u for uu small, which is exponential growth or decay according to the sign of f′(y∗)f'(y^*) (Section 2). Hence u→0u\to 0 (stability) when f′(y∗)<0f'(y^*)<0 and ∣u∣|u| grows (instability) when f′(y∗)>0f'(y^*)>0. ■\blacksquare

Worked example. For the logistic equation y′=f(y)=y(1−y)y'=f(y)=y(1-y), the equilibria are y∗=0y^*=0 and y∗=1y^*=1. Here f′(y)=1−2yf'(y) = 1-2y, so f′(0)=1>0f'(0)=1>0 (unstable) and f′(1)=−1<0f'(1)=-1<0 (asymptotically stable). This matches the direction-field picture of Section 3: every solution with y(x0)∈(0,1)y(x_0)\in(0,1) is pushed away from 00 and pulled toward 11.

5. Existence and Uniqueness

A model is only useful if the IVP it produces actually has a solution, and exactly one — otherwise "the" solution is not well defined. The precise statement:

Theorem (Picard–Lindelöf). Suppose f(x,y)f(x,y) is continuous on a rectangle R={(x,y):∣x−x0∣≤a, ∣y−y0∣≤b}R = \{(x,y): |x-x_0|\le a,\ |y-y_0|\le b\} and satisfies a Lipschitz condition in yy on RR: there is a constant LL such that

∣f(x,y1)−f(x,y2)∣≤L ∣y1−y2∣for all (x,y1),(x,y2)∈R.|f(x,y_1) - f(x,y_2)| \le L\,|y_1-y_2| \quad \text{for all } (x,y_1),(x,y_2)\in R.

Then the IVP y′=f(x,y), y(x0)=y0y'=f(x,y),\ y(x_0)=y_0 has a unique solution on some interval ∣x−x0∣≤h|x-x_0|\le h for some h>0h>0.

Proof sketch. Integrating the ODE converts it to the equivalent integral equation

y(x)=y0+∫x0xf(t,y(t)) dt,y(x) = y_0 + \int_{x_0}^{x} f(t,y(t))\,dt,

and solving this is a fixed point of the map (Ty)(x):=y0+∫x0xf(t,y(t)) dt(Ty)(x) := y_0 + \int_{x_0}^{x} f(t,y(t))\,dt on the space of continuous functions. The Lipschitz condition makes TT a contraction (in a suitable weighted norm, or after restricting to a small enough interval), so the Banach fixed-point theorem gives a unique fixed point — constructed explicitly as the limit of the Picard iterates y0(x)≡y0, yn+1=Tyny_0(x)\equiv y_0,\ y_{n+1} = Ty_n. Continuity of ff alone (Peano's theorem) guarantees existence but not uniqueness; the Lipschitz condition is exactly the extra hypothesis that rules out two different solutions through the same point. ■\blacksquare

Why the hypothesis is needed. Consider y′=y1/3y' = y^{1/3}, y(0)=0y(0)=0. Here f(y)=y1/3f(y)=y^{1/3} is continuous everywhere but ∂f/∂y=13y−2/3→∞\partial f/\partial y = \tfrac13 y^{-2/3}\to\infty as y→0y\to 0, so ff is not Lipschitz near y=0y=0. Indeed both y≡0y\equiv 0 and y(x)=(23x)3/2y(x) = \bigl(\tfrac23 x\bigr)^{3/2} (for x≥0x\ge 0) solve the IVP: uniqueness genuinely fails, exactly where the theorem's hypothesis fails.

6. The Interval of Existence Can Be Finite

Linear equations with continuous coefficients have solutions on the whole interval where the coefficients are continuous, but nonlinear equations can have solutions that blow up in finite time even though ff is perfectly smooth everywhere. Example: y′=y2y' = y^2, y(0)=1y(0)=1. Separating variables (anticipating Chapter 2) gives y(x)=11−xy(x) = \dfrac{1}{1-x}, which solves the IVP on (−∞,1)(-\infty,1) but is undefined at x=1x=1 — the solution escapes to infinity before xx reaches 11, even though f(y)=y2f(y)=y^2 has no singularity at all. The Picard–Lindelöf theorem only promises a solution on some interval ∣x−x0∣≤h|x-x_0|\le h; it does not promise that hh can be taken as large as the domain of ff suggests.

7. Common Exam Pitfalls

  • Writing Newton's law of cooling with the wrong sign. The rate must be −k(T−Ta)-k(T-T_a), not +k(T−Ta)+k(T-T_a); check it against the physical requirement that a hot object cools (dT/dt<0dT/dt<0 when T>TaT>T_a).
  • Using the inflow concentration for the outflow term in mixing problems. The tank is well-mixed, so the outflow concentration is the current ratio y(t)/V(t)y(t)/V(t), never the (generally different) inflow concentration cinc_{\text{in}}.
  • Forgetting that V(t)V(t) need not be constant. If the inflow and outflow rates differ, V(t)=V0+(rin−rout)tV(t) = V_0 + (r_{\text{in}}-r_{\text{out}})t must be substituted into the outflow term before the equation becomes separable or linear.
  • Confusing order with degree, or linearity with "looks simple." y′=yy'=\sqrt{y} is first order but nonlinear; y′′′+x2y=sin⁡xy''' + x^2y = \sin x is third order but linear. Check the dependence on yy and its derivatives, not on xx.
  • Citing existence–uniqueness without checking the Lipschitz condition. Continuity of ff alone only guarantees existence (Peano); quoting Picard–Lindelöf to claim uniqueness requires checking ∂f/∂y\partial f/\partial y is bounded (or at least Lipschitz) near the initial point, as Section 5's counterexample shows.
  • Assuming equilibrium solutions are automatically stable. Stability must be checked via f′(y∗)f'(y^*) (or the direction field); an equilibrium found by setting f(y)=0f(y)=0 could equally well be unstable (Section 4's y∗=0y^*=0 for the logistic equation).

Summary

  • An ODE's order is its highest derivative; it is linear iff FF is linear in y,y′,…y,y',\dots; a solution of an nnth-order IVP is pinned down by nn initial conditions.
  • Growth/decay, Newton's cooling and mixing problems all reduce to a first-order ODE via a correctly signed rate balance; get the sign and the current (not inflow) concentration right.
  • A direction field plots the slope f(x,y)f(x,y) at each point; solution curves are everywhere tangent to it, giving qualitative behaviour without solving.
  • Autonomous equations y′=f(y)y'=f(y) have equilibria at the zeros of ff; linearised stability: f′(y∗)<0⇒f'(y^*)<0 \Rightarrow asymptotically stable, f′(y∗)>0⇒f'(y^*)>0 \Rightarrow unstable.
  • Picard–Lindelöf theorem: continuity plus a Lipschitz condition in yy guarantees a unique local solution of an IVP, proved via the contraction mapping theorem on the equivalent integral equation; continuity alone (Peano) gives existence but not uniqueness.
  • Even smooth nonlinear equations such as y′=y2y'=y^2 can have solutions that blow up in finite time; the guaranteed existence interval can be strictly smaller than the domain of ff.