Separable differential equations

advertisement
LECTURE 1: REVIEW OF ORDINARY DIFFERENTIAL EQUATIONS
MINGFENG ZHAO
July 07, 2015
Separable differential equations
A separable differential equation has the form of:
y0 =
dy
= f (x)g(y).
dx
There are two cases:
Case I: If g(a) = 0 for some constant a, then y(x) ≡ a is a solution.
Case II: If g(y) 6= 0, then moving g(y) to the left hand side, we get
1
dy
·
= f (x).
g(y) dx
Integrate both sides with respect to x, then
Z
1
dy
·
dx =
g(y) dx
Z
f (x) dx.
By the change of variables, then
Z
One can just think the cancellation in
1
dy =
g(y)
Z
f (x) dx.
dy
dy
= dy.
dx, that is,
dx
dx
dx
In summary,



 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)
Z
Remark 1. In the formula
1
dy =
g(y)
Z
f (x) dx, we call y is an implicit solution to y 0 = f (x)g(y).
1
2
MINGFENG ZHAO
Example 1. Solve y 0 =
xy
.
+1
y2
Notice that
y0 =
y
dy
=x· 2
.
dx
y +1
Then
1) y(x) ≡ 0 is a solution.
2) If y 6= 0, then
y2 + 1
dy = x dx.
y
So we get
Z y+
1
y
Z
dy =
x dx.
Hence
1
1 2
y + ln |y| = x2 + C.
2
2
xy
In summary, the general solution of y 0 = 2
is
y +1
either y ≡ 0,
or
1 2
1
y + ln |y| = x2 + C .
2
2
First order linear ordinary differential equations: integrating factors or variation of parameters
A first order linear ordinary differential equation has the form of:
y 0 + p(x)y = f (x).
To find the general solution to the above differential equation:
1) First of all, find the general solution (which is called complementary solution) to the homogeneous equation
(that is, f (x) = 0): the general solution to y 0 + p(x)y = 0 is given by:
yc (x) = Ce−
R
p(x) dx
.
2) Secondly, find a particular solution to y 0 + p(x)y = f (x) by integrating factors or variation of parameters:
Let u(x) be a non-zero solution to the homogeneous equation y 0 + p(x)y = 0, that is, u(x) = e−
yp (x) = c(x)u(x) for some c(x) be a particular solution to y 0 + p(x)y = f (x), then
yp0 (x)
= c0 (x)u(x) + c(x)u0 (x)
R
p(x) dx
, let
LECTURE 1: REVIEW OF ORDINARY DIFFERENTIAL EQUATIONS
y 0 + p(x)y
3
= c0 (x)u(x) + c(x)u0 (x) + p(x)c(x)u(x)
= c0 (x)u(x) + c(x)[u0 (x) + p(x)u(x)]
= c0 (x)u(x)
Since u0 (x) + p(x)u(x) = 0
= f (x).
Z
Then we get c(x) =
f (x)
dx. That is, we find a particular solution:
u(x)
Z
R
R
− p(x) dx
yp (x) = c(x)u(x) = e
· f (x) · e p(x) dx dx.
3) The general solution to y 0 + p(x)y = f (x) is just the sum of the complementary solution and the particular
solution:
y(x
= yc (x) + yp (x)
Z
R
R
+ e− p(x) dx · f (x) · e p(x) dx dx
Z
R
dx
·
f (x) · e p(x) dx dx + C .
= e−
R
p(x) dx
= e−
R
p(x)
2
Example 2. Solve y 0 + 2xy = ex−x , y(0) = −1.
1) Let’s solve the homogeneous equation: y 0 + 2xy = 0, then we have
2
yc (x) = Ce−x .
2
2) Take u(x) = e−x which is a solution to the homogeneous equation y 0 +2xy = 0, set yp (x) = c(x)u(x) = c(x)e−x
2
2
for some c(x) to be a particular solution to y 0 + 2xy = ex−x , then
yp0 + 2xyp
2
2
2
=
c0 (x)e−x − 2xc(x)e−x + 2xc(x)e−x
=
ex−x .
2
2
2
Then we get c0 (x)e−x = ex−x , that is, c0 (x) = ex , which implies that c(x) = ex + C. So a particular solution
2
to y 0 + 2xy = ex−x is:
2
2
yp (x) = c(x)u(x) = ex · e−x = ex−x .
2
3) So the general solution to y 0 + 2xy = ex−x is
2
2
y(x) = yc (x) + yp (x) = Ce−x + ex−x .
4
MINGFENG ZHAO
2
4) Since y(0) = −1, then −1 = C + 1, that is, C = −2. Therefore, the solution to y 0 + 2xy = ex−x , y(0) = −1 is:
2
2
y(x) = −2e−x + ex−x .
Second order linear homogeneous differential equations
Definition 1. Two function u(x) and v(x) are linearly independent if neither
u(x)
v(x)
nor
is constant function.
v(x)
u(x)
Theorem 1. Let u1 (x) and u2 (x) be a fundamental set of solutions to y 00 + p(x)y 0 + q(x)y = 0 (that is, u1 and u2 are
two linearly independent solutions to y 00 + p(x)y 0 + q(x)y = 0), then the general solution to y 00 + p(x)y 0 + q(x)y = 0 is
given by:
y = C1 u1 (x) + C2 u2 (x).
Constant coefficients Second order linear homogeneous differential equations
A constant coefficients second order liner differential equation has the form of:
ay 00 + by 0 + cy = 0.
(1)
To find the general solution to the above differential equation:
1) Try y = erx to be a solution to (1, then
y 0 = rerx ,
and y 00 = r2 erx .
Then r will be a root of the characteristic equation of ay 00 + by 0 + cy = 0, that is,
(2)
ar2 + br + c = 0.
2) Find the solutions to the characteristic equation ar2 + br + c = 0, that is,
√
−b ± b2 − 4ac
.
r=
2a
3) Write down the general solution to ay 00 + by 0 + cy = 0:
– If b2 − 4ac > 0, that is, (2) has two different real roots, then the general solution to (1) is:
y = C1 er1 x + C2 er2 x .
LECTURE 1: REVIEW OF ORDINARY DIFFERENTIAL EQUATIONS
5
– If b2 − 4ac = 0, that is, (2) has only one real root, then the general solution to (1) is:
−b
−b
y = C1 e 2a ·x + C2 xe 2a ·x .
– If b2 − 4ac < 0, that is, (2) has two different complex roots, then the general solution to (1) is:
!
!
√
√
b
b
4ac − b2
4ac − b2
− 2a
·x
·x
− 2a
y = C1 e
cos
sin
x + C2 e
x .
2a
2a
Remark 2. For the case that b2 − 4ac = 0, that is, (2) has only one real root, say r0 , then ar2 + br + c = a(r − r0 )2 =
ar2 − 2ar0 r + ar02 , which implies that b = −2ar0 and c = ar02 . There are two approaches to find another solution to (1):
• Approach I: (Method of reduction of order) Let u(x) = C(x)er0 x be a solution to (1) for some function C(x),
let’s determine what C(x) is, plug u(x) into (1), then
u0 (x)
= C 0 (x)er0 x + r0 C(x)er0 x
u00 (x)
=
C 00 (x)er0 x + r0 C 0 (x)er0 x + r0 C 0 (x)er0 x + r02 C(x)er0 x
=
C 00 (x)er0 x + 2r0 C 0 (x)er0 x + r02 C(x)er0 x .
So we get
0
= au00 (x) + bu0 (x) + cu(x)
= aC 00 (x)er0 x + 2ar0 C 0 (x)er0 x + ar02 C(x)er0 x + bC 0 (x)er0 x + br0 C(x)er0 x + cC(x)er0 x
= aC 00 (x)er0 x + [2ar0 + b]C 0 (x)er0 x + [ar02 + br0 + c]C(x)er0 x
= aC 00 (x)er0 x
Since b = −2ar0 and r0 is a root of ar2 + br + c = 0.
So we get C 00 (x) = 0, which implies that u(x) = xer0 x is a solution to (1).
• Approach II: (Frobenius’ Method) Think r is a variable, let φ(r, x) = erx , then
aφxx + bφx + cφ = erx [ar2 + br + c]
= aerx (r − r0 )2
Since r0 is the unique solution to ar2 + br + c = 0.
Then we get
aφxxr + bφxr + cφr = axerx (r − r0 )2 + 2aerx (r − r0 ).
Then we get
aφxxr (x, r0 ) + bφxr (x, r0 ) + cφr (x, r0 ) = 0.
6
MINGFENG ZHAO
That is, y = φr (x, r0 ) is a solution to (1). Notice that
φr (x, r0 ) = xerx0 .
Remark 3. For the case √
that b2 − 4ac < 0, that is, (2) has two different complex roots r1 = α + iβ and r2 = α − iβ,
b
4ac − b2
where α = −
and β =
. By the Euler identity, we have
2a
2a
e r1 x
= e(α+iβ)x
= eαx+iβx
= eαx · eiβx
= eαx [cos(βx) + i sin(βx)]
= eαx cos(βx) + ieαx sin(βx)].
So the real and imaginary parts or er1 x form a fundamental set of solutions to (1).
Example 3. Let a be a real constant, solve y 00 − 4y 0 − 5y = 0, y(0) = 6 and y 0 (0) = 6a. Then find the value of a such
that the solution approaches 0 as x → ∞.
Let y = erx be a solution to y 00 − 4y 0 − 5y = 0, then
y0
=
rerx
y 00
=
r2 erx
0
=
y 00 − 4y 0 − 5y
=
r2 erx − 4rerx − 5erx
=
erx (r2 − 4r − 5).
So r2 − 4r − 5 = 0, that is,
r = −1,
and r = 5.
So the general solution to y 00 − 4y 0 − 5y = 0 is:
y(x) = C1 e−x + C2 e5x .
Then
y 0 (x) = −C1 e−x + 5C2 e5x .
LECTURE 1: REVIEW OF ORDINARY DIFFERENTIAL EQUATIONS
Since y(0) = 6 and y 0 (0) = 6a, then
C1 + C2 = 6,
and
− C1 + 5C2 = 6a.
Solve the above system, we get
C1 = 5 − a,
and C2 = 1 + a.
So we know that the solution to y 00 − 4y 0 − 5y = 0, y(0) = 6 and y 0 (0) = 6a is:
y(x) = (5 − a)e−x + (1 + a)e5x .
Moreover, if we assume y(x) → 0 as x → ∞, then we must have 1 + a = 0, that is,
a = −1 .
Example 4. Solve y 00 − 8y 0 + 16y = 0, y(0) = 1 and y 0 (0) = 6.
Let y = erx be a solution to y 00 − 8y 0 + 16y = 0, then
y0
= rerx
y 00
= r2 erx
0
= y 00 − 8y 0 + 16y
= r2 erx − 8rerx + 16erx
= erx (r2 − 8r + 16).
So r2 − 8r + 16 = 0, that is,
r1 = r2 = 4.
So the general solution to y 00 − 8y 0 + 16y = 0 is:
y(x) = C1 e4x + C2 xe4x .
Since y(0) = 1, then C1 = 1 and
y(x) = e4x + C2 xe4x .
So
y 0 (x) = 4e4x + C2 e4x + 4C2 xe4x .
7
8
MINGFENG ZHAO
Since y 0 (0) = 6, then 6 = 4 + C2 , that is, C2 = 2. So the solution to y 00 − 8y 0 + 16y = 0, y(0) = 1 and y 0 (0) = 6 is:
y(x) = e4x + 2xe4x .
Example 5. Find the solution of y 00 − 6y 0 + 13y = 0, y(0) = 0 and y 0 (0) = 10.
Let y = erx be a solution to y 00 − 6y 0 + 13y = 0, then
y0
= rerx
y 00
= r2 erx
0
= y 00 − 6y 0 + 13y
= r2 erx − 6rerx + 13erx
= erx (r2 − 6r + 13).
So r2 − 6r + 13 = 0, that is,
r1 =
6+
√
√
36 − 4 · 12
6 + −16
=
= 3 + 2i,
2
2
and r2 = 3 − 2i.
So the general solution to y 00 − 6y 0 + 13y = 0 is:
y(x) = C1 e3x cos(2x) + C2 e3x sin(2x).
Since y(0) = 0, then C1 = 0, that is, y(x) = C2 e3x sin(2x). So we get
y 0 (x) = 3C2 e3x sin(2x) + 2C2 e3x cos(2x).
Since y 0 (0) = 10, then 10 = y 0 (0) = 2C2 that is, C2 = 5. Therefore, the solution of y 00 − 6y 0 + 13y = 0, y(0) = 0 and
y 0 (0) = 10 is:
y(x) = 5e3x sin(2x) .
Second order linear nonhomogeneous differential equations
Consider the nonhomogeneous differential equations:
(3)
To find the general solution to (3):
y 00 + p(x)y 0 + q(x)y = f (x).
LECTURE 1: REVIEW OF ORDINARY DIFFERENTIAL EQUATIONS
9
1) Find a fundamental set of solution {u1 (x), u2 (x)} to the homogeneous equation y 00 + p(x)y 0 + q(x)y = 0, that
is, the general solution to y 00 + p(x)y 0 + q(x)y = 0 is given by:
y = C1 u1 (x) + C2 u2 (x).
2) Let yp (x) = C1 (x)u1 (x) + C2 (x)u2 (x) be a particular solution to (3) for some C1 (x) and C2 (x), then
yp0
= C1 (x)u01 (x) + C2 (x)u02 (x)
+C10 (x)u1 (x) + C20 (x)u2 (x).
3) Set C10 (x)u1 (x) + C20 (x)u2 (x) = 0, then
yp0
=
C1 (x)u01 (x) + C2 (x)u02 (x)
yp00
=
C10 (x)u01 (x) + C1 (x)u001 (x) + C20 (x)u02 (x) + C2 (x)u002 (x)
f (x)
=
a(x)yp00 + b(x)yp0 + c(x)yp
=
C10 (x)u01 (x) + C1 (x)u001 (x) + C20 (x)u02 (x) + C2 (x)u002 (x)
+p(x)[C1 (x)u01 (x) + C2 (x)u02 (x)] + q(x)[C1 (x)u1 (x) + C2 (x)u2 (x)]
=
C1 (x)[u001 (x) + p(x)u01 (x) + q(x)u1 (x)]
+C2 (x)[u002 (x) + p(x)u02 (x) + q(x)u2 (x)]
+C10 (x)u01 (x) + C20 (x)u02 (x)
=
(4)
C10 (x)u01 (x) + C20 (x)u02 (x).
So we get a system of C10 (x) and C20 (x):

 u1 (x)C 0 (x) + u2 (x)C 0 (x) = 0
