CHAPTER 1 Differential Equations II: More Separation of Variables

In certain practical situations we might want to make simplifying assumptions that lead to somewhat more complicated differential equations which are still not too complicated to be solved by the method of separation of variables. This section is devoted to several examples of this.

But first we want to illustrate how the general method of separation of variables can be used to solve differential equations that look quite different from those in the last chapter.

Example 1.1. Find an equation for the curve that passes through the point (2, 3) and satisfies the differential equation dy/dx = y^{2}/x^{3}.

We first separate variables in the differential equation, obtaining

\frac{dy}{y^{2}} = \frac{dx}{x^{3}}.

If we integrate both sides and combine the constants of integration into a single constant on the right, we get

−\frac{1}{y} = −\frac{1}{2} · \frac{1}{x^{2}} + C.

To find C, we use the “initial data” that the point (2, 3) is on the curve. Thus, −\frac{1}{3} = −\frac{1}{2} · \frac{1}{2^{2}} + C, from which we get C = \frac{1}{8} − \frac{1}{3} = −\frac{5}{24}. Finally, we solve for y by taking the negative reciprocal of both sides. The result is:

y = \frac{1}{\frac{1}{2x^{2}} + \frac{5}{24}} = \frac{24x^{2}}{12 + 5x^{2}} .

1. Spread of an Epidemic

Suppose that y(t) is the number of people (or some type of animal) who have a certain contagious disease at time t. We are interested in the rate of change of y(t), and eventually in a formula for y(t). Since the spread of the disease depends on the number of people from whom one can catch it, we might try supposing that the rate of spread of the disease is simply proportional to the number who have it, i.e., dy/dt = ky. This would lead to the exponential growth function y(t) = y_{0}e^{kt}, a function which might be a reasonable approximation for some small time interval, but which clearly is far off for large t: the function y_{0}e^{kt} rapidly grows without bound, while the total population has some finite value P. The number of sick people cannot be greater than the number of people.

So let’s try another type of simplifying assumption: that the spread of the disease is proportional to the number of contacts between a sick person and a healthy person, and that this, in turn, is proportional to the product of the number of people with the disease and the number of people without the disease. That is, at any time t, dy/dt is proportional to the product of y(t) and P − y(t):

\frac{dy}{dt} = ky(P − y).

It must be admitted that this model for the spread of an epidemic is still very simplistic. It assumes, for instance, that no attempt is made to quarantine sick people, that everyone is susceptible to the disease, that someone who gets the disease remains sick (and a carrier) indefinitely, and so on. But in some situations this differential equation is a reasonable approximation to reality.

We now solve the above differential equation by separation of variables. The first step is to move the dt to the right, to move the part on the right with y over to the left, and then to insert an integral sign on both sides:

∫ \frac{dy}{y(P − y)} = ∫ kdt = kt + C_{2}.

The anti-derivative on the left can be found by the method of partial fractions, i.e., we write:

\frac{1}{y(P − y)} = −\frac{1}{(y − 0)(y − P)} = −\frac{1}{0 − P} (\frac{1}{y} − \frac{1}{y − P} ) = \frac{1}{P} (\frac{1}{y} + \frac{1}{P − y} ) ,

after which we see that the above indefinite integral with respect to y is

\frac{1}{P} (ln |y| − ln |P − y|) + C_{1} = \frac{1}{P} (ln y − ln(P − y)) + C_{1}

(since both y and P − y are positive)

= \frac{1}{P} ln (\frac{y}{P − y} ) + C_{1}.

We next move the C_{1} to the right of the equality, multiply through by P, and set C = P (C_{2} − C_{1}). We then exponentiate both sides. The result is

\frac{y}{P − y} = e^{P kt+C}.

To solve this for y, the simplest thing is to take the reciprocal of both sides, getting

\frac{P − y}{y} = \frac{P}{y} − 1 = e^{−C}e^{−P kt}.

To find y we add 1 to both sides, take the reciprocal again and multiply through by P, obtaining:

y(t) = \frac{P}{1 + e^{−C}e^{−P kt}} .

