First Order ODE (Online Copy)
First Order ODE (Online Copy)
First Order ODE (Online Copy)
Introduction
Any first order differential equation can be written as
F (x, y, y 0) = 0
by moving all nonzero terms to the left hand side of the equation. Of course, y 0 must
appear explicitly in the expression F . Our study of first order differential equations
requires an additional assumption, namely that the equation can be solved for y 0.
This means that we can write the equation in the form
The solution method for linear equations is based on writing the equation as
where p(x) = −P (x). The precise definition of a linear equation that we will use is:
15
FIRST ORDER LINEAR DIFFERENTIAL EQUATION: The first order
differential equation y 0 = f (x, y) is a linear equation if it can be written in the form
SOLUTION METHOD:
Step 2. Calculate Z
h(x) = p(x) dx
and
Z Z
−h(x) h(x) −h(x)
y=e e q(x) dx + C = e eh(x) q(x) dx + Ce−h(x) .
NOTES: (a) Standard Form: The solution method requires that the equation
be written in the standard form (1).
16
(b) Integrating Factor: The key step in solving y 0 +p(x)y = q(x) is multiplication
R
by eh(x) where h(x) = p(x) dx. It is multiplication by this factor, called an
integrating factor, that enables us to write the left side of the equation as a derivative
(the derivative of the product eh(x) y) from which we get the general solution in Step
4.
y 0 + 2x y = x.
SOLUTION
(1) The equation is linear; it is already in the form (1); p(x) = 2x, q(x) = x
continuous functions on (−∞, ∞).
Z
2
(2) Calculate: h(x) = 2x dx = x2 and eh(x) = ex .
2
(3) Multiply by ex :
2 2 2
ex y 0 + 2x ex y = x ex
h i0
2 2
ex y = x ex (verify this)
(4) Integrate: Z
x2 2 2
e y= x ex dx = 1
2
ex + C
and
−x2 1 x2 1 2
y=e e +C = 2
+ C e−x .
2
1 2
Thus, y = 2
+ C e−x is the general solution of the equation.
17
SOLUTION The first step is to find the general solution of the differential equation.
After dividing the equation by x2, we obtain:
1
y0 − y = x2 cos 2x, (∗)
x
a linear equation in the standard form (1)with p(x) = −1/x and q(x) = x2 cos 2x,
continuous functions on (0, ∞).
Z
−1
Set h(x) = (−1/x) dx = − ln x = ln x−1. Then eh(x) = eln x = x−1 .
1
The solution of the initial-value problem is y = 2
x2 sin 2x + 14 x cos 2x + 74 x.
A Special Case: There is a special case of equation (1) which will be useful later.
If q(x) = 0 for all x ∈ I, then (1) becomes
y 0 + p(x)y = 0. (3)
R
p(x) dx
We multiply this equation by e , to obtain
R R
p(x) dx
e y 0 + p(x) e p(x) dx
y=0
18
It follows from this that
R R
p(x) dx
e y=C and y = C e− p(x) dx
.
R
Let y = y(x) be a solution of (3). Since e− p(x) dx
6= 0 for all x, we can conclude
that:
(1) If y(a) = 0 for some a ∈ I, then C = 0 and y(x) = 0 for all x ∈ I (y ≡ 0).
Final Remarks
1. The general solution (2) of a first order linear differential equation involves two
integrals Z Z
h(x) = p(x) dx and f (x)eh(x) dx.
It will not always be possible to carry out the integration steps as we did in the
preceding examples. Even simple equations can lead to integrals that cannot be
calculated in terms of elementary functions. In such cases you will either have to
leave your answer in the integral form (2) or apply some type of numerical method.
y 0 + p(x)y = f (x).
We can regard the left-hand side of the equation, L[y] = y 0 +p(x)y, as an “operation”
that is performed on the function y. That is, the left-hand side says “take a function
y, calculate its derivative, and then add that to p(x) times y.” The equation asks
us to find a function y such that the operation L[y] = y 0 + p(x)y produces the
function f .
L[f (x) + g(x)] = [f (x) + g(x)]0 + p(x)[f (x) + g(x)] = f 0 (x) + g 0 (x) + p(x)f (x) + p(x)g(x)
= f 0 (x) + p(x)f (x) + g 0(x) + p(x)g(x)
= L[f (x)] + L[g(x)]
19
and
L : C 1(I) → C(I)
is a linear transformation. The fact that the operation L[y] = y 0 + p(x)y is a linear
operation is the reason for calling y 0 + p(x)y = f (x) a linear differential equation.
In this context L is called a linear differential operator.
Exercises 2.1
1. y 0 − 2xy = 2x.
2. xy 0 − 2y = −x.
cos x
3. xy 0 + 2y = .
x
dy
4. (x + 1) + 2y = (x + 1)5/2 .
dx
5. xy 0 − 2y = x4 ex
6. xy 0 − y = 2x ln x.
dy
7. + y tan x = cos2 x.
dx
dy
8. + y cot x = csc2 x.
dx
9. xy 0 + y = (1 + x)ex.
2
10. y 0 + 2xy = xe−x .
20
12. xy 0 − 2y = x3 ex, y(1) = 0.
15. 2xy y 0 = 1 + y 2
y 0 = f (x, y)
The solution method for separable equations is based on writing the equation as
1 0
y = p(x)
h(y)
or
q(y) y 0 = p(x) (1)
21
where q(y) = 1/h(y).
This is the motivation for the term “separable,” the variables are separated.
Step 1. Identify: Can you write the equation in the form (1).
22
is separable since f (x, y) = −(x/y) = (−x)(1/y). Writing the equation in the form
(1)
y y0 = x or y dy = −x dx
and integrating Z Z
y dy = − x dx + C,
we get
1
2
y 2 = − 12 x2 + C or 1
2
x2 + 12 y 2 = C,
which, after multiplying by 2, gives
x2 + y 2 = C.
The set of integral curves is the family of circles centered at the origin. Note that
for each positive value of C, the resulting equation defines y implicitly as a function
of x.
Remark we may or may not be able to solve the implicit relation (2) for y. This
is in contrast to linear differential equations where the solutions y = y(x) are given
explicitly as a function of x. When we can solve (2) for y, we will.
The set of integral curves of a separable equation may not represent the set of all
solutions of the equation and so it is not technically correct to use the term “general
solution” as we did with linear equations. However for our purposes here this is a
minor point and so we shall also call (2) the general solution of (1). As noted above,
if h(r) = 0, then y = r may be a singular solution of the equation; in solving
separable equations, we will have to check for singular solutions.
23
SOLUTION Here
xy − y y(x − 1) y
f (x, y) = = = (x − 1) .
y+1 y+1 y+1
Thus, f can be expressed as the product of a function of x and a function of y
so the equation is separable.
and
1
y + ln |y| = 2
x2 − x + C
is the general solution. Again we have y defined implicitly as a function of x. Note
that y = 0 is a solution of the differential equation (verify this), but this function is
not included in the general solution (ln 0 does not exist). Thus, y = 0 is a singular
solution of the equation.
1
1 + ln 1 = 2
(2)2 − 2 + C which implies C = 1.
1
A particular solution that satisfies the initial condition is: y + ln |y| = 2
x2 − x + 1.
dy xy 2 − x
=
dx y
24
Integrating
Z Z
y
dy = x dx.
y2 − 1
1 1 2
ln (y 2 − 1) = x +C
2 2
ln (y 2 − 1) = x2 + C (should be 2C but 2C is arbitrary so we call it C.)
2 +C 2 2
y 2 − 1 = ex = ex eC = Cex (C arbitrary, eC arbitrary, call it C.)
2
y 2 = Cex + 1 (the general solution)
2
y 2 = Cex + 1; no singular solutions.
Exercises 2.2
Find the general solution and any singular solutions. If possible, express your
general solution in the form y = f (x).
y2 + 1
0
1. y = .
xy + y
2. (2xy 3 + 4x)y 0 = x2 y 2 + y 2
dy
3. = x2y − 2x2
dx
4. y 0 = xex+y .
5. y 0 = xy 2 − x − y 2 + 1.
y2 + 1
6. (y ln x)y 0 = .
x
7. (xy + y)y 0 = x − xy.
8. xy 0 + y = y 2 ln x.
dy 1 + y2
9. = .
dx 1 + x2
dy y
10. ln x = .
dx x
25
dy sin 1/x
11. =− 2 .
dx x y cos y
I. Orthogonal Trajectories:
26
√
is a family of circles with center at the point (2, 1) and radius C.
-1 1 2 3 4 5
-1
-2
2(x − 2) + 2(y − 1) y 0 = 0
and
x−2
y0 = − (b)
y−1
This is the differential equation of the family of circles. Note that if we choose a
specific point (x0, y0 ), y0 6= 1 on one of the circles, then (b) gives the slope of the
tangent line at (x0 , y0).
Now consider the family of straight lines passing through the point (2, 1):
-1 1 2 3 4 5
-2
-4
Comparing equations (b) and (d) we see that right side of (b) is the negative
reciprocal of the right side of (d). We can conclude from this that if P (x0, y0) is a
point of intersection of one of the circles and one of the lines, then the line and the
circle are perpendicular (orthogonal) to each other at the point P .
27
A curve that intersects each member of a given family of curves at right angles
(orthogonally) is called an orthogonal trajectory of the family. Each line in (c) is an
orthogonal trajectory of the family of circles (a) [and conversely, each circle in (a) is
an orthogonal trajectory of the family of lines (c)]. In general, if
are one-parameter families of curves such that each member of one family is an or-
thogonal trajectory of the other family, then the two families are said to be orthogonal
trajectories.
Step 1. Determine the differential equation for the given family F (x, y, C) = 0.
SOLUTION You can verify that the differential equation for the family y = Cx2
can be written as
2y
y0 = .
x
0 0
Replacing y by −1/y , we get the equation
1 2y x
− = which simplifies to y0 = −
y0 x 2y
a separable equation. Separating the variables, we get
2y y 0 = −x or 2y dy = −x dx.
1 x2
y 2 = − x2 + C or + y 2 = C.
2 2
28
This is a family of ellipses with center at the origin and major axis on the x-axis.
-4 -2 2 4
-1
-2
-3
Radioactive Decay: It has been observed and verified experimentally that the
rate of decay of a radioactive material at time t is proportional to the amount of
material present at time t. Mathematically this says that if A = A(t) is the amount
of radioactive material present at time t, then
dA
= rA
dt
where r, the constant of proportionality, is negative (since the amount of material
is decreasing). To emphasize the fact that A is decreasing, this equation is often
written
dA
= −kA, k > 0 constant.
dt
The constant of proportionality k is called the decay constant.
A(t) = Ce−kt
A(t) = A0 e−kt .
29
for T :
1
A0 = A0 e−kT
2
e−kT = 1
2
−kT = ln(1/2) = − ln 2
ln 2
T = −
k
(a) Find the decay constant and determine an expression for the amount of the
sample that will remain t years from now.
(b) How long will it take for 90% of the sample to decay?
(b) If 90% of the material decays, then 10%, which is 10 grams, remains. Therefore,
we solve the equation
100 e−0.131t = 10
for t:
ln (0.1) ∼
e−0.131t = 0.1, −0.131t = ln (0.1), t= = 17.6.
−0.131
It will take approximately 17.6 years for 90% of the sample to decay.
30
In this case, the constant of proportionality r is called the growth constant.
P (t) = Cert.
P (t) = P0 ert
is the size of the population at time t. Note that limt→∞ P (t) = ∞. In reality, the
rate of increase of a population does not continue to be proportional to the size of the
population. After some time has passed, factors such as limitations on space or food
supply, introduction of diseases, and so forth affect the growth rate; the mathematical
model is not valid indefinitely. In contrast, the model does hold indefinitely in the
case of the growth of an investment under continuous compounding.
The analog of the half-life of a radioactive material is the so-called doubling time,
the length of time T that it takes for a population to double in size. Using the same
analysis as above, we have
2 A0 = A0 erT
erT = 2
rT = ln 2
ln 2
T =
r
In the banking, investment, and real estate communities there is a standard mea-
sure, called the rule of 72, which states that the length of time (approximately) for
a principal invested at r%, compounded continuously, to double in value is 72/r%.
We know that the doubling time is
ln 2 0.69 69 72
T = ≈ = ≈ .
r r r% r%
This is the origin of the “rule of 72;” 72 is used rather than 69 because it has more
divisors.
31
Example Scientists have observed that a small colony of penguins on a remote
Antarctic island obeys the population growth law. There were 2000 penguins initially
and 3000 penguins 4 years later.
(b) How long will it take for the number of penguins to double?
SOLUTION Let P (t) denote the number of penguins at time t. Since P (0) = 2000
we have
P (t) = 2000 ert .
We use the fact that P (4) = 3000 to determine the growth constant r:
and so
ln 1.5 ∼
r= = 0.101.
4
(b) To find out how long it will take the number of penguins in the colony to double,
we need to solve
2000 e0.101t = 4000
for t:
ln 2 ∼
e0.101t = 2, 0.101t = ln 2, t= = 6.86 years.
0.101
Note: There is another way of expressing P that uses the exact value of r. From
the equation 3000 = 2000 e4r we get r = 14 ln 32 . Thus
t/4
t
ln [3/2] ln [3/2]t/4 3
P (t) = 2000 e 4 = 2000 e = 2000 .
2
32
III. Newton’s Law of Cooling
Newton’s Law of Cooling states that the rate of change of the temperature u of an
object is proportional to the difference between u and the (constant) temperature
σ of the surrounding medium (e.g., air or water), called the ambient temperature.
The mathematical formulation of this statement is:
du
= m(u − σ), m constant.
dt
The constant of proportionality, m, in this model must be negative; for if the object
is warmer than the ambient temperature (u − σ > 0), then its temperature will
decrease (du/dt < 0), which implies m < 0; if the object is cooler than the ambient
temperature (u − σ < 0), then its temperature will increase (du/dt > 0), which
again implies m < 0.
This differential equation is both linear and separable so either method can be
used to solve it. As you can check, the general solution is
u(t) = σ + Ce−kt .
If the initial temperature of the object is u(0) = u0, then
u0 = σ + Ce0 = σ + C and C = u0 − σ.
Thus, the temperature of the object at any time t is given by
u(t) = σ + [u0 − σ]e−kt . (6)
The graphs of u(t) in the cases u0 < σ and u0 > σ are given below. Note
that limt→∞ u(t) = σ in each case. In the first case, u is increasing and its graph
is concave down; in the second case, u is decreasing and its graph is concave up.
Sigma 0
Sigma
33
Example A metal bar with initial temperature 25o C is dropped into a container
of boiling water (100o C). After 5 seconds, the temperature of the bar is 35o C.
(b) How long will it take for the temperature of the bar to be within 0.5o C of
the boiling water?
SOLUTION Applying equation (2), the temperature of the bar at any time t is
The first step is to determine the constant k. Since T (5) = 35, we have
Therefore,
T (t) = 100 − 75 e−0.0286 t.
(b) We want to calculate how long it will take for the temperature of the bar to reach
99.5o . Thus, we solve the equation
for t:
−0.0826 t = ln (0.5/75), t∼
= 60.66 seconds.
Exercises 2.3
In Exercises 1 - 3, find the orthogonal trajectories for the given family of curves
and draw several members of each family.
1. y 2 = Cx3 − 2.
34
2. The family of parabolas with vertical axis and vertex at the point (1, 2).
3. The family of circles that pass through the origin and have their center on the
x-axis.
(a) An expression for the mass of the material remaining at any time t.
(b) The mass of the material after 4 hours.
(c) The half-life of the material.
5. The size of a certain bacterial colony increases at a rate proportional to the size
of the colony. Suppose the colony occupied an area of 0.25 square centimeters
initially, and after 8 hours it occupied an area of 0.35 square centimeters.
(a) Estimate the size of the colony t hours after the initial measurement.
(b) What is the expected size of the colony after 12 hours?
(c) Find the doubling time of the colony.
6. In 1980 the world population was approximately 4.5 billion and in the year 2000
it was approximately 6 billion. Assume that the world population at each time
t increases at a rate proportional to the population at time t. Measure t in
years after 1980.
(a) Find the growth constant and give the world population at any time t.
(b) How long will it take for the world population to reach 9 billion (double
the 1980 population)?
(c) The world population for 2002 was reported to be about 6.2 billion. What
population does the formula in (a) predict for the year 2002?
35
(c) When will the thermometer read 68o F?
9. A 44-gallon barrel, initially full of oil, develops a leak at the bottom. Let A(t)
be the amount of oil in the barrel at time t. Suppose that the amount of oil
is decreasing at a rate proportional to the product of the time elapsed and the
amount of oil present in the barrel.
10. A 44-gallon barrel, initially full of oil, develops a leak at the bottom. Let A(t)
be the amount of oil in the barrel at time t. Suppose that the amount of oil
is decreasing at a rate proportional to the product of the time elapsed and the
square of amount of oil present in the barrel.
11. A disease is infecting a colony of 1000 penguins living on a remote island. Let
P (t) be the number of sick penguins t days after the outbreak. Suppose that
50 penguins had the disease initially, and suppose that the disease is spreading
at a rate proportional to the product of the time elapsed and the number of
penguins who do not have the disease.
36
Consider the differential equation
y2
y0 = −
x2
together with the three initial conditions:
(a) y(0) = 1,
(b) y(0) = 0,
(c) y(1) = 1.
Since the differential equation is separable, we can calculate the general solution.
x2 y 0 + y 2 = 0
1 0 1
2
y + 2 = 0
y x
Z Z
1 1
2
dy + dx = C
y x2
1 1 1 1
− − = C or + = C.
y x y x
Solving for y we get
x
y= .
Cx − 1
37
Finally, we apply the initial condition (c) by setting x = 1, y = 1 in the general
solution:
1
1= which implies C = 2.
C ·1−1
This initial-value problem x2 y 0 + y 2 y = 0, y(1) = 1 has a unique solution, namely
y = x/(2x − 1).
Going back to our example, note that f (x, y) = −y 2/x2 is not continuous on
any rectangle that contains (0, b) in its interior. Thus, the existence and uniqueness
theorem does not apply in the cases y(0) = 1 and y(0) = 0.
y 0 + p(x)y = q(x)
where p and q are continuous functions on some interval I = [α, β], we have
∂f
f (x, y) = q(x) − p(x)y and = p(x)
∂y
and these functions are continuous on every rectangle R of the form α ≤ x ≤
β, −γ ≤ y ≤ γ where γ is any positive number; that is f and ∂f/∂y are
continuous on the “infinite” rectangle α ≤ x ≤ β, −∞ < y < ∞. Thus, every linear
initial-value problem has a unique solution .
38