Model a differential equation
A differential equation is an equation that contains the derivative of an unknown function. In a model, the function gives a quantity \(y\) at each time \(t\), and the equation states \(\frac{dy}{dt}\) using \(y\), \(t\) or both. This topic writes such an equation from words, adds the starting value that it leaves open, and checks the units.
A rate that depends on the amount
On the left, the graph of an amount y against time t: a curve that rises faster and faster from a low start, with an orange point that can be dragged and the orange tangent there. On the right, a panel shows the rate across and the amount up, on the same scale: a green line through the point where its axes cross, labeled k y, and an orange bar from the vertical axis to the line at the height of the point. One button adds red dashed lines for a rate kept at its starting value: a vertical line in the panel, and a straight line on the graph that lies below the curve. Another button makes the rate proportional to M minus y: a dashed line marks the value M, the curve rises more and more slowly toward it, and the line in the panel meets the vertical axis at the height M, green below it and red above it.
To write the equation, name the quantity and the time with their units. The phrase “the rate of change of \(y\)” is the derivative \(\cy{\frac{dy}{dt}}\), in units of \(y\) per unit of time (topic 4.1). The word “is” becomes an equals sign.
One quantity is proportional to another if it equals the other times a constant \(k\neq 0\), the constant of proportionality. A rate proportional to the amount is therefore \(ky\), so the sentence “the rate of change of \(y\) is proportional to \(y\)” becomes \(\frac{dy}{dt}=ky\).
In Figure 1, the curve follows this equation with \(k>0\), and the slope of the orange tangent is the rate. The panel on the right shows the rate across and the amount up, on the graph's amount scale. Its line gives the rate \(ky\) at each amount. The orange bar at the height of the point ends on the line, so its length is the slope.
Move the point to the right. The amount grows, so the bar lengthens and the tangent becomes steeper. The line passes through the origin, where the amount and the rate are both 0, and twice the amount gives twice the rate.
For \(y>0\), the rate \(ky\) has the sign of \(k\), so the amount increases if \(k>0\) and decreases if \(k<0\) (topic 5.3). Some books call this equation the law of natural growth or decay.
A rate given as a percent of the amount is proportional to the amount. A population \(P\) that grows at a rate of 2% of \(P\) per year follows \(\frac{dP}{dt}=0.02P\), where \(P\) is the population at each moment. The starting population gives only the starting rate. Use the first button under Figure 1 to keep the rate at its starting value. The red dashed lines show this mistake: the same rate at every amount, and amounts that lie below the curve.
Some rates are proportional to a difference. By Newton's law of cooling, a drink at temperature \(T\) in a room at a fixed temperature \(M\) has \(\frac{dT}{dt}\) proportional to \(M-T\). Use the second button under Figure 1 to make the rate proportional to \(M-y\). The dashed line marks \(M\), and the line in the panel crosses the vertical axis at \(M\), where the rate is 0. With \(k>0\), the rate \(k(M-y)\) is positive below \(M\) and negative above it, where the line is red. The amount therefore increases below \(M\) and decreases above it. As it nears \(M\), the bar shortens and the curve flattens.
“Inversely proportional to \(y\)” gives \(\frac{k}{y}\), for \(y\neq 0\), and “proportional to the time” gives \(kt\). To find \(k\), divide a known rate by what \(k\) multiplies, such as \(\frac{1}{y}\), at the same moment.
Rates in and out
On the left, a tank of teal water, with a green arrow that pours in at the top and a red arrow that drains at its foot, each as wide as its rate. On the right, the graph of the water W in liters against the time in minutes, from 0 to 40 minutes. The curve starts at 100 liters, at an orange dot that can be dragged up and down the vertical axis, and rises more and more slowly toward a dashed line at 300 liters. An orange point on the curve carries the orange tangent, and the water in the tank stands at the height of the point. As the water rises, the red arrow widens. Faint curves start at 0, 200 and 400 liters, and they also approach the dashed line.
Many quantities gain and lose at the same time. Let \(I(t)\) be all that comes in from time 0 to time \(t\), and \(O(t)\) all that goes out. Then \(y(t)=y(0)+I(t)-O(t)\), and by the difference rule, \(\frac{dy}{dt}=I'(t)-O'(t)\), the rate in minus the rate out, called the net rate.
In Figure 2, a pipe adds 30 liters of water per minute to a tank. A leak removes water at a rate of 10% of the amount per minute. With \(W\) liters in the tank, the leak removes \(0.1W\) liters per minute, so
At the start, \(W=100\), so the tangent has slope \(30-0.1\cdot 100=20\). Move the time forward. The water rises, the red arrow widens and the tangent flattens. At 300 liters the two rates are equal, so the net rate, which is \(0.1(300-W)\), is 0 there. This rate is \(k(M-W)\) with \(k=0.1\) and \(M=300\), a rate proportional to a difference, as in Figure 1.
Every term must be in units of the amount per unit of time. Salt water with 0.2 kilograms of salt per liter, flowing in at 6 liters per minute, brings \(0.2\cdot 6=1.2\) kilograms of salt per minute.
The starting value and the units
The equation gives the rate at every amount, but not the amount at a given time. The faint curves in Figure 2 follow the same equation from other starting amounts. Drag the orange dot on the vertical axis, or use the second slider, to move the start. Each curve that holds 250 liters has slope \(30-0.1\cdot 250=5\) there, yet each start gives its own curve.
A model therefore states the amount \(y_0\) at one time \(t_0\). This initial condition, \(y(t_0)=y_0\), together with the equation forms an initial value problem, such as the tank's equation with \(W(0)=100\).
In the tank, \(0.1W\) is in liters per minute and \(W\) in liters, so 0.1 is in 1 per minute. If \(s=ct\) measures the time in another unit, then \(\frac{dt}{ds}=\frac{1}{c}\), and the chain rule \(\frac{dy}{ds}=\frac{dy}{dt}\cdot\frac{dt}{ds}\) divides the right side by \(c\). In seconds, with \(c=60\), the water follows
The initial condition stays the same, because \(s=0\) when \(t=0\).
Example 1
Translate a rate statement into an equation
A spherical snowball melts so that its volume \(V\) decreases at a rate proportional to its surface area. Its radius is \(r\), so \(V=\frac{4}{3}\pi r^3\) and its surface area is \(4\pi r^2\). Write a differential equation for \(V\) in terms of \(r\), and show that the radius decreases at a constant rate.
Solution
A rate proportional to the surface area is a constant \(k\) times the area, and \(k<0\) because the volume decreases:
Both \(V\) and \(r\) depend on time. If \(r\) is a differentiable function of \(t\), the chain rule (topic 3.1) gives
While the snowball exists, \(r>0\). Setting the two expressions equal and dividing by \(4\pi r^2\) gives
The rate of the radius is the constant \(k<0\), so the radius decreases at a constant rate.
Example 2
Model proportional growth or decay
A metal rod at 220 °C is placed in a room at 20 °C. Its temperature \(T\), in degrees Celsius, decreases at a rate proportional to the difference between \(T\) and the room temperature. When \(T=120\), it decreases at 8 degrees per minute. Write a differential equation for \(T\), with \(t\) in minutes, and find \(\dfrac{dT}{dt}\) when \(T=70\).
Solution
By Newton's law of cooling, the rate is proportional to \(20-T\), which is negative while the rod is hotter than the room. A constant \(k>0\) therefore gives the decrease:
At \(T=120\), the rate is \(-8\) and the difference is \(20-120=-100\):
The constant is in 1 per minute, because it is a rate in degrees per minute divided by a difference in degrees. When \(T=70\),
The rod cools at 4 degrees per minute, half the rate at 120 °C, because it is half as far above the room. The starting 220 °C is the initial condition \(T(0)=220\), not a term of the equation.
Example 3
Combine competing rates
Fish in a lake are born at a rate of 9% of the population per year, die at a rate of 4% of the population per year, and are caught at 300 fish per year. Write a differential equation for the number \(N\) of fish, with \(t\) in years. Find \(\dfrac{dN}{dt}\) when \(N=5000\) and the value of \(N\) for which the population does not change.
Solution
Every rate is in fish per year. Births are the rate in, and deaths and fishing are rates out:
When \(N=5000\), births add 450 fish per year and deaths remove 200, but fishing removes 300:
The population decreases at 50 fish per year. It does not change where the net rate is 0:
Example 4
Use initial conditions and units
An account opens with 3000 dollars, and its balance \(B\), in dollars, grows at a rate of 6% of the balance per year. Write an initial value problem for \(B\) with the time \(t\) in years. Then write it with the time \(s\) in months, and find the rate of change of \(B\) at the start in dollars per month.
Solution
The rate is 6% of the balance at each moment, and the opening balance is the value at \(t=0\):
Since \(0.06B\) is in dollars per year, 0.06 is in 1 per year. A year has 12 months, so \(s=12t\), and the chain rule divides the right side by 12. The initial condition stays the same, because \(s=0\) when \(t=0\):
At the start, the balance grows at
As a check, the starting rate \(0.06\cdot 3000=180\) dollars per year is \(\frac{180}{12}=15\) dollars per month.
Each example is one of the four skills of topic 7.1 in Which & Why: AP Calculus.