Calculus · Chapter 9 — Differential Equations
0%
Calculus · Chapter 9

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.

Instructor Note

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).

Natural Growth Model (first order)
\[ \frac{dP}{dt} = kP \]

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.

General Solution of the Natural Growth Model
\[ P(t) = C e^{kt} \]

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\).

Logistic Differential Equation
\[ \frac{dP}{dt} = kP\left(1 - \frac{P}{K}\right) \]
Key Idea The constant functions \(P=0\) and \(P=K\) are equilibrium solutions: if the population ever equals one of these, it stays there. Solutions that start between \(0\) and \(K\) increase toward \(K\); solutions above \(K\) decrease toward it.
P t P = K (carrying capacity) P = 0

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.

Law · Hooke's Law

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.

Spring Motion (second order)
\[ m\frac{d^2x}{dt^2} = -kx \qquad\Longleftrightarrow\qquad \frac{d^2x}{dt^2} = -\frac{k}{m}\,x \]

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.

EXAMPLE 1 Verifying a Family of Solutions
Show that every member of the family \( y = \dfrac{1+ce^{t}}{1-ce^{t}} \) is a solution of \( y' = \tfrac{1}{2}(y^2 - 1) \).
Solution
Differentiate using the Quotient Rule: \( y' = \dfrac{2ce^{t}}{(1-ce^{t})^2} \).
Compute the right side: \( \tfrac{1}{2}(y^2-1) = \tfrac{1}{2}\!\left[\dfrac{(1+ce^{t})^2-(1-ce^{t})^2}{(1-ce^{t})^2}\right] = \dfrac{2ce^{t}}{(1-ce^{t})^2} \).
Both sides agree, so the equation holds for every value of \(c\). The given family is a solution. ∎

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.

EXAMPLE 2 Solving an Initial-Value Problem
Find the solution of \( y' = \tfrac{1}{2}(y^2-1) \) from Example 1 that satisfies \( y(0)=2 \).
Solution
Substitute \(t=0,\ y=2\) into \( y = \dfrac{1+c}{1-c} \): \( 2 = \dfrac{1+c}{1-c} \).
Solve for \(c\): \( 2-2c = 1+c \Rightarrow c = \tfrac{1}{3} \).
The particular solution is \( y = \dfrac{1+\tfrac{1}{3}e^{t}}{1-\tfrac{1}{3}e^{t}} = \dfrac{3+e^{t}}{3-e^{t}} \). ∎
Instructor Note

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.

EXAMPLE 1 A Circuit Direction Field
A series circuit has \(R=12\,\Omega\), \(L=4\,\text{H}\), and a constant \(60\,\text{V}\) source, giving \(\dfrac{dI}{dt} = 15 - 3I\). Identify the limiting current and any equilibrium solution.
Solution
The equation is autonomous; set the right side to zero: \(15 - 3I = 0 \Rightarrow I = 5\).
So \(I(t)=5\) is an equilibrium solution. The direction field shows all solutions approaching it, so \(\displaystyle\lim_{t\to\infty} I(t) = 5\,\text{A}\). ∎

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 Iteration
\[ y_n = y_{n-1} + h\,F(x_{n-1}, y_{n-1}), \qquad x_n = x_{n-1} + h \]
Key Idea Euler's method gives approximations, not exact values. Decreasing the step size \(h\) (and so taking more corrections) produces successively better estimates that converge to the true solution as \(h \to 0\).
EXAMPLE 2 Euler's Method by Hand
Use Euler's method with step size \(h=0.1\) to approximate the solution of \( y' = x + y,\ y(0)=1 \) for the first few steps.
Solution
Here \(F(x,y)=x+y\), \(x_0=0\), \(y_0=1\).
\( y_1 = 1 + 0.1(0+1) = 1.1 \).
\( y_2 = 1.1 + 0.1(0.1+1.1) = 1.22 \).
\( y_3 = 1.22 + 0.1(0.2+1.22) = 1.362 \), and so the estimate \( y(0.3) \approx 1.362 \). Continuing gives \( y(1.0) \approx 3.19 \). ∎
Instructor Note

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.

Separation and Integration
\[ h(y)\,dy = g(x)\,dx \quad\Longrightarrow\quad \int h(y)\,dy = \int g(x)\,dx \]
EXAMPLE 1 Solving and Applying an Initial Condition
(a) Solve \( \dfrac{dy}{dx} = \dfrac{x^2}{y^2} \). (b) Find the solution with \( y(0)=2 \).
Solution
Separate: \( y^2\,dy = x^2\,dx \).
Integrate: \( \tfrac{1}{3}y^3 = \tfrac{1}{3}x^3 + C \), so \( y = \sqrt[3]{x^3 + K} \) with \(K = 3C\).
Apply \(y(0)=2\): \( 2 = \sqrt[3]{K} \Rightarrow K = 8 \). Thus \( y = \sqrt[3]{x^3 + 8} \). ∎
EXAMPLE 2 An Implicit General Solution
Solve \( \dfrac{dy}{dx} = \dfrac{6x^2}{2y + \cos y} \).
Solution
Separate: \( (2y + \cos y)\,dy = 6x^2\,dx \).
Integrate both sides: \( y^2 + \sin y = 2x^3 + C \).
This defines \(y\) implicitly; it cannot be solved explicitly for \(y\) in terms of \(x\), which is perfectly acceptable as a general solution. ∎

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.

EXAMPLE 3 Salt in a Stirred Tank
A tank holds \(20\,\text{kg}\) of salt in \(5000\,\text{L}\) of water. Brine at \(0.03\,\text{kg/L}\) enters at \(25\,\text{L/min}\); the stirred mixture drains at the same rate. How much salt remains after \(30\) minutes?
Solution
Rate in \(= 0.03 \times 25 = 0.75\,\text{kg/min}\); rate out \(= \dfrac{y}{5000}\times 25 = \dfrac{y}{200}\).
Balance: \( \dfrac{dy}{dt} = 0.75 - \dfrac{y}{200} = \dfrac{150 - y}{200} \).
Separate and integrate; with \(y(0)=20\): \( y(t) = 150 - 130\,e^{-t/200} \).
At \(t=30\): \( y(30) = 150 - 130\,e^{-0.15} \approx 38.1\,\text{kg} \). ∎
Instructor Note

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.

Law · Law of Natural Growth

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.

Solution of the Logistic Equation
\[ P(t) = \frac{K}{1 + A e^{-kt}}, \qquad A = \frac{K - P_0}{P_0} \]
Key Idea As \(t \to \infty\), \(P(t) \to K\): every logistic solution levels off at the carrying capacity. The population grows fastest when it reaches half its carrying capacity, \(P = K/2\), where the solution curve has an inflection point.
P t P = K K/2 (fastest growth)

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.)

EXAMPLE 1 A Logistic Initial-Value Problem
Solve \( \dfrac{dP}{dt} = 0.08P\!\left(1 - \dfrac{P}{1000}\right) \) with \(P(0)=100\), then find \(P(40)\) and the time when \(P=900\).
Solution
Here \(k=0.08\), \(K=1000\), \(P_0=100\), so \(A = \dfrac{1000-100}{100} = 9\).
Solution: \( P(t) = \dfrac{1000}{1 + 9e^{-0.08t}} \).
\( P(40) = \dfrac{1000}{1 + 9e^{-3.2}} \approx 731.6 \).
Set \(P=900\): \( e^{-0.08t} = \tfrac{1}{81} \Rightarrow t = \dfrac{\ln 81}{0.08} \approx 54.9 \). The population reaches \(900\) at about \(t \approx 55\). ∎

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.

Instructor Note

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
\[ I(x) = e^{\int P(x)\,dx} \]
Method · Solving a Linear Equation

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] \).

