Modeling with differential equations When trying to predict the future value, the core idea used is that future value = present value + change. From this idea, we obtain a differential or difference equation by noting that change = future value − present value If we monitor the values during discrete periods (for example, discrete time intervals), we obtain a difference equation (to be discussed in next section). If the independent variable varies continuously (for example, time increasing continuously), we arrive to a differential equation of first order. dy = f (x, y)dx

−→

dy = f (x, y). dx

The function y = y(x) is a solution of such equation if the equation is satisfied when y and its derivative y 0 are substituted into the equation. General solution of such equation is a family of all functions that satisfy the equation. A solution that satisfies the equation and the condition y(x0 ) = y0 is called particular solution. The equation y 0 = f (x, y) together with condition y(x0 ) = y0 is called initial value problem. The equation y 0 = f (x, y) is separable if we can separate the variables x and y. To solve such equation, rewrite such equation so that x’s are on one and y’s are on the other side and integrate both sides. Example 1. A bacteria culture starts with 500 bacteria and grows at a rate proportional to its size. After 3 hours there are 8000 bacteria. Find the number of bacteria after 4 hours. Solution. Identifying variables: let y stands for the bacteria culture and t stands for time passed. The first part of the problem “A bacteria culture starts with 500 bacteria..“ tells us that y(0) = 500. The second part ”... and grows at a rate proportional to its size.“ is the key for getting the mathematical model. Recall that the rate is the derivative and that ”...is proportional to..“ corresponds to ” equal to constant multiple of..“ So, the equation relating the variables is dy = ky. dt xt This is a separable differential equation with the solution y = y0 e . Since y0 = 500, it remains to determine the proportionality constant k. From the condition ”After 3 hours there are 8000 bacteria.“ we obtain that 8000 = 500e3k which gives us that k = 13 ln 16 = .924. Thus, the number of bacteria after t hours can be described by y = 500e.924t . Using the function we have obtained, we find the number of bacteria after 4 hours to be y(4) = 20159 bacteria. Example 2. Suppose that an object is falling in the atmosphere near the sea level. Assume that the drag is proportional to the velocity with the drag coefficient of 2 kg/sec. If the mass of the object is 10 kg and the object is dropped from a height of 300 m, how long will it take for the object to hit the ground and how fast will it go at the time of the impact? 1

Solution. Identifying variables: Let v denotes the velocity and t denotes the time. Our goal is to get the differential equation describing the fall. The physical law that governs the motion is the Newton’s second law F = ma. As a = dv , we have that F = m dv . We have two forces acting on this dt dt 2 object: gravitational force equaling mg where g = 9.8 m/sec and drag force which is, by assumption of the problem equal to 2v. Since these two forces act in the opposite directions, the total force is equal to the difference of these two forces. Thus, we have that m

dv = mg − 2v. dt

The mass of the object in question is 10 kg, so we have that dv = 9.8 − v5 . The solution of this dt −t/5 equation is v = ce + 49. As the object is dropped, the initial velocity is 0 and so 0 = c + 49. −t/5 So, v = 49 − 49e . Graphing this solution, we can see that the velocity will increase to 49 m/sec on the long run. Note that even without the restriction on the initial condition the graphing of the general solution will give us that the velocity will - Increase to 49 m/sec if the initial velocity is between 0 and 49; - Stay constant at 49 m/sec if the initial velocity is 49; and - Drop to 49 m/sec if the initial velocity is larger than 49. Thus, v = 49 is a stable equilibrium solution in this case. In order to determine the velocity and time of the impact, we need to find a formula describing the distance x as a function of time t. As v = dx , x = 49t+245e−t/5 +c. Note that here the coordinate dt system is chosen so that gravity acts in a positive direction (downward) so, x measures the distance of the object from the initial position. Thus, initial position of the object corresponds to x(0) = 0 (Explain how relations would change if we were to choose a different coordinate system). This gives us that x = 49t + 245e−t/5 − 245. So, if an object of mass 10 kg is dropped from 300 meters, the time it hits the ground can be obtained from the equation 300 = 49t + 245e−t/5 − 245 Using Matlab or calculator (or any other technology) we obtain that the object will hit the ground after t = 10.51 second. The velocity at that time is v(10.51) = 43.01 m/sec. Example 3. A population of field mice inhabits a certain rural area. In the absence of predators, the mice population increases so that each month, the population increases by 50%. However, several owls live in the same area and they kill 15 mice per day. Find an equation describing the population size and use it to predict the long term behavior of the population. Solution. Identifying variables: Let y stands for the size of mice population and t be the time in months. Note that without the predators, the equation describing the population of mice would = .5y. Incorporating the information about the owls, we must subtract the monthly loss in be dy dt the number of mice. As 15 are killed daily, 15 · 30 = 450 is killed monthly and so the equation is dy = .5y − 450. dt Solving the equation we obtain, y = ±cet/2 + 900. Graphing the equation for different initial conditions we can see that the number of mice will - Drop to 0 if the initial number is smaller than 900; 2

