CHAPTER 1: FIRST ORDER ODES September 20, 2014 • Integrals as solutions: Z

advertisement
CHAPTER 1: FIRST ORDER ODES
MINGFENG ZHAO
September 20, 2014
• Integrals as solutions:
Z
I.
y 0 = f (x) =⇒ y =
II.


Z x
 dy = f (x, y)
dx
=⇒ y =
f (t) dt + y0 .

x0
 y(x0 ) = y0 .
III.



 1) y(x) ≡ a for some constant a such that f (a) = 0
0
Z
y = f (y) =⇒
1


dy.
 2) x =
f (y)
Example 1. Solve
f (x) dx
dy
= ex + x and y(0) = 10.
dx
In fact, we have
Z
y(x)
=
x
(et + t) dt + 10
0
=
x
t2 + 10
et +
2 0
x2
− 1 + 10
2
x2
+ 9.
= ex +
2
= ex +
So the solution to
dy
= ex + x and y(0) = 10 is:
dx
y = ex +
Example 2. Solve x0 =
1
π
, x(0) = .
cos(x)
2
1
x2
+9 .
2
2
MINGFENG ZHAO
In fact, we have
Z
t=
Since x(0) =
cos(x) dx = sin(x) + C.
π
, then
2
π
+ C = 1 + C.
2
π
1
So C = −1. Hence the solution to x0 =
, x(0) = is:
cos(x)
2
0 = sin
t = sin(x) − 1 .
Example 3. Suppose a cup of coffee is at 100 degrees Celsius at time t = 0, it is at 70 degrees at t = 10
minutes, and it is at 50 degrees at t = 20 minutes. Compute the ambient temperature.
Let A be the ambient temperture, and T (t) be the temperature of coffee at time t minutes, then
T (0) = 100,
T (10) = 70,
and T (20) = 50.
Newton’s Law of Cooling:
The rate of changing of the temperature of the object is proportional to the difference
between the ambient temperature and the temperature of the object.
Then there exists some constant k such that
T 0 = k(T − A).
Since the temperature T (t) is chaning, then T (t) 6≡ A. Hence
Z
1
dT =
T −A
Z
k dt.
Then
ln |T − A| = kt + C.
So we get
T = A ± ekt+C .
Since C is an arbitrary consant, then
T = A + Cekt .
CHAPTER 1: FIRST ORDER ODES
Since T (0) = 100, T (10) = 70 and T (20) = 50, then
100 = A + C,
70 = A + Ce10k ,
and
50 = A + Ce20k .
Since 70 = A + Ce10k and 50 = A + Ce20k , then
2
50 − A
70 − A
=
.
C
C
That is,
A2 − 140A + 4900 = C(50 − A).
Since A + C = 100, then
A2 − 140A + 4900 = C(50 − A) = (100 − A)(50 − A) = 5000 − 150A + A2 .
So we get 10A = 100, that is, A = 10. Hence
The ambient temperature is 10 degrees .
• Slope fields: To draw the slope field of y 0 = f (x, y):
1) select points in the xy-plane,
2) compute the numbers f (x, y) at the selected points (x, y),
3) at each selected point (x, y), draw a short tangent line whose slope is f (x, y).
Example 4. Draw the slope field of
dy
= y − x2 .
dx
Figure 1. Slope field of
dy
= y − x2
dx
3
4
MINGFENG ZHAO
• Existence and uniqueness:
Theorem 1 (Picard’s Theorem on Existence and Uniqueness). If f (x, y) is continuous with respect to x and y,
∂f
and
(x, y) exists and is continuous near some (x0 , y0 ), then a solution to
∂y
y 0 = f (x, y),
y(x0 ) = y0 ,
exists for some small interval containing x0 , and is unique.
Example 5. Its it possible to solve y 0 = xy for y(0) = 0? Is the solution unique?
Let f (x, y) = xy, then
– f (x, y) = xy is continuous near (0, 0).
∂f
–
(x, y) = x is also continuous near (0, 0).
∂y
By Picard’s Theorem on Existence and Uniqueness, there exists a unique solution to y 0 = xy for y(0) = 0. In
fact, we know that the unique solution is y(x) ≡ 0.
Example 6. Take (y − x)y 0 = 0, y(0) = 0. a)Find two distinct solutions. b) Explain why this does not violate
Picard’s theorem.
a) It’s easy to see that y1 = 0 and y2 = x are two solutions to (y − x)y 0 = 0, y(0) = 0.
b) Picard’s theorem only applies to the problem y 0 = f (x, y) and y(x0 ) = y0 . In our case, we can not simply to
rewrite the equation as y 0 = 0 and y(0) = 0, because we have y(0) = 0.
• Separable equations:



 1) y(x) ≡ a for some constant a such that g(a) = 0
