math.wiki
Calculus › Differential equations › Writing a differential equation from a description
Open on the map
Calculus 1

Writing a differential equation from a description

A law of nature or a rule of thumb often says only how fast something changes, in words. How do you turn that sentence into an equation you can work with?

Where you are 7 in Differential equations

When you reach for it

Many statements about the world describe a rate, not an amount. “The herd grows faster the bigger it is.” “A hot pan cools faster in a colder room.” “Salt water runs in at the top and the mixture drains out the bottom.” Each says how fast a quantity changes, and how fast depends on the quantity itself.

Such a sentence becomes a differential equation: an equation for an unknown function that involves its derivative. You already read a derivative as a rate with units and a sign (The derivative as a rate of change); this lesson runs that skill backward, from the sentence to the equation. Solving the equations comes later. Here the job is to write them correctly and to read what they already say.

The procedure

Name the variables and their units

Start by naming the unknown function, the independent variable and their units: “let T be the pan’s temperature in degrees Fahrenheit, t minutes after it leaves the stove.” Then \displaystyle \frac{dT}{dt} is in degrees per minute, and every term on the right-hand side must carry those same units. That is the most useful single check on a model.

Turn the phrases into symbols

To say z is proportional to x means z = kx for a constant k, the constant of proportionality; inversely proportional to x means \displaystyle z = \frac{k}{x}; jointly proportional to x and y means z = kxy. When z is a rate, these give the following forms.

The rate of change of y isEquation
proportional to y\dfrac{dy}{dt} = ky
proportional to y - A, for a fixed A\dfrac{dy}{dt} = k(y - A)
inversely proportional to y\dfrac{dy}{dt} = \dfrac{k}{y}
jointly proportional to y and M - y\dfrac{dy}{dt} = ky(M - y)

“Proportional to” never says whether the quantity grows or shrinks, so the sign of k comes from the situation: a growing population has k > 0, a decaying amount k < 0. Some books write decay as \displaystyle \frac{dy}{dt} = -ky with k > 0; either is correct once the sign is stated. In this lesson the constant carries its own sign.

The second row is Newton’s law of cooling: an object in surroundings held at temperature A changes temperature at a rate proportional to T - A. A hot object has T - A > 0 and cools, so k < 0. A cold object has T - A < 0 and warms, and the same negative k makes \displaystyle \frac{dT}{dt} > 0. One equation covers both.

The last row is the logistic form. The rate is small when y is near 0 (few present to cause growth) and small again near M (little left to gain). It fits a population limited by food or space, and a rumor or disease spreading through a fixed group. Logistic functions themselves are the subject of Logistic growth: when growth levels off; here the aim is the rate equation behind them.

Rates in minus rates out

When a quantity is fed by one process and drained by another, its rate of change is the difference:

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

This is exact bookkeeping: the net change in a short time is what came in minus what left. For a substance dissolved in a flowing liquid, each rate is a flow times a concentration (liters per minute times kilograms per liter gives kilograms per minute), and what flows out has the tank’s own concentration, amount divided by volume, provided the tank is kept well mixed.

Read the equation back

A value of y where \displaystyle \frac{dy}{dt} = 0 is an equilibrium: a quantity that equals it stays there, because nothing changes it. Where the right-hand side is positive the quantity rises; where it is negative the quantity falls. A table of signs between the equilibria shows which way the quantity heads from any starting value, with no formula for the solution.

Worked examples

Example 1

A herd and a dose

(a) A caribou herd grows at a rate proportional to its size. When the herd has 2400 animals it is growing by 180 animals per year. Write a differential equation for the herd size.

(b) Naja takes a dose of medicine. The amount in her bloodstream decreases at a rate proportional to the amount present. When 400 milligrams remain, the amount is falling by 60 milligrams per hour. Write a differential equation for the amount.

Solution

(a) Let P be the number of caribou t years from now, so \displaystyle \frac{dP}{dt} = kP. At P = 2400 the rate is +180, so 180 = 2400k and k = 0.075:

\frac{dP}{dt} = 0.075P.

The left side is animals per year and P is animals, so k is “per year”. The positive k matches a growing herd.