- Stay constant at 900 if the initial number is equal to 900; and - Keep increasing if the initial number is larger than 900. Thus y = 900 is an unstable equilibrium solution in this case. In the previous problem, the differential equation is obtained by considering the total rate to be Total rate of change = rate in - rate out The next example also illustrates this reasoning. Example 4. A pond initially contains 8 million gallons of fresh water. Water containing an undesirable chemical flows into the pond at the rate of 2 million gallons per year and the mixture in the pond flows out at the same rate. The concentration of chemical in the incoming water is increasing in time t according to the expression 0.02t grams per gallon. Find the formula describing the amount of chemicals (in grams) as a function of time (in years) and use it to determine the amount of chemical in the pond after 5 years. Solution. If Q denotes the amount of chemical measured in grams and t the time measured in years, the rate of change of Q (in grams per year) is equal to the difference of the rate of flow in gal 0.02t g and the rate out is and the rate of flow out of the pond. Since the rate in is 2 · 106 year gal g 6 gal Q 2 · 10 year 8·106 gal , the equation dQ = 4 · 104 t − 0.25Q dt models this situation. The equation Q0 = 4 · 104 t − 0.25Q is linear. Write it in the form Q0 + 0.25Q = 4 · 104 t and R .25t 1 1 0.25t .25t 4 0.25t find integrating factor to be e . So, Qe = 4 · 10 te dt = 4 · 104 ( 0.25 te0.25t − 0.25 ) + c. 2e Thus Q = 1.6 · 105 (t − 4) + ce−0.25t is the general solution. Since the pond initially contains no undesirable chemical, Q(0) = 0. Thus, 0 = 0 − 6.4 · 105 + c ⇒ c = 6.4 · 105 . The particular solution is Q = 1.6 · 105 (t − 4) + 6.4 · 105 e−0.25t = 1.6 · 105 (t − 4 + 4e−0.25t ). After five years, t = 5 and so Q = 3.43 · 105 grams or 343 kg.

Autonomous Equations If a differential equation is of the form dy = f (y), dt it is called autonomous. Note that an autonomous equation is a separable differential equation. If f (y) = 0 is zero at y = a, then the horizontal line y = a is a solution. This solution is called the equilibrium solution and a is called a critical point. After finding the equilibrium solutions, check the sign of f . On intervals of y with y 0 = f (y) positive, the solutions y are increasing and on intervals of y with y 0 = f (y) negative, the solutions y are decreasing. Thus, the analysis of the sign of f (y) can tell us a lot about the graph of the solutions. If the solutions asymptotically approach the equilibrium solution for t → ∞, regardless of the values of initial conditions, then the equilibrium solution is called asymptotically stable solution. 3

If the solutions are not converging towards the equilibrium solution for all values of initial conditions, then the equilibrium solution is called unstable solution. In some cases, it may be difficult to obtain an explicit formula of the solution. In those cases, getting a graph of an autonomous equation may provide valuable information about the solution. Applications - Models of population growth 1. Unlimited Growth. The simplest model of population growth is one describing the population that changes at a rate proportional to its size. The differential equation model for that situation is dP = kP dt We encounter this situation in examples when the percent birth rate is b and the percent death rate is c so that dP = bP − cP. Let k = b − c. If b > c (so k > 0) the population will be dt increasing, if b < c (so k < 0) the population will be decreasing and if b = c (so k = 0) the population will remain constant. If the initial size is P0 , convince yourself that the solution of this equation is P = P0 ekt . For a given set of data, a good way to test if the unlimited growth is a suitable modes is to check if the dependence of ln y and x is linear. 2. Limited Growth. If a given environment has limited resources to support the population growth, the population might not increase indefinitely. Suppose that the rate of increase is proportional to the population size and the difference between a constant K (called carrying capacity) limiting the growth. The differential equation model for that situation is dP = kP (K − P ) dt Graphing the solution of this autonomous equation, we can see that the population size increases to P if the initial size P0 is smaller than K but the growth does not increase the capacity K. If P0 > K, the population size decreases to K as the population is too large to grow due to the limiting resources of the environment. If P0 = K, the solution is constant P = K. Note that in this case, the equilibrium solution P = K is stable since limt→∞ P = K regardless of the initial size. The analytic form of the general solution is P = 1+(K/P0K−1)e−kKt . Try to obtain this analytic form without using Matlab (it is not that hard, use partial fractions for integral on the left side when you separate the variables). This function is called the logistic curve and the growth (if P0 < K) is referred to as logistic growth. Note that the maximal growth can be obtained by considering the zero of the second derivative. Since P 00 = k(KP 0 − 2P P 0 ) = kP 0 (K − 2P ), P 00 = 0 when P = K/2. Thus, the increase of population keeps increasing until half of the carrying capacity is reached. At the time when P = K/2 the growth is the largest. After that time, the growth decreases towards zero. For a given set of data, a good way to test if the limited growth is a suitable modes is to check y and x is linear. if the dependence of ln K−y 4

