Modeling with Differential Equations: Steps and Examples

#Calculus
TL;DR
To model with a differential equation, write the rate of change as a rule, such as rate in minus rate out. This guide to modeling with differential equations builds, solves and checks five classic models.
BT
Bhanzu TeamLast updated on October 11, 202615 min read

What Is Modeling With Differential Equations?

Modeling with differential equations means writing an equation for how fast a quantity changes, then solving it to predict the quantity itself. You rarely know a formula for the amount of salt, heat or people directly; you usually know a rule for its rate of change, and that rule is the model.

Most first models come from one of two templates. The balance law, for anything that flows in and out:

dQdt=(rate in)−(rate out)\frac{dQ}{dt} = (\text{rate in}) - (\text{rate out})

and the proportional law, for anything that grows or shrinks in step with its own size:

dydt=ky\frac{dy}{dt} = ky

where:

  • QQ or yy is the quantity being tracked (salt in kilograms, population, temperature gap), a function of time tt

  • dQdt\frac{dQ}{dt} is its rate of change, in units of the quantity per unit time

  • kk is a constant of proportionality: k>0k > 0 means growth, k<0k < 0 means decay

  • the rate in and rate out are measured in the same units as dQdt\frac{dQ}{dt}, which is the first check on any model

The derivative here is doing its original job, measuring a derivative as a rate of change. A model is only finished when it also has a starting value, such as Q(0)=60Q(0) = 60, which turns it into an initial value problem with one answer instead of a family.

How Do You Build A Differential Equation From A Word Problem?

Build the model in six steps, and do them in this order every time. Most wrong models come from skipping step 1 or step 6, not from bad algebra.

  1. Name the variables and units. Decide what tt measures (minutes or hours) and what the unknown is (kilograms of salt, not concentration, for example).

  2. Pick the governing rule. Is it a balance (things flow in and out), a proportional rate, or a force law?

  3. Translate each phrase into symbols. Use the table below.

  4. Attach the starting value. Every "initially" or "at the start" becomes an initial condition.

  5. Solve. Choose a method by the equation's shape.

  6. Check the model. Units, signs, long-run behaviour and a sanity comparison with reality.

The translation step is where language trips people up, so here is the phrasebook:

Phrase in the problem

What it becomes

"the rate at which QQ changes"

dQdt\frac{dQ}{dt}

"proportional to QQ"

kQkQ for some constant kk

"proportional to the difference between TT and the room temperature TsT_s"

k(T−Ts)k(T - T_s)

"decreases", "is lost", "leaks out"

a minus sign in front of that term

"enters at 3 L/min with 0.2 kg/L of salt"

rate in =3×0.2=0.6= 3 \times 0.2 = 0.6 kg/min

"the solution is kept well mixed"

rate out =QV×= \frac{Q}{V} \times outflow rate

"the population cannot exceed KK"

a factor (1−PK)\left(1 - \frac{P}{K}\right) (logistic)

"air resistance proportional to speed"

a drag force −cv-cv

A model only needs to be as detailed as the question. Asking "when will this tea be drinkable?" needs Newton's law of cooling; asking how heat moves through the cup wall needs a partial differential equation in space and time. That second, more complex kind of question is how differential equations model complex physical phenomena: more variables, more equations coupled together, and usually a computer to solve them.

What Assumptions Does Every Model Make?

Every differential equation model rests on simplifying assumptions, and the honest way to model is to write them down. An assumption is not a weakness; a hidden assumption is.

Model

Key assumption

What breaks if it is false

Exponential growth

Unlimited food and space; constant growth rate kk

Predicts infinite population; switch to logistic

Newton's law of cooling

Room temperature stays constant; the object has one uniform temperature

A large object in a small room warms the room

Mixing tank

The tank is well mixed, so the outflow concentration equals the tank concentration

Layers form; the model needs a PDE in space

Falling body with drag

Drag is proportional to speed (cvcv)

At high speed drag is closer to cv2cv^2; terminal speed changes

Logistic growth

A fixed carrying capacity KK and no harvesting or migration

Seasonal or harvested populations need extra terms

The well-mixed assumption deserves a second look, because it answers the question students ask most about mixing problems: why is the rate out equal to concentration times flow? Because if the tank is well mixed so the salt is spread evenly, every litre leaving carries the tank's current concentration QV\frac{Q}{V}, so salt leaves at QV\frac{Q}{V} kilograms per litre times the litres leaving per minute.

Which Classic Models Should You Know?

Five models cover most first-course problems, and each one is a balance law or a proportional law in disguise. The table is the reference; the examples below work each one through.

Model

Differential equation