(b) Let A be the amount in milligrams, t hours from now, so \displaystyle \frac{dA}{dt} = kA. “Falling by 60 milligrams per hour” means \displaystyle \frac{dA}{dt} = -60, so -60 = 400k and k = -0.15 per hour:

\frac{dA}{dt} = -0.15A.

The two sentences have the same grammar; only the sign of the measured rate tells growth from decay.

Example 2

Kunuk’s skillet

Kunuk takes a cast-iron skillet off the stove at 400 degrees Fahrenheit and sets it in a kitchen held at 70 degrees. It cools at a rate proportional to the difference between its temperature and the kitchen’s. When the skillet is at 250 degrees it is cooling by 9 degrees per minute. Write the equation, find how fast it cools the moment it leaves the stove, and find its equilibrium temperature.

Solution

Let T be the temperature in degrees Fahrenheit, t minutes after it leaves the stove. Newton’s law of cooling gives \displaystyle \frac{dT}{dt} = k(T - 70). At T = 250 the rate is -9, so -9 = k(250 - 70) = 180k and k = -0.05 per minute:

\frac{dT}{dt} = -0.05(T - 70).

At the start, \displaystyle \frac{dT}{dt} = -0.05(330) = -16.5 degrees per minute. The rate depends only on the current temperature, so the skillet cools fastest at first and more slowly as it nears the room. Setting \displaystyle \frac{dT}{dt} = 0 gives the equilibrium T = 70. Units: k is per minute and T - 70 is degrees, so the right side is degrees per minute, as required.

Example 3

A rumor at Ivalu’s school

A rumor starts among the 1200 students at Ivalu’s school. It spreads at a rate jointly proportional to the number N of students who have heard it and the number who have not. When 200 students have heard it, it is spreading at 50 students per hour. Write the equation, find the equilibria, and find when the rumor spreads fastest and how fast.

Solution

The number who have not heard is 1200 - N, so with t in hours

\frac{dN}{dt} = kN(1200 - N).

At N = 200: 50 = k(200)(1000) = 200{,}000k, so \displaystyle k = \frac{1}{4000} = 0.00025, in “per student per hour”, since N(1200 - N) is students squared.

The right side is zero at N = 0 (nobody knows, so nobody tells) and at N = 1200 (everyone knows). For 0 < N < 1200 both factors are positive, so the count rises between these equilibria. As a function of N the rate is a downward-opening parabola with zeros 0 and 1200, so it is largest halfway, at N = 600:

\frac{1}{4000}(600)(600) = 90.

That is 90 students per hour. The rumor spreads fastest when half the school has heard it.

600 1200 0 45 90 N dN/dt (600, 90)
Figure 1The rate \displaystyle \frac{dN}{dt} = \frac{1}{4000}N(1200 - N) from Example 3, plotted against N itself. It is zero at both ends and largest halfway.
Example 4

Kunuk’s pickling tank

Kunuk’s tank holds 500 liters of water with 10 kilograms of salt dissolved in it. Brine containing 0.04 kilograms of salt per liter flows in at 6 liters per minute, and the well-mixed solution drains at 6 liters per minute. Write an equation for the salt S (kilograms) after t minutes, with its starting value, and find the equilibrium.

in: 6 L/min 0.04 kg/L out: 6 L/min S/500 kg/L 500 L, well mixed S kg of salt
Figure 2Kunuk’s pickling tank (Example 4). Salt arrives with the brine at a fixed concentration and leaves at the tank’s own concentration, \displaystyle \frac{S}{500} kilograms per liter.
Solution

Salt arrives at 6 \times 0.04 = 0.24 kilograms per minute. Inflow equals outflow, so the volume stays 500 liters, the concentration is \displaystyle \frac{S}{500} kilograms per liter, and salt leaves at \displaystyle 6 \cdot \frac{S}{500} = 0.012S kilograms per minute. Rates in minus rates out:

\frac{dS}{dt} = 0.24 - 0.012S, \qquad S(0) = 10.

At the start, \displaystyle \frac{dS}{dt} = 0.24 - 0.12 = 0.12 kilograms per minute, so the salt increases. The equilibrium solves 0.24 - 0.012S = 0: S = 20 kilograms, a concentration of \displaystyle \frac{20}{500} = 0.04, exactly that of the incoming brine. Once the tank matches the brine, salt leaves as fast as it arrives. Below 20 the salt rises toward 20; above 20 it would fall.