To find C we need some initial information, such as y_{0} = y(0). Substituting t = 0 (it’s simplest to substitute into our earlier equation which had (P/y) − 1 on the left) gives: e^{−C} = (P/y_{0}) − 1. In a practical situation, if you’re not given the value of k, you can find it if you know the value of y(t) at some other particular time.

Cautionary note: The above solution technique works only when k and P are constant with respect to time t.

Example 1.2. Let y(t) denote the fraction of the population having the disease at time t months (in other words, we are measuring population in units of fraction of the total, rather than in units of individuals; in that way the total population P = 1). At time t = 0 suppose that 1% of the population are sick, and after a month 10% are sick. Find a formula for y(t), graph y(t), and find out at what time the rate of spread of the disease starts to slow down.

As shown above, we have

y(t) = \frac{1}{1 + e^{−C}e^{−kt}} .

Substituting t = 0 gives e^{−C} = (1/0.01) − 1 = 99. To find k, we substitute t = 1 month: (1/y(1)) − 1 = e^{−C}e^{−k·1} = 99e^{−k}, so that 9 = 99e^{−k}, which leads to −k = ln(1/11), i.e., k = ln 11 = 2.4. At the right, we show the graph of our solution y(t) = 1 / (1 + 99e^{−2.4t}).

To ask when the rate of spread of the disease starts to slow down is the same as asking when y′ = dy/dt reaches its maximum. This is the point of inflection in the above graph, which we find by setting y′′ = 0. We could take the second derivative of our y(t) formula. But an easier way is to take d/dt of both sides of the original differential equation y′ = ky(1 − y). Using the product rule on the right, we obtain

y′′ = ky(−y′) + ky′(1 − y) = ky′(−y + 1 − y) = ky′(1 − 2y).

This vanishes when y = 1/2. In other words, the spread of the disease starts to ease off as soon as more than 50% of the population has the disease. To find the time when this occurs, we can set the y(t) formula equal to 1/2 and solve for t. The result is: approximately 2 months.

2. More Mixing Problems

Suppose that water is being pumped into our container at a constant rate r_{1} that is faster than the constant rate r at which water is leaving. This means that the volume V is no longer constant: it changes at rate r_{1} − r, and so is given by the formula V = V_{0} + (r_{1} − r)t. On the right side rk − \frac{r}{V} y of the differential equation in the last section the effect is to change the first r to r_{1} and replace the constant volume V by a function of t:

\frac{dy}{dt} = r_{1}k − \frac{ry}{V_{0} + (r_{1} − r)t}.

If k ≠ 0 and we try to solve this by separation of variables, we find that we are stymied. This problem can be solved by a different technique that will not be covered in this course, but it cannot be solved by separation of variables. So for now let us assume that k = 0, i.e., that fresh water is being pumped into the container. In that case, we can use separation of variables: we divide both sides by y, multiply both sides by dt, and put an integral sign in front of both sides:

∫ \frac{dy}{y} = ∫ −\frac{r dt}{V_{0} + (r_{1} − r)t} = −\frac{r}{V_{0}} ∫ \frac{dt}{1 + \frac{r_{1}−r}{V_{0}} t}.

Performing both integrations, we obtain

ln |y| + C_{1} = −\frac{r}{r_{1} − r} ln|1 + \frac{r_{1} − r}{V_{0}} t| + C_{2}.

Since the expressions in the absolute value signs are both positive, we can drop the absolute value. We also set C = C_{2} − C_{1} and exponentiate both sides. The result is:

y(t) = e^{C} (1 + \frac{r_{1} − r}{V_{0}} t)^{−r/(r_{1}−r)} .

Finally, by substituting t = 0 on both sides, we find that e^{C} = y(0) = y_{0}.

Notice that this variant on the mixing problem has a very different solution from the variant we treated in the last section, where we had r_{1} = r. Finally, be careful to note that the above solution is correct only when r and r_{1} are constants (do not change with t).

Example 1.3. At time t = 0 a container has y_{0} gm of salt dissolved in 100 liters of water. Fresh water is pumped into the container at 5 liters/min, and the well-mixed solution leaves the container at 3 liters/min. Find a formula for the amount of salt in the water at time t.