3. A model with a threshold level. Suppose that a given population can keep increasing just if the initial size is large enough and it dies out otherwise. The level that allows the increase of population is called a threshold level. In this case the rate of increase is proportional to the population size and the difference of the present population size and the threshold level T. The differential equation model for that situation is dP = kP (P − T ) dt Graphing the solution of this autonomous equation, we can see that the population size decreases to 0 if the initial size P0 is smaller than T . If P0 > T, the population size increases unboundedly. If P0 = T, the solution is constant P = T. Note that in this case, the equilibrium solution P = T is unstable. Example 5. Assume that a whale population is such that 1. The population becomes extinct if the number of whales falls below a minimum survival level m. 2. If the population is above the minimum survival level, then the growth is limited by the carrying capacity M. 3. If the population is above M, then it will decline due to the environment that cannot sustain such high population level. Write a differential equation that models this situation. Solution. Let P = P (t) denote the whale population at time t. We can use an autonomous differential equation with equilibrium solutions P = m and P = M. The conditions determine that 1. If P0 < m, P is to decrease towards 0. Thus P 0 < 0. 2. If m < P0 < M, P is to increase towards M . Thus P 0 > 0. 3. If P0 > M, P is to decrease towards M . Thus P 0 < 0. These conditions are satisfied for the product (M − P )(P − m). Thus the differential equations dP = k(M − P )(P − m) dt where k is a positive constant, models the given situation. Practice Problems. 1. (a) Show that y = 2 + e−x is a solution of differential equation y 0 + 3x2 y = 6x2 . 3

(b) Show that y = ce2x is a solution of differential equation y 00 −3y 0 +2y = 0 for every constant c. 2. Solve the following differential equations. 5

(a) y 0 x = y

(b) y 0 y = −x

(c) y 0 =

0

0

(d) y = 2xy, y(0) = 1

(e) y =

√

4x + 3, y(0) = 4/3

xy , x2 +1

y(0) = 2

3. (a) A population of protozoa develops with a constant relative growth rate of 0.7 per member per day. Initially, the population consist of two members. Find the population size after six days. (b) A glucose solution is administered intravenously into the bloodstream at a constant rate r. As the glucose is added, it is converted into other substances and removed from the bloodstream at a rate proportional to the concentration at that time. i) Set up the differential equation that models this situation. ii) If r = 4 and the proportionality constant is 2, draw the solutions. What can we conclude about the concentration of the glucose after a long period of time? Explain. iii) Suppose that the initial concentration is 1 mg. Solve the equation with this initial condition and draw the graph of the solution. (c) Experiments show that if the chemical reaction N2 O5 → 2N O2 + 21 O2 takes place at 45 degrees Celsius, the rate of reaction of dinitrogen pentoxide is proportional to its concentration C(t) with proportionality constant equal to -.0005. How long will the reaction take to reduce the concentration of N2 O5 to 90% of its original value? 4. Consider an insect population whose size P is measured as biomass (mass of the population members) in kilograms. The population is increasing by 30% per year. However, the population is also controlled by a natural predator population that destroys 6 kg of insects per year. (a) Find the model describing the population size P at any given time t. (b) Sketch the graphs of the solutions (note that the equation is autonomous) and use the graph to estimate the threshold level of the population (the minimum level of the initial size that will allow the population to survive on the long run). Explain what happens with the population. (c) Find the population size 4 years after if the initial biomass is 15 kg. 5. (a) Sketch the graph of solutions of y 0 = y(y − 1)(y − 2). (b) Sketch the graph of solutions of y 0 = y(y − 1)2 (y − 2). (c) The size of a population of rabbits is modeled by differential equation y 0 = −ky(1 − y/T ) where T = 100 and k = 0.8 per year. i) Estimate the number of rabbits after a long period of time if the initial size of the population is 103 rabbits. ii) Estimate the number of rabbits after long period of time if the initial size of the population is 99 rabbits. (d) The Pacific halibut fishery is modeled by differential equation y 0 = ky(1 − y/K) where y(t) is the biomass (total mass of the members of the population) in kilograms at time t, K = 8 · 107 kg and k = 0.71 per year. i) Estimate the biomass after many years if the initial biomass is 3 · 106 . ii) Estimate the biomass after many years if the initial biomass is 9 · 107 . iii) If the biomass is 2 · 107 kg initially, find the biomass a year later (use Matlab for part iii). 6. Let A(t) be the area of tissue culture at time t (in days). Let the final area of the tissue when the growth is complete be 8 cm2 . Most cell divisions occur √ on the periphery of the tissue and the the number of cells on the periphery is proportional to A. So, a reasonable model for √ growth of tissue is obtained by assuming that the rate of growth is jointly proportional to A 6