Solution

Long-run behaviour

Growth or decay

dPdt=kP\frac{dP}{dt} = kP

P=P0ektP = P_0e^{kt}

Grows without limit (k>0k > 0) or decays to 0 (k<0k < 0)

Newton's law of cooling

dTdt=−k(T−Ts)\frac{dT}{dt} = -k(T - T_s)

T=Ts+(T0−Ts)e−ktT = T_s + (T_0 - T_s)e^{-kt}

Settles at room temperature TsT_s

Mixing (equal flows)

dQdt=rcin−rVQ\frac{dQ}{dt} = r c_{\text{in}} - \frac{r}{V}Q

Q=Vcin+(Q0−Vcin)e−rt/VQ = Vc_{\text{in}} + \left(Q_0 - Vc_{\text{in}}\right)e^{-rt/V}

Tank concentration approaches the inflow concentration

Falling body, linear drag

mdvdt=mg−cvm\frac{dv}{dt} = mg - cv

v=mgc(1−e−ct/m)v = \frac{mg}{c}\left(1 - e^{-ct/m}\right) for v(0)=0v(0) = 0

Terminal velocity mgc\frac{mg}{c}

Logistic growth

dPdt=rP(1−PK)\frac{dP}{dt} = rP\left(1 - \frac{P}{K}\right)

P=K1+Ae−rtP = \frac{K}{1 + Ae^{-rt}}, A=K−P0P0A = \frac{K - P_0}{P_0}

Levels off at the carrying capacity KK

Each solution comes from a standard method. Growth, cooling and the logistic equation separate cleanly, so they belong to separable differential equations. Mixing and falling-body equations are first-order linear, the home ground of the integrating factor method. Growth and decay have a page of their own on exponential growth and decay, including half-life and doubling time, so they are not re-derived here.

How Do You Check Whether A Model Is Any Good?

Check a model before you trust its numbers: units, signs, equilibrium, special cases and data. These checks take a minute and catch most modeling errors before any solving starts.

  • Units: every term in the equation must carry the units of dQdt\frac{dQ}{dt}. Kilograms per minute cannot be added to litres per minute.

  • Signs: a hot object in a cool room must have dTdt<0\frac{dT}{dt} < 0. If your cooling equation makes the tea heat up, a sign is wrong.

  • Equilibrium: set dQdt=0\frac{dQ}{dt} = 0 and solve. The equilibrium value should make physical sense (room temperature, carrying capacity, inflow concentration).

  • Special cases: turn a parameter off and see if the model reduces to something you trust. With no drag, mdvdt=mgm\frac{dv}{dt} = mg gives free fall.

  • Data: if a measurement exists (the tea was 70 degrees after 5 minutes), use it to fix the constant, then compare later predictions with later measurements.