0
Z
Z
y = f (x)g(y) =⇒
.
1


dy = f (x) dx.
 2)
g(y)
Example 7. Find an explicit solution for xy 0 = e−y , y(1) = 1.
Rewrite the equation:
y0 =
1 −y
·e .
x
Then
Z
1
e−y
Z
dy =
1
dx.
x
That is,
Z
y
e dy =
Z
1
dx.
x
CHAPTER 1: FIRST ORDER ODES
5
So we get
ey = ln |x| + C.
Since y(1) = 1, then
e = 0 + C.
That is, C = e. Hence we have
ey = ln x + e.
That is, the solution for xy 0 = e−y , y(1) = 1 is:
y = ln(ln x + e) .
dy
= xy + x + y + 1.
dx
Since xy + x + y + 1 = x(y + 1 + +(y + 1) = (x + 1)(y + 1), then
Example 8. Solve
dy
= (x + 1)(y + 1).
dx
1) y(x) ≡ −1 is a solution.
2) If y 6= −1, then
Z
1
dy =
y+1
Z
(x + 1) dx.
Then
ln |y + 1| =
x2
+ x + C.
2
Then we have
y = ±e
x2
2
+x+C
− 1.
Since C is an arbitrary constant, then ±eC can be any nonzero number, that is,
y = Ce
x2
2
+x
In summary, the general solution to
− 1,
for any nonzero constant C.
dy
= xy + x + y + 1 is:
dx
y = Ce
x2
2
+x
−1 .
R
p(x) dx
• Linear equations and the integrating factor:
R
I. y 0 + p(x)y = f (x) =⇒ r(x) = e
p(x) dx
, y = e−
Z
e
R
p(x) dx
f (x) dx
6
MINGFENG ZHAO

 y 0 + p(x)y = f (x)
Rx
p(t)
II.
=⇒ r(x) = e x0
 y(x ) = y