and 8 − A. Write down a differential equation that models this situation. If the proportionality constant is 1/3 and the area of tissue culture initially is 1.5 cm2 , approximate the area of the culture after 10 days using Matlab. 7. The use of mathematical methods to study the spread of contagious disease goes back to some work of Daniel Bernoulli in 1760 on smallpox. In more recent years, many mathematical models have been proposed and studied for many different diseases. Suppose that a given population can be divided in two parts: those who have a given disease and can infect others and those who do not have it but are susceptible. Let x be the proportion of susceptible individuals and y be the proportion of infectious individuals. Then x + y = 1 = 100%. If the disease spreads by the contact, the rate dy/dt is proportional to both the number of susceptible (because they are getting in contact with infected individuals) and the number of infected individuals (because their increase increases the rate of change also). i) Write down a differential equation that models this situation. ii) Use the graph to determine the proportion of infectious individuals for large values of t (i.e. when t → ∞). Explain what your answer means. Solutions. 1. Plug the given function and its derivative(s) into the given differential equation and show that it reduces into a true equality. 2. (a) lines y = cx (b) circles x2 + y 2 = c √ 2 y = e1/2 ln(x +1)+ln 2 = 2 x2 + 1

(c) y = 1/6 · (4x + 3)3/2 + 0.47

2

(d) y = ex

(e)

3. (a) y(6) = 133 protozoa (b) i) dC/dt = r − kC ii) C = 2 is the stable equilibrium solution, so concentration will be approximately 2 mg after a long period of time. iii) C(t) = 2 − e−2t (c) C(t) = C0 e−.0005t It takes 211 seconds to reduce the concentration of N2 O5 to 90% of the initial size. = 0.3P − 6 = 0.3(P − 20). To solve 4. (a) The differential equation modeling the situation is dP dt it, separate the variables: PdP = 0.3dt. Integrate both sides: ln |P − 20| = 0.3t + c and get the −20 0.3t general solution P = ce + 20. (b) To sketch the graph, find the equilibrium solution. Solving 0.3(P − 20) = 0, get the equilibrium value P = 20 kg. It is an unstable equilibrium solution: if the initial size is below 20 kg, the population will eventually die out. If the initial size is above 20 kg, the population will increase without bound. So, the threshold level is 20 kg. (c) If P (0) = 15, 15 = c + 20 so c = −5. Thus, P = −5e0.3t + 20. When t = 4, P = 3.4 kg. 5. (a) y = 1 stable, y = 0 and y = 2 unstable solutions. (b) y = 0 stable, y = 1 semistable, y = 2 unstable solution. (c). i) infinity ii) 0 (d). i) 8 · 107 ii) 8 · 107 √ 6. The differential equation dA = k A(8 − A), where k is the proportionality constant, models dt this situation. Using Euler’s method, A(10) = 7.9997 cm2 . 7. Since x = 1 − y, the differential equation dy = ky(1 − y) y(0) = y0 , where k is the proportiondt ality constant, models the situation. Graphing the solutions, we can see that 0 is unstable and 7

1 is stable solution. This means that the percent of infected individuals keeps growing towards 100%.

8