In this problem V_{0} = 100, r_{1} = 5, and r = 3. Hence, by the formula just derived, y(t) = y_{0}(1 + 0.02t)^{−1.5}.

3. Harmonic Oscillation

Suppose that we have an object of mass m at the end of a spring. Let y(t) be the distance of the object from the equilibrium point at time t (i.e., the distance through which the spring is extended). We shall assume that the only force on the object is that of the spring (i.e., we neglect friction, air resistance, gravity, etc.). We shall also assume the following basic physical relationship: the force of the spring is proportional to the amount by which the string is extended. Since acceleration is proportional to force (it is equal to force divided by m), it follows that the acceleration ÿ(t) is proportional to y(t). Note that the direction of pull is opposite to the direction of extension — that is, if the string is extended, then the pull is inward, i.e., negative; while if the string is compressed, then the pull is outward, i.e., positive. Thus, the proportionality constant between ÿ(t) and y(t) is negative; we shall let −k be this constant. Thus, the distance function y(t) satisfies the differential equation

ÿ = −ky.

This is called a second order differential equation, because it involves the second derivative. Before solving it, we rewrite it in the form

ÿ + ky = 0.

Instead of worrying about the differential equation in its present form, we instead look at a different expression involving only y(t) and its first derivative ẏ(t):

ẏ^{2} + ky^{2}.

This is basically the sum of the squares of the function and its first derivative, with the constant k thrown in. Why would we want to look at that? In the next paragraph we’ll say something about where this expression comes from. For now what we want to do is just take its derivative:

\frac{d}{dt}(ẏ^{2} + ky^{2}) = 2ẏ ÿ + 2ky ẏ = 2ẏ(ÿ + ky).

But according to our differential equation, ÿ + ky = 0, so the derivative of our sum-of-squares expression is zero. The only function with zero derivative is a constant. What is the value of this constant? We use our initial conditions to answer this question: at time t = 0 the sum-of-squares expression has value ẏ(0)^{2} + ky(0)^{2} = v_{0}^{2} + ky_{0}^{2}. Let us suppose that the object is at location 0 at time t = 0; then the constant is simply v_{0}^{2}, where v_{0} is the object’s initial velocity. We conclude that ẏ^{2} + ky^{2} = v_{0}^{2}.

Before solving this last differential equation, we make a remark about where the sumof-squares expression comes from. It is essentially what physicists call the energy of the object. More precisely, if we multiply it by the constant \frac{1}{2}m (where m is the mass), we get the energy. The conclusion of the last paragraph — that this is constant — is an example of another fundamental principle of physics, the law of conservation of energy. If we work only with the mathematics, then admittedly the expression ẏ^{2} + ky^{2} seems to be pulled out of a hat. However, if we know a little physics, then the method of solving this differential equation seems quite natural.

Anyway, we now have the differential equation

ẏ^{2} + ky^{2} = v_{0}^{2},

which we shall see can be solved by separation of variables. If we move ky^{2} to the right and take square roots, we get (using the notation dy/dt instead of ẏ)

\frac{dy}{dt} = \sqrt{v_{0}^{2} − ky^{2}},

and then, separating variables,

∫ \frac{dy}{\sqrt{v_{0}^{2} − ky^{2}}} = ∫ dt.

On the left, if we pull the k out of the radical (so that it becomes \sqrt{k}) and set r^{2} = (v_{0}/\sqrt{k})^{2}, then we have Example 7.8 of the chapter on inverse trig functions (with y in place of x and with r replaced by v_{0}/\sqrt{k}). Using the answer to Example 7.8, we find that the anti-derivative on the left is

\frac{1}{\sqrt{k}} Arcsin (\frac{y}{v_{0}/\sqrt{k}} ) + C_{1}.

Thus, we can write

\frac{1}{\sqrt{k}} Arcsin (\frac{y}{v_{0}/\sqrt{k}} ) = t + C

(where C = C_{2} − C_{1} is the difference of the constants of integration that one gets on the right and on the left). To find C we again use the initial information that y(0) = 0 when t = 0; since Arcsin(0) = 0, we find that C = 0. Finally, we solve for y by multiplying through by \sqrt{k} and then taking the sine of both sides:

