Processing math: 100%
Skip to main content

Section 1.2 Separable Differential Equations

We will define a differential equation of order n to be an equation that can be put in the form

F(t,x,xβ€²,xβ€³,…,x(n))=0,

where F is a function of n+2 variables. A solution to this equation on an interval I=(a,b) is a function u=u(t) such that the first n derivatives of u are defined on I, and

F(t,u,uβ€²,uβ€³,…,u(n))=0.

We will concentrate on first-order differential equations in this chapter. That is, we will consider equations of the form

dxdt=f(t,x).

Subsection 1.2.1 Separable Differential Equations

For some first-order differential equations such as

dxdt=kx

the solution is given by an explicit formula. In this particular case, the solution is x(t)=Cekt. In general, we cannot generally find such a formula for an arbitrary first-order differential equation. We can, however, solve a differential equation yβ€²=f(x,y) if we can write the equation in the form

f(x)+g(y)dydx=0.

Such equations are called separable. We can solve separable equations by integrating the first term with respect to x and the second term with respect to y.

Example 1.2.1.

Suppose that we wish to solve the initial value problem

dydx=xyy(0)=1.

We can rewrite this equation in the form

1ydydx=x

or in the alternate form

1ydy=xdx.

Integrating both sides of the equation, we have

ln|y|=12x2+C,

where C is an arbitrary constant. Using the initial condition, y(0)=1 to find C, we see that

0=ln|1|=0+C.

Thus, the solution to our initial value problem can be given implicitly by lny=x2/2. In this example, we can actually write down an explicit solution that is defined everywhere,

y=ex2/2.

The Sage commands for solving our initial value problem are below.

If we ask Sage to solve a differential equation that is impossible to solve analytically, the computation will return an error. Sage will not solve the initial value problem

dydx=sin(xy)y(0)=1.
Example 1.2.2.

Consider the initial-value problem

dydt=tyβˆ’t2yy(0)=4.

First, we separate the variables of the equations and write

ydy=t1βˆ’t2dt.

Integrating both sides of the equation, we have

12y2=βˆ’12ln|1βˆ’t2|+Cory2=βˆ’ln|1βˆ’t2|+C.

Using the initial condition, y(0)=4, we can determine the value of C,

y2=16βˆ’ln|1βˆ’t2|ory=√16βˆ’ln|1βˆ’t2|.

Notice that the solution does not make sense for all values of t. In fact, the solution is only defined on the interval βˆ’1<t<1, if we require that our solution be continuous. Let us see what Sage has to say.

Sage does return a solution even if it looks a bit different than the one that we arrived at above. Notice that we have an imaginary term in our solution, where i2=βˆ’1. We will examine the role of complex numbers and how useful they are in the study of ordinary differential equations in a later chapter, but for the moment complex numbers will just muddy the situation.

Example 1.2.3.

The initial value problem in Example 1.1.2 is a good example of a separable differential equation,

dPdt=k(1βˆ’P1000)PP(0)=100.

Using partial fractions, we can rewrite this equation as

1000P(1000βˆ’P)dP=(1P+11000βˆ’P)dP=kdt.

Integrating both sides of (1.2.1), we obtain

ln|P|βˆ’ln|1000βˆ’P|=ln|P1000βˆ’P|=kt+C.

Taking the exponential of both sides yields

P1000βˆ’P=ekt+C=ekteC.

Since C is an arbitrary constant, we know that eC is an arbitrary postive constant, which we will also call C. So we can rewrite this last equation as

P=Cekt(1000βˆ’P)=1000Cektβˆ’CektP.

Solving for P yields

P=1000CektCekt+1=1000Ceβˆ’kt+1.

Using our initial condition P(0)=100, we can determine that C=9.

Subsection 1.2.2 Newton's Law of Cooling

