Professional Documents
Culture Documents
Ord Equations
Ord Equations
Differential Equations
Ordinary
Differential Equations:
Methods and Applications
Universal Publishers
Boca Raton
To our parents
Everywhere, we learn from those whom
we love Johann Wolfgang von Goethe
Preface
This introductory course in ordinary dierential equations
is intended for junior undergraduate students in applied mathematics, science and engineering. It focuses on methods of solutions and applications rather than theoretical analyses. Applications drawn mainly from dynamics, population biology and
electric circuit theory are used to show how ordinary dierential equations appear in the formulation of problems in science
and engineering.
The calculus required to comprehend this course is rather elementary, involving dierentiation, integration and power series
representation of only real functions of one variable. A basic
knowledge of complex numbers and their arithmetic is also assumed, so that elementary complex functions which can be used
for working out easily the general solutions of certain ordinary
dierential equations can be introduced. The pre-requisites just
mentioned aside, the course is mainly self-contained.
The course comprises six chapters.
Chapter 1 gives the basic concepts of ordinary dierential
equations, explaining what an ordinary dierential equation is
and what is involved in solving such an equation. It also illustrates how ordinary dierential equations can be derived from
physical laws or basic principles for two specific examples of
problems.
In Chapter 2, methods of solution are given for some first
order ordinary dierential equations. The equations studied
include those which can be written in separable form, those
which are linear, and the nonlinear Bernoulli dierential equation. Mathematical models which describe population growth
are given as examples of applications involving first order ordinary dierential equations.
v
In Chapter 3, the mathematical theory for constructing general solutions of second order linear ordinary dierential equations is studied. It is applied to obtain general solutions of second order linear ordinary dierential equations with constant
coecients and the Euler-Cauchy equations. Also discussed
is the extension of the theory to higher order linear ordinary
dierential equations.
Chapter 4 shows how linear ordinary dierential equations
with constant coecients arise in the formulation of problems
involving electric circuits and spring-mass systems. Specific
examples of problems are solved.
Chapter 5 introduces the power series method and the Frobenius method for deriving series solutions of rather general homogeneous second order linear ordinary dierential equations.
The methods studied can be applied to solve some well known
ordinary dierential equations in mathematical physics, such as
the Legendres equation and the Bessels equation, giving rise
to particular special functions, but those equations and the associated special functions are not examined in this course.
Chapter 6 describes some simple numerical methods for
solving first and second order ordinary dierential equations.
For a particular example of applications, the second order nonlinear ordinary dierential equation which governs the motion
of a swinging pendulum is solved numerically.
Exercises are set not only to test the understanding of students but sometimes also to impart additional insights into the
materials studied. Suggested solutions to all the exercises are
given at the end of the chapters. To promote the use of this
course for self-study, the solutions provided are by and large
complete with details.
W. T. Ang and Y. S. Park, Singapore, 2008
vi
Contents
1 Basic concepts
1.1 What is an ODE?
. . . . . . .
1.2 Solving an ODE . . . . . . . . . .
1.2.1 General solution . . . . . .
1.2.2 Particular solution . . . . .
1.2.3 Exact solution . . . . . . .
1.3 Exercise I . . . . . . . . . . . . . .
1.4 Why study ODEs? . . . . . . . . .
1.4.1 ODE for a body in motion
1.4.2 ODE for a pursuit problem
1.5 Exercise II . . . . . . . . . . . . . .
1.6 Solutions to Exercise I . . . . . . .
1.7 Solutions to Exercise II . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
10
10
11
12
12
12
13
14
14
18
20
22
24
.
.
.
.
.
.
.
.
.
.
.
27
27
27
33
34
34
36
38
38
39
41
43
vii
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
viii
.
.
.
.
.
.
.
.
.
.
.
.
49
49
50
50
52
55
64
70
71
72
78
81
81
81
82
83
85
89
96
96
96
96
98
99
109
109
109
115
118
119
124
5 Series solutions
5.1 Preamble . . . . . . . . . . . .
5.2 Review of power series . . . .
5.3 Power series method for ODEs
5.4 Exercise VIII . . . . . . . . . .
5.5 Frobenius method . . . . . . .
5.6 Exercise IX . . . . . . . . . . .
5.7 Solutions to Exercise VIII . . .
5.8 Solutions to Exercise IX . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
128
. 128
. 128
. 131
. 146
. 147
. 161
. 162
. 167
6 Numerical methods
176
6.1 Preamble . . . . . . . . . . . . . . . . . . . . . . 176
6.2 Eulers method for 1st order ODEs . . . . . . . . 176
6.3 Second order ODEs . . . . . . . . . . . . . . . . . 183
6.4 Oscillation of a pendulum . . . . . . . . . . . . . 187
6.4.1 Nonlinear ODE . . . . . . . . . . . . . . . 187
6.4.2 ODE for very small oscillation . . . . . . 188
6.4.3 Numerical solution for larger oscillation 189
6.5 Numerical prudence . . . . . . . . . . . . . . . . 191
6.6 Exercise X . . . . . . . . . . . . . . . . . . . . . . 191
6.7 Solutions to Exercise X . . . . . . . . . . . . . . 194
ix
Chapter 1
Basic concepts
1.1
What is an ODE?
dy
2x = 0
dx
dy
d2 y
2y(x) = x5
+3
2
dx
dx
d3 y
d2 y
x3 3 + 6x2 2 3xy(x) = sin(2x)
dx
dx
4y
d
d2 y
2x2 (y(x))10 4 + 3x 2 = xy(x)
dx
dx
dy 00
d2 y
d3 y
dN y
, y (x) = 2 , y 000 (x) = 3 , , y (N) (x) = N .
dx
dx
dx
dx
10
1.2
Solving an ODE
Here C and D are constants which may have any values (arbitrary constants).
Thus, we find that y(x) = x3 + Cx + D (where C and D
are arbitrary constants) satisfies the ODE y00 6x = 0.
Not all ODEs may be easily solved by direct integration like
in the example above. In subsequent chapters, we will look at
various methods for solving ODEs.
1.2.1
General solution
1.2.2
Particular solution
1.2.3
Exact solution
12
1.3
Exercise I
y 00 y = 0
2. Find out whether each of the following functions is a solution of the ODE p0000 (x) 5p00 (x) 36p(x) = 0 or not.
(a)
p(x) = 2 sinh(3x)
(b)
p(x) = cosh(2x)
(c)
(d)
13
y 0 ex = 5
(c)
y 00 + 6x2 2 = 0
(d)
xy 0 + y = 4x3 + 2x (Hint.
d
dy
(xy) = x
+ y)
dx
dx
6. Verify that
y(x) =
5
2 cos(x) + 4 sin(x) + 10e2x
1.4
1.4.1
We assume that the body, which is pulled by gravity towards the earth, moves along a straight line which is perpendicular to the surface of the earth (that is, it moves along a
vertical path). In addition to gravity, the body is also acted
upon by a force due to air resistance.
A sketch of the situation is given in Figure 1.1. Let s(t)
be the vertical downward displacement (in meter) of the body
from a fixed point P (which may lie on the path of motion)2 .
We are interested in finding s(t), that is, the position of the
body at time t.
Figure 1.1
All motion obeys Newtons law which may be stated as
follows.
If the mass of a moving body is constant, then the
total force (in newton) acting on the body is equal
to the product of the mass (in kilogram) and the
2
15
= mg k|s0 (t)|
= mg ks0 (t)
16
k 0
s (t) g = 0.
m
If we can solve the ODE for s(t), we can predict the position
of the body at any time t during which it is moving towards
the earth. For the case in which k is a non-zero constant, the
ODE may be solved using methods of solution in later chapters
(see Problem 3 in Exercise V on page 84).
For now, let us consider the special case in which the eect
of air resistance on the motion is so small that it may be ignored, that is, we take k/m in the ODE to be zero. For such a
case, the ODE which describes Newtons law of motion reduces
to
s00 (t) g = 0 or s00 (t) = g.
This simpler ODE may be solved by directly integrating it
twice with respect to t. Bearing in mind that g is a constant,
we obtain
Z
ds
= gdt = gt + C
dt
Z
1
s(t) = (gt + C)dt = gt2 + Ct + D.
2
Here C and D are arbitrary constants.
To calculate the position of the body, we need to know the
values of the constants C and D. The values of these constants
may be determined if the displacement and velocity of the body
are known at a certain time.
For example, if we are told that s0 (t) = 3 (meter per second)
when t = 0 (second) then
3 = g 0 + C C = 3.
Furthermore, if s(t) = 2 (meter) at t = 0, we obtain
1
2 = g 02 + 3 0 + D D = 2.
2
17
1.4.2
Figure 1.2
A geometrical sketch of the problem is given in Figure 1.2.
Let the path be given by the curve y = p(x), where p(x) is an
18
dx
dx
dx
+ p0 (x)
= p0 (x)
u
dt
dt
dt
which simplifies to
xp00 (x)
dx
= u.
dt
dx 2
) (1 + (p0 (x))2 ) = v
dt
v
dx
= p
.
dt
1 + (p0 (x))2
(
19
1.5
Exercise II
21
1.6
Solutions to Exercise I
y 00 y = 0 (from y 00 = y).
2y00 + 2y 0 3y = ex 6ex
y 000 + 3y 00 y0 3y
= y 0 + 3y y 0 3y = 0. Yes.
2. (a) p = 2 sinh(3x), p0 = 6 cosh(3x), p00 = 18 sinh(3x) =
9p, p000 = 9p0 and p0000 = 9p00 = 81p. Thus,
p0000 5p00 36p = 81p 45p 36p = 0.
Yes, p = 2 sinh(3x) is a solution of the given ODE.
(b) p = cosh(2x), p0 = 2 sinh(2x), p00 = 4 cosh(2x) = 4p,
p000 = 4p0 and p0000 = 16p. Thus,
p0000 5p00 36p = 16p 20p 36p 6= 0.
No, p = 2 cosh(2x) is not a solution of the given ODE.
(c) p(x) = cos(3x) sin(3x) is not a solution.
(d) p(x) = 2 sin(2x) + 3 cos(2x) is a solution.
3. Substitute y = sin(2x) + cos(2x) into ODE, we obtain
( 8) sin(2x) + ( + 8) cos(2x) = 3 sin(2x).
Thus, for the ODE to be satisfied for all x, we require
+ 8 = 3 and 8 = 0. This gives = 3/65 and
= 24/65.
22
2 13/2 10 3/2
+ x + C.
x
13
3
x4 + x2 + C
y = x3 + x +
23
C
.
x
5
(2 cos(x) + 4 sin(x) + 10e2x )
y 2 (2 cos(x) + 4 sin(x) + 10e2x ) = 5
=
1.7
Solutions to Exercise II
T` T0
x + T0 .
`
24
T` T0
.
`
xp
x
xp0 + p = x
d
(xp) = x.
dx
Integrating, we obtain
1
1
C
xp = x2 + C p = x + .
2
2
x
From the point (1, 1), we have p(1) = 1, that is, C =
1/2. Thus, the required curve is
1
1
y = x
(for x > 0).
2
2x
4. The ODE is
dw
= 8t3 + 3t2 + 1
dt
which can be integrated to obtain
w = 2t4 + t3 + t + C.
From w(0) = 1, we find that C = 1. Thus, w(2) = 42+1 =
43.
25
5. The ODE is
d2 s
= 1 + e2t .
dt2
Integrating, we find that
1
1
1
ds
= t e2t + C s = t2 + e2t + Ct + D.
dt
2
2
4
Now, the body is at rest at t = 0. This gives s0 (0) = 0,
hence C = 1/2. Also, s(0) = 0. This gives D = 1/4.
Thus, the rightward displacement at t = 1 is
s(1) =
1 1 2 1 1
3
1
+ e + = e2 + .
2 4
2 4
4
4
6. We have
dT
= c(T (t) Tambient )
dt
If T (t) > Tambient , the body should be losing heat, that
is, dT /dt < 0. This implies c < 0. Likewise, if T (t) <
Tambient , the body should be gaining heat, that is, dT /dt >
0 and hence c < 0 (as deduced earlier). (Note. This ODE
can be solved as a 1st order ODE in separable form as
explained in Chapter 2.)
26
Chapter 2
Preamble
We will consider 1st order ODEs in y(x) which are of the form
dy
= G(x, y)
dx
where G(x, y) denotes a given mathematical expression involving x and y.
For cases in which G(x, y) assumes certain specific forms,
methods for solving the ODEs may be obtained. We will look
at some of these cases in this chapter.
2.2
= P (x).
Q(y) dx
27
dx = P (x)dx.
Q(y) dx
This may be rewritten as
Z
Z
dy
= P (x)dx.
Q(y)
The formula above provides us with a method for solving
the ODE, if we can work out the indefinite integrals on both
sides of the equation. Note that the integration on the left hand
side is carried out with respect to y and that on the right hand
side with respect to x.
Examples
1. Solve the ODE
y 0 (x) = (y + 1)2 (2x + 1)
subject to y(0) = 1.
We are required to find the particular solution y(x) of the
ODE which is such that y(0) = 1.
The ODE is 1st order and in separable form.
We rewrite it as
Z
Z
dy
=
(2x + 1)dx.
(y + 1)2
This leads to the general solution of the form
(y + 1)1 = x2 + x + C
where C is an arbitrary constant. The general solution as given
above is said to be in implicit form1 .
1
If we can rearrange the implicit solution to express y explicitly in terms
of x, we obtain a general solution in explicit form. An explicit solution (if it
can be easily obtained) may be preferable to an implicit one as the former
may be readily used to evaluate y at any suitably chosen value of x.
28
1 2x2 2x
.
2x2 2x + 1
y 7 + y 3 + 3 = Ae1/(2x
(A = B)
dq
up
1 + q2
=
dx
v
Z
u
dx
p
=
2
v
x
1+q
Z
u
dq
p
= ln |x| + E.
2
v
1+q
dq
u
ln |x| + C
v
u
q = sinh( ln |x| + C)
v
C (u/v) ln |x|
eC e(u/v) ln |x|
2q = e e
1
1
q = A|x|u/v A1 |x|u/v
2
2
where A = eC is an arbitrary constant.
In the pursuit problem, we note that 0 < x a when the
navy ship is chasing the small boat. Thus, |x| = x and
1
1 u/v
p0 (x) = Axu/v
x
2
2A
x1
u
Ax+1
+ B if = 6= 1,
p(x) =
2( + 1) 2A(1 )
v
+1
Ax
1
u
or p(x) =
ln(x) + B if = = 1,
2( + 1) 2A
v
where B is an arbitrary constant.
To determine the arbitrary constants A and B in the general
solution, we apply the conditions p(a) = 0 and p0 (a) = 0.
Using p0 (a) = 0, we obtain
Aau/v
1
1
= 0 A = u/v .
u/v
Aa
a
1 (x/a)2u/v
0 for 0 < x a.
2(x/a)u/v
31
du
1
= (G(u) u).
dx
x
x
y
+ ( )3
x
y
subject to y(1) = 1.
We let y = xu(x). This gives y 0 = xu0 (x)+u. Substituting
into the given ODE, we find that
1
du
1
= ( )3 .
x u0 (x) + u = u + ( )3 x
u
dx
u
32
u3 du =
dx
.
x
2.3
2.3.1
2.3.2
y = ex
35
v(x).
It follows that
2 /2
y 0 = ex
2 /2
v 0 xex
v.
ex
2 /2
v 0 xex
2 /2
v + x ex
v(x) = (x + 1)ex
ex /2 v 0 = (x + 1)ex
dv
2
= (x + 1)e(x /2)+x
Zdx
Z
2 /2)+x
(x + 1)e(x
dv =
2 /2)+x
v(x) = e(x
dx
+C
y(x) = ex
2 /2)+x
(e(x
2 /2
+ C) = ex + Cex
y(x) = ex + ex
2.4
36
yp 0
u.
1p
37
dx
Thus, the solution of y 0 + 9y = y 5 e32x is given implicitly by
y 4 = (e4x + C)e36x .
2.5
Population dynamics
2.5.1
2.5.2
At first glance, the assumption behind Malthus theory may appear plausible. It seems not unreasonable to think that a larger
population is favourable to the rate of a growing population.
On careful thought, however, we realize that a larger population is favorable to growth only if the population does not
have to compete with one another for resources (such as food)
to survive, that is, if the resources for survival are inexhaustible.
In fact, if the resources are limited, a larger population leads
to a stier competition for survival which does not favor population growth.
To take the competitive factor into account, mathematical
biologists modify the ODE in Malthus theory by taking the
coecient k as a decreasing function of the population size. In
Verhulst theory, k is taken to be of the form
k = P (t),
39
ln |u | = t + C
u = Det (D = eC )
P
= Det
P
F et
1
P (t) =
(F = ).
t
1 + F e
D
Here C, D and F are arbitary constants.
40
F
P (0)
F =
.
1 + F
P (0)
2.6
Exercise III
2x
y
0
y = (y 2)(x + 1)
y0 =
y 0 = xy 3y
y 0 = (1 y)1 cot(x)
xy
.
x+y
y 0 + (2x + 1)y = 2x + 1
(b)
xy 0 + y = 2x6
(Hint. Rewrite in the form y 0 + f(x)y = r(x).)
8. The growth of a tumor may be described using the Gompertz equation which is a 1st order separable ODE of the
form
dV
= ( ln(V ))V
dt
where and are positive constants and V (t) is the volume of the tumor at time t. Solve the Gompertz equation.
Find the limiting volume of the tumor as t .
42
2.7
(x + 1)dx
Z
Z
dy
= (x + 1)dx
y2
1
ln |y 2| = x2 + x + C.
2
1 2
y = 2 + Ae 2 x +x .
y = Ae 2 x
= 10 2V
+ 2V = 10.
dt
dt
If we regard the ODE as a nonhomogeneous 1st order
linear ODE, we first solve the corresponding homogeneous
ODE, that is,
dW
+ 2W = 0 W (t) = e2t .
dt
43
sinh(x + C)
s0 (x) = sinh(x + C)
s(x) = cosh(x + C) + F.
From the endpoints (0, 0) and (1, 0), we know that s(0) =
0 and s(1) = 0. This gives
eC + eC + 2F
C
1 C
ee +e
+ 2F
= 0
= 0.
Eliminating F, we obtain
(1 e)eC +
(1 e1 )
=0
eC
which gives
e2C
e1 1
1
e1 1
C = ln(
)
1e
2
1e
1
F = (eC + eC )
2
1 e1 1 1/2
e1 1 1/2
F = [(
].
) +(
)
2 1e
1e
=
45
1 e1 1 1/2 x
e1 1 1/2 x
e ]
[(
) e +(
)
2 1e
1e
1 e1 1 1/2
e1 1 1/2
[(
].
) +(
)
2 1e
1e
|u2 + 2u 1| = C 2 x2
y
y
( )2 + 2( ) 1 = Ex2 (E = C 2 ).
x
x
7. (a) Regard ODE as 1st order linear. Solve corresponding
homogeneous ODE first, that is,
Y 0 + (2x + 1)Y = 0.
2
2 +x
(2x + 1)ex
2 +x
v(x) = ex
46
+ C.
y = 1 + Cex
1
Y =0
x
2y3 y 0
1
y 0 = y 3 u0 .
2
If we subsitute the above into the Bernoulli equation, we
obtain
du
+ u = 2x6
x
dx
which may be solved as a 1st order linear ODE (see part
(b) above) to obtain
=
2
u(x) = x6 + Cx1 .
7
The required general solution is
2
y 2 = x6 + Cx1 .
7
47
8. The Gompertz equation is 1st order separable. Separating the variables, we find that
Z
Z
dV
= dt
V ( ln(V ))
1
ln | ln(V )| = t + C
ln(V ) = Aet (A = eC )
A
V (t) = exp(/) exp( et )
48
Chapter 3
Preamble
Here we will look at 2nd order linear ODEs. These are ODEs
which can be written in the form
y 00 + f (x)y 0 + g(x)y = r(x)
where f (x), g(x) and r(x) are given functions of x. The ODE
above is said to be homogeneous if r(x) 0. Otherwise, it is
nonhomogeneous.
Below are some examples of 2nd order linear ODEs in y(x):
(1)
(2)
y 00 (x) + xy(x) = 0
(3)
(4)
3.2
If two linearly independent solutions of a homogeneous 2nd order linear ODE can be found, they can be used to construct
the general solution of the ODE.
3.2.1
Theorem 1
Let f (x) and g(x) be dierentiable functions over
the interval [a, b]. The functions f(x) and g(x) are
not linearly independent over [a, b] if and only if
f (x)g 0 (x) g(x)f 0 (x) = 0 for all x in [a, b].
The above theorem can be proven as follows.
Let
f (x) + g(x) = 0 for all x in [a, b],
(1)
(2)
If we multiply (1) and (2) above by g 0 (x) and g(x) respectively and take the dierence between the two resulting equations, we find that
[f (x)g 0 (x) g(x)f 0 (x)] = 0 for all x in [a, b].
(3)
(4)
51
3.2.2
(5)
Lemma 1
If y1 (x) and y2 (x) are solutions of (5) then y(x) =
Ay1 (x) + By2 (x), where A and B are any arbitrary constants, is also a solution of (5).
The lemma above can be proven as follows.
If y1 (x) and y2 (x) are solutions of (5) then
y100 + f (x)y10 + g(x)y1 = 0
(6)
y200
(7)
+ f (x)y20
+ g(x)y2 = 0.
d 0
y2 y1 y1 y20
dx
= y2 y100 + y20 y10 y1 y200 y20 y10
=
= y2 y100 y1 y200 .
dz
=
z
f (x)dx
to give
ln |z| + C =
f (x)dx
f (x)dx
where D is a constant.
Similarly, since y1 (x) and Y (x) are solutions of (5), Lemma
2 gives
Y y10 y1 Y 0 = Ee
f (x)dx
where E is a constant. Note that we should allow for the possibility that E and D are dierent constants.
Also, as y2 (x) and Y (x) are solutions of (5), we may write
Y y20 y2 Y 0 = F e
f (x)dx
where F is a constant.
The last two equations above may be used to obtain
Y y10 y2 y1 y2 Y 0 = y2 Ee
Y y20 y1 y2 y1 Y 0 = y1 F e
f (x)dx
f (x)dx
y1 F e
f (x)dx
+ y2 Ee
R
Ee f (x)dx
f (x)dx
y2 y10
+ y2
y1 y20
f (x)dx ,
Y = Ay1 + By2
54
f (x)dx
3.3
(8)
Dierentiating, we obtain
y 0 (x) = ex
y 00 (x) = ex = 2 ex .
Substituting into (8), we find that
a2 ex + bex + cex = 0
ex a2 + b + c = 0
b + b2 4ac
= 1
2a
b b2 4ac
= 2
2a
and we obtain two solutions of (8) as given by
y1 = e1 x
and
y2 = e2 x .
56
where i = 1.
If we ignore the fact that 1 and 2 are complex and proceed
as in Case I above, the general solution of (8) is given by
y = Ae1 x + Be2 x
where A and B are arbitrary constants.
The only question that arises here is, How can we evaluate
ex for complex ? The general solution given above is useless
if we cannot evaluate e1 x and e2 x . A proper interpretation
of ex for complex may be found in the theory of complex
functions as explained below.
In calculus of real functions, ex can be represented by its
Taylor series about x = 0, that is, we can write
ex =
X
xn
n=0
n!
58
X
(x + iy)n
n!
n=0
(9)
X
(iy)n
n=0
X
k=0
=
=
n!
(iy)2k X (iy)2k+1
+
(2k)!
(2k + 1)!
k=0
X
(i2 )k y 2k
k=0
X
k=0
(2k)!
+i
X
(i2 )k y 2k+1
k=0
(1)k y 2k
+i
(2k)!
(2k + 1)!
k=0
(1)k y2k+1
.
(2k + 1)!
X
(1)k x2k
(2k)!
k=0
and sin(x) =
X
(1)k x2k+1
k=0
(2k + 1)!
n
X
n!
xm (iy)nm
m!(n
m)!
m=0
=
=
X
(x + iy)n
n=0
n!
n
X
xm (iy)nm
.
m!(n m)!
n=0 m=0
59
(10)
Figure 3.1
Let us now interchange the order of the double summation,
that is, we fix m first and sum over n. To cover all the points
in Figure 3.1, we find that we have to let m run from 0 to ,
and for a fixed m, we sum over n from m to . (For example,
when m = 3, we sum over n from 3 to .) Interchanging the
order of the double summation, we find that
e
x+iy
=
=
=
X
xm (iy)nm
m!(n m)!
n=m
m=0
X
X
xm (iy)k
(if we let k = n m)
m!k!
m=0 k=0
m X
X
m=0
x
m!
(iy)k
k!
k=0
x+iy
= ex eiy .
60
(11)
y 0 = ex
and y 00 = 2 ex .
ex 2 + 6 = 0
2 + 6 = 0
( + 3)( 2) = 0 = 3, = 2.
and
y2 = e2x .
61
It follows that
y(0) = 1 A + B = 1
y0 (0) = 7 3A + 2B = 7.
Solving for A and B, we obtain A = 1 and B = 2.
Thus, the required particular solution of the ODE is
y = e3x + 2e2x .
2. Solve the ODE y 00 + 6y 0 + 9y = 0 subject to the conditions
y(0) = 1 and y0 (0) = 1.
This is a homogeneous 2nd order linear ODE with constant
coecients. Thus, we use
y = ex ,
y 0 = ex
and y 00 = 2 ex .
62
y 0 = ex
and y 00 = 2 ex .
= 2 + 3i, = 2 3i.
Thus, the general solution is given by
y = Ae(2+3i)x + Be(23i)x
where A and B are arbitrary constants.
It is useful to rewrite the general solution as
y = Ae(2+3i)x + Be(23i)x
= e2x (Aei(3x) + Bei(3x) )
= e2x (A [cos(3x) + i sin(3x)] + B [cos(3x) i sin(3x)])
y( ) = e cos( ) = 0.
2
2
3.4
Euler-Cauchy equations
(12)
b 0
c
y (x) + 2 y(x) = 0.
ax
ax
a( 1) + b + c = 0
a2 + (b a) + c = 0.
We consider the following cases.
64
y2 = x2 .
(b a)
.
2a
Thus, only one solution is found for (12). Two linearly independent solutions are needed to construct the general solution
of the ODE. To find another solution, we let
y(x) = x1 u(x)
where u(x) is a function yet to be determined.
Dierentiating, we obtain
y 0 (x) = 1 x1 1 u(x) + x1 u0 (x)
x1 u(x) [a1 (1 1) + b1 + c]
dv
= 0.
dx
1
ln(v) = ln(x) = ln( )
x
1
v=
x
1
du
=
dx
x
u = ln(x).
66
Examples
1. Solve the ODE x2 y 00 + 4xy 0 + 2y = 0 subject to y(1) =
y 0 (1) = 1.
This is an Euler-Cauchy equation. We use
y = x ,
y 0 = x1 ,
y 00 = ( 1)x2 .
2 + 3 + 2 = 0
( + 1)( + 2) = 0 = 1,
67
= 2.
y 0 (1) = 1 A 2B = 1.
Solving for A and B, we obtain A = 3 and B = 2.
The required particular solution is
y = 3x1 2x2 .
y 0 = x1 ,
y 00 = ( 1)x2 .
2 + 2 + 1 = 0
y 0 = x1 ,
y 00 = ( 1)x2 .
2 + 2 + 2 = 0 = 1 + i, 1 i.
The general solution of the ODE is
y = Ax1+i + Bx1i
where A and B are arbitrary constants.
We may rewrite the above general solution as
y = Ax1+i + Bx1i
= x1 [Axi + Bxi ]
= x1 [Aei ln(x) + Bei ln(x) ]
= x1 [A (cos(ln(x)) + i sin(ln(x)))
+B (cos(ln(x)) i sin(ln(x)))]
= x1 [C cos(ln(x)) + D sin(ln(x))]
where C = A + B and D = i(A B) are arbitrary constants.
69
Dierentiating, we obtain
y 0 (1) = 1 D C = 1 D = 2.
Thus, the required particular solution is
y = x1 [cos(ln(x)) + 2 sin(ln(x))] .
3.5
Exercise IV
(d) x2 y 00 + 5xy0 + 3y = 0
p0 (x)
+ q(x))y 0 + p(x)r(x)y = 0
p(x)
by letting
u(x) =
3.6
y0 (x)
.
y(x)p(x)
(13)
00
yp + f (x)yp0 + g(x)yp + Y 00 + f (x)Y 0 + g(x)Y
00
= r(x)
(14)
3.6.1
Below are examples of how guesswork may be used to find particular solutions of some nonhomogeneous ODEs.
Examples
1. Solve the ODE y00 + 3y0 + 2y = 2e5x subject to y(0) =
y 0 (0) = 0.
Firstly, let us solve the corresponding homogeneous ODE,
that is,
Y 00 + 3Y 0 + 2Y = 0.
72
Y 0 = ex
and Y 00 = 2 ex .
yp00 = 25e5x .
1 5x
e
21
73
1 5x
e + Aex + Be2x
21
5 5x
e Aex 2Be2x .
21
y(0) = 0 A + B =
1 5x 1 x 2 2x
e e + e .
21
3
7
Y 0 = ex
and Y 00 = 2 ex .
This gives
2 = 0 = 0, 1.
The general solution of the homogeneous ODE is
Yg = A + Bex
74
2 + 4 = 1.
1
1
sin(2x) + cos(2x) + A + Bex
10
5
75
76
3.6.2
The method of variation of parameters gives a systematic approach for finding a particular solution of the nonhomogeneous
2nd order linear ODE in (13). Let us examine the method from
a general view point before applying it to a specific example.
Assume that we can find two linearly independent solutions
Y1 (x) and Y2 (x) of the corresponding homogeneous ODE in
(14). The two solutions may be used to construct a particular
solution yp of (13) as follows.
Let yp take the form
yp = u(x)Y1 (x) + v(x)Y2 (x)
where u(x) and v(x) are functions to be determined.
Dierentiating, we obtain
yp0 = uY10 + u0 Y1 + vY20 + v 0 Y2
yp00 = uY100 + 2u0 Y10 + u00 Y1 + vY200 + 2v0 Y20 + v00 Y2 .
Substitution into (13) gives
0 0
2u Y1 + u00 Y1 + 2v 0 Y20 + v 00 Y2 + f (x) u0 Y1 + v 0 Y2 = r(x)
since Y1 and Y2 are solutions of (14).
The ODE above may be rewritten as
d 0
u Y1 + v0 Y2 + u0 Y10 + v0 Y20 + f (x) u0 Y1 + v0 Y2 = r(x)
dx
which is satisfied if
u0 Y1 + v0 Y2 = 0
u0 Y10 + v0 Y20 = r(x).
Multiplying the first equation above by Y20 and the second
by Y2 gives
u0 Y1 Y20 + v0 Y2 Y20 = 0
u0 Y10 Y2 + v0 Y2 Y20 = r(x)Y2 (x).
78
r(x)Y1 (x)
dx.
(Y1 Y20 Y10 Y2 )
3ex ex
3
dx = x.
2
2
3.7
Much of the discussion above for 2nd order linear ODEs can
be extended to higher order linear ODEs. The extension is
indicated below.
3.7.1
3.7.2
Theorem 2 (page 53) for the general solution of 2nd order linear
ODEs can be generalized as follows.
If y1 , y2 , , yN1 and yN are linearly independent solutions of the homogeneous N-th order linear ODE
y (N) + fN 1 (x)y (N1) + + f1 (x)y(1) + f0 (x)y = 0
(16)
then the general solution of the ODE is
y = A1 y1 + A2 y2 + + AN 1 yN 1 + AN yN
where A1 , A2 , , AN1 and AN are arbitrary constants.
The functions y1 , y2 , , yN1 and yN are linearly independent if we cannot find any constants k1 , k2 , , kN 1 and
kN , other than k1 , k2 , , kN1 and kN all being zero, such
that
k1 y1 + k2 y2 + + kN 1 yN 1 + kN yN 0.
81
3.7.3
ex 3 22 5 + 6 = 0
that is,
( 1)( + 2)( 3) = 0
= 1, = 2, = 3.
82
It is easy to see that a particular solution of this nonhomogeneous ODE is yp = 2. The general solution of the corresponding
homogeneous ODE is found in the example above. Thus the
required general solution is
y = 2 + Aex + Be2x + Ce3x
where A, B and C are arbitrary constants.
3.8
Exercise V
k 0
s (t) = g
m
3.9
Solutions to Exercise IV
A=1
y(e)
e2 (A + B) = 2
B = 2e2 1.
Thus, required solution is
y(x) = x2 (1 + [2e2 1] ln(x)).
86
yp0
eF (x)
dx
yp2
eF (x)
eF (x)
dx + yp0
2
yp
yp2
y 00 = yp00
eF (x)
eF (x)
dx
+
yp2
yp
f(x)
.
yp2
yp
It follows that
y 00 + f (x)y 0 + g(x)y
=
(yp00
+ f (x)yp0
f(x)
= 0
+ g(x)yp )
eF (x)
dx
yp2
eF (x)
eF (x)
+ f (x)
yp
yp
eF (x)
dx + 0 = 0.
yp2
eF (x)
dx
yp2
1/2
ex /2
dx
x1
1 2
y = x1/2 e 2 x .
Since the given ODE is homogeneous 2nd order linear
ODE, we may use Theorem 2 to write down the general
solution
1 2
y = Ax1/2 Bx1/2 e 2 x .
5. Let
u(x) =
y0 (x)
.
y(x)p(x)
It follows that
u0 =
ypy00 + y0 (y 0 p + yp0 )
.
(yp)2
p(
+
q
)
r =0
(yp)2
yp
yp
Multiplying the above by py, we obtain
ypy 00 + y 0 (y 0 p + yp0 ) p(y 0 )2
+ qy0 rpy = 0
yp
which may be simplified to give
p0 0
y + qy0 rpy = 0
p
p0
y 00 ( + q)y 0 + pry = 0.
p
y00 +
88
3.10
Solutions to Exercise V
Y (x) = (A + Bx)e 3 x .
For a particular solution of the nonhomogeneous ODE,
let
yp = x3 + x2 + x + .
Substituting yp into nonhomogeneous ODE, we obtain
25x3 + (90 + 25)x2
+(54 60 + 25)x + (18 30 + 25)
= x3 + 3x + 2
Thus,
1
, 90 + 25 = 0
25
54 60 + 25 = 3, 18 30 + 25 = 2
=
1348 237
18 2
+
x+
x
3125 625
125
5
1
+ x3 + (A + Bx)e 3 x .
25
3 5x
xe
+ Ae5x + Be6x .
11
1
1
sin(2x) + cos(2x) + A + Bex .
10
5
2
y = x2 + x 1 + A cos( 3x) + B sin( 3x).
3
Applying the condition y(0) = 1, we obtain A 1 =
1, that is,
y 0 (0) = 2 gives
2
4 3
2
sin( 3x).
y = x + x 1 + 2 cos( 3x) +
3
9
(b) The corresponding homogeneous solution has general
solution
Y (x) = Ae4x + Be5x .
For a particular solution, let
yp = x + + ex .
We find that = 1/20, = 1/400 and = 1/20.
General solution of the nonhomogeneous ODE is
y=
1
1
1
x+
ex + Ae4x + Be5x .
20
400 20
1
137 4x 143 5x
1
1
+
x+
ex +
e
e .
20
400 20
240
300
91
5
+ [A cos(2 ln(x)) + B sin(2 ln(x))]x2 .
8
5
1
5
+ [ cos(2 ln(x)) sin(2 ln(x))]x2 .
8
8
8
1 3x
+ Aex + Bex + Ce2x .
e
40
1
1
1 3x 7 x
+ e + ex + e2x .
e
40
8
12
15
92
0 2 = 1, 2 = 1
= 1, = i.
2( c)Q() + ( c)2 Q0 ()
P 0 (c) = 0.
It follows that
LHS of ODE
(3 72 + 16 12) = 0
( 3) ( 2)2 = 0
= 0, = 2 (twice), = 3.
1 1 2x
1
+ e xe2x + e3x .
6 2
3
95
Chapter 4
Preamble
4.2
4.2.1
Electric circuits
Basic electrical components
Basic components which may be found in an electric circuit include resistor, inductor and capacitor. The resistor is a device
which restricts the flow of electric current to within a safe level
in the circuit. The inductor is essentially a coil of wire (usually
copper) which stores energy in a magnetic field. The capacitor stores energy in an electric field in between two oppositely
charged plates. In addition to the components just mentioned,
96
Figure 4.1
The symbols which we use to represent external source voltage, resistor, inductor and capacitor are shown in Figure 4.1.
A simple circuit which contains each of the basic components
mentioned, that is, the so called LCR circuit, is shown at the
bottom of Figure 4.1. Circuits may contain less components
than the LCR circuit shown in Figure 4.1 or they may be more
complicated being made up of many simple circuits joined together to form a network.
97
4.2.2
dI
dt
4.2.3
Figure 4.2
As mentioned earlier on, the electric current is the same in
every part of the circuit. If we denote the electric current by
I(t) then
dI
.
dt
According to Kirchos voltage law, VR + VL equals the
input voltage supplied by the external source. Thus,
VR = 2I
and VL = 3
dI
+ 2I = 2 + et .
dt
This is a 1st order nonhomogeneous linear ODE. We solve
it now by the method of variation of parameter.
Firstly, we find a particular solution of the corresponding
homogeneous ODE
3
dJ
+ 2J = 0.
dt
Solving the ODE, we obtain
Z
Z
2
dJ
=
dt
J
3
2
ln(J) = t
3
J = e2t/3 .
3
100
= u(t)e2t/3 + u0 (t)e2t/3 .
dt
3
Substituting into the nonhomogeneous ODE, we obtain
2u(t)e2t/3 + 3u0 (t)e2t/3 + 2u(t)e2t/3 = 2 + et .
Rearranging, we find that
Z
Z
3 du = [2e2t/3 + et/3 ]dt
u = e2t/3 et/3 + C
Thus, in the long run, we expect the current to get closer and
closer to a constant value of 1 ampere.
101
102
Let us use
J = et , J 0 = et , J 00 = 2 et .
This leads to
2 + 3 + 2 = 0
( + 1)( + 2) = 0 = 1, 2.
The general solution of the homogeneous ODE is
J = Aet + Be2t
where A and B are arbitrary constants.
Let us now find a particular solution of the original nonhomogeneous ODE. The right hand side of the ODE suggests
that we try
I = sin(t) + cos(t)
where and are constants to be determined.
Dierentiating, we obtain
I 0 = cos(t) sin(t)
I 00 = sin(t) cos(t).
Substituting into the nonhomogeneous ODE, we obtain
sin(t) cos(t) + 3 cos(t) 3 sin(t)
which leads to
[ 3] sin(t) + [3 + ] cos(t) cos(t).
The nonhomogeneous ODE is satisfied if we choose and
satisfying
3 = 0 and 3 + = 1,
103
that is,
=
1
3
and = .
10
10
3
1
sin(t) +
cos(t),
10
10
3
1
sin(t) +
cos(t) + Aet + Be2t
10
10
Z 0
dI
+
3I(0)
+
2
I( )d = sin(0)
dt t=0
0
I 0 (0) = 3I(0) = 6
Dierentiating the general solution,
I 0 (t) =
3
1
cos(t)
sin(t) Aet 2Be2t .
10
10
which leads to
A=
5
22
and B = .
2
5
3
22
1
5
sin(t) +
cos(t) et + e2t .
10
10
2
5
104
Figure 4.3
To analyze the network, we break it up into two simple
circuits as shown in Figure 4.4 and apply Kirchos voltage
law separately on each of the circuits.
Applying Kirchos voltage law on the each of the circuits
in Figure 4.4, we obtain
Z t
2I3 +
I1 ( )d + VC (0) = 0
0
dI2
2I3 = 9
dt
Figure 4.4
The first equation above is an integro-dierential equation
in 2 unknowns, namely I1 and I3 . The second equation is a 1st
order ODE in I2 and I3 . Since there are three unknowns I1 , I2
and I3 , a third equation is required to completely describe the
flow of current in the electric network.
Another equation may be obtained by applying Kirchos
curent law at the point (node) P in Figure 4.3. The total
amount of electric current entering P is I2 +I3 , while the electric
current leaving P is I1 . Thus,
I1 = I2 + I3 .
This is the required third equation.
How do we solve this system of 3 equations for I1 , I2 and
I3 ?
Dierentiating the integro-dierential equation with respect
to t, we obtain
2
dI3
+ I1 (t) = 0.
dt
106
since I1 = I2 + I3 .
Dierentiating once more with respect to t, we obtain
2
d2 I3 dI2 dI3
+
+
= 0.
dt2
dt
dt
Now, from the ODE dI2 /dt 2I3 = 9, that is, dI2 /dt =
9 + 2I3 , we obtain the 2nd order ODE
2
dI3
d2 I3
+ 9 + 2I3 +
=0
dt2
dt
d2 I3 dI3
+ 2I3 = 9
+
dt2
dt
t for 0 t < 1
1 for 1 t < 2
V (t) =
0 for t 2.
If the electric current I is zero at time t = 0, find I(t)
for t 0.
According to Kirchos voltage law, the ODE for the electric current in the circuit is given by
3
dI
+ 2I = V (t).
dt
107
dI
+ 2I = t for 0 t < 1.
dt
dI
+ 2I = 1 for 1 t < 2
dt
1 3
+ (1 e2/3 )e2t/3 for 1 t < 2
2 4
and
I(2) =
1 3
+ (1 e2/3 )e4/3 .
2 4
Lastly, we solve
3
dI
+ 2I = 0 for t 2
dt
108
4.3
Exercise VI
t for 0 t < /4
V (t) =
0 for t /4.
3. Find the currents I1 , I2 and I3 in Figure 4.3 (page 105),
if it is known that I1 (0) = I2 (0) = I3 (0) = 0 and the
capacitor is not charged at time t = 0.
4. A simple RC circuit is made up of a resistor, a capacitor
and an external source voltage. If the external source
voltage provides an input voltage which does not change
with time t and if the resistance R of the resistor and the
capacitance C of the capacitor are such that the RC = 1
(ohm farad), find the time taken for the magnitude of the
current to be reduced to 20% of its magnitude at t = 0.
5. A simple LC circuit is made up of an inductor, a capacitor and an external source voltage. If the external source
voltage provides a constant input voltage V0 and if the capacitance C of the capacitor and the inductance L of the
inductor are such that LC = 1 (ohm farad) and V0 C = 1
(volt farad), find the current flowing in the circuit, given
that at t = 0 there is no current and the capacitor is not
charged.
4.4
4.4.1
Spring-mass systems
A simple spring-mass system
Figure 4.5
Hookes law
The spring is said to be in its natural condition when it does
not exert any force on the body. For convenience, we assume
that the spring is in its natural condition when the body is
at the fixed reference position, that is, when the downward
displacement y of the body is zero.
Let the vertical length of the spring in its natural condition
be `natural . If the vertical length of the spring is changed to `,
the spring exerts a force (which we call the spring force) on the
body. According to Hookes law, the magnitude of the spring
force is proportional to |` `natural |. What is the direction of
the spring force? For the spring-mass system in Figure 4.5,
when ` > `natural (the spring extends in length), that is, when
the body is below the fixed reference position (y > 0), the
110
dy
dt
111
where k > 0 is the damping coecient. (If the spring-mass system is placed in vacuum, k = 0.) Note when the body is moving
downward, dy/dt > 0 and Fdamping < 0, that is, the damping
force is in the upward direction. When the body moves upward, dy/dt < 0 and Fdamping > 0, that is, the damping force
is acting downward. As we will see, the presence of damping
force helps to kill the motion of the body.
Another force acting on the body is the gravitational force.
This always acts downward. The downward gravitational force
acting on the body, Fgravity , is given by
Fgravity = mg
where g is the acceleration due to gravity (g ' 9.81 meter per
second per second around planet earth) and m is the mass of
the body.
We assume that there are no other types of forces acting on
the body. Thus, the total downward force acting on the body
is given by
Fspring + Fdamping + Fgravity = y k
dy
+ mg.
dt
2 +
+ y = g.
dt
m dt
m
y k
d2 y
+
+ y=g
2
dt
m dt
m
for the spring-mass system in Figure 4.5.
We first solve the corresponding homogeneous ODE, that
is,
d2 Y
k dY
+ Y = 0.
+
2
dt
m dt
m
It is a homogeneous 2nd order linear ODE with constant coefficients.
Let us use
Y = et , Y 0 = et , Y 00 = 2 et .
Substituting into the homogeneous ODE, we find that
k
+
=0
m pm
k k2 4m
.
=
2m
2 +
113
mg
+ Aeit /m + Beit /m
y(t) =
r
r
mg
=
+ C cos(
t) + D sin(
t).
m
m
In this case, y does not tend to any fixed value as t .
Because of the real sine and cosine terms in time t, the body
keeps on oscillating forever if there is no damping to the motion.
If k2 < 4m, we find that the displacement may be rewritten
as
p
|k 2 4m| t
mg
y(t) =
+ Cekt/(2m) cos(
)
2m
p
|k 2 4m| t
).
+Dekt/(2m) sin(
2m
mg
(k+ k2 4m)t/(2m)
(k k2 4m)t/(2m)
y(t) =
+ Be
+ Ae
4.4.2
Figure 4.6
115
d2 y1
dt2
(1)
d2 y2
dt2
(2)
1
1
d2 Y
+
)Y + 1 y1 = 2
m2 m1
m1
dt
(3)
where Y = y2 y1 .
If we dierentiate (3) twice with respect to t, we obtain
2 (
1
1 d2 Y
d2 y1
d4 Y
+
) 2 + 1
=
m2 m1 dt
m1 dt2
dt4
1
1 d2 Y
d4 Y
+
) 2 + 1 ( 1 y1 + 2 Y ) = 4 .
m2 m1 dt
m1 m1
m1
dt
+
)+ 1
m2 m1
m1
1 2 1
1
(
+
) 1 22 .
m1 m2 m1
m1
= 2 (
=
4.5
Exercise VII
4.6
Solutions to Exercise VI
d2 I
dI
+ 2 + 13I = 4 cos(2t).
dt
dt
We are given I(0) = 0. From the integro-dierential equation, we obtain I 0 (0) = 0. Thus, the nonhomogeneous 2nd
order linear ODE is to be solved subject to I(0) = I 0 (0) =
0. The corresponding homogeneous ODE is
6
dJ
d2 J
+ 2 + 13J = 0.
dt
dt
119
16
4
sin(2t) +
cos(2t)
75
25
+e3t (A cos(2t) + B sin(2t)).
I(t) =
I(2) =
d
d2 I
dI
+ 2 + 13I = [V (t)].
dt
dt
dt
t for 0 t < /4
V (t) =
0 for t /4
120
and hence
d
[V (t)] =
dt
1 for 0 t < /4
0 for t /4
dI
d2 I
+ 2 + 13I = 1.
dt
dt
1
1
e3t cos(2t) e3t sin(2t) for 0 t < .
13 13
26
4
dI
d2 I
+ 2 + 13I = 0.
dt
dt
I( ) =
4
=
1
1
3
The value of I 0 (/4) must be obtained from the integrodierential equation with V (t) = 0 (that is, the integrodierential equation which is valid for t /4). We find
121
that
6I( ) + I 0 ( ) + 13
4
4
/4
I( )d = 0.
=
52
338
169
and hence
1
1
I 0 ( ) = e3/4 .
4
2
4
For t /4 , we have to solve
6
dI
d2 I
+ 2 + 13I = 0
dt
dt
subject to
1
1
3
1
I( ) =
e3/4 and I 0 ( ) = e3/4 .
4
13 26
4
2
4
We obtain
I(t) =
e3/4
(12 8e3/4 + 13)e3t cos(2t)
104
e3/4
3. Refer to page 105 (and a few pages thereafter) for equations for I1 , I2 amd I3 . We start with
2
d2 I3 dI3
+
+ 2I3 = 9.
dt2
dt
122
I1 (t) = 2
I( )d = 1
+
dt
0
V0
= 1)
(after using LC =
L
d2 I
+ I(t) = 0 .
dt2
The 2nd order ODE can be solve to give the general solution
I(t) = A cos(t) + B sin(t).
We are told I(0) = 0. From the integro-dierential equation, I 0 (0) = 1. Using I(0) = 0 and I 0 (0) = 1, we obtain A = 0 and N = 1, that is, the required solution is
I(t) = sin(t).
4.7
1
sin(3t)).
3
d
1
(1 et (cos(3t) + sin(3t)))
dt
3
10 t
e sin(3t)
3
1
sin(3))
3
10 1
sin(3)
3 e
00
y (t) + y(t) = 10 cos(t) (after using
= 1).
m
Fspring + Fmotor = m
= 13 and
= 6).
(after using
m
m
The general solution of the corresponding homogeneous
ODE Y 00 (t)+6Y 0 (t)+13Y (t) = 0 is Y (t) = e3t (A cos(2t)+
B sin(2t)). To find a particular solution of the nonhomogeneous ODE, we let y(t) = C cos(2t) + D sin(2t) and
work out C and D. We obtain C = 4/25 and D =
16/75. Thus, the displacement is given generally by
Fspring + Fdamping + Fmotor = m
16
4
cos(2t)
sin(2t)
25
75
+e3t (A cos(2t) + B sin(2t))
y(t) =
4. Refer to the analysis on page 116 (and a few pages thereafter). Now y1 and y2 denote the displacement of body
1 and 2 respectively. We first solve for Y = y2 y1 . The
ODE to solve is Y 0000 + 14Y 00 + 24Y = 0. If we try Y =et ,
we
obtain 2 = 2 or 12. It follows that = 2i,
2 3i. This gives the general solution
Y 00 (t) + 8Y
2
2
C cos(2 3t) D sin(2 3t).
3
3
It follows that
y2 = Y + y1
1
1
+ C cos(2 3t) + D sin(2 3t).
3
3
3
cos( 2t) +
5
6
cos( 2t)
5
127
2
cos(2 3t)
5
1
cos(2 3t).
5
Chapter 5
Series solutions
5.1
Preamble
5.2
n=0
cn (x )n = c0 + c1 (x ) + c2 (x )2 +
128
cm+1 (x )m+1
<1
lim
m cm (x )m
cm
cm
.
R = lim
|x | < lim
m cm+1
m cm+1
Power series may be used to represent functions. If a function F (x) can be represented by a power series of x centered
about , that is, if we can write
X
cm (x )m for R < x < + R
F (x) =
m=0
then we can dierentiate the power series term by term to obtain a power series representation for F 0 (x) as follows.
F 0 (x) =
m=0
cm
d
(x )m
dx
d
d
d
(1) + c1 (x ) + c2 (x )2
dx
dx
dx
d
+c3 (x )3 +
dx
= c1 + 2c2 (x ) + 3c3 (x )2 +
X
=
kck (x )k1 (note that k starts from 1)
= c0
k=1
X
=
(n + 1)cn+1 (x )n (if we let k = n + 1)
n=0
F (x) =
m=0
then
F 00 (x) =
(m + 1)cm+1
m=0
k=1
(k + 1)kck+1 (x )k1
d
(x )m
dx
(n + 2)(n + 1)cn+2 (x )n
n=0
X
F (n) ()
n=0
n!
(x )n = F () + F 0 ()(x )
+
F 00 ()
(x )2 + .
2!
X
F (n) ()
n=0
1
n!
130
5.3
(1)
X
f (m) ()
(x )m
m!
m=0
X
g (m) ()
g(x) =
(x )m .
m!
m=0
(2)
n=0
cn (x )n .
(3)
X
y (x) =
(n + 1)cn+1 (x )n .
0
(4)
n=0
X
(n + 2)(n + 1)cn+2 (x )n .
n=0
2
131
(5)
(iv) Substitute (2), (3), (4) and (5) into the ODE in (1) to
obtain
X
(n + 2)(n + 1)cn+2 (x )n
n=0
+
+
X
f (m) ()
(n + 1)cn+1 (x )n
(x )m
m!
m=0
n=0
X
X
g (m) ()
cn (x )n = 0.
(x )m
m!
m=0
n=0
(6)
X
p=0
bp (x )p = 0.
(7)
X
X
f (m) ()
(n + 1)cn+1 (x )n
(x )m
m!
m=0
n=0
=
=
(n + 1)cn+1
n=0
p
X
X
X
f (m) ()
(x )m+n
m!
m=0
(n + 1)cn+1
p=0 n=0
f (pn) ()
(x )p
(p n)!
(8)
X
X
g (m) ()
cn (x )n
(x )m
m!
m=0
n=0
p
X
X
p=0 n=0
cn
g (pn) ()
(x )p .
(p n)!
(9)
replace the series on the second and third lines using (8)
and (9) respectively, we obtain
bp = (p + 2)(p + 1)cp+2
p
X
f (pn) ()
g (pn) ()
+ cn
}
+
{(n + 1)cn+1
(p n)!
(p n)!
n=0
for p = 0, 1, 2, .
(10)
for p = 0, 1, 2, .
(11)
133
cn xn .
n=0
It follows that
y0 =
y00 =
(n + 1)cn+1 xn
n=0
(n + 2)(n + 1)cn+2 xn .
n=0
X
{(p + 2)(p + 1)cp+2 2(p + 1)cp+1 }xp = 0.
p=0
c3 =
c4
c5
134
2n1
c1 for n = 2, 3, 4, .
n!
We can easily check whether the deduced formula for cn is correct as follows.
2n1
c1
n!
2p+11
2p
cp+1 =
c1 =
c1
(p + 1)!
(p + 1)!
2p+21
cp+2 =
c1
(p + 2)!
2
2p
=
c1
(p + 2) (p + 1)!
2
=
cp+1 (verified).
(p + 2)
cn =
cn xn
n=0
= c0 +
X
2n1
n=1
n!
c1 xn
c1 X (2x)n
= c0 +
.
2 n=1 n!
135
c1 X (2x)n
y(x) = c0 +
2 n=1 n!
c1 c1
c1 X (2x)n
= c0 + ( + ) +
2
2
2 n=1 n!
c1 X (2x)n
c1
c1
c1
= (c0 ) + e2x
= (c0 ) +
2
2
n!
2
2
n=0
X
xn
n=0
n!
e2x =
X
(2x)n
n=0
n!
136
f 0 (x) = x2 f 0 (1) = 1
X
1
=
(1)m (x 1)m .
x m=0
Whether the Taylor series of f (x) = x1 about x = 1 converges or not depends on the value of x. For example, if x = 2,
the series diverges as the n-th term in the series does not tend to
0 as n increases. The range of x for which the series converges
can be determined by calculating the radius of convergence of
the series.
Since the Taylor series of x1 about x = 1 has non-zero
coecients for all positive powers of (x 1), its radius of convergence is given by
(1)m
= 1.
R = lim
m (1)m+1
X
1
2 =
(m + 1)(1)m (x 1)m .
x
m=0
137
X
X
n d
n
(1)
n(1)n (x 1)n1
(x 1) =
dx
n=0
n=1
X
1
2 =
(m + 1)(1)m (x 1)m
x
m=0
(if we let n = m + 1)
n=0
cn (x 1)n
then (11) in step (v) above of the power series method (page
133) gives
(p + 2)(p + 1)cp+2
p
X
=
{(n + 1)cn+1 (p n + 1)cn }(1)pn
n=0
for p = 0, 1, 2, .
For p = 0, we obtain
2c2 = c0 c1 .
Subsequent values of p give
6c3 = 2(c1 c0 c2 ) c3 = c2
X
1
(1)p (x 1)p .
y(x) = c0 + c1 (x 1) + (c0 c1 )
2
p=2
X
1
(1)p (x 1)p
+ (c0 c1 )
2
p=0
which simplifies to
X
1
1
y(x) = (c0 + c1 )x + (c0 c1 )
(1)p (x 1)p .
2
2
p=0
X
B
1
(1)p (x 1)p = ).
(since
x
x
p=0
n=0
cn (x 1)n
X
=
(n + 1)cn+1 (x 1)n
n=0
y 00 =
n=0
X
(n + 1)(n + 2)cn+2 (x 1)n+2
n=0
X
+2
(n + 1)(n + 2)cn+2 (x 1)n+1
n=0
X
+
(n + 1)(n + 2)cn+2 (x 1)n
+
+
n=0
(n + 1)cn+1 (x 1)n+1
n=0
(n + 1)cn+1 (x 1)
n=0
= 0
140
n=0
cn (x 1)n
X
X
(p 1)pcp (x 1)p + 2
p(p + 1)cp+1 (x 1)p
p=2
p=1
X
p=0
X
p=1
pcp (x 1)p
X
X
p
+
(p + 1)cp+1 (x 1)
cp (x 1)p = 0
p=0
p=0
to give
2c2 + c1 c0 + (6c2 + 6c3 )(x 1)
X
(p + 1){(p + 2)cp+2 + (2p + 1)cp+1
+
p=2
= 0.
and
(p + 2)cp+2 + (2p + 1)cp+1 + (p 1)cp = 0 for p = 2, 3, ,
that is,
1
c2 = (c0 c1 ), c3 = c2 , c4 = c2 , c5 = c2 and so on.
2
From the above, we deduce that
1
cp = (1)p (c0 c1 ) for p = 2, 3, 4,
2
as before.
141
cn xn
n=0
X
(n + 1)cn+1 xn
y (x) =
0
y 00 (x) =
n=0
(n + 2)(n + 1)cn+2 xn .
n=0
X
{(p + 2)(p + 1)cp+2 + 4cp }xp = 0
p=0
which gives
(p + 2)(p + 1)cp+2 = 4cp for p = 0, 1, 2, .
For p = 0 and p = 1, we obtain
4
2c2 = 4c0 c2 = c0
2
4
c1
3 2c3 = 4c1 c3 =
32
Subsequent even values of p yields
42
c0
4!
43
= 4c4 c6 = c0
6!
4
4
= 4c6 c8 = c0
8!
45
= 4c8 c10 = c0
10!
..
.
4 3c4 = 4c2 c4 =
6 5c6
8 7c8
10 9c10
142
5 4c5 = 4c3 c5 =
7 6c7
9 8c9
11 10c11
(1)k 4k
c0 for k = 0, 1, 2,
(2k)!
and
c2k+1 =
(1)k 4k
c1 for k = 0, 1, 2, .
(2k + 1)!
(1)k 4k
for k = 0, 1, 2,
(2k)!
and
c2k+1 =
2(1)k 4k
for k = 0, 1, 2, .
(2k + 1)!
cn xn +
n=0,2,4,
X
c2k x2k
k=0
cn xn
n=1,3,5,
143
X
k=0
c2k+1 x2k+1 .
X
(1)k 4k
k=0
(2k)!
x2k +
X
2(1)k 4k
k=0
(2k + 1)!
x2k+1 .
X
(1)k 22k
k=0
(2k)!
x2k +
k=0
X
(1)k (2x)2k
k=0
X
(1)k 22k+1
(2k)!
(2k + 1)!
x2k+1
X
(1)k (2x)2k+1
k=0
(2k + 1)!
X
(1)k x2k+1
k=0
X
k=0
(2k + 1)!
sin(2x) =
(1)k x2k
cos(2x) =
(2k)!
X
(1)k (2x)2k+1
k=0
X
k=0
(2k + 1)!
(1)k (2x)2k
.
(2k)!
n=0
144
cn xn .
p
X
(n + 1)cn+1
n=0
for p = 0, 1, 2, .
1
cp
(p n)!
6c3 = c1 2c2 c1 = 0 c3 = 0
1
5
5
12c4 = c1 2c2 3c3 c2 = c4 =
2
2
24
Thus, the required approximation is given by
y(x) ' 1 + x x2 +
5 4
x .
24
y0000 (0) = e0 y 0 (0) 2e0 y00 (0) e0 y 000 (0) y00 (0) = 5.
5.4
Exercise VIII
y 00 25y = 0
(b)
(c)
y 00 + sin(2x)y 0 + cos(2x)y = 0
5.5
Frobenius method
p(x)
x
q(x)
(x )2
(12)
(13)
to obtain a power series solution centered about . Depending on p(x) and q(x), it may just end up giving us the trivial
solution y = 0.
There is a more general approach for solving (13) to obtain
a solution in terms of a series containing powers of (x )
(not necessarily non-negative integer powers). According to
the Frobenius method, we can look for a solution of (13) in the
form of a series given by
y(x) = (x )
n=0
dn (x )n
(14)
147
n=0
dn (x )n+
X
(n + )dn (x )n+1
y 0 (x) =
y 00 (x) =
(15)
n=0
n=0
X
(n + )(n + 1)dn (x )n+
n=0
X
p(m) () X
+
(n + )dn (x )m+n+
m!
m=0
n=0
X
q (m) () X
+
dn (x )m+n+ = 0
m!
m=0
n=0
X
{(k + )(k + 1)dk
k=0
k
X
(n + )dn
n=0
k
X
n=0
dn
p(kn) ()
(k n)!
q (kn) ()
}(x )k+ = 0.
(k n)!
(16)
148
k
X
p(kn) ()
(n + )dn
(k n)!
n=0
k
X
n=0
dn
q (kn) ()
(k n)!
= 0 for k = 0, 1, 2, (17)
In (17), k = 0 yields
[( 1) + p() + q()]d0 = 0.
(18)
(19)
k1
X
n=0
dn
{(n + )p(kn) () + q (kn) ()}
(k n)!
for k = 1, 2, .
(20)
dk1 if = 1
dk =
dk2 if = 2
then the solutions corresponding to = 1 and = 2 are
respectively y1 (x) and y2 (x) given by
1
y1 (x) = (x )
y2 (x) = (x )2
n=0
X
n=0
dn1 (x )n
dn2 (x )n .
(21)
(22)
n=0
dn2 (x )n+2 1
n=0
dn1 (x )n
150
(23)
or
dn2 (x )n
y2 (x)
n=0
.
=
P
y1 (x)
dn1 (x )n+1 2
(24)
n=0
n=0
gn (x )n
(25)
gn (n = 0, 1, 2, ) by substituting (25) into (13) and equating the coecients of the resulting series to zero. The task of
determining gn (n = 0, 1, 2, ) for (13) in its general form
will not be described here. Instead, it will be illustrated below
through some specific examples.
Examples
1. Use the Frobenius method to find the general solution of
x2 y 00 2xy0 + y = 0.
Comparing the given ODE to (13) (page 147), we find that
= 0, p(x) = 2 and q(x) = 1. Thus, if we take y(x) to be of
the series form
y(x) = x
dn xn
n=0
Similarly, for =
tion
3
2
y1 (x) = x 2 + 2 5 .
The two particular solutions given above are linearly independent. Hence, the required general solution is given by
3
y(x) = Ax 2 + 2
+ Bx 2 2
dn xn .
n=0
X
X
(n + )(n + 1)dn xn+
(n + )dn xn+
n=0
n=0
+2
dn xn++1 +
n=0
dn xn+ = 0
n=0
X
+
{2(k + )(k + 1)dk (k + )dk
k=1
+2dk1 + dk }xk+ = 0.
y(x) = x
(1 +
X
k=1
(1)k 2k xk
).
k!(2k 1)(2k 3) 5 3
d1 =
d2
dk
X
k=1
(1)k 2k xk
).
k!(2k + 1)(2k 1) 5 3
154
y(x) = Ax
(1 +
X
k=1
+Bx(1 +
X
k=1
(1)k 2k xk
)
k!(2k 1)(2k 3) 5 3
(1)k 2k xk
)
k!(2k + 1)(2k 1) 5 3
x3 0
1
y = 0.
y +
x2
(x 2)2
n=0
dn (x 2)n .
X
(n + )(n + 1)dn (x 2)n+
n=0
= 0
(n + )dn (x 2)n++1
n=0
n+
(n + )dn (x 2)
n=0
155
n=0
dn (x 2)n+
X
+
{(n + )(n + 1)dn
n=1
= 0.
( 1)2 = 0 = 1.
With = 1, the constants d1 , d2 , can be determined
from
[(n + 1)n (n + 1) + 1]dn = ndn1 for n = 1, 2, .
Taking d0 = 1, we find that
d1 = 1
2d2 = d1 d2 =
1
2
3d3 = d2 d3 =
dn
1
32
..
.
(1)n
=
for n = 0, 1, 2, .
n!
From the above analysis, we manage to obtain one particular solution, that is,
y1 (x) =
X
(1)n (x 2)n+1
n!
n=0
n=0
gn (x 2)n
which gives
y20 = y10 (x) ln(x 2) +
y200 = y100 (x) ln(x 2) +
+
n=1
y1 (x) X
+
gn (n + 1)(x 2)n
x2
n=0
2y10 (x)
x2
y1 (x)
(x 2)2
gn (n + 1)n(x 2)n1 .
2)2 y100
X
(1)n (n + 1)(x 2)n+1
n=0
= 0
n=1
X
n=0
X
n=0
n!
gn (n + 1)n(x 2)n+1 +
gn (n + 1)(x 2)n+2
gn (n + 1)(x 2)n+1 +
X
(1)n (x 2)n+1
n!
n=0
(1)n (x 2)n+2
n!
n=0
X
(1)n (x 2)n+1
n=0
X
n=0
n!
gn (x 2)n+1
X
(1)n
+ n2 gn + ngn1 }(x 2)n+1 = 0.
{
(n 1)!
n=1
It follows that
ngn =
(1)n
gn1 for n = 1, 2, .
n!
157
X
(1)n (x 2)n+1
y1 (x) =
n!
n=0
y2 (x) = ln(x 2)
X
(1)n (x 2)n+1
n!
n=0
3
11
+(x 2) (x 2) (x 2)2 + (x 2)3
4
36
25
137
(x 2)4 +
(x 2)5
288
7200
49
(x 2)6 + .
14 400
n=0
158
dn xn .
X
X
(n + )(n + 1)dn xn+ + 4
(n + )dn xn+
4
n=0
= 0
n=0
n=0
dn xn+
dn xn++1
n=0
X
{[4n2 + 8n + 42 1]dn dn1 }xn+ = 0.
n=1
1
n(n 1)dn = dn1 for n = 1, 2, .
4
If we let n = 1, we find that d0 = 0. Thus, d0 cannot be
arbitrary. Noticing that 4n(n 1) 6= 0 for n = 2, 3, , we
may regard d1 as an arbitrary constant. Let us take d1 = 1. It
follows that
1
1
2d2 =
d2 =
4
42
1
1
3 2d3 =
d2 d3 = 2
4
4 322
1
1
4 3d4 =
d3 d4 = 3
4
4 43322
..
.
1
for k = 1, 2, .
dk =
k1
4 k[(k 1)!]2
159
X
k=1
1
4k1 k[(k
1)!]2
xk1/2
1
1 5/2
1 7/2
= x1/2 + x3/2 +
x +
x +
8
192
9216
Now for = 1/2, we find that
1
n(n + 1)dn = dn1 for n = 1, 2, .
4
If we take d0 = 1, we obtain
d1 =
1
322
1
=
3
4 43322
..
.
1
=
for k = 0, 1, 2, .
k
4 (k + 1)[k!]2
d2 =
d3
dk
1
42
42
gn xn .
n=0
X
{
k=1
8(k 1/2)
+ 4k(k 1)gk gk1 }xk1/2 = 0.
4k1 k[(k 1)!]2
160
8(k 1/2)
+ gk1 for k = 1, 2, .
1)!]2
4k1 k[(k
X
k=1
"
1
4k1 k[(k
+B ln(x)
X
k=1
1)!]2
xk1/2
1
xk1/2 + 4x1/2
4k1 k[(k 1)!]2
3
7 5/2
35
x3/2
x
x7/2
16
576
110 592
5.6
Exercise IX
For each of the following ODEs, use the Frobenius method
to find two linearly independent solutions.
1. 6x2 y 00 x(1 + x2 )y 0 3y = 0
2. 4y 00 + 19(x 1)1 y0 (5 x)(x 1)2 y = 0
3. x2 y 00 + xy0 + (x2 9)y = 0
161
5.7
cn xn
n=0
and hence
y0 =
y 00 =
X
(n + 1)cn+1 xn
n=0
(n + 2)(n + 1)cn+2 xn .
n=0
X
{(n + 2)(n + 1)cn+2 25cn }xn = 0.
n=0
It follows that
c2 =
c3
c4
c5
162
We deduce that
c2k =
52k
52k
c0 and c2k+1 =
c1
(2k)!
(2k + 1)!
for k = 0, 1, 2, .
X
X
52k 2k
52k
x + c1
x2k+1
y = c0
(2k)!
(2k + 1)!
k=0
k=0
where c0 and c1 are arbitrary constants. Since the coecients of the ODE are constant functions, their Taylor series about x = 0 should converge for all values of x. Thus,
the above series solution converges for < x < .
(b) From the conditions y(0) = 2 and y 0 (0) = 5, we find
that y(0) = c0 = 2 and y 0 (0) = c1 = 5. If we substitute
the series solution into the given ODE, we obtain
(n + 2)(n + 1)cn+2 = 5(n + 1)cn+1 + 6cn
for n = 0, 1, 2, .
It follows that
52 + 6 2
1 + 62
=
2!
2!
2
5(1 + 6 ) 6(5)
1 63
=
=
3!
3!
3
2
5(1 6 ) + 6(1 + 6 )
1 + 64
=
=
4!
4!
..
.
1 + (1)n 6n
=
for n = 0, 1, 2, .
n!
c2 =
c3
c4
cn
X
1 + (1)n 6n
n=0
163
n!
xn .
(n + 2)(n + 1)cn+2 xn
n=0
n
(n + 1)cn+1 x + 3
n=0
cn xn = 0
n=0
X
{3cn 5(n + 1)cn+1 + 5ncn
+
n=2
= 0.
for n = 2, 3, .
164
= cn3 + 1 + (n 2) + 1 + n + n
= cn3 + 1 + (n 1) + n + n
= cn4 + 1 + (n 3) + 1 + (n 1) + n + n
= cn4 + 1 + (n 2) + (n 1) + n + n
..
.
= c0 + 1 + 2 + 3 + + n + n
1
=
n(n + 1) + n.
2
The required series solution is
X
1
y=
( n(n + 1) + n)xn .
2
n=1
cn xn .
n=0
(a) From the given conditions, c0 = 1 and c1 = 0. Proceeding as explained on page 133, we find that
2 1c2
3 2c3
c4
=
=
c0 sin(0) = 0
c0 cos(0) c1 sin(0) = 1
1
c3 =
3!
1
1
= 0, c5 =
and c6 =
.
5!
180
165
Thus,
1
1 5
1 6
y(x) ' 1 x3 +
x +
x .
6
120
180
(b) Here c0 = c1 = 0 and
(n + 2)(n + 1)cn+2 = 4(n + 1)cn+1 13cn for n = 0, 1, 2, .
Form the above, we can work out c2 = 9/2 and c3 =
49/6. Thus,
9
49
y(x) ' 1 + x x2 x3 .
2
6
(c) Here c0 = 0 and c1 = 1. Proceeding as explained on
page 133, we find that
2 1c2
3 2c3
c4
=
=
(sin(0) + 0 cos(0)) = 0
(1 2 cos(0) + cos(0)) = 3
1
c3 =
2!
41
923
= 0, c5 = , c7 =
.
5!
7!
Thus,
y(x) ' x
1 3 41 5 923 7
x + x
x .
2!
5!
7!
cn xn .
n=0
for p = 2, 3, .
166
It follows that
4 3c4 = (4) 9c2 c4 = 126
462
c5 = 0, c6 =
,
5
c7 = 0, c8 = 0
..
.
cn = 0 for n = 9, 10, 11, .
Thus, the required exact solution is
y(x) = 2 42x2 + 126x4
462 6
x .
5
cn xn .
n=0
6c3 + 54c1 = 0 c3 = 18
for p = 2, 3, .
5.8
198 5 858 7
x
x .
5
35
Solutions to Exercise IX
n=0
167
dn xn+ .
(62 + 5 4)d1 = 0
for k = 2, 3, .
3
3
11
, d4 =
, d6 =
,
92
3680
691840
y(x) = Ax3/2 (1 +
n=0
dn (x 1)n+ .
1
1
1
, d2 =
, d3 =
21
1050
91350
1
1
1
, d2 =
, d3 =
.
13
234
3510
y(x) = Ax1/4 (1
dn xn+ .
n=0
1 8
1 10
1
x +
x
x12 + )
16
640
46080
1
1 7
1
= x3 x5 +
x
x9 +
16
640
46080
If we attempt to find another particular solution by using
= 3, we find that it is a merely a multiple of y1 above,
that we cannot obtain two linearly independent solutions
from = 3 and = 3. To seek another particular solution y2 which is linearly independent of y1 , let
y1 (x) = x3 (x6
y2 = y1 ln(x) +
gn xn3 .
n=0
X
2
{n(n 6)gn + gn2 }xn3 = 0.
5g1 x +
2x(3x2
n=2
g3
8g4 g2
6 + g4
0 g5 = 0
5g5 g3
7g7 g5
0 g4 = 6
g2 = 48 g0 = 384
=
16g8 + g6
27g9 + g7
40g10 + g8
0 g7 = 0
5
8
0 g9 = 0
7
320
..
.
y2 = (x3
171
y = A(x3
y2 = (x3
dn xn+ .
n=0
for n = 1, 2, 3, .
172
From the above, we obtain only one value for , that is,
= 1/3. We find that the coecient (9[n ][n
1] + 15[n ] + 1) is not 0 for = 1/3 and n = 1, 2,
. Thus, we can assign a non-zero arbitrary value to d0 .
Taking = 1/3 and d0 = 1, we find that
1
d1 = 2
3
1
d2 =
2
(3 )2 22
1
d3 = 2 3
(3 ) (3 2)(3 2)
1
d4 =
2
4
(3 ) (4 3 2)(4 3 2)
..
.
(1)n
dn =
for n = 0, 1, 2,
32n (n!)2
A particular solution of the ODE is
X
(1)n n1/3
y1 (x) =
x
.
32n (n!)2
n=0
To find another particular solution, let
X
X
(1)n n1/3
1/3
x
+x
gn xn .
y2 (x) = ln(x)
2n (n!)2
3
n=0
n=0
X
(1)n n1/3
y(x) = A
x
32n (n!)2
n=0
+B{ln(x)
X
(1)n n1/3
x
32n (n!)2
n=0
2
1 2
+x1/3 ( x
x + )}.
9
108
173
dn xn+ .
n=0
for n = 1, 2, 3, .
1
1
1 2
x+
x +
x3 + ).
32
3072
589 824
The two dierent values of give linearly dependent solutions. To obtain another particular solution which is not
a multiple of y1 , let
y2 (x) = y1 ln(x) + x1/4
gn xn .
n=0
y(x) = Ax3/4 (1 +
n=0
dn (x 1)n+ .
174
y2 (x) = y1 ln(x) + x
gn xn .
n=0
Chapter 6
Numerical methods
6.1
Preamble
6.2
177
178
As shown graphically in Figure 6.1, the Eulers method approximates the actual solution curve using a set of straight
lines over the subintervals x0 x x1 , x1 x x2 , ,
xk1 x xk , , xN2 x xN 1 and xN 1 x xN .
The straight line over the subinterval xk1 x xk passes
through the point (xk1 , yk1 ) and its gradient is given by
F (xk1 , yk1 ) (from the ODE y 0 = F (x, y)). Note that the
straight line over the subinterval xk1 x xk is parallel
to the tangent to the solution curve at x = xk1 .
Figure 6.1
Example
Use the Eulers method to solve numerically the ODE
y 0 (x) = 2xy subject to y(0) = 1 over the interval 0
x 1, in order to find an approximate value for y(1).
Note that this ODE can be solved exactly. It is a 1st order
2
separable ODE. The exact solution is y = ex . There is really
no need to use the Eulers method to solve this problem numerically. Nevertheless, for the purpose of illustration, we will
179
use the Eulers method here to solve the ODE and examine the
accuracy of the numerical results obtained through comparison
2
with the exact solution y = ex .
We divide up the interval 0 x 1 into N smaller subintervals of equal size h = (10)/N = 1/N. Thus, x0 = 0, x1 = h,
x2 = 2h, , xk = kh, , xN1 = (N 1)h and xN = N h =
1. In this case, xk xk1 = h for all k = 1, 2, , N. The required approximate value for y(1) is given by yN . The Eulers
method is then given by the formula
yk ' yk1 + 2 h xk1 yk1
= yk1 + 2 h 2 (k 1) yk1
for k = 1, 2, , N.
Table 6.1
A
1
2
3
4
We set up the spreadsheet as outlined in the steps below.
1. In row 1 of column A (that is, in the cell A1), we enter
the positive integer N (the number of subintervals) (for
example, 10).
2. In the cell B1, we insert the formula =1.0/A1.
3. In C1, we set the initial value of k to 1.
4. In D1, we enter the value 1 for the condition y(0) = 1.
5. In E1, we insert the formula for the Eulers method, that
is,
=D1+2.0*B1*B1*(C11.0)*D1.
6. In A2, we insert the formula =A1, since the value of N
does not change throughout the calculations.
7. In B2, we insert the formula =B1.
8. In C2, we insert the formula =C1+1, since k increases by
1 in the next step of the calculations.
9. In D2, we insert the formula =E1.
181
Table 6.2
1
2
3
4
5
6
7
8
9
10
Guide
A
10
10
10
10
10
10
10
10
10
10
N
B
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
h
C
1
2
3
4
5
6
7
8
9
10
k
182
D
1
1
1.02
1.0608
1.1244
1.2144
1.3358
1.4961
1.7056
1.9785
yk1
E
1
1.02
1.0608
1.1244
1.2144
1.3358
1.4961
1.7056
1.9785
2.3346
yk
Table 6.3
N
10
50
100
500
Approximate y(1)
2.3346
2.6309
2.6738
2.7093
% Error
14
3.2
1.6
0.3
6.3
0
0
yk0 ' yk1
+ (xk xk1 ) F (xk1 , yk1 , yk1
).
1
2
3
4
5
Guide
A
5
5
5
5
5
N
B
0.2
0.2
0.2
0.2
0.2
h
C
1
2
3
4
5
k
D
0
0.2
0.32
0.388
0.424
yk1
E
1
0.6
0.34
0.18
0.0904
0
yk1
F
0.2
0.32
0.388
0.424
0.44208
yk
G
0.6
0.34
0.18
0.0904
0.04944
yk0
6.4
6.4.1
Oscillation of a pendulum
Nonlinear ODE
p
where k = g/L and g is the acceleration due to gravity (g '
9.81 meter per second per second). The ODE above comes from
Newtons law of motion. We will not go into the details of its
derivation here.
Figure 6.2
The ODE above is not a linear one. It is a second order
nonlinear ODE which is dicult (if not impossible) to solve
exactly.
6.4.2
188
6.4.3
Nonlinear
0.9836
0.9340
0.8522
0.7404
0.6016
190
Linear
0.9801
0.9211
0.8253
0.6967
0.5403
6.5
Numerical prudence
6.6
Exercise X
The values of (0) and 0 (0) are known from the given
conditions at t = 0 and those of 00 (0), 000 (0) and 0000 (0)
can be found from the ODE which governs the motion of
the swinging pendulum in Problem 2 above. (Dierentiate the ODE once and twice to obtain expressions for
000 (t) and 0000 (t).) Use the above to obtain a small time
approximate solution for the swinging pendulum in Problem 2 and compute the values of approximately at at
192
t = 0.20, 0.40, 0.60, 0.80 and 1.00. Are the values in good
agreement with those obtained in Problem 2?
4. Extend the Eulers method to devise a numerical procedure for solving the 3rd order ODE y000 = F (x, y, y 0 , y 00 )
subject to y(a) = c, y 0 (a) = d and y00 (a) = s, where a, b,
c, d and s are given numbers.
5. Second order Runge-Kutta method. As mentioned on page
179, in the Eulers method for solving the 1st order ODE
y 0 (x) = F (x, y) subject to y(a) = c, the solution curve
is approximated using a set of straight lines over the
subintervals a = x0 x x1 , x1 x x2 , ,
xk1 x xk , , xN2 x xN1 and xN 1
x xN , and the straight line over the k-th subinterval
xk1 x xk has a gradient given by F (xk1 , yk1 ).
(Note that y0 = c = y(x0 ), y1 = y(x1 ), y2 = y(x2 ) and
so on.) In the second order Runge-Kutta method, the
gradient of the straight line over xk1 x xk is modified to take the value of F (x, y(x)) at x = 12 (xk1 + xk )
(the midpoint of the k-th subinterval). From the earlier
approximation (in the Eulers method), that is,
y(x) ' yk1 + (x xk1 )F (xk1 , yk1 )
for xk1 x xk ,
we obtain
1
1
y( (xk1 + xk )) ' yk1 + (xk xk1 )F (xk1 , yk1 ).
2
2
Thus, if we define
1
(xk1 + xk )
2
1
= yk1 + (xk xk1 )F (xk1 , yk1 )
2
xk =
yk
mula
yk ' yk1 + (xk xk1 )F (xk , yk )
for k = 1, 2, , N.
Repeat Problem 1 above using the second order RungeKutta method. Do you obtain more accurate numerical
results?
6. Extend the second order Runge-Kutta method in Problem 5 to solve the 2nd order ODE y00 = F (x, y, y0 ) subject
to y(a) = c and y0 (a) = d. Apply the extended method
to solve the problem in the example on page 184, that is,
solve the ODE y00 = y 2y 0 + 12 x subject to y(0) = 0 and
y 0 (0) = 1, over the interval 0 x 1, in order to compute y(1) approximately. Do you obtain more accurate
numerical results?
6.7
Solutions to Exercise X
x
0.20
0.40
0.60
0.80
1.00
N = 10
0.5005
0.5070
0.5286
0.5782
0.6834
N = 20
0.5009
0.5089
0.5334
0.5896
0.7128
Exact
0. 501 3
0. 510 9
0. 538 8
0. 602 9
0.7500
N = 100
0.9850
0.9423
0.8780
0.7974
0.7053
N = 200
0.9846
0.9418
0.8774
0.7968
0.7049
0000 (t) = (0 (t))2 sin 00 (t) cos 000 (t), hence 000 (0) '
0. 841 47 and 0000 (0) ' 0. 386 82. It follows that
0. 841 47 2 0. 841 47 3 0. 386 82 4
t +
t
t ,
2
6
24
(0.2) ' 0. 984 2, (0.4) ' 0. 941 2, (0.60) ' 0. 876 7,
(t) ' 1
00
0
00
yk00 ' yk1
+ (xk xk1 ) F (xk1 , yk1 , yk1
, yk1
).
197
N = 10
0.5012
0.5107
0.5383
0.6015
0.7446
N = 20
0.5013
0.5108
0.5387
0.6025
0.7485
Exact
0. 501 3
0. 510 9
0. 538 8
0. 602 9
0.7500
0
0
yk0 ' yk1
+ (xk xk1 ) F (xk1 , yk1 , yk1
).
xk =
yk
y0k
yk
0
yk0 ' yk1
+ (xk xk1 ) F (xk , y k , y0k ).
198
1
(2k 1)h
2
1 0
yk1 + hyk1
2
1
1
0
0
yk1 + h(yk1 2yk1
+ (k 1)h)
2
2
yk1 + hy 0k
1
0
yk1
+ h(y k 2y 0k + (2k 1)h).
4
200