2.5. Second order linear O.D.E.s: non

Transcription

2.5. Second order linear O.D.E.s: non
MATHEMATICS FOR ENGINEERS & SCIENTISTS
23
2.5. Second order linear O.D.E.s: non-homogeneous case. .
We’ll now consider non-homogeneous second order linear O.D.E.s. These are of the form
ay 00 + by 0 + cy = r(x)
for some function r(x) which is not zero. Notice now that the Principle of Superposition doesn’t work
since if y1 (x) and y2 (x) are solutions, then y = y1 + y2 satisfies
ay 00 + by 0 + cy = a(y100 + y200 ) + b(y10 + y20 ) + c(y1 + y2 ) = 2r(x).
However, something similar does help: let yc (x) be the general solution of the corresponding homogeneous equation
ay 00 + by 0 + cy = 0.
We call yc (x) the complementary function of the O.D.E., which we can find using the methods of the
previous sections.
Proposition 2.11. Suppose yp (x) is any solution of ay 00 + by 0 + cy = r(x). Then y(x) = yc (x) + yp (x)
is the general solution of ay 00 + b, y 0 + cy = r(x).
Proof. We have
ay 00 + by 0 + cy = a(yc00 + yp00 ) + b(yc0 + yp0 ) + c(yc + yp )
= (ayc00 + byc0 + cyc ) + (ayp00 + byp0 + c, yp )
= 0 + r(x)
Also, this solution y = yc + yp will have two arbitrary coefficients coming from the complementary
function yc (x).
Thus to solve the non-homogeneous O.D.E., we now just need to find a particular solution yp (x). When
r(x) is of a familiar form, one way to do this is the Method of Undetermined Coefficients. This
involves looking at r(x) and making an educated guess as to the shape of yp (x), knowing that the
derivatives of yp (x) have to somehow add up to give r(x). For instance, consider the following table.
r(x)
yp (x)
ωx
Ceωx
ke
k0 + k1 x + · · · + kn xn
C 0 + C 1 x + · · · + C n xn
k cos ωx
C cos ωx + D sin ωx
k sin ωx
C cos ωx + D sin ωx
Basic Rule: If r(x) is one of the functions in the first column of the table, choose the corresponding
function yp (x) in the second column and find the undetermined coefficients by substituting yp (x) and
its derivatives into the non-homogeneous O.D.E.
Sum Rule: If r(x) is a sum of functions in the first column of the table, then choose for yp (x) the
sum of the corresponding functions in the second column.
Modification Rule: If r(x) is a solution of the corresponding homogeneous equation ay 00 +by 0 +cy = 0
then multiply your choice of yp (x) by x (or by x2 if this solution corresponds to a double root of the
auxiliary equation).
We’ll now demonstrate with a series of examples.
Example 2.12. Solve the equation
y 00 + 3 y 0 + 2 y = 4x2 + 1.
We first find the complementary function yc (x), i.e. the general solution of the corresponding homogeneous O.D.E.
y 00 + 3 y 0 + 2 y = 0.
24
MATHEMATICS FOR ENGINEERS & SCIENTISTS
This has auxiliary equation λ2 + 3λ + 2 = 0, i.e. (λ + 2)(λ + 1) = 0, so the complementary function is
yc = Ae−2x + Be−x .
We now look for a particular solution; the table suggests trying
yp = c2 x2 + c1 x + c0
for some constants c0 , c1 and c2 to be determined. Now
yp0 = 2c2 x + c1
yp00 = 2c2
and
so
yp00 + 3yp0 + 2yp = 2c2 + 3 (c1 + 2c2 x) + 2 c0 + c1 x + c2 x2
= 2c2 x2 + (6c2 + 2c1 )x + (2c2 + 3c1 + 2c0 ) = 4x2 + 1.
This is an identity between polynomials so we can compare the coefficients:
coefficients of x2 :
coefficients of x:
constant coefficients:
2c2 = 4
so c2 = 2
so c1 = −6
6c2 + 2c1 = 0
2c2 + 3c1 + 2c0 = 1
so c0 = 15/2
Hence the general solution of the O.D.E is y = yc + yp , i.e.
y=
15
+ 2x2 − 6x +
2}
|
{z
function
Ae−2x + Be−x
{z
}
|
complementary
particular solution
Note that there are two arbitrary constants, as expected.
Example 2.13. Solve
1 √
1 0
, y (0) = − 2.
2
2
The corresponding homogeneous O.D.E. y 00 + 2y 0 + 3y = 0 has auxiliary equation
y 00 + 2y 0 + 3y = 6 cos 3x
given that y(0) =
λ2 + 2λ + 3 = 0
which has roots
−2 ±
√
4 − 12
2
√
= −1 ± i 2
so the complementary function is
√
√ yc = e−x A cos 2 x + B sin 2 x .
The method says that we should try for a particular solution of the form
yp = C cos 3x + D sin 3x.
Then
yp0 = −3C sin 3x + 3D cos 3x
and
yp00 = −9C cos 3x − 9D sin 3x.
Substituting into the O.D.E. gives
yp00 + 2yp0 + 3yp = −9C cos 3x − 9D sin 3x + 2(−3C sin 3x + 3D cos 3x) + 3(C cos 3x + D sin 3x)
= (6D − 3C) cos 3x + (−6D − 6C) sin 3x = 6 cos 3x.
We can now compare the coefficients of cos 3x and sin 3x to get
coeffs of cos 3x:
− 6C + 6D = 6
coeffs of sin 3x:
− 6C − 6D = 0
So D = 21 , C = − 12 and the general solution y = yc + yp is
√
√ 1
1
y = e−x A cos 2 x + B sin 2 x − cos 3x + sin 3x .
2
|
{z
}|
{z 2
}
complementary function
particular integral
MATHEMATICS FOR ENGINEERS & SCIENTISTS
25
In this example, we also have some initial conditions; we use these to find A and B. Now
1
1
y(0) = A − =
so A = 1.
2
2
Also,
√
√
√ √
√
√ y 0 = −e−x A cos 2 x + B sin 2 x + e−x −A 2 sin 2 x + B 2 cos 2 x
+
and
√
3
1 √
y 0 (0) = −A + B 2 + = − 2
2
2
3
3
sin 3x + cos 3x
2
2
so B = −1.
The required solution is thus
√
√ 1
1
y = e−x cos 2 x − sin 2 x − cos 3x + sin 3x.
2
2
Remark 2.14. When there are initial conditions as in this last example, it is important to get the steps
in the right order. To solve
ay 00 + by 0 + cy = r(x)
the general procedure is
(1) Find the complementary function yc (x) i.e. the general solution of corresponding homogeneous
linear O.D.E. (this involves constants A, B).
(2) Find a particular solution yp (x) (this has no arbitrary constants).
(3) Find the general solution by adding yc (x) to yp (x).
(4) Find A and B using the initial conditions (if required).
Do not do step (4) straight after step (1). The initial conditions apply to the inhomogeneous equation,
not the corresponding homogeneous one.
Example 2.15. Solve
3y 00 − 2y 0 − y = ex
given that y(0) = 0, y 0 (0) = 1.
The corresponding homogeneous equation 3y 00 − 2y 0 − y = 0 has auxiliary equation
3λ2 − 2λ − 1 = 0
which has roots λ =
− 31 ,
(3λ + 1)(λ − 1) = 0
i.e.
1. Hence the complementary function is
y(x) = Ae−x/3 + Bex .
Normally we should look for a particular solution the form yp (x) = cex but here ex is already a solution
of the homogeneous equation (it is yc (x) with A = 0, B = 1). Thus we use the modification rule and
try
yp (x) = cxex
instead. In that case,
yp0 = cex + cxex
and
yp00 = 2cex + cxex
so substituting into the O.D.E. gives
3yp00 − 2yp0 − yp = 3(2cex + cxex ) − 2 (cex + cxex ) − cxex
= 4cex = ex .
Hence c =
1
4
and the general solution is
y=
Ae−x/3 + Bex
|
{z
}
complementary function
+
1 x
xe
4
| {z }
particular integral
Now we use the initial conditions to find A and B. Firstly,
y(0) = A + B = 0.
.
26
MATHEMATICS FOR ENGINEERS & SCIENTISTS
Also,
A
1
1
y 0 = − e−x/3 + Bex + ex + xex
3
4
4
so
A
1
+ B + = 1.
3
4
9
9
, B = 16
and the required solution is
Solving these two equations gives A = − 16
y 0 (0) = −
y=−
9 −x/3
9
1
e
+ ex + xex .
16
16
4
Example 2.16. Solve
y 00 + 2y 0 + y = e−x .
The corresponding homogeneous equation y 00 + 2y 0 + y = 0 has auxiliary equation
λ2 + 2λ + 1 = 0
(λ + 1)2 = 0
i.e.
which has equal roots λ = −1, −1. The complementary function is thus
yc (x) = (A + Bx)e−x .
Normally we should look for a particular solution of the form yp (x) = ce−x but here e−x is a solution
of the homogeneous equation (it’s yc (x) with A = 1, B = 0), and so is xe−x (it’s yc (x) with A = 0,
B = 1). So the modification rule says we should look for a particular solution of the form
yp (x) = cx2 e−x .
Then
yp0 = 2cxe−x − cx2 e−x
yp00 = 2ce−x − 2cxe−x − 2cxe−x + cx2 e−x
and
= 2ce−x − 4cxe−x + cx2 e−x
Substituting into the O.D.E. gives
yp00 + 2yp0 + yp = (2ce−x − 4cxe−x + cx2 e−x ) + 2 2cxe−x − cx2 e−x + cx2 e−x
= 2ce−x = e−x
So c =
1
2
and the general solution is
y=
(A + Bx)e−x
{z
}
|
+
complementary function
1 2 −x
x e
2
| {z }
.
particular integral
Everything we have done applies similarly to linear constant coefficient O.D.E.s of higher order, as
we’ll now demonstrate.
Example 2.17. Solve
y (4) − y = x
subject to the initial conditions
y(0) = 3,
y 0 (0) = 1,
y 00 (0) = −1,
y 000 (0) = 4.
[Notice this 4th order equation has 4 initial conditions.]
The auxiliary equation of the corresponding homogeneous O.D.E. is λ4 − 1 = 0. This has roots ±1, ±i
so the complementary function is
yc (x) = Aex + Be−x + C cos x + D sin x.
Now look for a particular solution of the form
yp (x) = k0 + k1 x.
Substituting gives
yp0000 − yp = −k0 − k1 x = x
and so k0 = 0, k1 = −1. Thus the general solution is
y(x) = Aex + Be−x + C cos x + D sin x − x.
MATHEMATICS FOR ENGINEERS & SCIENTISTS
27
We also have
y 0 (x) = Aex − Be−x − C sin x + D cos x − 1
y 00 (x) = Aex + Be−x − C cos x − D sin x
y 000 (x) = Aex − Be−x + C sin x − D cos x
and so the applying the initial conditions leads to simultaneous equations
A+B+C
=3
A−B
+D =2
A+B−C
A−B
= −1
−D =4
In the next chapter we will see a methodical way of solving sets of equations like these. For now,
however, we’ll just use ad hoc reasoning:
• Adding the first and third equations and dividing by 2 gives A + B = 1.
• Adding the second and fourth equations and dividing by 2 gives A − B = 3.
• Hence A = 2, B = −1 and we also find C = 2, D = −1.
Thus the required solution is
y(x) = 2ex − e−x + 2 cos x − sin x − x.
Example 2.18. Solve
d2 y
d4 y
−
2
+ y = e3x .
dx4
dx2
The auxiliary equation of the corresponding homogeneous O.D.E. is
λ4 − 2λ2 + 1 = 0
2
λ2 − 1 = 0
2
2
(λ − 1) (λ + 1) = 0
The roots of this are 1, 1, −1, −1, both being repeated roots. So the complementary function is
yc (x) = (A + Bx)ex + (C + Dx)e−x .
Now look for a PI of the form yp (x) = ke3x . Then
yp0000 − 2yp00 + yp = 81ke3x − 18ke3x + ke3x
= 64ke3x = e3x
Thus k =
1
64
and the general solution is
y(x) = (A + Bx)ex + (C + Dx)e−x +
1 3x
e .
64