Section7.1Functions modelling rate of accumulation
Subsection7.1.1Concept and basic examples
In Chaptersย 5โ6, we explored starting with a quantity function and computing the quantityโs rate of accumulation. From this point to the end of Chapterย 21, we will most often be concerned with the opposite problem: starting with a model of the rate of accumulation of some quantity and from that computing accumulation amounts and, ultimately, obtaining a quantity function that can be used to predict specific future quantity amounts.
Suppose \(q \) is a quantity that is varying over time. A rate function for \(q \) is a function \(r(t) \) whose output represents the instantaneous rate of accumulation of \(q \) at a specific time \(t \text{.}\)
You run the pump at medium for one minute, but itโs taking too long so you bump it up to high. After two minutes on high, the raft is nearly inflated but the pump seems like itโs getting a bit hot as it works to counter-act the tendency of the raft to want to deflate, so you switch it to low for one more minute before turning it off.
We can model the rate of accumulation of air in the raft using the following rate function, with time \(t \) measured in minutes and output \(r \) measured in cubic metres per minute.
\begin{equation*}
r(t) = \begin{cases}
0.5 \amp 0 \le t \lt 1 \\
0.75 \amp 1 \le t \lt 3 \\
0.25 \amp 3 \le t \lt 4
\end{cases}
\end{equation*}
In Exampleย 7.1.2, outputs for \(r(t) \) were measured in cubic metres per minute. In general, for every rate function \(r \) the outputs \(r(t) \) should similarly be measured in output-units-per-input-unit, where โoutput unitsโ corresponds to the units of the varying quantity \(q \) for which \(r \) is a rate function, and โinput unitsโ corresponds to the units of the independent variable \(t \) (for us, usually some unit of time).
You get in your car and pull out, then accelerate up to the city speed limit of 50 kmโh. With a stop light ahead, you slow down to a stop, wait for the light to turn green, then get back up to speed. A little later you merge onto the highway and accelerate some more.
A speed-vs-time graph, with the vertical axis in kilometres-per-hour and the horizontal axis in hours. The function graphed is a constant zero along the negative horizontal axis. After \(t = 0 \text{,}\) the graph increases steeply and continuously up to \(50 \) and maintains that level until \(t = 1 \text{,}\) at which point it decreases steeply and continuously back down to \(0 \text{.}\) It remains \(0 \) until just before \(t = 1.5 \text{,}\) and from there is again increases steeply and continuously up to \(50 \text{.}\) It again maintains that level until just after \(t = 3 \text{,}\) before increasing steeply and continuously up to \(100 \text{,}\) a level it maintains for the remainder of the graph (which ends at \(t = 5 \)).
In Figureย 7.1.5, the plotted curve passes the Vertical Line Test, and so represents the graph of a function โ in this case, a velocity function, \(v(t) \text{.}\)
A drain pipe empties into a covered reservoir. As rain water falls, it is collected and routed through the drain pipe and accumulates in the reservoir. A flow meter is installed in the drain pipe to measure the rate of water flow into the reservoir in litres per second. If water only enters the reservoir through the drain pipe, then the rate of accumulation of water in the reservoir is the same as the rate of flow of water in the drain pipe, and the a function \(r(t) \) that represents the reading on the flow meter at time \(t \) will be a rate function for the quantity of water in the reservoir.
Subsection7.1.2Rate functions versus derivative functions
We created the concept of derivative value (Definitionย 5.5.1) specifically to represent the instantaneous rate of accumulation of some quantity, and then collected all derivative values of one quantity function \(q(t) \) into the derivative function\(q'(t) \) (Definitionย 6.1.1).
In Exampleย 2.3.1, we modelled the salary of salespeople who were paid a base salary, commission on each sale, and a bonus commission on each sale above some threshold. The model we came up with for the salary \(s(u) \) as a function of the number of units \(u \) sold was
\begin{equation*}
s(u) = \begin{cases}
4000 + 10 u \amp 0 \le u \le 100 \\
4000 + 10 u + 5 (u - 100) \amp u \gt 100
\text{.}\end{cases}
\end{equation*}
Simplifying the second formula in the piecewise definition, we can write
\begin{equation*}
s(u) = \begin{cases}
4000 + 10 u \amp 0 \le u \le 100 \\
3500 + 15 u \amp u \gt 100
\text{.}\end{cases}
\end{equation*}
The rate of accumulation of salary relative to number of units sold is constant โ salary increases by \(10 \) dollars per extra unit sold โ up until the threshold where the bonus kicks in, at \(u = 100 \text{.}\) After that, the rate of accumulation of salary jumps to a new level: salary increases by \(15 \) dollars per extra unit sold. The derivative function keeps track of how the rate of accumulation varies:
\begin{equation*}
s'(u) = \begin{cases}
10 \amp 0 \lt u \lt 100 \\
15 \amp u \gt 100
\text{.}\end{cases}
\end{equation*}
Note that the salary function is not differentiable at \(u = 100 \) because it has a cusp, and so the piecewise definition of \(s'(u) \) above leaves the derivative function undefined there. (See Subsectionย 5.7.1.)
We know that the constant rate for a linear function is just the slope of the line, so essentially the derivative function simply extracts the slopes of the two โpiecesโ of \(s(u) \) on their respective subdomains.
In light of Patternย 7.1.7 it is natural to wonder why we would bother making Definitionย 7.1.1 as a separate definition; why not simply refer to any function that measures rate of accumulation as a derivative function? The reason is to make a distinction between different cases of โstarting information.โ If we begin with a quantity function\(q \) with a known formula, then we may attempt to directly compute its derivative function \(q'(t) \text{.}\) On the other hand, if we begin instead with a model \(r(t) \) for the rate at which some quantity is accumulating (as in Exampleย 7.1.2), can we call \(r(t) \) a derivative function if we donโt know a corresponding function \(q(t) \) for which it is the derivative (that is, for which \(r(t) = q'(t)\))? While Patternย 7.1.7 states that every derivative function is a rate function, at this point it is not clear whether every rate function is a derivative function.
It is usually difficult to immediately write down a function for a varying quantity. Being able to do so is equivalent to predicting both โpastโ and โfutureโ values of the quantity for any input value. We might make some observations to collect data points and then try to fit a curve to those data points, but then we are making an assumption in what type of function to fit to the data. The systemโs data might only superficially look like that type of function for the time we are observing it, while the reality of the true underlying behaviour of the system might be completely different.
When we model a system, it is usually easier to model the rate of variation itself, as humans are better at observing change over time. But again, not directly as a formula for a rate function (which is effectively just as difficult as trying to determine a quantity function directly). Instead, we try to model how the variation in the quantity is affected by the quantity itself.
For example, consider trying to model a population of some species of animal over time. It would be very difficult to make an exact prediction like โIn \(t \) years I think the population size will be exactly \(P \text{.}\)โ It is much more reasonable to express patterns like โMore animals means more offspring means more animals.โ In other words, the rate of accumulation could initially be modelled not directly in terms of time but indirectly in terms of the population size: a large population creates a high rate of accumulation of population because more individuals will produce more offspring, and a small population creates a low rate of accumulation of population because fewer individuals will produce fewer offspring. The next step in analyzing the situation would be to try to make this observation more precise using an equation relating the rate to the quantity size.
Let \(q(t) \) represent a quantity function (whose formula is unknown). A differential equation is an equation relating the instantaneous rate of accumulation \(dq/dt \) to the โcurrentโ accumulated quantity amount \(q(t) \text{.}\) It is usually expressed in the form
\begin{equation*}
\dqdt = r(t,q)
\end{equation*}
where
\begin{equation*}
r(t,q) = \text{some formula in both } t \text{ and } q(t) \text{.}
\end{equation*}
The multivariable function \(r(t,q) \) is called the rate function for the differential equation.
There is a difference between a formula for a function and an equation. An equation expresses an equality of two different formulas, while a function formula describes the input-output process of the function. For example, the expression \(dq/dt = t^2 \) is not an equation involving the rate of accumulation \(dq/dt \) (even though it contains an equals sign), it is an expression of a formula for the derivative function \(q'(t) \) of some quantity function \(q \text{.}\)
Applying the terminology rate function to the multivariable function \(r(t,q) \) in a differential equation is in line with Definitionย 7.1.1 because the differential equation asserts that each output of this function is equal to \(q'(t) \text{,}\) and so represents the instantaneous rate of accumulation of \(q \) at a specific time \(t \text{.}\) However, itโs a special kind of function in that it requires two inputs: both the input value \(t \) and the output value \(q(t) \) at that particular \(t \)-value must be known in order to evaluate it. In examples, often the rate function only involves \(q \) and not \(t \text{,}\) and we may write just \(r(q) \) in those cases.
Physicists observed long ago that radioactive material decays at a rate that is proportional to the amount of material left. That is, if \(q(t) \) models the amount of some sample of radioactive material remaining after a period of time measured by \(t \text{,}\) then there is a positive constant \(k \) so that
A negative sign is included in the formula (rather than just assuming \(k \) to be negative in the first place) to emphasize that we expect the quantity of material to decay, and so the rate of accumulation should be negative (while the quantity \(q(t) \) will always be positive).
Even though the differential equation expresses a linear relationship between \(dq/dt \) and \(q \text{,}\) the model for \(q(t) \) in terms of \(t \) is definitely not linear, as we will see in Chapterย 16.
A 1000 L tank of salt water (brine) is being fed by a supply of fresh brine of concentration 15 gโL at a rate of 2 Lโs. To maintain a constant volume, old brine is also being drained from the tank at the same rate of 2 Lโs. We assume that the tank is well-mixed, so that there are no pockets of higher or lower concentration brine within the tank.
A diagram of a 1000 L tank. Also picture are an inlet pipe pouring liquid into the top of the tank, and an outlet pipe draining liquid from the bottom.
Let \(q(t) \) represent the amount of salt in the tank in grams at \(t \) seconds after the system starts up, so that \(dq/dt \) represents the rate of accumulation of salt in the tank in grams per second. The rate of accumulation is dependent on how much salt is in the tank, because even through brine both enters and drains from the tank at a constant rate, how much salt exits the tank through the drain depends on how much salt is in the tank at that moment.
Is the amount of salt increasing or decreasing? We seem to have both behaviours at once, since salt is entering through the fresh brine supply and is being lost through the drained liquid. The actual rate of accumulation of the quantity of salt is the net effect:
\begin{equation*}
\text{rate of accumulation} = (\text{rate in }) - (\text{rate out}) \text{.}
\end{equation*}
We can use the same calculation formula of concentration-times-flow-rate to calculate the rate out, where here we want to use the concentration of the mixed solution in the tank. Except we donโt know the concentration because it is varying! However, since the volume in the tank is staying constant at 1000 L, then at any given moment if we knew the value of \(q(t) \) the concentration in the tank would be
In all of our examples so far, the rate function for the differential equation involved only the dependent variable \(q \text{;}\) here is an example of a differential equation where the rate function involves both \(q \) and the independent variable \(t \text{.}\)
However, a differential equation should not only involve the independent variable \(t \text{,}\) since then that would just be a formula for the derivative function.
After forming a differential equation to model a system, our goal is to recover a formula for the quantity function so that we can make predictions about the behaviour of the system.
a solution is a function \(q(t) \) that, when substituted into the right-hand side of the differential equation, gives the correct derivative function \(dq/dt \) for that particular \(q(t) \text{.}\)
Here we are using variable \(r \) to represent the constant rate of accumulation of the linear function \(q(t) \) rather than the rate function for the differential equation. However, they must actually be one and the same, since Patternย 6.3.11 asserts that
\begin{equation*}
q(t) = r t + q_0 \quad \implies \qquad \dqdt = r \text{.}
\end{equation*}
So under our assumption that \(q(t) \) is linear, the differential equation says that can set the constant \(r \) equal to the rate function for the differential equation:
\begin{align*}
r \amp = q(t) - 5 t \\
\implies \quad r \amp = (r t + q_0) - 5 t \\
\implies \quad r \amp = (r - 5) t + q_0 \text{.}
\end{align*}
Now, we donโt want to solve for \(t \) in the final equation above โ instead we are looking for the values of the constants \(r \) and \(q_0 \) that make this equation true for all values of \(t \). And since the left-hand side is a constant, we will only get equality if the right-hand side is a constant function, which requires
\begin{equation*}
r - 5 = 0 \quad \implies \quad r = 5 \text{.}
\end{equation*}
In that case, only \(q_0 \) remains on the right-hand side, so matching again left (\(r = 5 \)) with right (\(q_0 \)) we arrive at \(q_0 = 5 \) as well. This tells us that the only linear quantity model that solves the differential equation is
\begin{equation*}
q(t) = 5 t + 5 \text{.}
\end{equation*}
\begin{equation*}
\dqdt = q(t) - 5 t
\end{equation*}
from Exampleย 7.2.9, the function \(q(t) = 5 t + 5 \) is a particular soluition because for this function, both \(dq/dt \) and \(q(t) - 5 t \) are equal to \(5 \text{,}\) making left-hand-side-equals-right-hand-side true in the differential equation for this particular function.
A differential equation can have many particular solutions. In Exampleย 7.2.9, we found that there was just one linear solution to that particular differential equation, but there could be other, non-linear solutions. Generally when we try to โsolveโ a differential equation, we are looking for all possible solution functions \(q(t) \text{,}\) not just particular solutions of a particular form.
Recall that the general idea of a differential equation is an expression of a direct relationship between a quantity and its rate of accumulation. In other words, the behaviour of the system depends on the quantity present. It follows that the precise solution function \(q(t) \) may depend on the โinitialโ amount \(q(t_0) \) (where \(t_0 \) represents some โinitialโ time, often \(t_0 = 0 \)). However, usually the different solution functions that correspond to different initial conditions are at least of the same type or form and differ only in some parameters (just as different lines have different slopes and vertical intercepts, but are still all lines).
so in fact in this case we have a constant solution. Is it actually a solution? We know that a constant function isnโt varying, so its rate of accumulation is \(0 \text{.}\) That is,
But other values of \(c \) provide different solution functions. For example,
\begin{gather*}
c = -1 \qquad \implies \qquad q(t) = - \frac{t + 1}{- t + 1} \\
c = \sqrt{2} \qquad \implies \qquad q(t) = \frac{\sqrt{2} (t + 1)}{\sqrt{2} t + 1} \\
c = \pi \qquad \implies \qquad q(t) = \frac{\pi (t + 1)}{\pi t + 1} \text{.}
\end{gather*}
We wouldnโt want to verify that each of these is a solution one-by-one using the left-hand-side-versus-right-hand-side method as above. Instead we can do it all at once with the general solution expression, by computing \(dq/dt \) from the given parametric expression for \(q(t) \) (treating any parameters just like other numbers in the formulas, not as variables). At this point we are not yet equipped to carry such computations out; later in the course we will learn techniques for computing derivatives of several different kinds of functions, For now, letโs just ask the computer algebra system Sage to compute the derivative for us.
The t |--> portion of the Sage output says that the rate function also uses input variable \(t \text{,}\) and then the formula for the derivative function follows:
\begin{equation*}
q'(t) = \frac{-c^2 (t + 1)}{{(c t + 1)}^2} + \frac{c}{c t + 1} \text{.}
\end{equation*}
To verify that the general solution formula always provides a solution to the differential equation, no matter the value of the parameter \(c \text{,}\) we would substitute
Carry out the verification of the general solution to the differential equation in Exampleย 7.2.13, using the process described at the end of that example.
When we have a general solution in hand, how do we decide what to take as the value(s) of the parameter(s)? As discussed above, we expect the system being modelled by a differential equation to behave differently when different quantities are present, so we should expect different initial quantities to lead to different solutions.
Example7.2.17.Obtaining a particular solution from an initial condition.
Letโs return to the differential equation and general solution from Exampleย 7.2.13. Suppose we want the particular solution that satisfies initial condition
While it will often be the case, it wonโt always happen that the parameter in the general solution ends up representing the initial amount \(q(t_0) \text{.}\)
Even though we havenโt yet developed any techniques for solving differential equations, we can still get an idea of what solutions look like graphically from the differential equation.
A differential equation only makes sense if we assume that the unknown quantity function \(q(t) \) is differentiable, since otherwise the \(dq/dt \) in the differential equation would be undefined. In Subsectionย 5.6.2 we introduced the concept of local linearity as a graphical interpretation of differentiability and derivative values: at a specific input value \(t = t^\ast \text{,}\) repeatedly zooming in on the graph of a differentiable function \(q \) around the point \(\bbrac{t^\ast, q(t^\ast)} \) eventually leads to the graph resembling a straight line, with the derivative value \(q'(t^\ast) \) representing the slope of that line.
If we assume that a particular solution to a differential equation exists whose graph includes a particular data point, then the rate function for the differential equation tells us the derivative value for the solution function at that point. Graphically, this tells us the slope of the local linearity of the solution function at that point.
Pattern7.3.1.Graphical interpretation of data points in a differential equation.
For differential equation
\begin{equation*}
\dqdt = r(t,q)
\end{equation*}
and specific data point \((t_0, q_0) \) in the \(tq \)-plane, if we assume that there exists a particular solution function \(q(t) \) whose graph passes through that point, then we can infer the following information about that function and its graph:
Function value.
The function must take on value \(q(t_0) = q_0 \text{.}\)
In that small โwindowโ around the point \((t_0, q_0) \text{,}\) the slope of the approximately linear graph is the value \(r(t_0,q_0) \) obtained but substituting \(t = t_0 \) and \(q = q_0 \) into the rate equation for the differential equation.
Patternย 7.3.1 summarizes the graphical interpretation of the information provided by a differential equation at one specific data point. We can โstitchโ together many such โlocalโ pieces of information to create a holistic picture of solution graphs by making a grid of data points in the \(tq \)-plane, and at each point drawing a small line segment with the corresponding slope predicted by the differential equation for that data point. Such a diagram is called a direction field (or slope field), and allows us to visualize the โshapeโ of the graphs of potential solution functions without having actual formulas for those functions.
In our direction field we will draw a little line segment at position \((1,4) \) to represent the local linearity of the graph of the solution function \(q(t) \text{,}\) and based on the above calculation we will give that line segment slope \(-2 \text{.}\) But notice what happens if we consider a different potential solution that passes through the data point \((3,4) \text{.}\) Then \(q(3) = 4 \) and
Hence in our direction field we will draw another little line segment at position \((3,4) \text{,}\) this time with slope \(-2 \text{.}\) (Note that the solution that satisfies \(q(1) = 4 \) might not be the same as the solution that satisfies \(q(3) = 4 \text{.}\))
Itโs not a coincidence that we got the same derivative value in both of our example calculations above โ since the rate function for the differential equation does not involve the independent variable \(t \text{,}\) different potential solutions that pass through the same output level (\(q \)-value) but at different \(t \)-values will do so with the same slope. For example, any solution that hits \(q(t_0) = 4 \) at some \(t = t_0 \) must have
Then when we draw our direction field for this differential equation below in Figureย 7.3.3, we use the same slope value for grid points that are at the same \(q \)-level.
A direction field is plotted in the first quadrant of a set of \(tq \)-axes. Very short line segments are drawn at regular intervals in a grid pattern. Along each horizontal row of the grid, each line segment is identical to the others in that row. But along vertical columns of the grid, the line segments progress from very steep negative slopes at the top to very shallow negative slopes at the bottom, just above the horizontal axis.
From the direction field, we can see the overall behaviour that individual solutions exhibit: when there is a lot of material (large \(q(t) \)) then it decays rapidly, and where is little material the decay occurs much more slowly.
The direction field from Figureย 7.3.3 is reproduced exactly. Over top, six representative solution curves are drawn, following the pattern of the direction field: descending steeply from high vertical positions and descending shallowly from low vertical positions. From left to right:
The first solution curve begins by crossing into the first quadrant at a relatively small \(q \)-value on the vertical axis, and then gently descends toward the horizontal axis.
The second solution curve begins by crossing into the first quadrant approximately midway up the vertical axis, descends fairly steeply toward the horizontal axis, but quickly begins to level out, so that approximately halfway across the diagram horizontally it is descending much more gently.
The third solution curve begins by crossing into the first quadrant near the top of the vertical axis, descends very steeply toward the horizontal axis, but gradually levels out, so that near the right edge of the diagram it is descending more gently.
The fourth, fifth, and sixth solution curves are all similar: beginning at the top of the diagram and to the right of the vertical axis, they descend very steeply, but as they get closer to the right edge of the diagram they begin to show signs of levelling out. The difference in the curves is how far to the right they begin at the top of the diagram.
We can even use the direction field and representative solution curves to make predictions about solutions, such as long-term behaviour. For example, it appears that no matter the initial amount \(q(0) \text{,}\) all solution functions will satisfy
Warning7.3.5.Solutions must pass Vertical Line Test.
All functions must pass the Vertical Line Test (Patternย 2.2.6). So while our grid of points in the setup for a direction field will have many instances of points vertically above/below each other, those necessarily represent different potential solution functions. In particular, following the โshapeโ of solution curves starting at different points along the vertical axis gives us a way to investigate how initial conditions affect the behaviour of the system.
Example7.3.6.A direction field that varies in both horizontal and vertical.
Now letโs try plotting a direction field for the differential equation in Exampleย 7.2.7. This example is slightly different from the last in that the differential equation involves the independent variable as well, so the slopes of our line segments will vary more.
Here is an example slope calculation for one of the line segments in the direction field. If we assume that there exists a solution function \(q(t) \) whose graph passes through the point \((1,-2) \text{,}\) then that means \(q(1) = -2 \text{,}\) and so
So in our direction field we should draw a little line segment at point \((1,-2) \) with slope \(-3 \text{.}\) To get an actual direction field, we repeat the above calculation at a number of points in a grid. In Figureย 7.3.7, we have carried this out for
A direction field is drawn in the first and fourth quadrants of a set of \(tq \)-axes. Very short line segments are drawn at regular intervals in a grid pattern. In the first horizontal row of the grid, at the top of the diagram, the line segments are very steep with a negative slope, but the slope of the segments becomes slightly less steep along the row from left to right. Subsequent rows below that are similar, except that the โstartingโ slope at the left end of the row becomes less steep as we descend rows, until the segments in the row at height \(q = 1 \) are all flat horizontal.
We see the same pattern starting at the bottom row in the fourth quadrant: the segments in that bottom row are very steep with a negative slope, but the slope of the segments becomes slightly less steep along the row from left to right, and then as we progress rows upwards the โstartingโ slope at the left end of the row becomes less steep, until finally the segments in the row at height \(q = 0 \) are all flat along the horizontal axis.
Finally, there is a single row between heights \(q = 0 \) and \(q = 1 \) where the segments are nearly flat but with a slight positive slope, and the segments become more flat along the row from left to right.
In this direction field, we can see a few different kinds of behaviours on the domain \(t \ge 0 \text{.}\) First, we can see two equilibrium or โsteady-stateโ solutions at \(q(t) = 1 \) and \(q(t) = 0 \text{.}\) (The slope segments at \(q(t) = 0 \) are hidden by the \(t \)-axis, but they are also horizontal there.) Second, when the initial amount \(q(0) \) is positive, the solutions appear to tend to \(1 \) over the long term. That is, when \(q(0) \gt 0 \text{,}\) it appears that we will have
However, when the initial amount \(q(0) \) is negative, the solutions appear to eventually head sharply downward. That is, when \(q(0) \lt 0 \text{,}\) it appears that we will have
The direction field from Figureย 7.3.7 is reproduced exactly. Over top, four example solution curves are drawn:
The first curve begins at the very top of the vertical axis and descends steeply, before quickly flattening out, approaching a horizontal asymptote at \(q = 1 \) from above.
The third curve begins near but slightly below the origin, then gradually decreases, reaching the right edge of the diagram only a little below the height at which it started at the left edge of the diagram.
The fourth curve begins only a little was below the third curve, but descends quickly, becoming even more steep in its descent as it goes, until it finally reaches the bottom edge of the diagram only a third of the way from left to right across the diagram.
Integral curves do not always represent solution functions, as they sometimes fail the Vertical Line Test. But even in that case we can usually โsnipโ them into pieces of the curve so that each individual piece is the graph of a solution function.