Example 5

Unequal flows

Naja’s dye vat holds 200 liters of clear water and can hold 350 liters. Water carrying 0.5 grams of dye per liter flows in at 8 liters per minute and the well-mixed liquid drains at 5 liters per minute. Write an equation for the dye Q (grams) after t minutes and say for which times it applies.

Solution

The volume gains 8 - 5 = 3 liters each minute, so V = 200 + 3t. Dye arrives at 8 \times 0.5 = 4 grams per minute and leaves at \displaystyle 5 \cdot \frac{Q}{200 + 3t} grams per minute:

\frac{dQ}{dt} = 4 - \frac{5Q}{200 + 3t}, \qquad Q(0) = 0.

The vat is full when 200 + 3t = 350, at t = 50; after that it overflows and the outflow is no longer 5 liters per minute. So the equation holds for 0 \le t \le 50. The right side now depends on t as well as Q, because the dye is spread through a growing volume.

Example 6

Reading a fishing model

Ivalu models the Arctic char in a lake by

\frac{dP}{dt} = 0.0002P(2500 - P) - 200,

with P the number of fish and t in years. Say what the equation assumes, find its equilibria, and describe what happens from different starting sizes.

Solution

The first term is logistic: without fishing, the population would grow at a rate jointly proportional to its size and to 2500 - P. The term -200 is a fixed catch of 200 fish per year, whatever the population. For the units to agree, 0.0002 is “per fish per year”.

Equilibria: 0.0002P(2500 - P) = 200 gives

\begin{aligned} P^2 - 2500P + 1{,}000{,}000 &= 0, \\ (P - 500)(P - 2000) &= 0, \end{aligned}

so P = 500 or P = 2000. Test one value in each interval:

P\displaystyle \frac{dP}{dt}The population
10048 - 200 = -152falls
1000300 - 200 = 100rises
2200132 - 200 = -68falls

A population between 500 and 2000 rises toward 2000, and one above 2000 falls toward it. One below 500 keeps falling: the catch takes more than the fish replace. The equation says this before anyone solves it.

Boundaries

  • A model is an assumption, not a theorem. “Proportional to” claims the ratio of rate to amount stays fixed, which real data may not obey.
  • The constants are assumed constant. If the kitchen warms or the brine’s concentration varies, that constant must be replaced by a function of t.
  • The tank model needs a well-mixed tank and a volume that stays positive and below capacity; the dye vat’s equation stops at t = 50.
  • An equation alone does not pick out one function; an initial condition such as S(0) = 10 does. Checking a proposed formula against both is substituting it into the equation.
  • A rate in students or fish per hour treats a count as smooth, which is sensible only when counts are large.

Where this goes next

The form \displaystyle \frac{dy}{dt} = ky has exponential functions as its solutions (Exponential growth and decay models). Cooling, tank and logistic equations are solved by separating the variables and fixing the constant from a starting value (Separable differential equations). An equation’s right-hand side can also be drawn as short slope marks across the plane (Slope fields), where the equilibria of this lesson appear as level lines; and the ceiling a logistic quantity approaches is studied in Logistic growth.

Exercises

Proportional rates and differences

  1. A colony of bacteria grows at a rate proportional to the number present. With 5000 bacteria it is growing by 400 bacteria per hour. Write a differential equation for the number B.
  2. A snowmobile’s value decreases at a rate proportional to its value. When it is worth 9000 dollars it is losing 1800 dollars per year. Write a differential equation for its value V.
  3. Lemonade at 38 degrees Fahrenheit is set in a room at 72 degrees and warms at a rate proportional to the difference between its temperature and the room’s. At 50 degrees it is warming by 1.32 degrees per minute. Write the equation and find how fast it warms at the start.
  4. Ice on a lake thickens at a rate inversely proportional to its thickness h in centimeters. At 2 centimeters thick it is thickening by 0.5 centimeters per hour. Write the equation and find the rate at 4 centimeters.
  5. The height h of water draining from a tank, in centimeters, falls at a rate proportional to \displaystyle \sqrt{h}. At 16 centimeters it falls by 2 centimeters per minute. Write the equation and find the rate at 9 centimeters.
  6. A student learns words from a list of 800 at a rate proportional to the number not yet learned. With 300 learned, she learns 25 words per day. Write an equation for the number W learned and give its equilibrium.

