01 / 21

Modeling with
Linear ODEs

Learn how first-order linear ordinary differential equations translate real-world phenomena into solvable mathematics: from cooling coffee to draining tanks.

Differential Equations

What is an ODE?

An Ordinary Differential Equation is an equation that relates an unknown function \( y(t) \) to its derivatives. The word "ordinary" means there is only one independent variable (often time \( t \)).

Order 1
\( \frac{dy}{dt} = -ky \)
Order 2
\( \frac{d^2 y}{dt^2} + y = 0 \)
Order 3
\( y''' + y' - 6y = 0 \)

The First-Order Linear ODE

A first-order linear ODE has the standard form:

Key properties: The unknown \( y \) and its derivative \( \frac{dy}{dt} \) appear to the first power only: no \( y^2 \), no \( y \cdot y' \), no \( \sin(y) \). This linearity is what makes the equation systematically solvable.

Why Model with Linear ODEs?

Many real-world processes follow a simple pattern: the rate of change of a quantity is proportional to the quantity itself (or to some external driving function). That pattern is exactly a first-order linear ODE.

Newton's Cooling
Temperature changes proportionally to the difference from ambient.
Mixing Tanks
Concentration changes as fluid flows in and out at known rates.
RC Circuits
Charge on a capacitor changes proportionally to voltage difference.

The Integrating Factor Method

Every first-order linear ODE in standard form can be solved with an integrating factor \( \mu(t) \):

Solution Roadmap

Step 1 Write in standard form Step 2
Find \( P(t) \), compute \( \mu(t) \)
Step 3 Multiply both sides Step 4 Integrate both sides Step 5
Solve for \( y(t) \), apply IC
Particular solution

Linear vs. Nonlinear ODEs

Linear Nonlinear
Form \( y' + P(t)y = Q(t) \) \( y' = f(t, y) \) (general)
Powers of \( y \) First power only \( y^2, \sin(y), e^y, \ldots \)
Guaranteed solution? Yes (integrating factor) Not always
Superposition Applies Does not apply
Example \( y' + 3y = e^t \) \( y' = y^2 - t \)

How to Solve Step by Step

1
Rewrite in standard form: \( \frac{dy}{dt} + P(t)\, y = Q(t) \). Identify \( P(t) \) and \( Q(t) \).
2
Compute the integrating factor: \( \mu(t) = e^{\int P(t)\, dt} \).
3
Multiply every term by \( \mu(t) \). The left side becomes \( \frac{d}{dt}[\mu(t)\, y] \).
4
Integrate both sides with respect to \( t \): \( \mu(t)\, y = \int \mu(t)\, Q(t)\, dt + C \).
5
Solve for \( y(t) \) and apply the initial condition to find \( C \).

Example 1: Exponential Decay

Solve \( \frac{dy}{dt} + 2y = 0 \) with \( y(0) = 5 \).

1
Already in standard form: \( P(t) = 2 \), \( Q(t) = 0 \).
2
Integrating factor: \( \mu = e^{\int 2\, dt} = e^{2t} \).
3
Multiply: \( \frac{d}{dt}[e^{2t} y] = 0 \). Integrate: \( e^{2t} y = C \).
4
Solve: \( y = Ce^{-2t} \). Apply IC: \( 5 = C \).

Visualizing Exponential Decay

t y 0 1 2 3 4 5 0 0.5 1.0 1.5 2.0
\( y(0) = 5 \)
\( y = 5e^{-2t} \)

Example 2: Newton's Cooling

A cup of coffee at \( 90^\circ\text{C} \) is placed in a room at \( 20^\circ\text{C} \). The cooling constant is \( k = 0.1 \). Find the temperature \( T(t) \).

1
Rewrite: \( \frac{dT}{dt} + 0.1\, T = 0.1 \cdot 20 = 2 \). So \( P = 0.1 \), \( Q = 2 \).
2
Integrating factor: \( \mu = e^{0.1t} \). Multiply and integrate.
3
General solution: \( T = 20 + Ce^{-0.1t} \). Apply \( T(0) = 90 \): \( C = 70 \).

Cooling Curve Visualization

t (min) T 0 20 50 90 0 10 20 30 40
\( 20^\circ\text{C} \)
\( T(0) = 90^\circ\text{C} \)
\( T = 20 + 70e^{-0.1t} \)

Example 3: Mixing Tank

A tank holds \( 100 \text{ L} \) of pure water. Brine with \( 0.5 \text{ kg/L} \) of salt flows in at \( 4 \text{ L/min} \). The well-stirred mixture flows out at \( 4 \text{ L/min} \). Find the amount of salt \( y(t) \) in the tank.

1
ODE: \( \frac{dy}{dt} = 2 - \frac{y}{25} \), so \( \frac{dy}{dt} + \frac{1}{25}y = 2 \).
2
Integrating factor: \( \mu = e^{t/25} \). Solve: \( y = 50 + Ce^{-t/25} \).
3
Apply \( y(0)=0 \): \( C = -50 \). So \( y(t) = 50(1 - e^{-t/25}) \).

Transient vs. Steady-State

Solutions to first-order linear ODEs with constant coefficients typically decompose into two parts:

Transient
The homogeneous part \( Ce^{-kt} \) that decays to zero over time. Depends on the initial condition.
Steady-State
The particular solution that persists as \( t \to \infty \). Determined by the driving function \( Q(t) \).

Common Mistakes to Avoid

✕ Forgetting Standard Form
You must divide through so the coefficient of \( y' \) is exactly 1 before identifying \( P(t) \).
✕ Wrong Sign in \( \mu \)
If \( P(t) = -3 \), then \( \mu = e^{-3t} \), not \( e^{3t} \). The sign of the exponent must match the integral of \( P \).
✕ Dropping the Constant
After integrating, always include \( + C \). Without it you cannot apply the initial condition.

Model Summary

Application ODE General Solution
Exponential decay \( y' + ky = 0 \) \( y = y_0 e^{-kt} \)
Newton's cooling \( T' + kT = kT_{\text{env}} \) \( T = T_{\text{env}} + Ce^{-kt} \)
Mixing tank \( y' + \frac{r}{V}y = c_{\text{in}} r \) \( y = c_{\text{in}}V + Ce^{-rt/V} \)
RC circuit \( \frac{dq}{dt} + \frac{1}{RC}q = \frac{V}{R} \) \( q = CV + Ce^{-t/(RC)} \)

Question 1 of 5

Which of the following is a first-order linear ODE?

Question 2 of 5

For the ODE \( \frac{dy}{dt} + 3y = 12 \), what is the integrating factor \( \mu(t) \)?

Question 3 of 5

A quantity satisfies \( y' + 0.5y = 10 \) with \( y(0) = 0 \). What is the steady-state value as \( t \to \infty \)?

Question 4 of 5

A cup of tea cools according to Newton's Law. It starts at \( 80^\circ\text{C} \) in a \( 25^\circ\text{C} \) room. The solution is \( T(t) = 25 + 55e^{-kt} \). What does the constant \( 55 \) represent?

Question 5 of 5

Given \( 2\frac{dy}{dt} + 6y = 4 \), what is the first step before finding the integrating factor?