Non-Homogeneous Equations

advertisement
Non-Homogeneous Equations
We now turn to finding solutions of a non-homogeneous second order linear equation.
1. Non-Homogeneous Equations
2. The Method of Undetermined Coefficients
3. The Method of Variation of Parameters
1
Non-Homogeneous Equations
Consider the following non-homogeneous, second order linear differential equation:
y ′′ + p(t)y ′ + q(t)y = g(t)
Associated with each non-homogeneous equation there is a corresponding homogeneous equation:
y ′′ + p(t)y ′ + q(t)y = 0
Let us suppose that y1 (t) and y2 (t) are both solutions to the non-homogeneous equation. Then we note that y1 (t) − y2 (t) is a solution to the homogeneous equation:
(y1 − y2 )′′ + p(t)(y1 − y2 )′ + q(t)(y1 − y2 ) =
y1′′ − y2′′ + p(t)y1′ − p(t)y2′ + q(t)y1 − q(t)y2
= (y1′′ + p(t)y1′ + q(t)y1 ) − (y2′′ + p(t)y2′ + q(t)y2 )
= g(t) − g(t)
= 0
In other words, the difference between any two solutions to a non-homogeneous equation is a solution to the homogeneous equation.
This gives us a useful approach to solving non-homogeneous equations:
1. Solve the corresponding homogeneous equation. This solution is sometimes
referred to as the complementary solution, and denoted yc .
2. Find (any) particular solution to the non-homogeneous equation. We will denote
this particular solution yp (t).
1
Then any solution to the non-homogeneous equation is of the form
y(t) = yc (t) + yp (t).
Example:
Find the general solution to
y ′′ − 2y ′ − 3y = e2t ,
given that yp (t) = − 31 e2t is a particular solution to the equation.
First we find the complementary solution to the corresponding homogeneous equation:
y ′′ − 2y ′ − 3y = 0. The characteristic equation is r 2 − 2r − 3 = 0, which has roots
r = −1 and r = 3. So the complementary solution is
yc (t) = c1 e−t + c2 e3t .
Therefore the general solution is
1
y(t) = yc (t) + yp (t) = c1 e−t + c2 e3t − e2t .
3
The difficulty is in attempting to find one solution to the non-homogeneous equation.
We will be discussing two methods to do this. The technique we will discuss today is
called the method of undetermined coefficients.
2
The Method of Undetermined Coefficients
The method of undetermined coefficients requires us to guess the general form for a
specific solution, but with undetermined coefficients. We then try to solve for the
required coefficients by plugging our proposed solution into the differential equation.
1. Multiples and Sums
2. Duplicated Solutions
Example:
Let us attempt to solve y ′′ + 3y ′ + 2y = 5e2t . We first note that the homogeneous
equation
y ′′ + 3y ′ + 2y = 0
has characteristic equation r 2 + 3r + 2 = 0, which has roots r = −2 and r = −1, so
the complementary solution is
yc (t) = c1 e−t + c2 e−2t .
2
Now we attempt to guess a particular solution to the non-homogeneous equation.
Since the exponential function does not change much under differentiation, we will
guess a solution of the form
yp (t) = Ae2t
where A is our undetermined coefficient.
Now yp′ (t) = 2Ae2t and yp′′(t) = 4Ae2t , so when we plug yp into the non-homogeneous
equation, we get
yp′′ + 3yp′ + 2yp = 5e2t
2t
2t
2t
2t
4Ae + 6Ae + 2Ae = 5e
e2t (4A + 6A + 2A) = 5e2t
which becomes
or
This equation will be true if we have (4A + 6A + 2A) = 12A = 5, so A = 5/12. Thus,
5 2t
e , so the general solution is
we have found a particular solution yp (t) = 12
y(t) = yc (t) + yp (t) = c1 e−t + c2 e−2t +
5 2t
e .
12
The method of undetermined coefficients will only work with a small selection of
non-homogeneous terms. If we have
y ′′ + p(t)y ′ + q(t)y = g(t)
then we can use the method in the following cases, if we choose the given form for
yp (t):
If g(t) is
Try yp (t) =
c ekt (an exponential function)
Aekt (another exponential function)
cn tn +cn−1tn−1 +· · ·+c0 (a polynomial
of degree n)
An tn + An−1 tn−1 + · · · + A0 (another
polynomial of degree n)
either c cos(bt) or c sin(bt)
A cos(bt)+B sin(bt) (a linear combination of both sine and cosine)
A potential problem: If any term in our proposed solution yp (t) happens to be
a term in the complementary solution, then parts will vanish when plugged into the
left side of the differential equation. We will discuss this situation later.
Example:
If our non-homogeneous term is g(t) = t4 + t, our particular solution should be of the
form
yp (t) = At4 + Bt3 + Ct2 + Dt + E.
There are a lot of constants to solve for here. Note that in general an order n
polynomial will generate another order n polynomial as the particular solution. So
3
if our g(t) is quadratic, we will have three constants to solve for, and if g(t) is cubic,
there will be four.
Example:
Solve 3y ′′ + y ′ − 2y = 2 cos(t). The complementary solution is
2t
yc (t) = c1 e 3 + c2 e−t .
Our particular solution should be yp (t) = A cos(t) + B sin(t), so yp′ (t) = −A sin(t) +
B cos(t) and yp′′(t) = −A cos(t) − B sin(t).
Plugging these in to the equation gives us
3yp′′ + yp′ − 2yp =
3(−A cos(t) − B sin(t)) + (−A sin(t) + B cos(t)) − 2(A cos(t) + B sin(t))
= (−3A + B − 2A) cos(t) + (−3B − A − 2B) sin(t)
= (−5A + B) cos(t) + (−5B − A) sin(t) = 2 cos(t)
Thus we must have −5A + B = 2 and −5B − A = 0. Solving the second for A gives
A = −5B. Plugging back into −5A + B = 2 reveals that 26B = 2, or B = 1/13.
Then we have A = −5B = −5/13, so we have found a specific solution
yp (t) =
−5
1
cos(t) +
sin(t)
13
13
and the general solution is
2t
y(t) = yc (t) + yp (t) = c1 e 3 + c2 e−t +
3
1
−5
cos(t) +
sin(t).
13
13
Multiples and Sums
If we have a product of two of the types of functions listed above for our nonhomogeneous term (such as a polynomial times an exponential function, or an exponential times a sine), simply use the product of our proposed particular solutions:
4
If g(t) is
Use yp (t) =
(An tn + An−1 tn−1 + · · · + A0 )ekt
(cn tn + cn−1 tn−1 + · · · + c0 )ekt
(a polynomial times an exponential func- (another polynomial times an exponential
function)
tion)
eat (A cos(bt) + B sin(bt))
(a product of an exponential function times
a linear combination of sine and cosine)
(An tn + An−1 tn−1 + · · · + A0 ) cos(bt) +
(Bn tn + Bn−1 tn−1 + · · · + B0 ) sin(bt)
(a polynomial times sine and another times
cosine)
n
n−1
at
(cn t + cn−1 t
+ · · · + c0 )e sin(bt) or
(An tn + An−1 tn−1 + · · · + A0 )eat cos(bt) +
(cn tn + cn−1 tn−1 + · · · + c0 )eat cos(bt)
(Bn tn + Bn−1 tn−1 + · · · + B0 )eat sin(bt)
(All three together–whoopee!)
(what you would expect)
(See 3.8 on p. 163 of the text for a complete summary of which terms to use. Also
note that again, there will be a special case if part of your complementary solution
shows up in your proposed yp .)
Example:
c sin(bt)eat or c cos(bt)eat
(sines or cosines times exponential functions)
(cn tn + cn−1 tn−1 + · · · + c0 ) sin(bt) or
(cn tn + cn−1 tn−1 + · · · + c0 ) cos(bt)
(a polynomial times sine or cosine)
If the non-homogeneous term is g(t) = t3 e−5t , we should try for a particular solution
of the form
yp (t) = (At3 + Bt2 + Ct + D)e−5t .
What if we have a sum of non-homogeneous terms of the types already mentioned?
So assume g(t) = g1 (t) + g2 (t). Then if yp1 is a solution to y ′′ + py ′ + qy = g1 and yp2
is a solution to y ′′ + py ′ + qy = g2 , it is clear that
(yp1 + yp2 )′′ + p(t)(yp1 + yp2)′ + q(t)(yp1 + yp2 ) = g1 (t) + g2 (t) = g(t).
So we can either solve each problem separately, or we can string a sequence of forms
for yp (t) together into one long solution and attempt to solve for all the constants at
once.
Example:
If the non-homogeneous term is g(t) = te2t cos(3t) + et sin(2t), then our particular
solution is of the form
yp (t) = (At + B)e2t cos(3t) + (Ct + D)e2t sin(3t) + Eet sin(2t) + F et cos(2t).
Alternatively, we could first find out what constants A, B, C, and D would make
yp1 (t) = (At + B)e2t cos(3t) + (Ct + D)e2t sin(3t)
a solution to our differential equation, then solve for E and F separately to make
yp2(t) = Eet sin(2t) + F et cos(2t)
5
a solution. Then our specific solution would be yp (t) = yp1(t) + yp2 (t).
Example:
To solve y ′′ + by ′ + cy = 7t2 e2t + 3 + 18 sin(5t), we would use the general form
yp (t) = (At2 + Bt + C)e2t + D cos(5t) + E sin(5t) + F
4
Duplicated Solutions
The method of undetermined coefficients will fail to give us a solution if our proposed
particular solution contains elements of the complementary solution.
Example:
We will attempt to solve y ′′ + 3y ′ + 2y = 5e−2t using undetermined coefficients. Note
that the complementary solution is c1 e−t + c2 e−2t .
Our proposed non-homogeneous solution is of the form yp (t) = Ae−2t , but this will
fail, as it contains a homogeneous solution:
yp′′ + 3yp′ + 2yp = 4Ae−2t − 6Ae−2t + 2Ae−2t = 0
Since 5e−2t 6= 0, we cannot solve this.
Whenever the proposed specific solution to the non-homogeneous equation duplicates
the homogeneous solution (or tn times one of those solutions), we will have to alter
our technique. Specifically, if we were to guess a specific solution yp (t), alter this to
typ (t). (If yp (t) still duplicates part of the complementary solution, multiply by t2
instead.)
Example:
Solve y ′′ +3y ′ +2y = 5e−2t using undetermined coefficients. The homogeneous solution
is again c1 e−t + c2 e−2t .
Since Ae−2t is one of the homogeneous solutions, we adjust our guess for the specific
solution to
yp (t) = Ate−2t .
Then we have
yp′ (t) = Ae−2t − 2Ate−2t = Ae−2t (1 − 2t)
yp′′ (t) = −4Ae−2t + 4Ate−2t = 4Ae−2t (t − 1)
Plugging these in to the differential equation yields
yp′′ + 3yp′ + 2yp = 4Ae−2t (t − 1) + 3Ae−2t (1 − 2t) + 2Ate−2t
= Ae−2t (4t − 4 + 3 − 6t + 2t)
= −Ae−2t
6
Setting this equal to 5e−2t , we finally get A = −5, and we have the specific solution
yp (t) = −5te−2t
which gives us the general solution
y(t) = yc (t) + yp (t) = c1 e−t + c2 e−2t − 5te−2t .
Example:
Solve y ′′ + 4y ′ = t2 + te−4t .
First solve the homogeneous equation: y ′′ + 4y ′ = 0 gives us characteristic equation
r 2 + 4r = 0, so r = 0 or r = −4. Thus the complementary solution is
yc (t) = c1 + c2 e−4t .
We can look at each term of the non-homogeneous term separately. For the term
g1 (t) = t2 , we get a specific solution of the form yp1 (t) = A2 t2 + A1 t + A0 . Does this
duplicate our complementary solution?
Yes! It duplicates the constant term. So we adjust our first guess to
yp1 (t) = t(A2 t2 + A1 t + A0 ) = A2 t3 + A1 t2 + A0 t
and try plugging in and solving for A0 , A1 , and A2 :
′′
+ 4yp′ = t2
yp1
2
2
6A2 t + 2A1 + 4(3A2 t + 2A1 t + A0 ) = t
12A2 t2 + (8A1 + 6A2 )t + (4A0 + 2A1 ) = t2
which becomes
or
which means that we have the equations
12A2 = 1
8A1 + 6A2 = 0
4A0 + 2A1 = 0
The solution is A2 = 1/12, A1 = −1/16, and A0 = 1/32, so
yp1 (t) =
1 3
1
1
t − t2 + t
12
16
32
Then we can move on to the second part: g2 (t) = te−4t . Our proposed solution would
be (At+B)e−4t . But this duplicates the e−4t . So instead we try yp2 (t) = (At2 +Bt)e−4t .
Then after taking derivatives and simplifying we have
′
yp2
(t) = e−4t (B + (2A − 4B)t − 4At2 )
′′
yp2
(t) = 2e−4t (A − 4B + 8(B − A)t + 8At2 )
7
and plugging this into y ′′ + 4y ′ = te−4t gives us
(2A − 4B)e−4t − 8Ate−4t = te−4t
which means that −8A = 1, so A = −1/8, and 2A − 4B = 0, so B = −1/16. Thus
1
1
yp2 (t) = − t2 − t e−4t
8
16
Thus, we have a general solution
y(t) = yc (t) + yp1 (t) + yp2(t) = c1 + c2 e−4t +
5
1 3
1
1
1
1
t − t2 + t + − t2 − t e−4t
12
16
32
8
16
The method of Variation of Parameters
We revisit non-homogeneous equations and develop a technique to find a non-homogeneous
solution in terms of the homogeneous solution:
1. Cramer’s Rule
2. Variation of Parameters
3. Using Variation of Parameters
6
Cramer’s Rule
We start with a brief review of Cramer’s rule, which tells us how to solve a system
in terms of matrices. Cramer’s rule will be helpful in remembering how to carry out
variation of parameters.
In order to solve the system
ax + by = m
cx + dy = n
for x and y, we can do the following:
x=
m
n
a
c
b
d
b
d
,
y=
a
c
a
c
m
n
b
d
In other words, to solve for x, we take the coefficient matrix and replace the x column
with the result (the right hand side of the equations.) Then we take the determinant
and divide by the determinant of the coefficient matrix.
8
To solve for y, we do the same thing, except we replace the y column with the result
column.
Example:
Solve
2x + 3y = 7
4x − 8y = 3
Here we have
x=
and
7 3
3 −8
2 3
4 −8
y = 2 3
4 −8
7
2 7 4 3 =
=
−56 − 9
65
=
−16 − 12
28
6 − 28
22
11
=
=
−28
28
14
Variation of Parameters
Suppose we have found a set of fundamental solutions y1 and y2 for the homogeneous
equation
y ′′ + p(t)y ′ + q(t)y = 0,
so that the solutions look like y(t) = c1 y1 (t) + c2 y2 (t). How can we find a solution to
the non-homogeneous equation
y ′′ + p(t)y ′ + q(t)y = g(t)?
Last time, we discussed the method of undetermined coefficients which worked if
we actually had constant coefficients, and if g(t) was a combination of exponential
functions, polynomials, or sines and cosines. Now we attempt to find a more general
approach.
Let us consider what happens if we allow the parameters c1 and c2 in the complementary solution to vary; in other words, we replace the constants with functions u1
and u2 :
y(t) = u1(t)y1 (t) + u2 (t)y2 (t)
9
We no longer have a solution to the homogeneous equation, but we may be able to
find functions u1 and u2 for which this y will be a solution to the non-homogeneous
equation.
We calculate y ′ (t), and begin to run into trouble:
y ′ (t) = u1 (t)y1′ (t) + u′1 (t)y1 (t) + u′2 (t)y2 (t) + u2 (t)y2′ (t)
This is a mess and the second derivative will be much worse. Let us introduce the
following additional condition on u′1 and u′2 :
u′1 (t)y1 (t) + u′2 (t)y2 (t) = 0
(1)
We emphasize the following: We have chosen to add the above condition because it
simplifies the equation. It is not added because of any feature of the original equation.
Now we continue:
y ′(t) = u1 (t)y1′ (t) + u2 (t)y2′ (t)
y ′′(t) = u′1 (t)y1′ (t) + u1 (t)y1′′ (t) + u′2 (t)y2′ (t) + u2 (t)y2′′(t)
Plugging these into the non-homogeneous equation yields the following:
y ′′ + p(t)y ′ + q(t)y =
[u′1 (t)y1′ (t) + u1 (t)y1′′ (t) + u′2 (t)y2′ (t) + u2 (t)y2′′ (t)] +
p(t) [u1(t)y1′ (t) + u2 (t)y2′ (t)] +
q(t) [u1 (t)y1 (t) + u2 (t)y2 (t)]
If we collect like terms on u1 and u2 , we get the following:
y ′′ + p(t)y ′ + q(t)y =
u1 (t) [y1′′(t) + p(t)y1′ (t) + q(t)y1 (t)] +
u2 (t) [y2′′(t) + p(t)y2′ (t) + q(t)y2 (t)] +
u′1 (t)y1′ (t) + u′2 (t)y2′ (t)
But since y1 and y2 are solutions to the homogeneous equation, the coefficients on u1
and u2 are zero, and in fact we have that if y(t) = u1 (t)y1 (t) + u2 (t)y2 (t), then
y ′′ + p(t)y ′ + q(t)y = u′1 (t)y1′ (t) + u′2 (t)y2′ (t).
Thus we must have
u′1 (t)y1′ (t) + u′2 (t)y2′ (t) = g(t)
(2)
Now equation (??) and equation (??) above form a set of two equations in the two
unknowns u′1 (t) and u′2 (t), which we can then attempt to solve. Cramer’s rule says
that the system
u′1 (t)y1 (t) + u′2 (t)y2 (t) = 0
u′1 (t)y1′ (t) + u′2 (t)y2′ (t) = g(t)
10
can be solved for u′1 and u′2 as follows:
u′1 (t) =
and
u′2 (t) =
0
g(t)
y (t)
1
′
y1 (t)
y (t)
1
′
y (t)
1
y (t)
1
′
y1 (t)
y2 (t) y2′ (t) y2 (t)
y2′ (t)
y2 (t) y2′ (t) 0
g(t)
=
−y2 (t)g(t)
W (y1 , y2 )
=
y1 (t)g(t)
W (y1 , y2 )
This is ok, because the Wronskian is non-zero. (Why? Because y2 and y2 are a
fundamental set of solutions.)
So we finally have a specific solution, after performing some integrations:
Y (t) = −y1 (t)
Z
y2 (t)g(t)
dt + y2 (t)
W (y1, y2 )
Z
y1 (t)g(t)
dt.
W (y1, y2 )
How wonderful! Sort of. . .
8
Using Variation of Parameters
Let’s use variation of parameters to solve some non-homogeneous equations.
Example:
Solve
1
y ′′ − 3y ′ + 2y =
.
1 + e−t
Note that this could not have been done by the method of undetermined coefficients.
First, we solve the homogeneous equation to find the complementary solution:
y ′′ − 3y ′ + 2y = 0
So we get characteristic equation r 2 − 3r + 2 = (r − 2)(r − 1) = 0, so r = 2 or r = 1.
Thus the complementary solution is
yc (t) = c1 et + c2 e2t
That is, we have y1 (t) = et and y2 (t) = e2t .
Second, we set up our equations for variation of parameters. We have
u′1 y1 + u′2 y2 = 0 or u′1 et + u′2 e2t = 0
11
and
1
1
or u′1 et + u′2 2e2t =
−t
1+e
1 + e−t
Thus, solving for u′1 and u′2 using Cramer’s rule, we get
u′1 y1′ + u′2 y2′ =
u′1 =
and
u′2
= So now we integrate:
u1 (t) =
Z
e2t
2e2t
0
1
−t
1+e
t
et
et
e e2t
et 2e2t
0
1
1+e−t
2t
et e
et 2e2t
−e−t
dt,
1 + e−t
=
2t
e
− 1+e
−t
(e3t )
=−
e−t
1 + e−t
!
et
e−2t
−3t
e
=
1 + e−t
1 + e−t
=
so we let
u = 1 + e−t
du = −e−t dt
which gives us
1
du = ln(1 + e−t ) + C1
u
Now note: We do not need the C1 ! When we take u1 (t)y1 (t), we will get a Cy1 (t)
term, which is a homogeneous solution, and thus will give zero when we plug this into
the differential equation.
Therefore, we take u1 (t) = ln(1 + e−t ).
Similarly,
Z
e−2t
u = e−t
dt,
so
we
so
set
u2 (t) =
du = −e−t dt
1 + e−t
u1 (t) =
Z
Here we get
u2 (t) = −
Z
e−t (−e−t dt)
=−
1 + e−t
We can reduce this by division to
−
Z
u
du = −
1+u
Z
1−
Z
u
du
1+u
1
du = −u + ln |1 + u| + C = −e−t + ln(1 + e−t ) + C2
1+u
We discard the constant C2 for the same reason we discarded the C1 , and we get
u2 (t) = ln(1 + e−t ) − e−t .
So finally, we have the particular solution
h
i
Y (t) = u1 (t)y1 (t) + u2 (t)y2 (t) = ln(1 + e−t )et + ln(1 + e−t ) − e−t e2t .
12
So the general solution must be
i
h
y(t) = yc (t) + Y (t) = c1 et + c2 e2t + ln(1 + e−t )et + ln(1 + e−t ) − e−t e2t
Notice by the way that if we had chosen to leave constants C1 and C2 after integrating
u′1 and u′2 , we would in fact have the general solution when we computed
y(t) = (u1 (t) + C1 )y1 (t) + (u2 (t) + C2 )y2 (t).
We could also simplify our answer algebraically to be much shorter, since several
terms will cancel or can be grouped together:
i
h
y(t) = c1 et + c2 e2t + ln(1 + e−t )et + ln(1 + e−t ) − e−t e2t
= c1 et + c2 e2t + ln(1 + e−t )et + ln(1 + e−t )e2t − et
=
h
i
h
i
c1 + ln(1 + e−t ) et + c2 + ln(1 + e−t ) e2t
(In the last step, we also renamed c1 as c1 − 1.)
Example:
Solve y ′′ + y = sec(t) tan(t).
First, we solve the homogeneous equation: The characteristic equation is r 2 + 1 = 0,
so we get r =. Thus, our fundamental solutions are y1 (t) = cos(t) and y2 (t) = sin(t).
Second, we calculate our specific solution from variation of parameters. We need to
solve
u′1 y1 + u′2 y2 = 0 or u′1 cos(t) + u′2 sin(t) = 0
and
u′1 y1′ + u′2 y2′ = sec(t) tan(t) or
− u′1 sin(t) + u′2 cos(t) = sec(t) tan(t).
Thus, using Cramer’s rule we get
u′1 (t) =
and
u′2 (t) =
So we get
u1 (t) =
13
and
u2 (t) =
Finally, we have a particular solution
Y (t) =
and the general solution
y(t) =
14
Download