Separable equations arise in a wide range of application problems. One does not have to watch too many crime dramas to realize that the time of death of a murder victim is an important question in many criminal investigations. How does a forensic scientist or a medical examiner determine the time of death? Human beings have a temperature of 98.6∘F. If the surrounding temperature is cooler, then the body will cool down after death. Eventually, the temperature of the body will match the temperature of the environment. We should not expect the body to cool at a constant rate either. Think of how a hot cup of coffee or tea cools. The liquid will cool quite quickly during the first few minutes but will remain relatively warm for quite a long period.

The answer to our forensic question can be found by using Newton's law of cooling, which tells us that the rate of change of the temperature of an object is proportional to the difference between the temperature of the object and the temperature of the surrounding medium. Newton's law of cooling can be easily stated as a differential equation,

dTdt=k(Tβˆ’Tm),

where T is the temperature of the object, Tm is the temperature of the surrounding medium, and k is the proportionality constant.

Suppose that the temperature of the surrounding environment is 70∘F, and we know from experience that a body under these conditions cools off approximately 2∘F during the first hour after death. In order to determine a formula for the time of death, we must solve the initial value problem

dTdt=k(Tβˆ’70)T(0)=98.6,

where T(1)=96.6. If we rewrite the equation

dTdt=k(Tβˆ’70)

as

1Tβˆ’70dTdt=k,

we see that this equation is separable. Integrating both sides of the last equation, we obtain ln|Tβˆ’70|=kt+C. Since we are assuming that T>70, we can write Tβˆ’70 instead of |Tβˆ’70|. Thus, we have

ln(Tβˆ’70)=kt+CorTβˆ’70=ekt+C=ekteC.

Letting D=eC, the solution becomes

T(t)=Dekt+70.

The initial condition, T(0)=98.6, tells us that D=28.6. Thus,

T(t)=28.6ekt+70.

Since

96.6=T(1)=28.6ekβ‹…1+70,

we can determine the constant k to be

k=ln(26.628.6)β‰ˆβˆ’0.0725.

and

T(t)=28.6eβˆ’0.0725t+70.

The graph of the T seems appropriate to our model (Figure 1.2.4).

a curve that starts at 98.6 and slowly decreases to seventy
Figure 1.2.4. Newton's law of cooling

Let us solve our differential equation using Sage.

We can use Sage to plot our solution.

Subsection 1.2.3 Mixing Problems

There is a large class of problems in modeling known as mixing problems. These problems refer to situations where two or more substances are mixed together in a container or containers. For example, we might wish to model how chemicals are mixed together in a refinery, how pollutants are mixed together in a pond or a lake, how ingredients are mixed together when brewing beer, or even how various greenhouse gases mix together across different layers of the atmosphere.

Suppose that we have a large tank containing 1000 gallons of pure water and that water containing 0.5 pounds of salt per gallon flows into the tank at a rate of 10 gallons per minute. If the tank is also draining at a rate of 10 gallons per minute, the water level in the tank will remain constant. We will assume that the water in the tank is constantly stirred so that the mixture of salt and water is uniform in the tank.

We can model the amount of salt in the tank using differential equations. If x(t) is the amount of salt in the tank at time t, then the rate at which the salt is changing in the tank is the difference between the rate at which salt is flowing into the tank and the rate at which it is leaving the tank, or

dxdt=rate inβˆ’rate out.

Of course, the salt flows into the tank at the rate of 10β‹…0.5=5 pounds of salt per minute. However, the rate at which the salt leaves the tank depends on x(t), the amount salt in the tank at time t. At time t, there is x(t)/1000 pounds of salt in one gallon. Therefore, salt flows out of the tank at a rate of 10x(t)/1000=x(t)/100 pounds per minute. Equation (1.2.2) now becomes

dxdt=5βˆ’x100x(0)=0.

This equation is separable,

dx500βˆ’x=dt100.

Integrating both sides of the equation, we have

βˆ’ln|500βˆ’x|=t100+k

or

ln|500βˆ’x|=βˆ’t100βˆ’k.

Consequently,

500βˆ’x=Ceβˆ’0.01t,

where C=eβˆ’0.01k. From our initial condition, we can quickly determine that C=500 and

x(t)=500βˆ’500eβˆ’0.01t

