MA1506 LECTURE NOTES
CHAPTER 1
DIFFERENTIAL EQUATIONS
1.1 Introduction
A dierential equation is an equation that
contains one or more derivatives of a dieren-
tiable function. [In this chapter we deal only
with ordinary DEs, NOT partial DEs.]
The order of a d.e. is the order of the equa-
tions highest order derivative; and a d.e. is
linear if it can be put in the form
a
n
y
(n)
(x)+a
n1
y
(n1)
(x)+ +a
1
y
(1)
(x)+a
0
y(x) = F,
1
where a
i
, 0 i n, and F are all functions of
x.
For example, y
= 5y and xy
sin x = 0 are
rst order linear d.e.; (y
)
2
+(y
)
5
y
= e
x
is
third order, nonlinear.
We observe that in general, a d.e. has many
solutions, e.g. y = sin x + c, c an arbitrary
constant, is a solution of y
= cos x.
Such solutions containing arbitrary constants
are called general solution of a given d.e.. Any
solution obtained from the general solution by
giving specic values to the arbitrary constants
is called a particular solution of that d.e. e.g.
2
y = sin x + 1 is a particular solution of y
=
cos x.
Basically, dierential equations are solved us-
ing integration, and it is clear that there will
be as many integrations as the order of the DE.
Therefore, THE GENERAL SOLUTION OF
AN nth-ORDER DE WILL HAVE n ARBI-
TRARY CONSTANTS.
1.2 Separable equations
A rst order d.e. is separable if it can be writ-
ten in the form M(x) N(y)y
= 0 or equiva-
lently, M(x)dx = N(y)dy. When we write the
3
d.e. in this form, we say that we have separated
the variables, because everything involving x is
on one side, and everything involving y is on the
other.
We can solve such a d.e. by integrating w.r.t.
x:
_
M(x)dx =
_
N(y)dy + c.
Example 1. Solve y
= (1 + y
2
)e
x
.
Solution. We separate the variables to obtain
e
x
dx =
1
1 + y
2
dy.
4
Integrating w.r.t. x gives
e
x
= tan
1
y + c,
or
tan
1
y = e
x
c,
or
y = tan(e
x
c).
Example 2. Experiments show that a ra-
dioactive substance decomposes at a rate pro-
portional to the amount present. Starting with
2 mg at certain time, say t = 0, what can be
said about the amount available at a later time?
Example 3. A copper ball is heated to
5
100
C. At t = 0 it is placed in water which
is maintained at 30
C. At the end of 3 mins the
temperature of the ball is reduced to 70
C. Find
the time at which the temperature of the ball is
31
C.
Physical information: Experiments show that
the rate of change dT/dt of the temperature T
of the ball w.r.t. time is proportional to the dif-
ference between T and the temp T
0
of the sur-
rounding medium. Also, heat ows so rapidly
in copper that at any time the temperature is
practically the same at all points of the ball.
6
Example 4. Suppose that a sky diver falls
from rest toward the earth and the parachute
opens at an instant t = 0, when sky divers
speed is v(0) = v
0
= 10 m/s. Find the speed of
the sky diver at any later time t.
Physical assumptions and laws:
weight of the man + equipment = 712N,
air resistance = bv
2
, where b = 30 kg/m.
Using Newtons second law we obtain
m
dv
dt
= mg bv
2
.
Thus
dv
dt
=
b
m
(v
2
k
2
), k
2
=
mg
b
1
v
2
k
2
dv =
b
m
dt
7
1
2k
_
_
_
1
v k
1
v + k
_
_
_
dv =
b
m
dt.
Integrating gives
n
v k
v + k
=
2kb
m
t + c
1
,
or
v k
v + k
= ce
pt
, p =
2kb
m
.
(c = e
c
1
according as the ratio on the left is
positive or negative).
Solving for v : v = k
1 + ce
pt
1 ce
pt
. (Note that
v k as t ). From v(0) = v
0
, c =
v
0
k
v
0
+ k
. Now k
2
=
mg
b
=
712
30
, so k = 4.87 m/s,
v
0
= 10 m/s, c = 0.345, p = 4.02.
v(t) = 4.87
1 + 0.345e
4.02t
1 0.345e
4.02t
.
8
Example 5. A conference room with volume
2000m
3
contains air with 0.002% CO. At time
t = 0 the ventilation system starts blowing in
air which contains 3% CO (by volume). If the
ventilation system blows in (and extracts) air
at a rate of 0.2m
3
/min, how long will it take for
the air in the room to contain 0.015% CO?
Solution. Let x m
3
of CO be in the room at
time t. Then
dx
dt
= in ow out ow
= (0.03)(0.2)
x
2000
(0.2)
= 0.006 0.0001x (1)
9
The initial condition is x(0) = 0.00002
2000 = 0.04.
Separating the variables and integrating (1):
n|60 x| = 0.0001t + c,
or
x = 60 ke
0.0001t
x(0) = 0.04 gives k = 59.96
x(t) = 60 59.96e
0.0001t
.
When the room contains 0.015% CO at t =
t
1
, we have
x(t
1
) = 60 59.96e
0.0001t
1
(2)
10
= 0.00015 2000 = 0.3, (3)
thus
e
0.0001t
1
=
59.7
59.96
, t
1
=10
4
n
59.7
59.96
43.5 mins.
Reduction to separable form
Certain rst order d.e. are not separable but
can be made separable by a simple change of
variable. This holds for equations of the form
y
= g(
y
x
) (1)
where g is any function of
y
x
. We set
y
x
= v,
then y = vx and y
= v+xv
. Thus (1) becomes
v + xv
= g(v), which is separable. Namely,
dv
g(v) v
=
dx
x
. We can now solve for v, hence
11
obtain y.
Example 6.
Solve 2xyy
y
2
+ x
2
= 0. [x
2
+ y
2
= cx]
Linear Change of Variable
A d.e. of the form y
= f(ax + by + c),
where f is continuous and b = 0 (if b = 0, the
equation is separable) can be solved by setting
u = ax + by + c.
Example 7. (2x4y+5)y
+x2y+3 = 0.
Set x 2y = u, we have
(2u + 5)
1
2
(1 u
) + u + 3 = 0,
(2u + 5)u
= 4u + 11.
12
Separating variables and integrating :
_
_
_
1
1
4u + 11
_
_
_
du = 2dx.
Thus u
1
4
n|4u + 11| = 2x + c
1
,
or 4x + 8y + n|4x 8y + 11| = c.
13
1.3 Linear First Order ODEs
A d.e. which can be written in the form
dy
dx
+ P(x)y = Q(x) (1)
where P and Q are functions of x, is called a
linear rst order d.e. Relation (1) above is the
standard form of such a d.e.
To solve (1), dene a new function R(x) by
R(x) = e
_
x
P(s)ds
and note that R
= RP by
the chain rule. So (Ry)
= RPy + Ry
. Hence
if we multiply both sides of (1) by R we get
Ry
+ RPy = RQ
14
or
(Ry)
= RQ.
Now you can integrate both sides and then di-
vide by R to obtain y. The function R is called
the INTEGRATING FACTOR for this equa-
tion.
Example 8. Solve
(i) xy
3y = x
2
, x > 0.
(ii) y
y = e
2x
.
Example 9. Consider an object of mass m
15
dropped from rest in a medium that oers a
resistance proportional to the magnitude of the
instantaneous velocity of the object. The goal
is to nd the position x(t) and velocity v(t) at
any time t.
16
Solution. Newtons second law of motion gives
m
dv
dt
= mg kv. The initial conditions are
v(0) = 0 and x(0) = 0. The equation is sep-
arable. Solving it directly or by multiplying it
by an integrating factor e
k
m
t
, we obtain v =
mg
k
(1 e
kt
m
), where v(0) = 0 has been used.
Set v =
dx
dt
in the above and integrate, and
using x(0) = 0, we get x(t) =
mg
k
t
m
2
g
k
2
(1
e
kt
m
).
Example 10. At time t = 0 a tank contains
20 lbs of salt dissolved in 100 gal of water. As-
sume that water containing 0.25 lb of salt per
gallon is entering the tank at a rate of 3 gal/min
17
and the well stirred solution is leaving the tank
at the same rate. Find the amount of salt at
any time t.
Solution. Let the amount of salt at time t be
Q(t). The time rate of change
dQ
dt
equals the
inow minus the outow.
We obtain
dQ
dt
= 30.25
3Q
100
, with Q(0) =
20. Solving, Q(t) = 25 5e
3t
100
. Note that
lim
t
Q(t) = 25. Thus after suciently long
time, the salt concentration remains constant
at 25 lbs/100 gal.
Example 11. In Example 2 in Section 1.2,
we saw that radioactive substances typically de-
18
cay at a rate proportional to the amount present.
Sometimes the product of a radioactive decay
is itself a radioactive substance which in turn
decays (at a dierent rate). An interesting ex-
ample of this is provided by Uranium-Thorium
dating, which is a method used by palaeontolo-
gists to determine how old certain fossils [espe-
cially ancient corals] are. Corals lter the sea-
water in which they live. Sea-water contains a
tiny amount of a certain kind of Uranium [Ura-
nium 234] and the corals absorb this into their
bodies. Uranium 234 decays, with a half-life of
245000 years, into Thorium 230, which itself de-
cays with a half-life of 75000 years. Thorium is
19
not found in sea-water; so when the coral dies,
it has a certain amount of Uranium in it but no
Thorium [because the lifetime of a coral polyp
is negligible compared with 245000 years]. It
is possible to measure the ratio of the amounts
of Uranium and Thorium in any given sample.
From this ratio we want to work out the age
of the sample [the time when it died]. This is
important if we want to know whether global
warming is causing corals to die now. [Maybe
they die o regularly over long periods of time
and the current deaths have nothing to do with
global warming.]
Let U(t) be the number of atoms of Uranium
20
in a particular sample of ancient coral and let
T(t) be the number of atoms of Thorium. Be-
cause each decay of one Uranium atom produces
one Thorium atom, Thorium atoms are being
born at exactly the same rate at which Uranium
atoms die: so we have
dU
dt
= k
U
U, (4)
dT
dt
= +k
U
U k
T
T, (5)
where k
U
, k
T
are constants [related to the half-
lives] with k
U
= k
T
, and U(0) = U
0
, T(0) = 0.
We want to nd t given that we know the ratio
of T(t) to U(t) at the present time.
Solving (4) with the given data gives U =
21
U
0
e
k
U
t
. From this we see that U
0
/2 = U
0
e
k
U
245000
so k
U
= ln(2)/245000 and similarly k
T
= ln(2)/75000.
So we know these numbers. Notice that k
U
is
smaller than k
T
.
Now (5) becomes
dT
dt
+ k
T
T = k
U
U
0
e
k
U
t
.
An integrating factor is e
k
T
t
. Solving, with
T(0) = 0, gives
T(t) =
k
U
k
T
k
U
U
0
(e
k
U
t
e
k
T
t
).
Unfortunately we dont know U
0
but luckily
that goes away when we take the ratio:
T/U =
k
U
k
T
k
U
[1 e
(k
U
k
T
)t
].
[Check that the expression on the right side is
22
positive after t = 0; note also that while both
U and T tend to zero, their ratio does not.] So
now if we measure the ratio T/U at the present
time, we can solve this for t and we have our
answer. This method is good for coral fossils
up to about half a million years old.
Reduction to linear form
Certain nonlinear d.e.s can be reduced to a
linear form. The most important class of such
equations are the Bernoulli equations of the form
y
+p(x)y = q(x)y
n
where n is any real number.
If n = 0 or 1, the equation is linear, otherwise
it is nonlinear. To solve, we rewrite this as
23
y
n
y
+ y
1n
p(x) = q(x), and set y
1n
= z.
Then (1 n)y
n
y
= z
, and the given d.e.
becomes z
+(1n)p(x)z = (1n)q(x), which
is a rst order linear d.e.
Examples. To solve
(i) y
Ay = By
2
, A, B constants.
Solution. (i) Observe that n = 2. Set
z = y
12
= y
1
. Then y
2
y
= z
. (i)
becomes z
+ Az = B, which is separable.
Solving, z =
B
A
+ ce
Ax
.
y =
1
z
=
1
B
A
+ ce
Ax
.
(ii) y
+y = x
2
y
2
. [y(Ae
x
+x
2
+ 2x + 2) = 1]
24
1.4 Second order linear dierential
equations
The general form of a second order linear d.e.
is
y
+ p(x)y
+ q(x)y = F(x). (1)
If F(x) 0, the linear d.e. is called homoge-
neous otherwise it is called nonhomogeneous.
The d.e.
y
+ 4y = e
x
sin x
is a nonhomogeneous linear second order d.e.;
(1 x
2
)y
2xy
+ 6y = 0 or in the above
standard form y
2x
1 x
2
y
+
6
1 x
2
y = 0 is
homogeneous; whereas x(y
y+(y
)
2
)+2y
y = 0
25
and y
=
_
1 + (y
)
2
are nonlinear. Note that
(1) is linear in the sense that it is linear in y
and its derivatives.
A solution of a second order d.e. on some in-
terval I is a function y = h(x) with derivatives
y
= h
(x) and y
= h
(x) satisfying the d.e.
for all x in I.
Homogeneous d.e.s
The general solutions of homogeneous equa-
tions can be found with the help of the Su-
perposition or linearity principle, which is
contained in the following theorem.
26
Theorem. For a homogeneous linear d.e.
y
+ p(x)y
+ q(x)y = 0, (2)
any linear combination of two solutions on an
open interval I is also a solution on I. In par-
ticular for such an equation, sums and constant
multiples of solutions are again solutions.
Proof. Let y
1
and y
2
be solution of (2) on I.
Then y
1
+py
1
+qy
1
= 0 and y
2
+py
2
+qy
2
= 0.
Substituting y = c
1
y
1
+ c
2
y
2
in the left of (2),
we get
(c
1
y
1
+ c
2
y
2
)
+ p(c
1
y
1
+ c
2
y
2
)
+ q(c
1
y
1
+ c
2
y
2
)
= c
1
y
1
+ c
2
y
2
+ pc
1
y
1
+ pc
2
y
2
+ qc
1
y
1
+ qc
2
y
2
= c
1
(y
1
+ py
1
+ qy
1
) + c
2
(y
2
+ py
2
+ qy
2
)
27
= c
1
0 + c
2
0 = 0.
Thus c
1
y
1
+ c
2
y
2
is also a solution of (2).
Caution
The above result does not hold for nonhomo-
geneous or nonlinear d.e.s. For example, y =
1 + cos x and y = 1 + sin x are solutions of the
nonhomogeneous linear d.e. y
+ y = 1, but
2(1 + cos x) and 2 + cos x + sin x are not its
solutions. Similarly, y = 1 and y = x
2
are solu-
tions of the nonlinear d.e. yy
xy
= 0. But
x
2
and x
2
+ 1 are not its solutions.
Example 12. Solve the initial value problem
y
y = 0, y(0) = 5, y
(0) = 3.
28
Solution. It is easy to see that e
x
and e
x
are solutions of y
y = 0. Thus y = c
1
e
x
+
c
2
e
x
is also a solution. From y(0) = 5 we get
c
1
+ c
2
= 5, and y
(0) = 3 gives c
1
c
2
= 3.
Solving, c
1
= 4, c
2
= 1. The required solution
is y = 4e
x
+ e
x
.
General solution of homogeneous lin-
ear second order d.e.
Let y
1
(x) and y
2
(x) be dened on some inter-
val I. Then y
1
and y
2
are said to be linearly
dependent on I if one of them is a CONSTANT
MULTIPLE OF THE OTHER ONE. Other-
wise they are LINEARLY INDEPENDENT.
29
A general solution of y
+ py
+ qy = 0 on
an open interval I is y = c
1
y
1
+ c
2
y
2
, where y
1
and y
2
are linearly independent solutions of the
d.e. and c
1
, c
2
are arbitrary constants.
A particular solution of the d.e. on I is ob-
tained if specic values are assigned to c
1
and
c
2
.
For example, y
1
= cos x and y
2
= sin x are
linearly independent solutions of y
+y = 0. A
general solution is y = c
1
cos x + c
2
sin x.
A particular solution is, for example, y =
2 cos x + sin x, (which satises y(0) = 2 and
y
(0) = 1).
30
Homogeneous d.e. with constant coef-
cients
Consider
y
+ ay
+ by = 0, a, b constants. (1)
Recall that a rst order linear d.e. y
+ky = 0,
k constant, has y = e
kx
as a solution. We now
try the function y = e
x
as a solution of (1).
Substituting y = e
x
in (1) we obtain (
2
+
a + b)e
x
= 0, which implies that e
x
is a
solution if is a solution of
2
+ a + b = 0. (2)
This equation is called the characteristic equa-
tion (or auxiliary equation) of (1).
31
The roots of (2) are
1
=
1
2
(a +
a
2
4b ),
2
=
1
2
(a
a
2
4b ).
We obtain e
1
x
and e
2
x
as solutions of (1).
Depending on the sign of a
2
4b, equation (2)
will have
Case 1: two real roots if a
2
4b > 0,
Case 2: a real double root (i.e.
1
=
2
) if
a
2
4b=0,
Case 3: complex conjugate roots if a
2
4b<
0.
Case 1. (2) has two distinct real roots
1
and
32
2
.
In this case e
1
x
and e
2
x
are linearly indepen-
dent solutions of (1) on any interval. The corre-
sponding general solution of (1) is y = c
1
e
1
x
+
c
2
e
2
x
.
Example 13. Solve y
+ y
2y = 0, with
y(0) = 4, y
(0) = 5.
Solution. The characteristic equation is
2
+
2 =0 (a
2
4b = 9 > 0). The roots are
1
= 1
and
2
= 2. The general solution is y =
c
1
e
x
+ c
2
e
2x
. Initial conditions y(0) = 4 and
y
(0) = 5 give c
1
+c
2
= 4 and c
1
2c
2
= 5.
Solving: c
1
= 1, c
2
= 3. Thus y = e
x
+ 3e
2x
33
is the solution.
Case 2. (2) has a real double root
1
(=
2
).
This occurs when a
2
4b = 0, and
1
=
2
=
a
2
, from which we get one solution y
1
= e
a
2
x
.
To nd a second solution y
2
, we try y
2
= xe
ax
2
.
This does work: y
2
= e
ax
2
a
2
xe
ax
2
, and
y
2
=
a
2
e
ax
2
a
2
e
ax
2
+
a
2
4
xe
ax
2
=
_
a +
a
2
4
x
_
e
ax
2
So
y
2
+ ay
2
+ by
2
=
_
a +
a
2
4
x + a
a
2
2
x + bx
_
e
ax
2
=
_
b
a
2
4
_
xe
ax
2
= 0
because b =
a
2
4
.
34
Thus in this case when a
2
4b = 0, a linearly
independent pair of solutions of y
+ay
+by = 0
on any interval is e
ax
2
, xe
ax
2
. The correspond-
ing general solution is y = (c
1
+ c
2
x)e
ax
2
.
Example 14.
(i) Solve y
+ 8y
+ 16y = 0.
(ii) Solve the initial problem y
4y
+4y = 0,
y(0) = 3, y
(0) = 1.
Case 3. (2) has two complex roots
1
,
2
.
35
This happens when a
2
4b < 0. We set w =
b
a
2
4
. Then you can easily show that
1
,
2
=
a
2
iw, where i
2
= 1. We try
y
1
= e
ax
2
coswx
y
2
= e
ax
2
sinwx
We leave it to you to show by substitution that
these are solutions of y
+ ay
+ by = 0. The
point to remember is that
a
2
, the REAL part of
1
and
2
, goes into the exponential part
_
e
ax
2
_
while the IMAGINARY part w goes into the cos
and sin part, cos(wx) and sin(wx). For example
if
1
,
2
= 1 2i, then y
1
= e
x
cos(2x) and
y
2
= e
x
sin(2x).
36
To conclude: set
y
1
= e
a
2
x
cos wx,
y
2
= e
a
2
x
sin wx.
Then y
1
and y
2
are linearly independent. The
corresponding general solution is
y = c
1
y
1
+ c
2
y
2
= e
a
2
x
(c
1
cos wx + c
2
sin wx).
Example 15.
(i) Solve y
+ 2y
+ 5y = 0.
(ii) Solve y
+2y
+5y = 0, y(0) = 1, y
(0) = 5.
37
Nonhomogeneous equations
We consider
y
+ p(x)y
+ q(x)y = r(x), r(x) 0. (1)
The corresponding homogeneous equation is
y
+ p(x)y
+ q(x)y = 0. (2)
Let y
1
and y
2
be any two solutions of (1). Then
y
1
+ p(x)y
1
+ q(x)y
1
= r(x), (3)
and
y
2
+ p(x)y
2
+ q(x)y
2
= r(x). (4)
Subtracting (4) from (3):
y
1
y
2
+p(x)(y
1
y
2
)+q(x)(y
1
y
2
) = r(x)r(x) = 0.
Thus (y
1
y
2
)
+p(x)(y
1
y
2
)
+q(x)(y
1
y
2
) =
0, i.e. y
1
y
2
is a solution of (2).
38
On the other hand, if y
0
is a solution of (2)
and y
1
a solution of (1), then clearly y
1
+ y
0
is again a solution of (1). This suggests the
following denition:
Denition. A general solution of the non-
homogeneous d.e. (1) is of the form
y(x) = y
h
(x) + y
p
(x), (5)
where y
h
(x) = c
1
y
1
(x) + c
2
y
2
(x) is a general
solution of the homogeneous d.e. (2) and y
p
(x)
is any solution of (1) containing no arbitrary
constants.
Thus to solve (1), we have to solve the ho-
mogeneous equation (2) and nd a (particular)
39
solution of (1). The sum of these two is what
we want.
Determination of y
p
(x)
(I) Method of undetermined coecients
This method applies to equations of the form
y
+ ay
+ by = r(x), where a and b are con-
stants, and r(x) is a polynomial, exponential
function, sine or cosine, or sums or products of
such functions.
We denote y
+ ay
+ by by L(y)(x), where
a and b may be complex numbers. Well make
use of the Principle of super-position:
If y
1
(x) is a solution of L(y)(x) = g
1
(x) and
40
y
2
(x) is a solution of L(y)(x) = g
2
(x), then for
any constants c
1
and c
2
, y = c
1
y
1
(x)+c
2
y
2
(x) is
a solution of L(y)(x) = c
1
g
1
(x)+c
2
g
2
(x). Using
this principle, the problem is reduced to nd-
ing a particular solution of L(y)(x) = p(x)e
kx
,
where p(x) is a polynomial in x and k is a real
or complex constant. Method of undetermined
coecients is adequately described by consider-
ing the following three cases, which we illustrate
with examples.
1. Polynomial case
In this case k = 0. The method begins with
try a polynomial with unknown coecients.
41
Example 16.
y
4y
+ y = x
2
+ x + 2.
Try y = Ax
2
+ Bx + C where A, B, C are
constant. Then we have, after substitution,
2A4(2Ax+B) +Ax
2
+Bx+C = x
2
+x+2
or
Ax
2
+(B8A)x+2A4B+C = x
2
+x+2.
Comparing coecients, we have
A = 1
B 8A = 1 B = 9
2A 4B + C = 2 C = 36
So Ax
2
+Bx+C = x
2
+9x+36 is a particular
solution.
42
Example 17. y
2y = 2x
3
. Try Ax
3
+
Bx
2
+ Cx + D, and we get
6Ax + 2B 2Ax
3
2Bx
2
2Cx 2D
= 2x
3
+ 0x
2
+ 0x + 0.
This means
2A = 2 A = 1
2B = 0 B = 0
6A 2C = 0 C = 3
2B 2D = 0 D = 0
So y = x
3
3x is a particular solution.
2. Exponential case
Here k is real but not zero. The method be-
43
gins with put y = ue
kx
, where u = u(x).
This substitution will remove e
kx
from the equa-
tion and reduce the problem to the polynomial
case 1 (above).
Example 18.
y
4y
+ 2y = 2x
3
e
2x
. (1)
Substituting y = ue
2x
, we get
y
= u
e
2x
+ 2ue
2x
y
= u
e
2x
+ 4u
e
2x
+ 4ue
2x
.
Thus (1) becomes:
u
e
2x
2ue
2x
= 2x
3
e
2x
,
or
44
u
2u = 2x
3
.
Using the result of example 17, u = x
3
3x.
Thus a particular solution is y
p
(x) = (x
3
3x)e
2x
.
Example 19.
y
4y
+ 4y = 20x
3
e
2x
.
Set y = ue
2x
, we get as above u
= 20x
3
.
Integrating twice, u = x
5
+ Ax + B. We may
set
A = 0 = B and take a particular solution
45
y
p
= x
5
e
2x
.
3. Trigonometric case
Here we use complex exponentials. Recall:
e
s+it
= e
s
(cos t + i sin t). We only need the
dierentiation property of e
cx
, c complex.
Recall also: if y = u(x) + iv(x) is a complex
valued solution of L(y)(x) = h
1
(x) + ih
2
(x)
(where u(x), v(x), h
1
(x) and h
2
(x) are real val-
ued functions), then
(u
+ iv
) + a(u
+ iv
) + b(u + iv)
= h
1
+ ih
2
,
(u
+ au
+ bu) + i(v
+ av
+ bv)
= h
1
+ ih
2
.
46
Equating real and imaginary parts:
u is a solution of L(y)(x) = h
1
(x)
v is a solution of L(y)(x) = h
2
(x)
Example 20. Solve
y
+ 4y = 16x sin 2x. (1)
We solve instead
z
+ 4z = 16xe
i2x
. (2)
By the above discussion, the imaginary part
of a solution of (2) will be a solution of (1).
Set z = ue
i2x
, u = u(x). (recall case 2 above)
computing z
and z
and substituting in (2) give
47
u
+ 4iu
= 16x.
Solving this, we get u = 2ix
2
+ x. Thus z =
(2ix
2
+x)e
i2x
, and a particular solution of (1)
is
y = Imz = x sin 2x 2x
2
cos 2x.
Example 21.
y
+ 2y
+ 5y = 16xe
x
cos 2x. (1)
Solve instead
z
+ 2z
+ 5z = 16xe
(1+2i)x
. (2)
Re (z) will be a solution of (1). Put z = ue
(1+2i)x
,
u = u(x).
48
(II) Method of variation of parameters
We consider
y
+ p(x)y
+ q(x)y = r(x) (1)
where p, q, r are continuous functions of x on
some open interval I.
The continuity of p and q implies that the
corresponding homogeneous d.e. y
+ p(x)y
+
q(x)y = 0 has a general solution y
h
(x) = c
1
y
1
(x)+
c
2
y
2
(x) on I.
The method of variation of parameters in-
volves replacing constants c
1
and c
2
by functions
u(x) and v(x) to be determined so that
y
p
(x) = u(x)y
1
(x) + v(x)y
2
(x)
49
is a particular solution of (1) on I.
Now y
p
= u
y
1
+uy
1
+v
y
2
+vy
2
. We impose
u
y
1
+ v
y
2
= 0. (A)
Then y
p
= uy
1
+ vy
2
,
and y
p
= u
1
+ uy
1
+ v
2
+ vy
2
.
Substituting these into (1) we obtain
(u
1
+ v
2
+ uy
1
+ vy
2
) + p(uy
1
+ vy
2
) + q(uy
1
+ vy
2
)
= u(y
1
+ py
1
+ qy
1
) + v(y
2
+ py
2
+ qy
2
) + (u
1
+ v
2
)
= r.
Thus
u
1
+ v
2
= r. (B)
50
Solving (A) and (B) for u
and v
:
u
=
y
2
r
y
1
y
2
y
1
y
2
, v
=
y
1
r
y
1
y
2
y
1
y
2
. (C)
Since y
1
and y
2
are linearly independent,
y
1
y
2
y
1
y
2
= 0. [Convince yourself that this is
true!]
Integrating (C) we obtain
u =
_
y
2
r
y
1
y
2
y
1
y
2
dx,
v =
_
y
1
r
y
1
y
2
y
1
y
2
dx. (D)
We obtain now y
p
and hence a general solution
of (1).
Note. The term y
1
y
2
y
1
y
2
may be viewed as
the determinant
y
1
y
2
y
1
y
. Its called the Wron-
skian of y
1
and y
2
.
51
Caution. When applying the above proce-
dure to solve (1), make sure that the given d.e.
is in standard form (1) where the coecient of
y
is 1.
Example 22. Solve y
+ y = tan x, x
(
2
,
2
).
Solution. The characteristic equation of y
+
y = 0 is
2
+ 1 = 0. So = i, and y
h
=
c
1
cos x + c
2
sin x. Here y
1
= cos x, y
2
= sin x.
y
1
y
2
y
1
y
2
= cos x cos x (sin x) sin x =
1.
Using (D) above,
u =
_
sin x tan x dx
52
=
_
sin
2
x
cos x
dx
=
_
cos
2
x 1
cos x
dx
=
_
(cos x sec x) dx
= sin x n| sec x + tan x|,
v =
_
cos x tan x dx
= cos x.
A general solution is
y = y
h
+ ucos x + v sin x
= c
1
cos x + c
2
sin x cos x n| sec x + tan x|.
Example 23. Solve y
y = e
x
sin e
x
+
cos e
x
.
Solution. We have y
h
= c
1
e
x
+c
2
e
x
. We take
53
y
p
= ue
x
+ ve
x
, and determine u, v as in the
above example:
We have y
1
y
2
y
1
y
2
= 2,
u =
1
2
(2 sin e
x
e
x
cos e
x
)
v =
1
2
e
x
cos e
x
y
p
= e
x
sin e
x
.
The general solution is y = c
1
e
x
+ c
2
e
x
e
x
sin e
x
.
54