Section 1.2 Separable Differential Equations
ΒΆSubsection 1.2.1 Separable Differential Equations
ΒΆFor some first-order differential equations such asExample 1.2.1.
Suppose that we wish to solve the initial value problem
We can rewrite this equation in the form
or in the alternate form
Integrating both sides of the equation, we have
where C is an arbitrary constant. Using the initial condition, y(0)=1 to find C, we see that
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,
The Sage commands for solving our initial value problem are below.
xxxxxxxxxx
x = var('x') #declare x as a variable
y = function('y')(x) #declare y as a function of x
de = diff(y, x) == x*y #write the differential equation
solution = desolve(de, y, ics=[0, 1]) #find the solution
solution
xxxxxxxxxx
x = var('x')
y = function('y')(x)
de = diff(y, x) == sin(x*y)
solution = desolve(de, y, ics=[0, 1])
solution
Example 1.2.2.
Consider the initial-value problem
First, we separate the variables of the equations and write
Integrating both sides of the equation, we have
Using the initial condition, y(0)=4, we can determine the value of C,
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.
xxxxxxxxxx
t = var('t')
y = function('y')(t)
de = diff(y, t) == t/(y - t^2*y)
solution = desolve(de, y, ics=[0, 4])
solution
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,
Using partial fractions, we can rewrite this equation as
Integrating both sides of (1.2.1), we obtain
Taking the exponential of both sides yields
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
Solving for P yields
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,
xxxxxxxxxx
k,t = var('k,t')
T = function('T')(t)
de = diff(T,t) == k*(T - 70)
solution = desolve(de, T, ivar=t)
solution.show()
xxxxxxxxxx
t = var('t')
T(t) = 28.6 * exp(-0.0725 * t) + 70
plot(T, (t, 0, 24))
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, orSubsection 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,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 formSubsection 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
This equation can be rewritten in the form
Integrating both sides of the equation, we have
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
This equation is separable since we can rewrite it in the form
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
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,
Thus,
or
If C=0, the initial condition is satisfied and
is a solution for tβ₯0. However, we can find at least two additional solutions for tβ₯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,
we see that
or
Therefore, a continuous solution also exists on (ββ,1) if y(0)=1. In the case that y(0)=β1, the solution is
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 formF(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, andF(t,u,uβ²,uβ³,β¦,u(n))=0.
- A first-order differential equation is an equation that can be written in the formdxdt=f(t,x).
- A differential equation is separable if it can be written in the formdydx=M(x)N(y).In this case we can rewrite the equation in the formf(x)+g(y)dydx=0org(y)dy=f(x)dxand 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
separable? Why or why not?
Exercises 1.2.9 Exercises
ΒΆFinding General Solutions
Solving Initial Value Problems
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.
xxxxxxxxxx
β
22.
Homogeneous Equations. A first-order differential equation, yβ²=f(x,y), is homogeneous if f(x,y)=f(tx,ty).
- Show that the equationdydx=x2+y22xyis homogeneous.
- Let y=xv and show that the equation in part (a) can be written asv+xdvdx=x2+v2x22vx2.Use the fact that this new equation is separable to solve for y.
- Show that any homogeneous equation yβ²=f(x,y) can be transformed into a separable differential equation by making the substitution y=vx.
- A function f is said to homogeneous of degree n if f(tx,ty)=tnf(x,y) for n=1,2,β¦. Show that differential equationP(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.
- Solve the differential equationx2yβ²=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- An abstract function
- A differential equation
- A Sage command to solve the equation.
xxxxxxxxxx
y = function('y')(x)
de = diff(y,x) == x + y
solution = desolve(de, y)
solution.show()
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.
xxxxxxxxxx
y = function('y')(x)
de = diff(y,x) == x + y
solution = desolve(de, y, ics=[0,1])
solution.show()
http://www.sagemath.org/doc/reference/calculus/sage/calculus/desolvers.html
. An empty Sage cell is below for practice and exploration.
xxxxxxxxxx
β