Jointly proportional rates

  1. A flu spreads through a town of 5000 people at a rate jointly proportional to the number I who have had it and the number who have not. When 1000 have had it, 80 new people catch it per day. Write the equation and find the rate when 2500 have had it.
  2. A population obeys \displaystyle \frac{dP}{dt} = 0.02P\left(1 - \frac{P}{600}\right). Find its equilibria, where P rises, the value of P at which it grows fastest and that rate, and write the equation in the form kP(600 - P).
  3. A rumor at a camp obeys \displaystyle \frac{dN}{dt} = 0.001N(400 - N), with t in hours. How fast is it spreading when 100 people have heard it? When is it spreading fastest, and how fast?

Rates in minus rates out

  1. A tank holds 1000 liters of pure water. Brine with 0.05 kilograms of salt per liter flows in at 10 liters per minute and the well-mixed solution drains at 10 liters per minute. Write an equation for the salt S in kilograms, with its starting value, and find the equilibrium.
  2. A tank holds 300 liters of water with 15 kilograms of salt. Pure water flows in at 4 liters per minute and the well-mixed solution drains at 4 liters per minute. Write the equation and find the rate at the start.
  3. A tank holds 400 liters of water with 20 grams of a chemical. Water with 2 grams of the chemical per liter flows in at 5 liters per minute, and the well-mixed solution drains at 7 liters per minute. Write an equation for the chemical Q, say for which times it applies, and find the rate at the start.
  4. A pond holds 8000 cubic meters of water. A stream brings in 40 cubic meters per day carrying 0.5 grams of pollutant per cubic meter, and 40 cubic meters per day flow out. The pollutant also breaks down at a rate of 0.015Q grams per day, where Q is the grams present. Write the equation and find the equilibrium.
  5. A drip delivers medicine into a patient’s blood at 3 milligrams per hour, and the body removes it at a rate proportional to the amount A present, with constant 0.2 per hour. Write the equation and find the equilibrium.

Reading an equation

  1. A temperature obeys \displaystyle \frac{dT}{dt} = -0.08(T - 65), in degrees Fahrenheit and minutes. What is the temperature of the surroundings? Find the rate at T = 40 and at T = 90 and say what each means.
  2. A reindeer herd obeys \displaystyle \frac{dy}{dt} = 0.25y - 30, with t in years. Say what each term means, find the equilibrium, and say what happens to a herd of 160 and to a herd of 80.

Reasoning

  1. Explain why \displaystyle \frac{dT}{dt} = k(T - A) needs k < 0 both for a hot object in a cool room and for a cold object in a warm room.
  2. A tank with equal inflow and outflow obeys \displaystyle \frac{dS}{dt} = rc - \frac{r}{V}S, with r, c, V positive constants. Find the equilibrium and explain from the sign of \displaystyle \frac{dS}{dt} why the salt moves toward it from either side.
  3. Explain why, for a rumor in a closed group of M people, \displaystyle \frac{dN}{dt} = kN(M - N) is more believable than \displaystyle \frac{dN}{dt} = kN.
  4. Show that kP(M - P) and \displaystyle rP\left(1 - \frac{P}{M}\right) are the same expression when r = kM.