\frac{y}{v_{0}/\sqrt{k}} = sin(\sqrt{k} t),  so that  y(t) = \frac{v_{0}}{\sqrt{k}} sin(\sqrt{k} t) = \frac{v_{0}}{ω} sin(ωt),

where we have set ω = \sqrt{k}, which is the angular frequency.

Thus, the object oscillates back and forth with sinusoidal motion having period 2π/ω. This motion is called harmonic oscillation.

Notice that once we have found the function y(t) = \frac{v_{0}}{ω} sin(ωt), it is very easy to check that it really does satisfy the original differential equation ÿ = −ky = −ω^{2}y; namely, just take the second derivative of y(t), and see that both sides of the equality are equal to −v_{0}ω sin(ωt). It is also clear that y(0) = 0 and ẏ(0) = \frac{v_{0}}{ω} · ω · cos(ω · 0) = v_{0}.

What would happen if we had to take into account friction or air resistance? Suppose that this contributed a force proportional to velocity (as we assumed in Section 3 of Chapter 16). Then our original differential equation would have another term equal to a constant times ẏ. One can show that the solution is a function similar to Example 10.2 in the chapter on the exponential function — it has an exponential decay factor. This is called damped harmonic oscillation.

Homework 1.

1. Find an equation in the form y = f(x) for the curve that passes through the point (3, 1) and satisfies the differential equation

(a) \frac{dy}{dx} = \frac{y^{3}}{x^{2}} ; (b) \frac{dy}{dx} = x^{2}y^{2}; (c) \frac{dy}{dx} = \frac{cos(πx)}{y}.

2. In modeling population growth one might take into account that the reproduction rate (birth rate minus death rate) is not constant, but rather diminishes as the population grows — because the food supply is not sufficient to sustain growth, crowded conditions cause disease and death, etc. The logistic model of population growth is the simplest model in which, instead of having a constant k in dy/dt = ky, we have a reproduction rate which decreases as the population increases. In the logistic model we insert a factor of (1 − y/M) on the right:

\frac{dy}{dt} = k (1 − \frac{y}{M} ) y,

where M is a constant which has the practical meaning of the maximum possible population. (Note that the population would stop growing — i.e., dy/dt would become zero — if y were to become equal to M.)

(a) Derive a general formula for y(t) which will involve the constants k and M and another constant whose value depends on y_{0}.

(b) Suppose that a beetle population on an island obeys the logistic equation. The maximum beetle population that the island can support is 100 million. At present there are 5 million beetles on the island, and last year at this time there were 2 million beetles. Find a formula for the beetle population at time t. How long will it be before the population reaches 95 million?

3. In Example 1.3, what function do you get for the amount y(t) of salt at time t if the rate of the outgoing water is 5 liters/min and the rate of the incoming fresh water is 3 liters/min? What is the domain of this function (until the container is empty)?

4. When an object falls, the deceleration caused by air resistance is some function r(v) of its velocity, and so v(t) satisfies the differential equation dv/dt = g−r(v), where g = 9.8 m/sec^{2} (if we choose downward as the positive direction). In the last section we assumed that r(v) was a linear function of v, namely, we took r(v) ≈ kv. For example, if k = 0.102, we have the differential equation dv/dt = 9.8 − 0.102v. In many cases using a linear approximation kv to r(v) is accurate enough — that way we get a differential equation that is particularly easy to solve. (Using kv instead of a more complicated r(v) is called “linearizing” the differential equation.) Now suppose that the linear approximation isn’t good enough, and you need a quadratic correction term 0.002v^{2}, i.e., r(v) = 0.102v + 0.002v^{2}.

(a) Graph the right side of the resulting differential equation, and find the terminal velocity.

(b) Solve the differential equation to find a formula for v(t) if the object is dropped from rest.

(c) Write a definite integral for the distance the object falls in the first 3 seconds (do not bother to evaluate the integral).

(d) Now suppose that you’re interested in distance fallen not as a function of time as in part (c), but rather as a function of velocity. Namely, you want to answer the question: How far does the object fall (from rest) before reaching a speed of 48 m/sec? Thus, consider distance s as a function of velocity, and use the chain rule to express ds/dv in terms of ds/dt (which is v) and dv/dt, thereby obtaining a differential equation for s(v). Now write an integral for the distance fallen as v increases from v_{1} to v_{2}, and answer the question in italics.

