L/Unit 13: second order differential equations with

L/Unit 13: second order differential equations with constant coefficients.
Objectives
By the end of this learning unit students should be able to:
• determine whether two solutions of homogeneous second order differential equation
are linearly independent or not.
• solve homogeneous and non homogeneous second order differential equations by the
method of undetermined coefficients.
• determine the solution of linear second order differential equations by the method
of variation of parameters.
• solve second order Cauchy-Euler differential equations.
Second order Linear differential Equations
The second order differential equation can be written as:
y 00 (x) + a(x)y 0 (x) + b(x)y(x) = f (x)
(1)
. where a(x), b(x) and f (x) are functions of the independent variable x only. If f (x) = 0
then Eqn. (1) is homogeneous, otherwise is nonhomogeneous equation.
Example 0.1 Consider the following differential equations:
1. The equation y 00 + 2xy 0 + 3y = 0 is homogeneous.
2. The equation y 00 + 2xy 0 + 3y = ex is nonhomogeneous
In Eqn. (1), if the coefficients a(x) and b(x) are constants, say a(x) = a and b(x) = b,
then the equation is said to have constant coefficients otherwise it is said to have variable
coefficients.
1
Example 0.2
1. Have a look on the following differential equations:
(a) The equation y 00 + 3y 0 − 10y = 0 has constant coefficients.
(b) The equation y 00 + 3xy 0 − 10x2 y = 0 has variable coefficients
Linear independent solutions
Let y1 (x) and y2 (x) be linearly independent solutions to the differential equation
y 00 + a(x)y 0 + b(x)y = 0
(2)
and let y3 (x) be another solution. Then there exist unique constants c1 and c2 such that
y3 (x) = c1 y1 (x) + c2 y2 (x)
In other words any solution to the differential equation (2) can be written as the linear
combination of two linearly independent solutions. Then the general solution of Eqn. (2)
is given by the linear combination
y(x) = c1 y1 (x) + c2 y2 (x)
(3)
Wroskian Test for linear independence
Consider the initial value problem
y 00 + a(x)y 0 + b(x)y = 0
y(x0 ) = y0 ,
y 0 (x0 ) = y00
The initial conditions require that c1 and c2 satisfy the equation
c1 y1 (x0 ) + c2 y2 (x0 ) = y0
c1 y10 (x0 ) + c2 y20 (x0 ) = y00
(4)
Upon solving Eqn. (4) for c1 and c2 we find that
c1 =
y0 y20 (x0 ) − y00 y2 (x0 )
y1 (x0 )y20 (x0 ) − y10 (x0 )y2 (x0 )
(5)
c2 =
−y0 y10 (x0 ) + y00 y1 (x0 )
y1 (x0 )y20 (x0 ) − y10 (x0 )y2 (x0 )
2
or
c1 = y0 y2 (x0 )
y00 y20 (x0 )
y1 y2 (x0 )
y10 y20 (x0 )
c2 = ,
y1 (x0 ) y0
y10 (x0 ) y00
y1 y2 (x0 )
y10 y20 (x0 )
(6)
The denominator of Eqn. (6)
y1 y2 (x0 )
W (y1 , y2 )(x) = y10 y20 (x0 )
is called Wroskian of solution y1 and y2 , and it should be nonzero. Therefore two solutions
y1 and y2 of the second order linear equation are linearly independent on the interval I if
and only if W (y1 , y2 )(x) 6= 0.
Example 0.3 Test the linear independence of the solutions of the differential equation
y 00 + 4y = 0; y(π) = 3; y 0 (π) = −2
and hence find its particular or unique solution.
It can be verified that y1 (x) = cos2x and y2 (x) = sin2x are both solution of above
differential equation. Now it follows that:
cos2x
sin2x
W (y1 , y2 )(x) = −2sin2x 2cos2x
= 2 6= 0.
Therefore the two solutions are linearly independent. The general solution is therefore
y(x) = c1 cos2x + c2 sin2x.
c1 and c2 can be determined from initial conditions:
y(π) = c1 cos2π + c2 sin2π = c1 = 3.
3
Therefore
y(x) = 3cos2x + c2 sin2x,
y 0 (x) = −6sin2x + 2c2 cos2x,
y 0 (π) = 2c2 cos2π = −2
=⇒ c2 = −1.
Thus the unique solution of the IVP is
y(x) = 3cos2x − sin2x
Exercise 0.1 Use Wroskian Test to show that the solutions y1 and y2 are linearly independent and hence find the unique solution of the following initial value problems:
1. y 00 − k 2 y = 0, y1 = coshkx, y2 = sinkx, with k > 0, y(0) = 1, y 0 (0) = 0.
2. y 00 + 4y 0 − 12y = 0, y1 = e2x , y2 = e−6x , y(0) = 1, y 0 (0) = −1.
3. y 00 − y 0 − 6y = 0, y1 = e−2x , y2 = e3x , y(−1) = 3, y 0 (−1) = 6.
16
7
4. y 00 − y 0 + 2 y = 0 y1 = x4 , y2 = x4 lnx, for x > 0, y(1) = 2, y 0 (1) = 4.
x
x
Solutions to Second order homogeneous equations
The differential equation
ay 00 + by 0 + cy = 0
(7)
where a, b, c ∈ R can be solved by considering its corresponding characteristic equation
am2 + bm + c = 0
whose roots are
m=
−b ±
√
b2 − 4ac
2a
(8)
If b2 − 4ac > 0 in Eqn. (8), we have two distinct real roots, m1 and m2 . Then the
corresponding general solution of Eqn. (7) is given by
4
y(x) = C1 em1 x + C2 em2 x
(9)
Example 0.4 Find the general solution of the differential equation
d2 y
dy
− 5 + 6y = 0
2
dx
dx
The corresponding characteristic equation is m2 − 5m + 6 = 0 whose roots are m1 = 2
and m2 = 3. Then its general solution is
y(x) = C1 e2x + C2 e3x
If b2 −4ac = 0 in Eqn. (8), we have only one real root, m. Then the corresponding general
solution of Eqn. (7) is given by
y(x) = emx (C1 + C2 x)
(10)
Example 0.5 Solve the initial value problem
dy
d2 y
− 8 + 16y = 0, y(1) = 3, y 0 (1) = −2
2
dx
dx
The corresponding characteristic equation is m2 − 8m + 16 = 0 whose root is m = 4.
Then its general solution is
y(x) = e4x (C1 + C2 x)
Now we have
y(1) = e4 (C1 + C2 ) = 3
The first derivative, y 0 (x) is
y 0 (x) = 4e4x (C1 + C2 x) + C2 e4x , so that
5
y 0 (1) = 4e4 (C1 + C2 ) + C2 e4 = −2
We formulate the simultaneous equation
C1 + C2 = 3e−4
4C1 + 5C2 = −2e−4
(11)
Solving , the system (11) we obtain C1 = 17e−4 and C2 = −14e−4 . Then the unique
solution of the differential equation is therefore
y(x) = e4(x−1) (17 − 14x)
If b2 − 4ac < 0 in Eqn. (8), we have complex roots of the form, m = p ± qi, for
√
p, q ∈ R, i = −1. Then the corresponding general solution of Eqn. (7) is given by
y(x) = epx (Acosqx + Bsinqx)
(12)
Example 0.6 Solve the initial value problem
d2 y
dy
− 2 + 10y = 0, y(0) = 4, y 0 (0) = 1
2
dx
dx
The corresponding characteristic equation is m2 −2m+10 = 0 whose roots are m = 1±3i,
that means p = 1 and q = 3. Then its general solution is
y(x) = ex (Acos3x + Bsin3x)
Differentiating we have
y 0 (x) = ex [(A + 3B)cos3x + (B − 3A)sin3x]
From the given initial conditions it follows that:
y(0) = A = 4,
y 0 (0) = A + 3B = 1.
6
Hence A = 4, B = −1. Then the complete unique solution is
y(x) = ex (4cos3x − sin3x)
Linear Nonhomogeneous Second Order Differential Equations: Method of Undetermined Coefficients.
Consider the linear nonhomogeneous second order differential equation
d2 y
dy
+ cy = f (x)
a 2 +b
dx
dx
(13)
The general solution of Eqn. (13) is the sum of two functions. The first one is called Complementary function, (C.F) which is obtained by setting f (x) = 0. This is homogeneous
equation which can be solved easily by using the characteristic equation, am2 +bm+c = 0.
The second solution is called particular Integral, (P.I) that makes the LHS of (13) equal
to f (x) and not zero. If we denote complementary function by yc (x), and particular
integral by yp (x), then the general solution, y(x) of the differential equation (13) is given
by
y(x) = yc (x) + yp (x)
(14)
Comment 0.1 Note that the RHS of Eqn. (13), f (x) can take any form. Here is the
short table of functions to try for PI corresponding to the form of f (x) as follows:
f (x)
PI
k
y=k
kx
y = Cx + D
kx2
y = Cx2 + Dx + E
p(x)sinβx or p(x)cosβx
y = q(x)cosβx + r(x)sinβx
ksinhx or kcoshx
y = Ccoshx + Dsinhx
keαx
y = Ceαx
p(x)eαx sinβx or p(x)eαx cosβx
y = q(x)eαx sinβx + p(x)eαx cosβx
7
Example 0.7 Solve the differential equation:
d2 y
dy
− 5 + 6y = x2
2
dx
dx
To find CF we have to make LHS=0 and make use of characteristic equation, m2 −5m+6 =
0, ⇒ m = 2 or m = 3. Then the CF is
yc (x) = Ae2x + Be3x .
To find PI we have to make a look on the nature of the function in the RHS of the
differential equation. The RHS is the function of the second degree. Now let yp (x) =
dy
d2 y
Cx2 + Dx + E. Then
= 2Cx + D and
= 2C. Substituting these in the given
dx
dx2
equation we get;
2C − 5(2Cx + D) + 6(Cx2 + Dx + E) = x2
or
6Cx2 + (6D − 10C)x + (2C − 5D + 6E) = x2 .
Equating coefficients of powers of x we have:
x2 :
6D − 10C = 0,
x:
Constants :
6D =
2C − 5D + 6E = 0,
Particular integral is therefore , yp (x) =
⇒C=
6C = 1,
10
5
= ,
6
3
6E =
19
,
18
⇒D=
⇒E=
1
6
5
18
19
108
x2
5
19
+ x+
. Complete general solution is
6
18
108
y(x) = CF + P I. That is:
y(x) = Ae2x + Be3x +
5
19
x2
+ x+
6
18
108
Example 0.8 Find the general solution of
y 00 − 8y 0 + 16y = 8sin2x + 3e4x
8
(15)
We have to split this problem into two problems and apply the principle of superposition
when finding particular solution. The problems are
Problem 0.1 Using the first function to the RHS of differential equation:
y 00 − 8y 0 + 16y = 8sin2x
Problem 0.2 Using the second function to the RHS of differential equation:
y 00 − 8y 0 + 16y = 3e4x
The solution to problem 0.1 can be handled by letting the particular integral function
to be
ψp = Asin2x + Bcos2x
Computing first and second derivatives we have:
ψp0 = 2Acos2x − 2Bsin2x
ψp00 = −4Asin2x − 4Bcos2x
Substituting these into the differential equation to get
−4Asin2x − 4Bcos2x − 16Acos2x + 16Bsin2x + 16Asin2x + 16Bcos2x = 8sin2x
Simplification yields:
[12A + 16B − 8]sin2x + [−16A + 12B]cos2x = 0
But sin2x and cos2x are linearly independent, hence:
12A + 16B − 8 = 0
−16A + 12B = 0
9
Then A =
6
8
and B =
so the particular solution of the problem is
25
25
ψp (x) =
8
6
sin2x + cos2x.
25
25
The complementary solution is obtained by solving homogeneous part y 00 − 8y 0 + 16y = 0,
whose characteristic equation is m2 − 8m + 16 = 0. Then there is only one root, namely
m = 4. Then the CF is given by
yp (x) = (C1 + C2 x)e4x
The solution of problem 0.2 will be handled by considering that the natural choice for a
particular solution is ke4x . However, e4x is a solution of y 00 − 8y 0 + 16y = 0. Likewise xe4x
is also the solution of the homogeneous part. The only attempt for particular solution
will be of the format ξp = kx2 e4x . Computing first and second derivatives we have
ξp0 = 2kxe4x + 4kx2 e4x
ξp00 = 16kxe4x + 2ke4x + 16kx2 e4x
Substituting into differential equation of problem 0.2 we get
16kxe4x + 2ke4x + 16kx2 e4x − 16kxe4x − 32kx2 e4x + 16kx2 e4x = 3e4x
3
Equating terms with e4x we have 2ke4x = 3e4x . Hence k = . then the particular solution
2
of problem 0.2 is given by
3
ξp (x) = x2 e4x
2
By principle of superposition, a particular solution of Eq. (15) is
6
8
3
sin2x + cos2x + x2 e4x .
25
25
2
Therefore the general solution of Eq. (15) is given by
y = (C1 + C2 x)e4x +
6
8
3
sin2x + cos2x + x2 e4x .
25
25
2
10
Variation of Parameters
We have simple nonhomogeneous equations which can not be solved by the method of
undetermined coefficients. Consider the following problem
y 00 + y = tanx
The solution of homogeneous part, y 00 + y = 0, is Acosx + Bsinx. Since the RHS of
equation , f (x) = tanx, we do not have a simple function which can be assumed as
a particular integral, PI. Now we have to consider the method which can be used to
find particular integrals of all problems (including those with variable coefficients) in
which the complementary functions are known. Consider the equation
y 00 + p(x)y 0 + q(x)y = f (x)
(16)
Suppose we have two linearly independent solutions, y1 and y2 of y 00 + p(x)y 0 + q(x)y = 0.
Now by variation of parameter method we have to find the particular solution of Eq. (16)
of the format:
yp (x) = u(x)y1 (x) + v(x)y2 (x)
(17)
Our task at hand is to determine unknown functions u and v. We have to solve first u0
and v 0 and then obtain u and v by integration. Differentiating Eq. (17) we get
yp0 (x) = u(x)y10 (x) + v(x)y20 (x) + u0 (x)y1 (x) + v 0 (x)y2 (x)
(18)
In order to simplify yp0 (x) and yp00 (x) we require u and v to satisfy:
u0 (x)y1 (x) + v 0 (x)y2 (x) = 0
or simply written as
u0 y1 + v 0 y2 = 0
(19)
This is the first equation for u0 and v 0 . After simplification Eqn. (18) becomes
yp0 (x) = u(x)y10 (x) + v(x)y20 (x)
11
(20)
From Eq. (20) the second derivative gives
yp00 (x) = u0 (x)y10 (x) + v 0 (x)y20 (x) + u(x)y100 (x) + v(x)y200 (x)
(21)
Substituting Equations (17), (20) and (21) into Eqn. (16) we find that
u0 y10 + v 0 y20 + uy100 + vy200 + p [uy10 + vy20 ] + q [uy1 + vy2 ] = f
Rearranging it we have
u [y100 + py10 + qy1 ] + v [y200 + py20 + qy2 ] + u0 y10 + v 0 y20 = f.
Since y1 and y2 are solutions of associated homogeneous equation, y 00 + p(x)y 0 + q(x)y = 0,
then the terms in the square brackets are zero and hence we have
u0 y10 + v 0 y20 = f
(22)
which is the second equation for u0 and v 0 . Eqns. (19) and (22) gives us two equations
for u0 and v 0 . We can write them together as
u0 y1 + v 0 y2 = 0
(23)
u0 y10 + v 0 y20 = f
The system of Eqn. (23)has unique solution if and only if
y1 y2 =
6 0
0
0
y1 y2 which is exactly the Wroskian W of y1 and y2 . Since y1 and y2 are assumed to be linearly
independent on I, W (x) 6= 0 for all x ∈ I. By using crammer’s rule the solution of Eqn.
(23) for u0 and v 0 are
0
f
u0 = y1
0
y1
y2
y20
y2
y20
yf
=− 2
W
and
12
y1
y1
v0 = y1
0
y1
0
f
y2
y20
yf
= 1
W
(24)
Carrying out some necessary integrations we have the functions u and v such that
yp = uy1 + vy2
is a particular solution of y 00 + p(x)y 0 + q(x)y = f (x)
Example 0.9 Find the general solution of
y 00 + 4y = tan2x
(25)
π π
in the interval − ,
4 4
The associated homogeneous equation y 00 + 4y = 0 has y1 = cos2x and y2 = sin2x which
are fundamental set of solutions. The function, f on the RHS of differential equation is
f = tan2x. Wroskian of fundamental solution is
cos2x sin2x
−sin2x 2cos2x
= 2cos2 x + 2sin2 x = 2
Equation (24) gives us
u0 = −
1
y2 f
= − sin2xtan2x
W
2
and
v0 =
y1 f
1
= cos2xtan2x
W
2
Then
Z
1
1
sin2 2x
u =
− sin2xtan2xdx = −
dx
2
2
cos2x
Z
Z
1
1 − cos2 2x
1
1
= −
dx = −
sec2xdx + cos2xdx
2
cos2x
2
2
Z
1
1
= − ln|sec2x + tan2x| + sin2x
4
4
and
13
Z
v=
1
1
cos2xtan2xdx = −
2
2
Z
1
sin2xdx = − cos2x
4
A particular solution of DE has to be written in the format
yp (x) = u(x)y1 (x) + v(x)y2 (x)
1
1
1
= − ln|sec2x + tan2x| + sin2x cos2x − cos2xsin2x
4
4
4
1
= − ln|sec2x + tan2x|cos2x.
4
The complementary solution, i.e, the complete solution to the homogeneous part y 00 +4y =
0 is
yc (x) = Acos2x + Bsin2x
The general solution of the original differential equation is therefore
1
y(x) = Acos2x + Bsin2x − ln|sec2x + tan2x|cos2x.
4
Second order linear differential equations with variable coefficients
As we have mentioned earlier the general format of linear ODE with variable coefficients
can be written as
a0 (x)y (n) + a1 (x)y n−1 + a2 (x)y n−2 + ... + an−1 (x)y 0 + an (x)y = F (x)
Cauchy-Euler Equation
Cauchy-Euler Equation (or equidimensional equation) is of the general format:
a0 xn y (n) + a1 xn−1 y n−1 + a2 xn−2 y n−2 + ... + an−1 xy 0 + an y = F (x)
Thus the second-order Cauchy-Euler differential equation is
a0 x 2
d2 y
dy
+
a
x
+ a2 y = F (x)
1
dx2
dx
14
(26)
The transformation x = et , for x > 0, makes Eqn. (26) to be linear equation with
constant coefficients. From this transformation:
lnx = t
dt
1
⇒
=
dx
x
By chain rule we have,
dy dt
dy
=
.
dx
dt dx
⇒
dy
1 dy
=
dx
x dt
d2 y
dy d 1
1 d dy
⇒ 2 =
+
dx
x dx dt
dt dx x
1 d2 y dt
1 dy
=
.
− 2
2
x dt dx
x dt
1 d2 y dy
−
= 2
x dt2
dt
Thus,
x
dy
dy
=
dx
dt
Now the ODE becomes;
a0
d2 y dy
−
dt2
dt
+ a1
dy
+ a2 y = F (et )
dt
Example 0.10 Find the general solution of
x2
d2 y
dy
−
2x
+ 2y = x3
dx2
dx
The solution towards this problem will be handled as follows;
Let x = et
⇒ lnx = t
dt
1
⇒
=
dx
x
15
(27)
By chain rule we have,
dy
dy dt
=
.
dx
dt dx
⇒
dy
1 dy
=
dx
x dt
dy d 1
1 d dy
d2 y
+
⇒ 2 =
dx
x dx dt
dt dx x
1 d2 y dt
1 dy
=
− 2
.
2
x dt dx
x dt
1 d2 y dy
= 2
−
x dt2
dt
Substituting these information into Eqn. (27) we find that:
2
d y dy
dy
−
+ 2y = e3t
−
2
dt
dt
dt
(28)
To solve Eqn. (28) we have to consider the characteristic equation m2 − 3m + 2 = 0 whose
roots are m1 = 1 and m2 = 2. Then the complementary function is
yc (x) = Aet + Be2t
The trial of a particular integral will be
yp (x) = ke3t
⇒ y 0 = 3ke3t
⇒ y 00 = 9ke3t
Substituting these information to Eqn. (28) we have
2ke3t = e3t
⇒ 2k = 1
1
⇒k=
2
General solution of Eqn. (28) is therefore
1
y(t) = Aet + Be2t + e3t
2
16
Remember, x = et . Therefore the general solution of the given differential equation (27)
is
1
y(x) = Ax + Bx2 + x3
2
Note 0.1 The complementary solution here is Ax+Bx2 , so by variation of parameter
method, the particular integral will be
yp (x) = u(x)x + v(x)x2
or simply;
y = ux + vx2
Activity 2.5
1. Show that the solutions to the differential equation x2 y 00 −7xy 0 +16y = 0 are linearly
independent for x > 0. Hence obtain its general solution.
2. Show that ex , e2x and e3x are linearly independent solutions of
y 000 − 6y 00 + 11y 0 − 6y = 0.
3. Solve the following initial value problem;
d2 y
dy
+ 3 + 2y = e−2t + 2cost,
2
dt
dt
y(0) = 1 and
dy
(0) = 0
dt
by both undetermined coefficient and variation of parameter methods.
4. Find the general solution of the following differential equation
(a) y 00 + y = secx
(b) y 00 − 2y 0 + y = ex sin−1 x.
5. Find the general solution to the differential equation
(x2 + 1)y 00 − 2xy 0 + 2y = 6(x2 + 1)2 ,
if its complementary function is given by
yc (x) = c1 x + c2 (x2 − 1)
17
6. Find the general solution of
(sin2 x)y 00 − (2sinxcosx)y 0 + (cos2 x + 1)y = sin3 x,
given that y = sin x and y = x sin x are linearly independent solutions of the corresponding homogeneous equation.
Resources/ References
Ross, S.L., Introduction to Ordinary Differential Equations, 4th edition, John Wiley &
Sons Ltd, 1989. pp. 110-177
18