models the amount of salt in the tank at time t. Notice that x(t)β†’500 as tβ†’βˆž, as expected.

Subsection 1.2.4 A Retirement Model

Differential equations have many applications in economics and finance. For example, Dr. J., a college professor, wisely started saving for his retirement as soon as he entered the workforce, and he now has $500,000 in a retirement account earning an interest of 5% compounded continuously. The initial value problem,

dPdt=0.05PP(0)=500

provides a nice model of Dr. J.'s investment, where P(t) is the amount in thousands of dollars in the fund at time t. The solution to our initial value problem is

P(t)=500e0.05t.

If Dr. J. plans to retire in 10 years, he can expect a nest egg of P(10)β‰ˆ824.360635350064 or about $824,360.

Of course, Dr. J. still plans to make contributions to his retirement fund during his next ten years of employment. His annual contribution will be $5,000, which his employer will generously match. If we assume that these contributions will spread out evenly over the course of the year, we can incorporate this information into our original initial value problem,

dPdt=0.05P+10P(0)=500

This differential equation is separable, so we have

∫dP0.05P+10=∫dt.

Integrating both sides of this equation, we have

20ln|0.05P+10|=t+k,

where k is an arbitrary constant. Since 0.05P+10>0, we have

20ln(0.05P+10)=t+k.

This last equation is equivalent to

0.05P+10=e0.05(t+k)=e0.05te0.05k.

If we let C=e0.05k and solve for P, we obtain

P=20Ce0.05tβˆ’200.

Using our initial condition,

500=P(0)=20Ce0.05β‹…0βˆ’200=20Cβˆ’200,

we have C=35. Thus, the solution that we seek is

P(t)=700e0.05tβˆ’200.

Dr. J.'s nest egg is now P(10)β‰ˆ954.104889490090 or about $954,105.

Once Dr. J. retires, he will need to begin withdrawing money from his account. He estimates that he will need to withdraw $60,000 a year for living expenses if he wishes to travel and enjoy his golden years. Of course, whatever remains in his account at any given time will still collect interest. We describe  J.'s retirement situation with the initial value problem,