5. Answer the same question as in Problem 4(d) under the assumption that the air resistance r(v) is not given by a formula at all, but rather by experimental readings. That is, using a wind tunnel, you let air rush past the object at velocities 8, 16, 24, 32, 40, and 48 m/sec, measuring the force of air resistance, which you then divide by the mass of the object to obtain r(v). The values you obtain are:

\begin{matrix}v & 0 & 8 & 16 & 24 & 32 & 40 & 48 \\ r(v) & 0 & 0.91 & 1.82 & 2.75 & 3.75 & 4.80 & 5.84 \end{matrix}

Use the trapezoid rule to evaluate the integral that represents the distance the object falls before reaching a speed of 48 m/sec.

6. A vat contains V liters of water with y_{0} grams of salt at time t = 0. Fresh water enters the vat at a rate r(t) that changes with time, and the well-stirred solution leaves the vat at the same rate.

(a) Find a differential equation for the amount of salt at time t.

(b) If V = 100 liters, and the rate r(t) starts at 2 liters/min and increases steadily at 0.5 liters/min each min, derive a formula for y(t).

(c) If V = 100 liters, and the rate r(t) varies sinusoidally with a minimum value of 0 at t = 0 and then a maximum of 2 liters/min after 1 minute (here r(t) goes from 0 to 2 and back to 0 once every 2 minutes), derive a formula for y(t).

7. Answer Problem 6(b) under the assumption that the rate at which water leaves the vat remains at 2 liter/min, and only the incoming rate increases. (Note that the volume is no longer constant.) Also find (in terms of y_{0}) the limiting value of the amount of salt as t ⟶ ∞.

8. A vat contains 100 liters of water with y_{0} grams of salt at time t = 0. Water with k gm/liter of salt enters the vat at a rate that changes gradually over 10 minutes, as measured at 1-minute intervals and tabulated below:

t  0  1  2  3  4  5  6  7  8  9 10 r(t) 2.50 2.56 2.62 2.67 2.71 2.73 2.74 2.74 2.72 2.68 2.62

The well-stirred solution leaves the vat at the same rate.

(a) Find a differential equation for the amount of salt at time t.

(b) Find the solution y(t) of the differential equation. Your solution should contain the constants k and y_{0}, and should include an integral involving r(t).

(c) If we flush out the salt by pumping in pure water (i.e., if k = 0), find the percent by which the amount of salt decreases during the 10 minutes. (Use the trapezoid rule to evaluate the integral.)

(d) If k = 0.40 gm/liter and y_{0} = 30 gm, find y(10).

9. At time t = 0 a car is traveling at 30 m/sec. From time t = 0 until the car stops, a constant breaking force is applied which causes a deceleration of 8 m/sec^{2}. The other force acting on the car is air resistance (and friction), causing a deceleration which for the range of velocities we’re dealing with is approximately equal to 0.4v + 0.01v^{2}. Find

(a) the differential equation for v(t);

(b) the velocity function v(t) for 0 ≤ t ≤ T; and

(c) the time T when the car stops.

10. A rocket sled starts from rest and is propelled by a constant thrust (force) F in a horizontal path. Suppose that, as the propellant is burned, the mass of the rocket, which initially is m, decreases at the constant rate α. Also assume that the force of air resistance and friction is proportional to the velocity with proportionality constant K.

(a) Using the basic physical principle that

(mass of rocket at time t) · (acceleration)=total of forces acting on rocket,

find a differential equation for v(t).

(b) Solve the differential equation in part (a) to find a formula for v(t) in terms of t and the constants F, m, α, K, and v_{0}.

11. In Section 3 we derived the formula y(t) = \frac{v_{0}}{ω} sin(ωt) for harmonic oscillation, assuming zero initial position. Find the formula for harmonic oscillation if the initial velocity is zero, but the initial position is y_{0} ≠ 0.

12. Find the formula for harmonic oscillation if y(0) = y_{0} and ẏ(0) = v_{0}, where we no longer suppose that either of these initial values is zero.