Answers
  1. 400 = 5000k, so k = 0.08 per hour: \displaystyle \frac{dB}{dt} = 0.08B.
  2. -1800 = 9000k, so k = -0.2 per year: \displaystyle \frac{dV}{dt} = -0.2V.
  3. 1.32 = k(50 - 72) = -22k, so k = -0.06: \displaystyle \frac{dT}{dt} = -0.06(T - 72). At the start, -0.06(38 - 72) = 2.04 degrees per minute.
  4. \displaystyle 0.5 = \frac{k}{2}, so k = 1 (square centimeters per hour): \displaystyle \frac{dh}{dt} = \frac{1}{h}. At h = 4 the rate is 0.25 centimeters per hour.
  5. \displaystyle -2 = k\sqrt{16} = 4k, so k = -0.5: \displaystyle \frac{dh}{dt} = -0.5\sqrt{h}. At h = 9: -0.5(3) = -1.5 centimeters per minute.
  6. 25 = k(800 - 300), so k = 0.05: \displaystyle \frac{dW}{dt} = 0.05(800 - W). Equilibrium W = 800, the whole list.
  7. \displaystyle \frac{dI}{dt} = kI(5000 - I) with 80 = k(1000)(4000), so k = 0.00002. At I = 2500: 0.00002(2500)(2500) = 125 people per day.
  8. Equilibria P = 0 and P = 600; P rises for 0 < P < 600. The rate is a downward parabola in P with zeros 0 and 600, largest at P = 300, where it is 0.02(300)(0.5) = 3. Since \displaystyle \frac{0.02}{600} = \frac{1}{30{,}000}, the equation is \displaystyle \frac{dP}{dt} = \frac{1}{30{,}000}P(600 - P).
  9. At N = 100: 0.001(100)(300) = 30 people per hour. Fastest halfway, at N = 200: 0.001(200)(200) = 40 people per hour.
  10. In: 10(0.05) = 0.5; out: \displaystyle 10 \cdot \frac{S}{1000}. So \displaystyle \frac{dS}{dt} = 0.5 - 0.01S, S(0) = 0, with equilibrium S = 50 kilograms.
  11. In: 0; out: \displaystyle 4 \cdot \frac{S}{300}. So \displaystyle \frac{dS}{dt} = -\frac{S}{75}, a proportional decay. At the start, \displaystyle -\frac{15}{75} = -0.2 kilograms per minute.
  12. Volume 400 - 2t. In: 5(2) = 10; out: \displaystyle \frac{7Q}{400 - 2t}. So \displaystyle \frac{dQ}{dt} = 10 - \frac{7Q}{400 - 2t}, Q(0) = 20, for 0 \le t < 200 (empty at t = 200). At the start, \displaystyle 10 - \frac{140}{400} = 9.65 grams per minute.
  13. In: 40(0.5) = 20; out with the water: \displaystyle 40 \cdot \frac{Q}{8000} = 0.005Q; broken down: 0.015Q. So \displaystyle \frac{dQ}{dt} = 20 - 0.02Q, with equilibrium Q = 1000 grams.
  14. \displaystyle \frac{dA}{dt} = 3 - 0.2A, with equilibrium A = 15 milligrams.
  15. The surroundings are at 65 degrees. At T = 40: -0.08(-25) = 2, warming by 2 degrees per minute. At T = 90: -0.08(25) = -2, cooling by 2 degrees per minute.
  16. 0.25y: growth proportional to size, constant 0.25 per year; -30: 30 animals removed per year. Equilibrium y = 120. At 160: 40 - 30 = 10 > 0, the herd grows. At 80: 20 - 30 = -10 < 0, it shrinks.
  17. A hot object has T - A > 0 and cools, so k(T - A) < 0 forces k < 0. A cold object has T - A < 0 and warms, so k(T - A) > 0, and a negative times a negative is positive: again k < 0. The factor T - A changes sign; k does not.
  18. \displaystyle rc - \frac{r}{V}S = 0 gives S = cV, the amount that makes the tank’s concentration c. If S < cV then \displaystyle \frac{dS}{dt} > 0 and the salt rises; if S > cV then \displaystyle \frac{dS}{dt} < 0 and it falls. Either way it heads toward cV.
  19. With \displaystyle \frac{dN}{dt} = kN, k > 0, the rate grows without limit, so more than M people would eventually “hear” it. The factor M - N says a teller must meet someone who has not heard; the rate slows to 0 as N nears M, and N = M is an equilibrium.
  20. Substitute r = kM and expand; the result is kP(M - P):
\begin{aligned} rP\left(1 - \frac{P}{M}\right) &= kMP\left(1 - \frac{P}{M}\right) \\ &= kMP - kP^2 = kP(M - P). \end{aligned}
unattributed · CC-BY-SA-4.0