0
dt
, y=e
−
Rx
x0
p(t) dt
Z
x Rt
e
x0
p(s) ds
f (t) dt + y0
x0
0
To solve y 0 + p(x)y 0 = f (x):
1) Understand the meaning of the integrating fact r(x), that is,
d
[r(x)y].
dx
r(x)f (x) = r(x)[y 0 + p(x)y 0 ] =
2) Find the integrating factor r(x), that is,
r(x) = e
R
p(x) dx
.
3) Solve the differential equation:
Z
r(x)y =
r(x)f (x) dx.
That is,
y=
1
·
r(x)
Z
r(x)f (x) dx = e−
R
p(x) dx
Z
·
f (x)e
R
p(x) dx
dx.
Example 9. Solve y 0 + 3x2 y = x2 .
Let p(x) = 3x2 and f (x) = x2 , then the integration factor is:
µ(x) = e
Since
R
p(x) dx
R
=e
3x2 dx
3
= ex .
d
[µ(x)y(x)] = µ(x)f (x), then
dx
Z
Z
3
3
3
3
1 x3
1
1
· µ(x)f (x) dx = e−x · x2 ex dx = e−x ·
e + C = + Ce−x .
y(x) =
µ(x)
3
3
Hence the general solution to y 0 + 3x2 y = x2 is:
3
y = Ce−x +
1
.
3
Example 10. Suppose a water tank is being pumped out at 3 L/min. The water tank starts at 10 L of clean
water. Water with toxic substance is flowing into the tank at 2L.min, with concentration 20t g/L at time t.
When the tank is half empty, how many grams of toxic substance are in the tank?
Let y(t) be the amount of toxic substance in the tank at time t minutes, then y(0) = 0. At time t, we know
that
The rate of changing of toxic substance in the tank
CHAPTER 1: FIRST ORDER ODES
=
7
The rate of toxic substance flowing into the tank
−The rate of toxic substance going out the tank.
So we have
y 0 (t) = 2 ∗ (20t) − 3 ∗
y(t)
3y(t)
= 40t −
.
10 + (2 − 3) ∗ t
10 − t
Rewrite the equation:
y+
Let p(t) =
3
and f (t) = 40t, then the integrating factor is:
10 − t
Rt
µ(t) = e
Since
3
· y = 40t.
10 − t
0
p(x) dx
=e
Rt
3
0 10−x
dx
t
= e −3 ln(10−x)|0 = e−3 ln(10−t)+3 ln 10 =
1000
.
(10 − t)3
d
[µ(t)y(t)] = µ(t)f (t), then
dt
y(t)
=
=
=
1
·
µ(t)
t
Z
µ(x)f (x) dx + 0
0
(10 − t)3
·
100
Z
t
40x ·
0
400(10 − t)3 ·
Z
t
0
1000
dx
(10 − x)3
x
dx.
(x − 10)3
It’s easy to see that there are 10 − t L water in the tank at time t, so after t = 5 minutes, the tank is half
empty. Hence
y(5) = 400(10 − 5)3 ·
5
Z
0
x
dx = 2500.
(x − 10)3
Therefore, when the tank is half empty, there are 2500 grams of toxic substance in the tank.
• Exact equations and integrating factor:
Definition 1. A differential equation M (x, y) + N (x, y)y 0 = 0 is exact if My = Nx .
To solve a general differential equation M (x, y) + N (x, y) y 0 = 0:
M y − Nx
1) Compute My (x, y), Nx (x, y) and
N
2) Compute the integrating factor µ(x):
µ(x) = e
R
My −Nx
N
dx
.
8
MINGFENG ZHAO
3) Understand the meaning of the integrating factor, that is, [µM ] + [µN ] y 0 = 0 is exact, then there exists
some φ(x, y) such that
φx (x, y) = µ(x)M (x, y),
and φy (x, y) = µ(x)N (x, y).
4) Since φx (x, y) = µ(x)M (x, y), then
Z
φ(x, y) =
µ(x)M (x, y) dx + f (y).
5) Since φy (x, y) = µ(x)N (x, y), take the partial derivative with respect to y on the both sides of φ(x, y) =
Z
µ(x)M (x, y) dx + f (y), then
Z
µ(x)N (x, y) = φy (x, y) =
µ(x)My (x, y) dx + f 0 (y).
6) Compute f (y), that is,
Z f (y) =
Z
µ(x)N (x, y) −
µ(x)My (x, y) dx dy.
7) Write down the solution:
Z
Z Z
φ(x, y) = My (x, y) dx +
µ(x)N (x, y) − µ(x)My (x, y) dx dy = C.
Example 11. Solve 3xy + y 2 + (x2 + xy)y 0 = 0, y(2) = 1.
Let M (x, y) = 3xy + y 2 and N (x, y) = x2 + xy, then
My (x, y) = 3x + 2y,
and Nx (x, y) = 2x + y.
So we have
x+y
1
M y − Nx
= 2
= .
N
x + xy
x
Then the integrating factor is:
µ(x) = e
R
My −Nx
N
dx
=e
R
1
x
dx
= eln x = x.
That is, [µM ] + [µN ]y 0 = 0 is exact. Then there exists some φ(x, y) such that
φx = µM = x(3xy + y 2 ) = 3x2 y + xy 2 ,
and φy = µN = x(x2 + xy) = x3 + x2 y.
Since φx = 3x2 y + xy 2 , then
Z
φ(x, y) =
(3x2 y + xy 2 ) dx + f (y) = x3 y +
x2 y 2
+ f (y).
2
CHAPTER 1: FIRST ORDER ODES
Since φy = x3 + x2 y, take the partial derivative with respect to y in the above identity, we have
x3 + x2 y = φy = x3 + x2 y + f 0 (y).
Then f 0 (y) = 0. So we can take f (y) = 0. Then we have
φ(x, y) = x3 y +
x2 y 2
= C.
2
Since y(2) = 1, then
1·2+
1·4
= C = 4.
2
So the solution to 3xy + y 2 + (x2 + xy)y 0 = 0, y(2) = 1 is:
x3 y +
x2 y 2
=4.
2
Example 12. Solve (x + 2) sin(y) + [x cos(y)]y 0 = 0
Let M (x, y) = (x + 2) sin(y) and N (x, y) = x cos(y), then
My (x, y) = (x + 2) cos(y),
and Nx (x, y) = cos(y).
Then
(x + 1) cos(y)
x+1
1
My − Nx
=
=
=1+ .
N
x cos(y)
x
x
So the integrating factor is:
µ(x) = e
R
My −Nx
N
dx
1
= e (1+ x )
R
dx
= ex+ln x = xex .
That is, [µM ] + [µN ]y 0 = 0 is exact. So there exists some φ(x, y) such that
φx = µM = xex (x + 2) sin(y),
and φy = µN = x2 ex cos(y).
Since φx = xex (x + 2) sin(y), then
Z
φ(x, y) = [xex (x + 2) sin(y)] dx + f (y) = x2 ex sin(y) + f (y).
Since φy = x2 ex cos(y), take the partial derivative with respect to y in the above identity, we have
x2 ex cos(y) = x2 ex cos(y) + f 0 (y).
Then f 0 (y) = 0. So we can take f (y) = 0. Then we have
φ(x, y) = x2 ex sin(y) = C.
9
10
MINGFENG ZHAO
• Autonomous equations:
To draw the phase diagram of y 0 = f (y):
1) Find all critical points of f (y), that is, find all zeros of f (y).
2) Mark all critical points on a vertical line.
3) For any two neighboring critical points a and b, choose any point c which is between a and b, compute f (c):
∗ If f (c) > 0, draw an up arrow “↑” between a and b.
∗ If f (c) < 0, draw a down arrow “↓” between a and b.
Example 13. x0 = (x − 1)(x − 2)x2 .
– Critical Points: Let (x − 1)(x − 2)x2 = 0, then
x = 0, 1, 2 .
– Phase Diagram:
Figure 2. Phase diagram of x0 = (x − 1)(x − 2)x2
– Classify the critical Points:
x = 0 is a node(unstable), x = 1 is a sink(stable), x = 2 is a source(node) .
– For the initial value problem: x(0) = 0.5. Since 0 < x(0) = 0.5 < 1, then x0 (0) = (0.5−1)(0.5−2)(0.5)2 > 0,
and
lim x(t) = 1 .
t→∞
CHAPTER 1: FIRST ORDER ODES
11
• Numerical methods: Euler’s method
Use Euler’s Method to approximate solutions of y 0 = f (x, y): Given the initial condition y(x0 ) = y0 and the
step size h, compute the point (xk+1 , yk+1 ) from the previous point (xk , yk ) as follows:
1) Use the differential equation to compute the slope f (xk , yk ).
2) Calculate the next point (xk+1 , yk+1 ) using the formula
xk+1
= xk + h
yk+1
= yk + hf (xk , yk )
Let xk = x0 + kh, and
x1 = x0 + h
y1 = y0 + hf (x0 , y0 )
x2 = x1 + h
y2 = y1 + hf (x1 , y1 )
x3 = x2 + h
..
.
y3 = y2 + hf (x2 , y2 )
..
.
xk+1 = xk + h
..
.
yk+1 = yk + hf (xk , yk )
..
.
Department of Mathematics, The University of British Columbia, Room 121, 1984 Mathematics Road, Vancouver, B.C.
Canada V6T 1Z2
E-mail address: mingfeng@math.ubc.ca
Download