EXAMPLE 1 A Direct Application
Solve \( \dfrac{dy}{dx} + 3x^2 y = 6x^2 \).
Solution
Here \(P(x)=3x^2\), so \( I(x) = e^{\int 3x^2\,dx} = e^{x^3} \).
Multiply through: \( \big(e^{x^3} y\big)' = 6x^2 e^{x^3} \).
Integrate: \( e^{x^3} y = 2e^{x^3} + C \).
Solve for \(y\): \( y = 2 + C e^{-x^3} \). ∎
EXAMPLE 2 Putting an Equation in Standard Form
Solve the initial-value problem \( x^2 y' + xy = 1,\ x>0,\ y(1)=2 \).
Solution
Divide by \(x^2\) for standard form: \( y' + \dfrac{1}{x}y = \dfrac{1}{x^2} \).
Integrating factor: \( I(x) = e^{\int (1/x)\,dx} = e^{\ln x} = x \).
Multiply: \( (xy)' = \dfrac{1}{x} \), so \( xy = \ln x + C \).
Apply \(y(1)=2\): \( 2 = 0 + C \Rightarrow C = 2 \). Thus \( y = \dfrac{\ln x + 2}{x} \). ∎

Application to Electric Circuits

Law · Kirchhoff's Voltage Law (RL circuit)

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)\).

EXAMPLE 3 Current in an RL Circuit
With \(R=12\,\Omega\), \(L=4\,\text{H}\), a constant \(60\,\text{V}\) battery, and \(I(0)=0\), find \(I(t)\) and its limiting value.
Solution
Standard form: \( \dfrac{dI}{dt} + 3I = 15 \); integrating factor \( e^{3t} \).
\( \big(e^{3t} I\big)' = 15 e^{3t} \Rightarrow e^{3t} I = 5 e^{3t} + C \), so \( I = 5 + C e^{-3t} \).
Apply \(I(0)=0\): \( C = -5 \), giving \( I(t) = 5\big(1 - e^{-3t}\big) \).
Limiting current: \( \displaystyle\lim_{t\to\infty} I(t) = 5\,\text{A} \). ∎
Instructor Note

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.

Lotka–Volterra System
\[ \frac{dR}{dt} = kR - aRW, \qquad \frac{dW}{dt} = -rW + bRW \]

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.

EXAMPLE 1 Equilibrium of a Rabbit–Wolf System
For \(k=0.08,\ a=0.001,\ r=0.02,\ b=0.00002\), find the nonzero equilibrium (constant) populations.
Solution
The system is \( \dfrac{dR}{dt} = 0.08R - 0.001RW \), \( \dfrac{dW}{dt} = -0.02W + 0.00002RW \).
Set both to zero. From the first: \( R(0.08 - 0.001W)=0 \Rightarrow W = 80 \).
From the second: \( W(-0.02 + 0.00002R)=0 \Rightarrow R = 1000 \).
The nonzero equilibrium is \(R=1000\) rabbits, \(W=80\) wolves — just enough rabbits to sustain a constant wolf population. ∎
Pop. t prey (R) predator (W)

FIGURE 9.6.1Prey and predator populations oscillate out of phase: prey peaks lead predator peaks by about a quarter cycle. (Original schematic.)

Key Idea Lotka–Volterra trajectories are closed curves — populations cycle indefinitely, returning to their starting values. Real Hudson's Bay Company records of snowshoe hare and Canada lynx show exactly such coupled ~10-year oscillations, confirming the model qualitatively.

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.

Instructor Note

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.