dPdt={0.05P+10,t≀100.05Pβˆ’60,t>10P(0)=500.

If P=954, then

dPdt=0.05Pβˆ’60β‰ˆβˆ’12.3<0.

Hence, the rate of withdrawal exceed the rate at which Dr. J.'s account is earning interest. Eventually, Dr. J.'s retirement fund will be disappear. This may pose a problem, if Dr. J. plans to retire early and live a long life.

Again, the differential equation dP/dt=0.05Pβˆ’60 is separable, and we have

∫dP0.05Pβˆ’60=∫dt.

Intergrating both sides of this equation yields

20ln|0.05Pβˆ’60|=t+k.

Since 0.05Pβˆ’60<0,

|0.05Pβˆ’60|=60βˆ’0.05P,

and

20ln(60βˆ’0.05P)=t+k.

Consequently,

60βˆ’0.05P=e(t+k)/20,

or

P=1200βˆ’Ce0.05t,

where C=20ek/20. Now, we can apply our initial condition P(10)=954 to determine that Cβ‰ˆ149.21. Therefore,

P=1200βˆ’149.21e0.05t

describes how much money Dr. J.has after he retires (tβ‰₯10).

If Dr. J. wants to know how long his retirement fund will last, he must solve the equation

1200βˆ’149.21e0.05t=0.

In this case,

t=20ln(1200149.21)β‰ˆ41.7.

This means that if Dr. J. retires in 10 years at the early age of 55, he can expect his retirement to last into his mid 90s.

Subsection 1.2.5 Some Theory

We now give a theoretical basis for solving first-order separable differential equations. A differential equation yβ€²=F(x,y) is called separable if it can be written in the form

f(x)+g(y)dydx=0.

We now will prove that such an equation can solved by integrating the first term with respect to x and the second term with respect to y. If

h1(s)=∫f(s)dsh2(s)=∫g(s)ds,

then we can rewrite equation (1.2.3) as

hβ€²1(x)+hβ€²2(y)dydx=0.

Applying the chain rule to the second term, we obtain

hβ€²2(y)dydx=ddx[h2(y)].

Hence, equation (1.2.3) now becomes

ddx(h1(x)+h2(y))=0.

Integrating, we obtain

h1(x)+h2(y)=C,

where C is any arbitrary constant.

Now suppose that y(x0)=y0 is an initial condition for

f(x)+g(y)dydx=0.

Then h1(x0)+h2(y0)=C. By the Fundamental Theorem of Calculus

h1(x)βˆ’h1(x0)=∫xx0f(s)ds,h2(y)βˆ’h2(y0)=∫yy0g(s)ds.

Consequently, we can replace equation (1.2.3) with the integral equation

∫xx0f(s)ds+∫yy0g(s)ds=0.

In other words, we simply need to integrate each term to solve the differential equation.

Subsection 1.2.6 What Can Go Wrong

Example 1.2.5.

It is not always possible to explicitly solve a separable differential equation. Consider the equation

dydx=y(1+y2)y2+y+1.

This equation can be rewritten in the form

(11+y2+1y)dy=dx

Integrating both sides of the equation, we have

arctany+ln|y|=x+C.

However, we have no method of solving this last equation explicitly for y.

Example 1.2.6.

Another difficulty arises if we consider the equation

yβ€²=teβˆ’y2.

This equation is separable since we can rewrite it in the form

ey2dy=tdt.

Although the Fundamental Theorem of Calculus guarantees that every continuous function has an antiderivative, we cannot find an antiderivative for the function ey2 in terms of elementary functions. Thus, we are forced to write our solution as

∫y0es2ds=12t2+C.
Example 1.2.7.

Even if we have a separable differential equation, we are not guaranteed a unique solution. Consider the initial value problem yβ€²=y1/3 with y(0)=0 and tβ‰₯0. Separating the variables,

yβˆ’1/3dy=dt.

Thus,

32y2/3=t+C

or

y=(23(t+C))3/2.

If C=0, the initial condition is satisfied and

y=(23t)3/2

is a solution for tβ‰₯0. However, we can find at least two additional solutions for tβ‰₯0:

y=βˆ’(23t)3/2,y≑0.

In Section 1.5 we will learn sufficient conditions for a first-order initial value problem to have a unique solution.

Example 1.2.8.

Suppose that yβ€²=y2 with y(0)=1. Separating the variables,

1y2dy=dt,

we see that

y=βˆ’1t+C

or

y=11βˆ’t.

Therefore, a continuous solution also exists on (βˆ’βˆž,1) if y(0)=1. In the case that y(0)=βˆ’1, the solution is

y=βˆ’1t+1,

and a continuous solution exists on (βˆ’1,∞).

Subsection 1.2.7 Important Lessons

  • A differential equation of order n is an equation that can be put in the form
    F(t,x,xβ€²,xβ€³,…,x(n))=0,
    where F is a function of n+2 variables. A solution to the equation on an interval I=(a,b) is a function u=u(t) such that the first n derivatives of u are defined on I, and
    F(t,u,uβ€²,uβ€³,…,u(n))=0.
  • A first-order differential equation is an equation that can be written in the form
    dxdt=f(t,x).
  • A differential equation is separable if it can be written in the form
    dydx=M(x)N(y).
    In this case we can rewrite the equation in the form
    f(x)+g(y)dydx=0
    or
    g(y)dy=f(x)dx
    and solve by integrating both sides.

Reading Questions 1.2.8 Reading Questions

1.

Does a differential equation always have a solution? Explain.

2.

Is the differential equation

dydt=y2+t2

separable? Why or why not?

Exercises 1.2.9 Exercises

Finding General Solutions

Find the general solution for each equation in Exercise Group 1.2.9.1–10.

1.

xdxβˆ’y2dy=0

2.

dydx=yx

3.

(t2+1)dt+(x2+x)dx=0

4.

dxdt=x2βˆ’6x+14

5.

yβ€²=x2y(2+x3)

6.

dydx=sinxy

7.

xyβ€²=√1βˆ’y2

8.

dydt=4tβˆ’t34+y3

9.

yβ€²=1ty+2t+y+2

10.

dxdt=xet+3et+xβˆ’3

Solving Initial Value Problems

Solve the initial value problems in Exercise Group 1.2.9.11–20.

11.

xdxβˆ’y2dy=0, y(0)=1

12.

dydx=yx, y(1)=βˆ’2

13.

(t2+1)dt+(x2+x)dx=0, x(0)=βˆ’1

14.

dxdt=x2βˆ’6x+14, x(0)=3

15.

yβ€²=x2y(2+x3), y(0)=βˆ’2

16.

dydx=sinxy, y(0)=2

17.

xyβ€²=√1βˆ’y2, y(1)=0

18.

dydt=4tβˆ’t34+y3, y(0)=1

19.

yβ€²=1ty+2t+y+2, y(0)=βˆ’3

20.

dxdt=xetβˆ’3et+xβˆ’3, x(0)=0

21.

Solve the initial value problems in Exercise Group 1.2.9.11–20 using Sage.

22.

Homogeneous Equations. A first-order differential equation, yβ€²=f(x,y), is homogeneous if f(x,y)=f(tx,ty).

  1. Show that the equation
    dydx=x2+y22xy
    is homogeneous.
  2. Let y=xv and show that the equation in part (a) can be written as
    v+xdvdx=x2+v2x22vx2.
    Use the fact that this new equation is separable to solve for y.
  3. Show that any homogeneous equation yβ€²=f(x,y) can be transformed into a separable differential equation by making the substitution y=vx.
  4. A function f is said to homogeneous of degree n if f(tx,ty)=tnf(x,y) for n=1,2,…. Show that differential equation
    P(x,y)dx+Q(x,y)dy=0,
    where P and Q are both homogeneous of degree n, can be transformed into a separable differential equation using the substitution y=vx.
  5. Solve the differential equation
    x2yβ€²=2y2βˆ’x2.
23.

Mr. Ratchett, an elderly American, was found murdered in his train compartment on the Orient Express at 7 AM. When his body was discovered, the famous detective Hercule Poirot noted that Ratchett had a body temperature of 28 degrees. The body had cooled to a temperature of 27 degrees one hour later. If the normal temperature of a human being is 37 degrees and the air temperature in the train is 22 degrees, estimate the time of Ratchett's death using Newton's Law of Cooling.

Subsection 1.2.10 Sageβ€”Quick Start Guide to Solving Ordinary Differential Equations

Sage has powerful algorithms for finding exact and numerical solutions of differential equations. In addition, we can plot solutions and direction fields. Although some differential equations have an exact solution and can be solved using analytic techniques with calculus, many differential equations can only be solved using numerical techniques. This should not be too surprising if we consider how we solve polynomials. It is quite easy to find the roots of any equation of the form ax2+bx+c=0 by either factoring or using the quadratic equation, but solving an equation such as

5x7βˆ’6x4+3x3βˆ’23x2+3xβˆ’17=0

is a much more difficult problem. Unlike the situation for quadratic equations, there does not exist a general formula for solving seventh degree equations. We can even encounter difficulties when using a numerical method such as the Newton-Raphson algorithm.

In general, Sage needs three things to solve a differential equation:

  1. An abstract function
  2. A differential equation
  3. A Sage command to solve the equation.

Suppose we wish to solve the equation

dydx=x+y.

We can use the following sequence of Sage commands.

The first command defines the abstract function. The second describes the actual differential equation. Finally, we use the Sage command desolve to find the actual solution. Try replacing the h command with show(h) or show(expand(h)).

We can also specify an initial condition for our differential equation, say y(0)=1.

There are many other commands and packages to solve ordinary differential equations using Sage. For more information, see http://www.sagemath.org/doc/reference/calculus/sage/calculus/desolvers.html. An empty Sage cell is below for practice and exploration.