1
2
 u0 (x)C 0 (x) + u0 (x)C 0 (x) = f (x).
1
1
2
2
4) Solve C10 (x) and C20 (x) from the system (4), then
C10 (x) = −
u2 (x)f (x)
,
W (u1 , u2 )
and C20 (x) =
u1 (x)f (x)
.
W (u1 , u2 )
Hence we have
Z
C1 (x) = −
u2 (x)f (x)
dx,
W (u1 , u2 )
Z
and C2 (x) =
u1 (x)f (x)
dx.
W (u1 , u2 )
10
MINGFENG ZHAO
5) The general solution to (3 is given by:
Z
y = C1 u1 (x) + C2 u2 (x) − u1 (x)
u2 (x)f (x)
+ u2 (x)
W (u1 , u2 )
Z
u1 (x)f (x)
dx.
W (u1 , u2 )
Remark 4. For two differentiable functions u1 (x) and u2 (x), the Wronskian of u1 (x) and u2 (x), W (u1 , u2 ), is defined
as:
= u1 (x)u02 (x) − u2 (x)u01 (x).
u1 (x) u2 (x)
W (u1 , u2 ) = u01 (x) u02 (x)
Example 6. Find the general solution to y 00 − y 0 − 2y = 3ex .
Let y = erx be a solution to y 00 − y 0 − 2y = 0, then
y0
= rerx
y 00
= r2 erx
0
= y 00 − y 0 + 2y
= r2 erx − rerx − 2erx
= erx (r2 − r − 2).
Then r2 − r − 2 = 0, that is,
r1 = −1,
and r2 = 2.
So the general solution to y 00 − y 0 − 2y = 0 is:
y = C1 e−x + C2 e2x .
Let yp (x) = C1 (x)e−x + C2 (x)e2x be a particular solution to y 00 − y 0 − 2y = 3ex , then
yp0
=
−C1 (x)e−x + 2C2 (x)e2x
+C10 (x)e−x + C20 (x)e2x .
Set C10 (x)e−x + C20 (x)e2x = 0, then
yp0
= −C1 (x)e−x + 2C2 (x)e2x
yp00
= −C10 (x)e−x + C1 (x)e−x + 4C2 (x)e2x + 2C20 (x)e2x
3ex
= yp00 − yp0 − 2yp
LECTURE 1: REVIEW OF ORDINARY DIFFERENTIAL EQUATIONS
11
= C1 (x)e−x − C10 (x)e−x + 4C2 (x)e2x + 2C20 (x)e2x
−[−C1 (x)e−x + 2C2 (x)e2x ] − 2[C1 (x)e−x + C2 (x)e2x ]
= −C10 (x)e−x + 2C20 (x)e2x .
Then we get

 C 0 (x)e−x + C 0 (x)e2x = 0
1
2
 −C 0 (x)e−x + 2C 0 (x)e2x = 3ex
1
2
Solve C10 (x) and C20 (x), then
C10 (x) = −e2x ,
and C20 (x) = e−x .
Then
C1 (x) = −
e2x
+ C1 ,
2
and C2 (x) = −e−x + C2 .
Then the general solution to y 00 − y 0 − 2y = 3ex is given by:
y
= C1 (x)e−x + C2 (x)e2x
2x
e
−x
= e
−
+ C1 + e2x −e−x + C2
2
3
= C1 e−x + C2 e2x − ex
2
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