Differential Equations
A differential equation is an equation relating an unknown function to its own derivatives. Most real-world models in engineering and science — growth, decay, motion, circuits, mixing, and competing populations — arise this way, because we usually understand how a quantity changes before we know the quantity itself. This chapter develops the geometric, numerical, and symbolic tools for understanding such equations, even when no closed-form solution exists.
Treat this chapter as the bridge between calculus and real engineering modeling. Almost every system you will analyze later — heat transfer, vibrations, fluid draining, RL/RC circuits — is a differential equation in disguise. Get comfortable reading a model before solving it: ask what each term physically represents and what the equilibrium behavior should be. That instinct matters more than memorizing solution recipes.
Modeling with Differential Equations
A mathematical model of a phenomenon often takes the form of an equation containing an unknown function together with some of its derivatives. We build such models from intuition or from a physical law, then study what the equation predicts.
Differential Equation
An equation that contains an unknown function and one or more of its derivatives. Its order is the order of the highest derivative that appears.
Solution of a Differential Equation
A function is a solution when substituting it and its derivatives into the equation satisfies the equation for all values in some interval. "Solving" means finding all such functions — the general solution — which typically forms a family indexed by an arbitrary constant.
Models of Population Growth
The simplest growth assumption is that a population changes at a rate proportional to its current size. This is reasonable for organisms under ideal conditions (unlimited space, food, no predators or disease).
Because the rate of change is a constant multiple of the function itself, exponential functions solve it. The full family of solutions is given below, where \(C = P(0)\) is the initial population.
Carrying Capacity & the Logistic Model
A finite environment cannot sustain unlimited growth. The carrying capacity \(K\) is the maximum population the environment can support. The logistic model makes growth nearly proportional to \(P\) when \(P\) is small, but drives the rate toward zero as \(P\) approaches \(K\).
FIGURE 9.1.1Solutions of the logistic equation move away from the equilibrium \(P=0\) and toward the equilibrium \(P=K\). (Original redrawn schematic.)
A Model for the Motion of a Spring
For a mass \(m\) on a vertical spring, Hooke's Law gives a restoring force proportional to the displacement \(x\). Combined with Newton's Second Law, this produces a second-order equation.
Spring Restoring Force
A spring stretched or compressed \(x\) units from its natural length exerts a restoring force proportional to \(x\): \(\;\text{force} = -kx\), where \(k>0\) is the spring constant.
The second derivative is proportional to \(x\) but with opposite sign — exactly the property of sine and cosine — so the mass oscillates about its equilibrium position.
Initial-Value Problem
A differential equation together with an initial condition of the form \(y(t_0)=y_0\). Geometrically, this selects the single solution curve from the family that passes through the point \((t_0, y_0)\) — letting us predict future behavior from a measured present state.
Before solving any model, classify it: what order is it, and is it autonomous (no explicit \(t\) on the right)? Autonomous first-order equations let you read off equilibrium behavior instantly by setting the right side to zero — often the answer the engineer actually needs.
Direction Fields & Euler's Method
Most differential equations have no explicit-formula solution. Even so, a graphical approach (direction fields) and a numerical approach (Euler's method) reveal the behavior of solutions.
Direction Field (Slope Field)
For a first-order equation \(y' = F(x,y)\), the value \(F(x,y)\) gives the slope of the solution curve at the point \((x,y)\). Drawing short line segments with that slope at many points produces a direction field, which lets us visualize the shape of solution curves without solving the equation.
FIGURE 9.2.1A direction field with one solution curve (red) traced through an initial point, staying parallel to nearby segments. (Original schematic.)
Autonomous Equation
A first-order equation of the form \(y' = f(y)\), in which the independent variable does not appear on the right side. Along any horizontal line the slopes are identical, so any one solution can be shifted left or right to produce infinitely many others.
Euler's Method
Euler's method turns the direction-field idea into numbers: start at the initial point, step a short distance along the current slope, then correct the direction using the slope at the new point.
Euler's method is the conceptual ancestor of every numerical ODE solver you'll meet later (Runge–Kutta, etc.). Understand why halving \(h\) roughly halves the error here — it builds the intuition for why higher-order solvers are worth the extra computation in practice.
Separable Equations
A separable equation is the first broad class we can solve symbolically. The strategy is to gather all \(y\)-terms on one side and all \(x\)-terms on the other, then integrate both sides.
Separable Equation
A first-order equation whose right side factors as a function of \(x\) times a function of \(y\): \( \dfrac{dy}{dx} = g(x)\,f(y) \). It can be rewritten so the variables are separated, then each side integrated independently.
Orthogonal Trajectories
Orthogonal Trajectory
A curve that intersects every member of a given family of curves at right angles. To find the family of orthogonal trajectories, derive the differential equation of the original family, replace its slope by the negative reciprocal, then solve. Such families arise in electrostatics (field lines vs. equipotentials) and aerodynamics (streamlines vs. equipotential curves).
FIGURE 9.3.1The family of lines through the origin (red) and the family of concentric circles (steel) are orthogonal trajectories of each other. (Original schematic.)
Mixing Problems
Mixing Problem
A tank holds a well-stirred solution; substance enters and leaves at given rates. If \(y(t)\) is the amount of substance present, then \(\dfrac{dy}{dt} = (\text{rate in}) - (\text{rate out})\), where the rate out uses the current concentration \(y(t)/V\). This balance is usually a separable equation.
The "rate in − rate out" balance is identical to the conservation laws you'll write for thermal and fluid systems. Always check units on every term before integrating — a units mismatch is the single most common error I see in mixing and flow problems.
Models for Population Growth
This section solves the growth models introduced earlier and compares their predictions against real data.
Constant Relative Growth Rate
If a quantity changes at a rate proportional to its size, \( \dfrac{dP}{dt}=kP \), then its relative growth rate \( \dfrac{1}{P}\dfrac{dP}{dt}=k \) is constant. A quantity with constant relative growth rate grows (or decays) exponentially: \( P(t)=P_0 e^{kt} \).
To account for emigration or harvesting at a constant rate \(m\), the model becomes \( \dfrac{dP}{dt} = kP - m \).
Solving the Logistic Equation
The logistic equation is separable. Using partial fractions on \(\dfrac{1}{P(1-P/K)}\) and integrating yields an explicit solution.
FIGURE 9.4.1A logistic solution curve: rapid early growth, an inflection point at \(P=K/2\), then leveling off toward \(P=K\). (Original schematic.)
Other Population Models
Variations refine the logistic model: subtracting a constant harvesting term \(c\) models a steady catch; the factor \(\left(1 - \dfrac{m}{P}\right)\) adds a minimum viable population \(m\) below which the species dies out; and the Gompertz function provides an alternative leveling-off curve.
When you fit a model to data, judge it over the whole range, not just the early points. Gause's Paramecium data shows exponential and logistic curves agreeing for the first few days, then the exponential model blows up while the logistic one tracks reality. Models are only as good as the regime they were built for.
Linear Equations
A first-order linear equation cannot generally be separated, but every one can be solved using an integrating factor that turns the left side into the derivative of a product.
First-Order Linear Equation
An equation that can be written in the standard form \( \dfrac{dy}{dx} + P(x)\,y = Q(x) \), where \(P\) and \(Q\) are continuous on an interval. These equations occur constantly in circuits, cooling, and mixing with variable volume.
Integrating-Factor Method
To solve \( y' + P(x)\,y = Q(x) \), multiply both sides by the integrating factor \( I(x) = e^{\int P(x)\,dx} \). The left side becomes \( \big(I(x)\,y\big)' \); integrating both sides gives \( y = \dfrac{1}{I(x)}\!\left[\displaystyle\int I(x)\,Q(x)\,dx + C\right] \).
Application to Electric Circuits
Series RL Circuit
In a series circuit with resistance \(R\), inductance \(L\), and source \(E(t)\), the sum of the voltage drops equals the supplied voltage: \( L\dfrac{dI}{dt} + RI = E(t) \) — a first-order linear equation for the current \(I(t)\).
Notice that the RL battery problem is both separable and linear. When a source becomes time-varying (a generator, \(E(t)=60\sin 30t\)), separability is lost but the linear method still works — that's why the integrating factor is the more powerful tool to master.
Predator–Prey Systems
Realistic models often couple two species. Predator–prey systems are pairs of linked differential equations that must be solved together.
Predator–Prey (Lotka–Volterra) Equations
Let \(R(t)\) be the prey population and \(W(t)\) the predator population. Prey grow exponentially when alone; predators decline when alone; and encounters (proportional to the product \(RW\)) reduce prey and feed predators. The two species are coupled, so neither equation can be solved on its own.
Equilibrium Point & Phase Plane
A constant (equilibrium) solution occurs where both derivatives vanish. Plotting solutions in the \(RW\)-plane gives the phase plane; each solution traces a closed phase trajectory, and the collection of equilibrium points and typical trajectories is the phase portrait.
FIGURE 9.6.1Prey and predator populations oscillate out of phase: prey peaks lead predator peaks by about a quarter cycle. (Original schematic.)
Refined Models
The basic system can be improved by letting the prey grow logistically (carrying capacity \(K\)) rather than exponentially, or by adapting the encounter terms to model species that compete for resources or cooperate for mutual benefit.
This is your first taste of a coupled system of ODEs, which is how nearly all multi-body mechanical and control systems are written. The phase-plane idea — analyzing behavior in state space instead of versus time — is the foundation of the dynamics and controls courses ahead. Learn to read a phase portrait now.