A slope field shows the equilibrium check at a glance: horizontal slope marks along a line mean an equilibrium, and arrows pointing toward it mean a stable one. The direction fields page shows how to sketch one by hand. When no formula exists, numerical methods (Euler's method and its descendants) step the model forward from the initial value.

Examples Of Modeling With Differential Equations

Example 1

A culture of 500 bacteria grows at a rate proportional to its size and reaches 4000 after 6 hours. When will it reach 10,000?

Model: rate proportional to amount.

dPdt=kP,P(0)=500\frac{dP}{dt} = kP, \quad P(0) = 500

P=500ektP = 500e^{kt}

Use the data point P(6)=4000P(6) = 4000:

e6k=8e^{6k} = 8

k=ln⁡86=ln⁡22≈0.3466k = \frac{\ln 8}{6} = \frac{\ln 2}{2} \approx 0.3466

The population doubles every 2 hours. Solve P=10,000P = 10{,}000:

ekt=20e^{kt} = 20

t=2ln⁡20ln⁡2≈8.6439t = \frac{2\ln 20}{\ln 2} \approx 8.6439

Final answer: about 8.6439 hours.

Example 2

A tank holds 300 litres of brine containing 60 kg of salt. Pure water flows in at 3 L/min and the well-mixed solution flows out at 5 L/min. How much salt is left after 60 minutes?

A first attempt treats the volume as fixed at 300 litres:

dQdt=−5Q300\frac{dQ}{dt} = -\frac{5Q}{300}

Q=60e−t/60Q = 60e^{-t/60}

Q(60)=60e−1≈22.0728Q(60) = 60e^{-1} \approx 22.0728

Now test the model. The tank loses 5−3=25 - 3 = 2 litres every minute, so it is empty at t=150t = 150. The fixed-volume model still predicts 60e−2.5≈4.9360e^{-2.5} \approx 4.93 kg of salt in an empty tank, which is impossible. The volume is changing, and the concentration must use the current volume:

V=300−2tV = 300 - 2t

dQdt=0−5Q300−2t\frac{dQ}{dt} = 0 - \frac{5Q}{300 - 2t}

Separate the variables and integrate:

∫dQQ=−∫5300−2t,dt\int \frac{dQ}{Q} = -\int \frac{5}{300 - 2t},dt

ln⁡Q=52ln⁡(300−2t)+C\ln Q = \frac{5}{2}\ln(300 - 2t) + C

Q=60(300−2t300)5/2Q = 60\left(\frac{300 - 2t}{300}\right)^{5/2}

At t=60t = 60:

Q(60)=60(0.6)5/2≈16.7313Q(60) = 60(0.6)^{5/2} \approx 16.7313

The corrected model also gives Q=0Q = 0 exactly when the tank empties at t=150t = 150, which passes the reality check the first model failed.

Final answer: about 16.73 kg of salt.

Example 3

A cup of tea at 90 degrees Celsius sits in a 20 degree room and cools to 70 degrees in 5 minutes. When does it reach 40 degrees?

Newton's law of cooling:

dTdt=−k(T−20),T(0)=90\frac{dT}{dt} = -k(T - 20), \quad T(0) = 90

T=20+70e−ktT = 20 + 70e^{-kt}

Use T(5)=70T(5) = 70:

e−5k=57e^{-5k} = \frac{5}{7}

k=15ln⁡75≈0.0673k = \frac{1}{5}\ln\frac{7}{5} \approx 0.0673

Solve T=40T = 40:

e−kt=27e^{-kt} = \frac{2}{7}

t=5ln⁡3.5ln⁡1.4≈18.6161t = \frac{5\ln 3.5}{\ln 1.4} \approx 18.6161

Final answer: about 18.62 minutes.

Example 4

A 60 kg skydiver falls from rest with air resistance 12v12v newtons, where vv is the speed in m/s. Take downward as positive and g=9.8g = 9.8. Find the speed after 10 seconds and the terminal velocity.

Force balance (Newton's second law, gravity down, drag up):

60dvdt=60(9.8)−12v60\frac{dv}{dt} = 60(9.8) - 12v

dvdt=9.8−0.2v,v(0)=0\frac{dv}{dt} = 9.8 - 0.2v, \quad v(0) = 0

This is linear; its solution is

v=49(1−e−0.2t)v = 49\left(1 - e^{-0.2t}\right)

v(10)=49(1−e−2)≈42.3686v(10) = 49\left(1 - e^{-2}\right) \approx 42.3686

Setting dvdt=0\frac{dv}{dt} = 0 gives the terminal velocity v=9.80.2=49v = \frac{9.8}{0.2} = 49 m/s. The link between velocity, acceleration and position is laid out on the page on velocity and acceleration.

Final answer: about 42.37 m/s after 10 seconds; terminal velocity 49 m/s.

Example 5

A pond can support at most 1000 fish. It starts with 100 fish, and the population follows logistic growth with r=0.5r = 0.5 per month. How many fish are there after 4 months, and when is the population growing fastest?

dPdt=0.5P(1−P1000),P(0)=100\frac{dP}{dt} = 0.5P\left(1 - \frac{P}{1000}\right), \quad P(0) = 100

A=1000−100100=9A = \frac{1000 - 100}{100} = 9

P=10001+9e−0.5tP = \frac{1000}{1 + 9e^{-0.5t}}

P(4)=10001+9e−2≈450.8531P(4) = \frac{1000}{1 + 9e^{-2}} \approx 450.8531

The growth rate 0.5P(1−P1000)0.5P\left(1 - \frac{P}{1000}\right) is largest when P=500P = 500, half the carrying capacity. Solve P=500P = 500:

9e−0.5t=19e^{-0.5t} = 1

t=2ln⁡9≈4.3944t = 2\ln 9 \approx 4.3944

Final answer: about 451 fish after 4 months; fastest growth at about 4.39 months.

Example 6

A savings account earns 4 percent interest per year, compounded continuously, and the owner withdraws 2000 currency units per year continuously. The account starts at 40,000. Does it last, and if not, when does it run out?

Balance law: interest in, withdrawals out.

dAdt=0.04A−2000,A(0)=40,000\frac{dA}{dt} = 0.04A - 2000, \quad A(0) = 40{,}000

Equilibrium first: 0.04A−2000=00.04A - 2000 = 0 gives A=50,000A = 50{,}000. Starting below it, the withdrawals outpace the interest, so the balance falls. The solution is

A=50,000−10,000e0.04tA = 50{,}000 - 10{,}000e^{0.04t}

Set A=0A = 0:

e0.04t=5e^{0.04t} = 5

t=ln⁡50.04≈40.2359t = \frac{\ln 5}{0.04} \approx 40.2359

Final answer: it does not last; it runs out after about 40.24 years. Starting at 50,000 or more, it would last forever.

Why Do We Model With Differential Equations?

We model with differential equations because the laws we actually know are laws about change. "We know the rule of change before we know the answer." Newton's second law, Newton's law of cooling and the balance of salt in a tank all describe rates, and Joseph Fourier built his 1822 theory of heat on Newton's cooling law, as the history of the differential equation records.

Modeling gives three things a formula alone cannot:

  • Prediction from a rule: you can forecast tomorrow's amount from today's amount and the rule, even before anyone has measured tomorrow.

  • Understanding through equilibrium: setting the rate to zero tells you where a system settles, often the most useful answer of all.

  • Control: engineers and doctors change one parameter (a drip rate, a drag coefficient) and read off the effect before trying it for real.

Where Is Modeling With Differential Equations Used?

Modeling with differential equations is used wherever something flows, grows, cools or moves. A few of the places it does real work:

  • Medicine: drug levels in the bloodstream follow balance laws, which set dosing intervals.

  • Epidemiology: infection models track susceptible, infected and recovered groups with coupled differential equations.

  • Environment: pollution in a lake follows the same rate-in, rate-out law as the salt tank in Example 2.

  • Engineering: circuits, springs and suspension systems are second-order models; see the classification on the ordinary differential equations page.

  • Archaeology: radiocarbon dating runs the decay model backwards to estimate age.

  • Finance: continuously compounded balances with deposits or withdrawals, as in Example 6.

Where Solutions Go Off The Rails

Most modeling errors happen before any calculus: in the sentence-to-symbol step. These four do the most damage.

Mistake 1: A Sign That Makes The Tea Heat Up

Where it slips in: Writing Newton's law of cooling from memory.

Don't do this: Do not write dTdt=k(T−Ts)\frac{dT}{dt} = k(T - T_s) with k>0k > 0; for hot tea, T−Ts>0T - T_s > 0 and the tea would heat up forever.

The correct way: Write dTdt=−k(T−Ts)\frac{dT}{dt} = -k(T - T_s) with k>0k > 0, then check: hot object, negative rate.

Mistake 2: Holding The Volume Fixed When The Flows Differ

Where it slips in: Mixing problems where inflow and outflow rates are not equal.

Don't do this: Do not divide by the starting volume for the whole problem.

The correct way: Write V(t)=V0+(inflow−outflow),tV(t) = V_0 + (\text{inflow} - \text{outflow}),t first, then use QV(t)\frac{Q}{V(t)} as the concentration, as in Example 2.

The rusher is the one most likely to fall here: the problem says "300 litres", and the number goes straight into the denominator. Writing the volume as its own line, before the salt equation, is the habit that fixes it, because the changing volume is then impossible to miss.

Mistake 3: Mixing Units Inside One Equation

Where it slips in: Problems that give flow in litres per minute but ask for an answer in hours, or give a growth rate per year and a time in months.

Don't do this: Do not combine terms measured per minute with terms measured per hour.

The correct way: Convert everything to one time unit in step 1, and write the units next to every term once.

Mistake 4: Trusting Exponential Growth Too Far

Where it slips in: Long-range predictions from dPdt=kP\frac{dP}{dt} = kP.

Don't do this: Do not extend an exponential model for decades; it predicts populations larger than the space or food can hold.

The correct way: Check the long-run behaviour. If the real system must level off, switch to a logistic model with a carrying capacity.

The memorizer tends to know every solution formula in the classic-models table and still pick the wrong one, because the formulas were learned without the sentence that produced them. Saying the rule out loud first ("the rate is proportional to the gap from room temperature") is what makes the right model choose itself.

Practice Problems On Modeling With Differential Equations

  1. A radioactive substance decays at a rate proportional to the amount present and has a half-life of 10 years. Write the differential equation and find kk.

  2. A metal block at 100 degrees cools in a 25 degree room with dTdt=−0.05(T−25)\frac{dT}{dt} = -0.05(T - 25), tt in minutes. Find T(20)T(20).

  3. A 200-litre tank of pure water receives brine with 0.5 kg of salt per litre at 4 L/min, and the well-mixed solution leaves at 4 L/min. Write the model, solve it, and find the salt after 50 minutes.

  4. For dPdt=0.3P(1−P600)\frac{dP}{dt} = 0.3P\left(1 - \frac{P}{600}\right), find the equilibrium populations and the population at which growth is fastest.

  5. Find the terminal velocity for dvdt=9.8−0.4v\frac{dv}{dt} = 9.8 - 0.4v.

  6. For dAdt=0.05A−3000\frac{dA}{dt} = 0.05A - 3000, find the balance at which the account neither grows nor shrinks.

Answer to Problem 1: dQdt=−kQ\frac{dQ}{dt} = -kQ with k=ln⁡210≈0.0693k = \frac{\ln 2}{10} \approx 0.0693 per year.

Answer to Problem 2: T=25+75e−0.05tT = 25 + 75e^{-0.05t}, so T(20)=25+75e−1≈52.5910T(20) = 25 + 75e^{-1} \approx 52.5910 degrees.

Answer to Problem 3: dQdt=2−Q50\frac{dQ}{dt} = 2 - \frac{Q}{50} with Q(0)=0Q(0) = 0, so Q=100(1−e−t/50)Q = 100\left(1 - e^{-t/50}\right) and Q(50)≈63.2121Q(50) \approx 63.2121 kg.

Answer to Problem 4: equilibria at P=0P = 0 and P=600P = 600; fastest growth at P=300P = 300.

Answer to Problem 5: 24.524.5 m/s.

Answer to Problem 6: 60,00060{,}000.

Bottom Line

  • Modeling with differential equations means writing a rule for how fast a quantity changes, then solving it for the quantity itself.

  • Most first models are either a balance law (rate in minus rate out) or a proportional law (dydt=ky\frac{dy}{dt} = ky).

  • Every model rests on assumptions such as a well-mixed tank or a constant room temperature, and the honest model states them.

  • Check units, signs, equilibrium and long-run behaviour before trusting any number a model produces.

  • The most common errors are a wrong sign, a volume held fixed when the flows differ, and mixed units.

Where To Go From Here

Work through Practice Problems 1 to 6, writing the units next to every term; if Problem 3 trips you up, return to Example 2 and the "What Assumptions Does Every Model Make?" table before trying it again.

Book a free demo class with Bhanzu:

Read More

Was this article helpful?

Your feedback helps us write better content

Frequently Asked Questions

What are some examples of modeling with differential equations?
Population growth, radioactive decay, Newton's law of cooling, salt in a mixing tank, a falling object with air resistance, logistic growth with a carrying capacity, drug levels in the blood and a bank balance with withdrawals. Examples 1 to 6 above work through six of them.
Why are partial differential equations used for modeling traffic flow?
Because traffic density changes with both position along the road and time, and an ordinary differential equation can only track one variable. Treating cars like a fluid gives a conservation law in two variables, which is a partial differential equation.
What are the numerical methods for solving differential equations?
The simplest is Euler's method, which steps forward using the slope at the current point. Improved Euler and the Runge-Kutta methods use several slope samples per step and are far more accurate; they are what most scientific software runs.
Is modeling with differential equations different from modeling with matrix algebra?
No, not entirely: the two often work together. A system of linear differential equations, such as several connected tanks or groups in an epidemic, is usually written as dxdt=Ax\frac{d\mathbf{x}}{dt} = A\mathbf{x}, where AA is a matrix. Matrix algebra alone describes a fixed relationship; the differential equation adds how the state changes over time.
What are good books for mathematical modeling with PDEs?
A common path is a first course in ordinary differential equations, then an applied PDE text that builds the heat, wave and transport equations from conservation laws. Look for one with worked modeling chapters, not only solution techniques.
What are the applications of differential equations?
Medicine, engineering, physics, ecology, epidemiology, economics, climate science and archaeology all use them.
What is the difference between a differential equation model and a difference equation model?
A differential equation model treats time as continuous and uses derivatives. A difference equation model updates in steps, such as once per generation or once per year, and suits populations that breed in seasons or money compounded at fixed dates.
✍️ Written By
BT
Bhanzu Team
Content Creator and Editor
Bhanzu’s editorial team, known as Team Bhanzu, is made up of experienced educators, curriculum experts, content strategists, and fact-checkers dedicated to making math simple and engaging for learners worldwide. Every article and resource is carefully researched, thoughtfully structured, and rigorously reviewed to ensure accuracy, clarity, and real-world relevance. We understand that building strong math foundations can raise questions for students and parents alike. That’s why Team Bhanzu focuses on delivering practical insights, concept-driven explanations, and trustworthy guidance-empowering learners to develop confidence, speed, and a lifelong love for mathematics.
Related Articles
Book a FREE Demo ClassBook Now →