Sie sind auf Seite 1von 40

1 Method for Ordinary Differential Equations

This chapter will introduce the reader to the terminology and notation of differential equations.
Students will also be reminded of some of the elementary solution methods they are assumed to
have encountered in an undergraduate course on the subject. At the conclusion of this review one
should have an idea of what it means to solve a differential equation and some condence that
they could construct a solution to some simple and special types of differential equations.
1.1 Denitions and Notation
Differential equations are divided into two classes, ordinary and partial. An ordinary differential
equation (ODE) involves one independent variable and derivatives with respect to that variable. A
partial differential equation (PDE) involves more than one independent variable and corresponding
partial derivatives. The rst semester of this course is about ordinary differential equations. The
phrase differential equation will usually mean ordinary differential equation unless the context
makes it clear that a partial differential equation is intended. The order of the highest derivative in
the differential equation is the order of the equation.
Example (1.1.1)
(a) x
2
d
3
y
dx
3
6x
dy
dx
+ 10y = 0 3
rd
order ODE
(b) x

(t) + sin x(t) = 0 2


nd
order ODE
(c) y

+y = 0 2
nd
order ODE
(d) x

+x = 0 1
st
order ODE
(e)
u
x

u
y
= 0 1
st
order PDE
(f)

2
u
t
2
=

2
u
x
2
+

2
u
y
2
2
nd
order PDE
From the equation it is usually clear which is the independent variable and which is dependent.
For example, in (a) it is implied that y = y(x) while in (b) the dependence of x upon t is explicitly
noted. In (c) and (d) the choice of the independent variable is arbitrary but as a matter of choice
we will usually regard y = y(x) and x = x(t). The latter notation is usually reserved for the
discussion of dynamical systems in which case one should think of x(t) as denoting the state of
a system at time t. In contrast the notation y = y(x) might be used in the context of a boundary
value problem when x has the interpretation of a spatial coordinate. Of course this is much ado
1
about nothing and the student should be prepared to see differential equations written in a variety
of ways.
For the partial differential equation in (e) u = u(x, y) while in (f), u = u(x, y, t). We will
often denote partial derivatives by subscripts in which case (e) could be written u
x
u
y
= 0 and
similarly for (f) u
tt
= u
xx
+u
yy
.
Differential equations are divided into two other classes, linear and nonlinear. An n
th
order
linear differential equation can be put into the form
a
0
y
(n)
+a
1
y
(n1)
+ +a
n1
y

+a
n
y = b
where b and the coefcients a
k
depend on at most the independent variable. If b = 0 the equation
is said to be homogeneous, otherwise it is called nohomogeneous.
Example (1.1.2)
y

= y

+ 1 linear, nonhomogeneous
x

sin t = x linear, homogeneous


(y

)
2
= x +y nonlinear
General differential equations of order 1 and 2 may be written as
F(x, y, y

) = 0 (1.1.1)
F(x, y, y

, y

) = 0
with the obvious notation for higher order equations. Such equations are often assumed to be
solvable for the highest derivative and then written as
y

= f(x, y) (1.1.2)
y

= f(x, y, y

).
Adifferentiable function y = (x) is a solution of (1.1.1) on an interval J if F(x, (x),

(x)) =
0, x J. Usually a rst order equation has a family of solutions y = (x, c) depending on
a single parameter c. A second order equation usually has a two-parameter family of solutions
y = (x, c
1
, c
2
) and so on. These parameters are like constants of integration and may be deter-
mined by specifying initial conditions corresponding to some time when a process starts.
Example (1.1.3) A two-parameter family of solutions of x

= 6 is
x = 3t
2
+c
1
t +c
2
(1.1.3)
The solution that satises the initial conditions
x(0) = 1, x

(0) = 1
is
x = 3t
2
t + 1.
2
Because solutions may involve one or more integrations, the graph of a solution is called an
integral curve. The integral curves in the previous example are parabolas. A family of functions is
a complete solution of a differential equation if every member of the family satises the differential
equation and every solution of the differential equation is a member of the family. The family of
functions given by (1.1.3) is the complete solution of y

= 6.
For the student who is familiar with the terminology of a general solution we should state at
this point that the notion of a general solution will only be used in the context of linear equations.
The appropriate denitions will be introduced in Chapter 3 at which time the distinction between
a general and complete solution will be made clear.
Example (1.1.4) The family
y = (x, c) =
1

2x +c
solves y

+ y
3
= 0. The family is not complete since the trivial solution, y(x) = 0 (also denoted
y 0), cannot be obtained for any value of c.
In equation (1.1.2) the left hand member dy/dx denotes the slope of a solution curve whereas
the right hand member f(x, y) gives the value of the slope at (x, y). From this point of view
the solution of an ordinary differential equations is a curve that ows along directions specied by
f(x, y). The use of dy/dx breaks down when the tangent is vertical but the geometric interpretation
remains meaningful. To deal with this matter note that a smooth curve in the (x, y) plane may be
described locally by y = (x) or x = (y). If dy/dx is meaningless, dx/dy may be permissible.
Consequently, it may be advantageous to treat x or y as independent or dependent variables in
formulating a differential equation. These remarks motivate the following discussion.
A differential equation is said to be in differential form if it is written as
M(x, y)dx +N(x, y)dy = 0. (1.1.4)
A differentiable function y = (x) is a solution of (1.1.4) on an interval if the substitutions
y = (x), dy =

(x)dx
make (1.1.4) true. A differentiable function x = (y) is a solution if the substitutions
x = (y), dx =

(y)dy
make (1.1.4) true. An equation
G(x, y) = c, c constant (1.1.5)
is said to furnish an implicit solution of (1.1.2) if (1.1.5) can be solved for y = (x) or x = (y)
in a neighborhood of a point (x, y) satisfying (1.1.5) and or is a solution in the sense dened
above. When (1.1.5) furnishes an implicit solution the graph of this equation is also called an
integral curve.
3
There is some ambiguity as to what one is expected to produce when asked to solve a dif-
ferential equation. Often the differential equation is regarded as solved when one has derived an
equation such as (1.1.5). However, the context of the problem may make it clear that one needs to
produce an explicit formula for the solution, say y = (x) or x = (y). The next two examples
will expound upon this issue, but in general the specic problem at hand will usually dictate as to
what is meant by the phrase, solution.
Example (1.1.5) Consider the equation in differential form
xdx +ydy = 0.
This equation is easily solved by writing it as a pure derivative, i.e.,
1
2
d(x
2
+y
2
) = 0.
When written in this form it is apparent that possible implicit solutions are
x
2
+y
2
= C. (1.1.6)
If C < 0, the locus is empty. If C = 0 the locus consists of the point (0,0). This case does not
correspond to a solution since it does not describe a differentiable curve of the form y = (x) or
x = (y). If C > 0, the integral curves are circles centered at the origin.
Example (1.1.6) Consider the three equations
(a)
dy
dx
=
x
y
(b)
dx
dy
=
y
x
(c) xdx +ydy = 0.
(a) This form of the equation implicitly requires a solution y = (x) and no integral curve can
contain a point (x, y) where y = 0.
(b) This requires a solution y = (x) and no integral curve can contain a point (x, y) where
x = 0.
(c) This equation allows for solutions of the form x = (y), or y = (x) and leads to the
family of circles (1.1.6) obtained in the previous example. In particular, in the neighborhood of
any point (x, y) on the circle we can express y as a differentiable function of x or vice versa. One
could obtain from (1.1.6) additional functions y = (x) by taking y > 0 on part of the circle and
y < 0 on the remainder (as in (c) below). Such a function is not differentiable and hence not a
solution.
(a) (b) (c) y=(x) x=(y) y=(x)
4
Fig. 1.1.1. Solutions dened by an integral curve are displayed in (a) and (b). Though the graph of
(x) lies on an integral curve, it is not a solution of the differential equation.
Having introduced the notion of a solution and integral curve, we now will review some of the
most elementary methods for solving ordinary differential equations.
1.2 Examples of Explicit Solution Techniques
(a) Separable Equations.
A differential equation is separable if it can be wrtitten in the form
F(x, y, y

) =
dy
dx
f(x)/g(y) = 0.
The differential equation is solved by separating the variables and performing the integra-
tions
_
g(y)dy =
_
f(x)dx.
Example (1.2.1) Solve
dy/dx = y
2
/x, x = 0.
We separate the variables and integrate to obtain
_
1
y
2
dy =
_
1
x
dx
or
y =
1
ln |x| +C
(1.2.1)
In the above calculation division by y
2
assumed y = 0. The function y = 0 is also a solution,
referred to as a singular solution. Therefore, the family given in (1.2.1) is not complete.
(b) Homogeneous Equations.
A differential equation is homogeneous if it can put in the form
F(x, y, y

) = y

f(y/x) = 0.
In this case let z = y/x so
dy
dx
= z +
dz
dx
= f(z)
or
dz
dx
=
f(z) z
x
,
which is separable.
5
(c) Exact Equations.
The differential equation F(x, y, y

) = 0 is exact if it can be written in differential form


M(x, y)dx +N(x, y)dy = 0
where
M
y
=
N
x
.
Recall that if M, N are C
1
on a simply connected domain then there exists a function P
such that
P
x
= M,
P
y
= N.
Thus the exact differential equation may be written as a pure derivative
dP = Mdx +Ndy = 0
and hence implicit solutions may be obtained from
P(x, y) = C.
Example (1.2.2) Solve
(3x
2
+y
3
e
y
)dx + (3xy
2
e
y
+xy
3
e
y
+ 3y
2
)dy = 0
Here
M
y
= 3y
2
e
y
+y
3
e
y
= N
x
.
Thus there exists P such that
P
x
= M,
P
y
= N.
It is simplest to obtain P from
P =
_
P
x
dx = x
3
+xy
3
e
y
+h(y).
Differentiate with respect to y to obtain
P
y
= 3xy
2
e
y
+xy
3
e
y
+h

(y) = N
and so h

(y) = 3y
2
or h(y) = y
3
. Thus
P(x, y) = x
3
+y
3
e
y
x +y
3
and so
x
3
+y
3
e
y
x +y
3
= C
provides an implicit solution.
6
(d) Integrating Factors.
Given
M(x, y)dx +N(x, y)dy = 0,
= (x, y) is called an integrating factor if

y
(M) =

x
(N)
The point of this denition is that if is an integrating factor, Mdx + Ndy = 0 is an
exact differential equation.
Here are three suggestions for nding integrating factors:
1) Try to determine m, n so that = x
m
y
n
is an integrating factor.
2) If
M
y
N
x
N
= Q(x),
then
(x) = exp
__
Q(x)dx
_
is an integrating factor.
3) If
N
x
M
y
M
= R(y),
then
(y) = exp
__
R(y)dy
_
is an integrating factor.
(e) First Order Linear Equations.
The general form of a rst order linear equation is
a
0
(x)y

+a
1
(x) = b(x)
We assume p =
a
1
a
0
, f =
b
a
0
are continuous on some interval and rewrite the equation as
y

(x) +p(x)y(x) = f(x). (1.2.2)


By inspection we see that
= e
_
p(x)dx
is an integrating factor for the homogeneous equation. From (1.2.2) we obtain
d
dx
(e
_
p(x)dx
y) = f(x)e
_
p(x)dx
7
and so
y(x) = e

_
p(x)dx
__
f(x)e
_
p(x)dx
dx +c
_
.
Example (1.2.3) Find all solutions of
xy

y = x
2
.
If x = 0, rewrite the equation as
y

1
x
y = x (1.2.3)
and so
= e

_
(1/x)dx
=
1
|x|
.
If x > 0,
d
dx
_
y
x
_
= 1
and so y = x
2
+Cx. If x < 0,
d
dx
_
1
x
y
_
= 1
and y = x
2
+Cx. Hence y = x
2
+Cx gives a differentiable solution valid for all x.
Now consider the initial value problem
xy

y = x
2
y(0) = y
0
.
If y
0
= 0, we see that there are innitely many solutions of this problem whereas if y
0
= 0,
there are no solutions. The problem in this latter case arises from the fact that when the
equation is put in the form of (1.2.3) the coefcient p(x) is not continuous at x = 0. The
signicance of this observation will be elaborated upon in the next chapter.
(e) Reduction in Order.
If in the differential equation the independent variable is missing, that is, the equation is of
the form
F(y, y

, , y
(n)
) = 0, (1.2.4)
set
v = y

=
dy
dx
,
y

=
d
dx
(y

) =
dv
dx
=
dv
dy
dy
dx
=
dv
dy
v,
y

=
d
dx
_
dv
dy
v
_
=
dv
dy
dv
dx
+v
d
dy
_
dv
dy
_
dy
dx
8
= v
_
dv
dy
_
2
+v
2
d
2
v
dy
2
,
etc.
These calculations show that with this change of variables we obtain a differential equation
of one less order with y regarded as the independent variable, i.e., the differential equation
(1.3.1) becomes
G(y, v, v

, v
(n1)
) = 0.
If the dependent variable is missing, i.e.,
F(x, y

, y

, y
(n)
= 0,
again set v =
dy
dx
= y

to obtain
G(x, v, v

, v
(n1)
) = 0.
(f) Linear Constant Coefcient Equations.
A homogeneous linear differential equation with constant real coefcients of order n has the
form
y
(n)
+a
1
y
(n1)
+ +a
n
y = 0.
We introduce the notation D =
d
dx
and write the above equation as
P(D)y
_
D
n
+a
1
D
(n1)
+ +a
n
_
y = 0.
By the fundamental theorem of algebra we can write
P(D) = (Dr
1
)
m
1
(Dr
k
)
m
k
(D
2
2
1
D+
2
1
+
2
1
)
p
1
(D
2
2

D+
2

+
2

)
p

,
where
k

j=1
m
j
+ 2

j=1
p
j
= n.
Lemma 1.1. The general solution of (D r)
k
y = 0 is
y =
_
c
1
+c
2
x + +c
k
x
(k1)
_
e
rx
and the general solution of (D
2
2D +
2
+
2
)
k
y = 0 is
y =
_
c
1
+c
2
x + +c
k
x
(k1)
_
e
x
cos(x) +
_
d
1
+d
2
x + +d
k
x
(k1)
_
e
x
sin(x).
Proof. Note rst that (D r)e
rx
= D(e
rx
) re
rx
= re
rx
re
rx
= 0 and for k > j
(D r)
_
x
j
e
rx
_
= D
_
x
j
e
rx
_
r
_
x
j
e
rx
_
= jx
j1
e
rx
.
9
Thus we have
(D r)
k
_
x
j
e
rx
_
= (D r)
k1
_
(D r)
_
x
j
e
rx
_
_
= j(D r)
k1
_
x
j1
e
rx
_
= =
= j! (D r)
kj
(e
rx
) .
Therefore, each function x
j
e
rx
, for j = 0, 1, , (k 1), is a solution of the equation and
by the fundamental theory of algebra these functions are linearly independent, i.e.,
0 =
k

j=1
c
j
x
j1
e
rx
= e
rx
k

j=1
c
j
x
j1
, for all x
implies c
1
= c
2
= = c
k
= 0.
Note that each factor (D
2
2D +
2
+
2
) corresponds to a pair of complex conjugate
roots r = i. In the above calculations we did not assume that r is real so that for a pair
of complex roots we must have solutions
e
(i)x
= e
ix
e
x
= e
x
(cos(x) +i sin(x)) ,
and any linear combination of these functions will also be a solution. In particular the real
and imaginary parts must be solutions since
1
2
[e
x
(cos(x) +i sin(x))] +
1
2
[e
x
(cos(x) i sin(x))] = e
x
cos(x)
1
2i
[e
x
(cos(x) +i sin(x))]
1
2i
[e
x
(cos(x) i sin(x))] = e
x
sin(x)
Combining the above results we nd that the functions
y =
_
c
1
+c
2
x + +c
n
x
(n1)
_
e
x
cos(x)
and
y =
_
d
1
+d
2
x + +d
n
x
(n1)
_
e
x
sin(x).
are solutions and, as is shown in Section 1.6, these solutions are linearly independent.
The general solution of P(D)y = 0 is given as a linear combination of the solutions for each
real root and each pair of complex roots.
Let us consider an example which is already written in factored form
_
(D + 1)
3
(D
2
+ 4D + 13)

y = 0
The term (D + 1)
3
gives a part of the solution as
(c
1
+c + 2x +c
3
x
2
)e
x
10
and the term (D
2
+ 4D + 13) corresponds to complex roots with = 2 and = 3 giving
the part of the solution
c
4
e
2x
cos(3x) +c
5
e
2x
sin(3x).
The general solution is
y = (c
1
+c + 2x +c
3
x
2
)e
x
+c
4
e
2x
cos(3x) +c
5
e
2x
sin(3x).
(g) Equations of Euler (and Cauchy) Type.
A differential equation is of Euler type if
F(x, y

, y

, , y
(n)
) = F(y, xy

, x
n
y
(n)
) = 0.
Set x = e
t
so that
y =
dy
dt
=
dy
dx
dx
dt
= y

x,
d
2
y
dt
2

dy
dt
=
d
dt
(y

x) y

x =
dy

dx
dx
dt
x +y

x y

x = y

x
2
,
etc.
In this way the differential equation can be put into the form
G(y, y, , y
(n)
) = 0
and now the method of reduction may be applied.
An important special case of this type of equation is the so-called Cauchys equation ,
x
n
y
(n)
+ +a
1
xy

+a
2
y = 0,
or
P(D)y
_
x
n
D
n
+a
1
x
n1
D
(n1)
+ +a
n
_
y = 0.
With x = e
t
and D
dy
dt
we have
Dy =
dy
dx
=
dy
dt
dt
dx
=
1
x
dy
dt
xDy = Dy,
D
2
y =
d
dx
_
1
x
dy
dt
_
=
1
x
2
_
d
2
y
dt
2

dy
dt
_
x
2
D
2
y = D(D1)y,
.
.
.
x
r
D
r
y = D(D1)(D2) (Dr + 1)y.
Thus we can write
P(D)y = P(D)y =
_
D(D1) (Dn + 1)
+a
1
_
D(D1) (Dn + 2)
_
+ +a
n1
D+a
n
_
y = 0.
11
The second order case
ax
2
y

+bxy

+cy = 0. (1.2.5)
will arise numerous times throughout the course. We assume the coefcients are constant
and x > 0 and as an alternative to the above approach we seek a solution in the form y = x
r
.
In this way one obtains the following quadratic for the exponent r,
ar
2
+ (b a)r +c = 0. (1.2.6)
There are three cases to be considered:
1) If (1.2.6) has distinct real roots r
1
, r
2
then we obtain solutions
x
r
1
, x
r
2
.
2) If r
1
= +i, r
2
= i then solutions may be written as
x
+i
= x

e
i ln x
= x

(cos( ln x) +i sin( ln x))


and similarly
x
i
= x

(cos( ln x) i sin( ln x)).


Observe that a linear combination of solutions of (1.3.2) is again a solution and so we obtain
the solutions
1
2
(x
+i
+x
i
) = x

cos( ln x)
and
1
2i
(x
+i
x
i
) = x

sin( ln x).
3) If (1.2.6) has repeated roots then (b a)
2
= 4ac and
r
1
= (a b)/2a.
We seek a second solution as
y = v(x)x
r
1
and observe that v must satisfy
axv

+av

= 0.
Set w = v

to get
xw

+w = 0
and so
w = c
1
/x,
and
v = c
1
ln x +c
2
.
Thus in the case of repeated roots we obtain the solutions
x
r
1
ln x, x
r
1
.
One might try to verify that c
1
x
r
1
+c
2
x
r
2
, x

(c
1
cos( ln x)+c
2
sin( ln x)), and c
1
x
r
1
ln x+
c
2
x
r
1
are complete families of solutions of Eulers equation in each of the three cases respec-
tively. That this is indeed the case will be a trivial consequence of a more general result for
linear equations that we will prove in Chapter 3.
12
(h) Equations of Legendre Type.
A slightly more general class of equations than the Cauchy equations is the Legendre equa-
tions which have the form
P(D)y
_
(ax +b)
n
D
n
+a
n1
(ax +b)
n1
D
(n1)
+ +a
1
(ax +b)D +a
0
_
y = 0.
These equations, just as Cauchy equations, can be reduced to linear constant coefcient
equations. For these equations we use the substitution (ax + b) = e
t
which, using the chain
rule just as above, gives:
Dy =
dy
dx
=
dy
dt
dt
dx
=
a
(ax +b)
dy
dt
(ax +b)Dy = aDy,
(ax +b)
2
D
2
y = a
2
D(D1)y,
.
.
.
(ax +b)
r
D
r
y = a
r
D(D1)(D2) (Dr + 1)y.
Thus we can write
P(D)y = P(D)y =
_
a
n
D(D1) (Dn + 1)
+a
1
a
n1
_
D(D1) (Dn + 2)
_
+ +a
n1
D+a
n
_
y = 0.
As an example consider the equation
_
(x + 2)
2
D
2
(x + 2)D + 1

y = 0
Set (x + 2) = e
t
; then the equation can be written as
_
D(D1) D+ 1
_
y = 0
or
_
D
2
2D+ 1
_
y = (D1)
2
y = 0.
The general solution to this problem is
y(t) = C
1
e
t
+C
2
te
t
and we can readily change back to the x variable using t = ln(x + 2) to obtain
y = (x + 2)
_
C
1
+C
2
ln(x + 2)

.
(i) Equations of Bernoulli Type.
A Bernoulli equation is a differential equation of the form
y

+p(x)y = q(x)y
n
.
13
I can be shown that the substitution v = y
1n
changes the Bernoulli equation into the linear
differential equation
v

(x) + (1 n)p(x)v = (1 n)q(x).


The special cases n = 0, n = 1 should be considered separately.
As an example consider the differential equation
y

+y = y
a+1
where a is a nonzero constant. This equation is separable so we can separate variables to
obtain an implicit solution or we can use Bernoullis procedure to derive the explicit solution
y = (1 +ce
ax
)
1/a
.
The student should check that both results give this solution.
(j) Equations of Clairaut Type.
An equation in the form
y = xy

+f(y

)
for any function f is called a Clairaut equation. While, at rst glance, it would appear that
such equation could be rather complicated, it turns out that this is not the case. As can be
readily veried, the general solution is given by
y = Cx +f(C)
where C is a constant.
As an example the equation
y = xy

+
_
4 + (y

)
2
has solution y = Cx +

4 +C
2
.
Sometimes one can transform an equation into Clairaut form. For example, consider the
equation
y = 2xy

+ 6y
2
(y

)
2
.
If we multiply the equation by y
2
we get
y
3
= 3xy
2
y

+ 6y
4
(y

)
2
.
Now use the transformation v = y
3
, which implies v

= 3y
2
y

, to write the equation as


v = xv

+
2
3
(v

)
2
whose solution is v = Cx +
2
3
C
2
which gives y
3
= Cx +
2
3
C
2
.
14
(k) Other First Order and Higher Degree Equations.
A rst order differential equation may have higher degree. Often an equation is given in
polynomial form in the variable y

and in this case we refer to the equation as having order


n if n is the highest order power of y

that occurs in the equation. If we write p = y

for
notational convienence, then such an equation can be written as
p
n
+g
n1
(x, y)p
n1
+ +g
1
(x, y)p +g
0
(x, y) = 0. (1.2.7)
It may be possible to solve such equations using one of the following methods (see [?]).
Equation Solvable for p:
It may happen that (1.2.7) can be factored into
(p F
1
)(p F
2
) (p F
n
) = 0
in which case we can solve the resulting rst order and rst degree equations
y

= F
1
(x, y), y

= F
2
(x, y), , y

= F
n
(x, y).
This will lead to solutions
f
1
(x, y, c) = 0, f
2
(x, y, c) = 0, , f
n
(x, y, c) = 0
and the general solution is the product of the solutions since the factored equation can be
rewritten in any form (i.e., the ordering of the terms does not matter). Thus we have
f
1
(x, y, c)f
2
(x, y, c) f
n
(x, y, c) = 0.
For example,
p
4
(x + 2y + 1)p
3
+ (x + 2y + 2xy)p
2
2xyp = 0
can be factored into
p(p 1)(p x)(p 2y) = 0
resulting in the equations
y

= 0, y

= 1, y

= x, y

= 2y.
These equations yield the solutions
y c = 0, y x c = 0, 2y x
2
c = 0, y ce
2x
= 0
giving the solution
(y c)(y x c)(2y x
2
c)(y ce
2x
) = 0.
15
Equation Solvable for y:
In this case we can write the equation G(x, y, y

) = 0 in the form y = f(x, p). In this case


differentiate this equation with respect to x to obtain,
p =
dy
dx
= f
x
+f
p
dp
dx
= F(x, p,
dp
dx
).
This is an equation for p which is rst order and rst degree. Solving this equation to
obtain (x, p, c) = 0 we then use the original equation y = f(x, p) to try to eliminate the p
dependence and obtain (x, y, c) = 0.
Consider the example y = 2px +p
4
x
2
. We differentiate with respect to x to obtain
p = 2x
dp
dx
+ 2p + 2p
4
x + 4p
3
x
2
dp
dx
which can be rewritten as
_
p + 2x
dp
dx
_
(1 2p
3
x) = 0.
An analysis of singular solutions shows that we can discard the factor (12p
3
x) and we have
(p+2x
dp
dx
) = 0 which implies xp
2
= c. If we write the original equation as (yp
4
x
2
) = 2px
and square both sides we have (y p
4
x
2
)
2
= 4p
2
x
2
. With this and xp
2
= c we can eliminate
p to obtain (y c
2
)
2
= 4cx.
Equation Solvable for x:
In this case an equation G(x, y, y

) = 0 can be written as x = f(y, p). We proceed by


differentiating with respect to y to obtain
1
p
=
dx
dy
= f
y
+f
p
dp
dy
= F(y, p,
dp
dy
)
which is rst order and rst degree in
dp
dy
. Solving this equation to obtain (x, y, c) = 0 we
then use the original equation y = f(x, p) to try to eliminate the p dependence and obtain
(x, y, c) = 0.
As an example consider p
3
2xyp + 4y
2
= 0 which we can write as 2x =
p
2
y
+
4y
p
.
Differentiating with respect to y gives
2
p
=
2p
y
dp
dy

p
2
y
2
+ 4
_
1
p

y
p
2
dp
dy
_
or
_
p 2y
dp
dy
_
(2y
2
p
3
) = 0.
The term (2y
2
p
3
) gives rise to singular solutions and we consider only
_
p 2y
dp
dy
_
= 0
16
which has solution p
2
= cy. We now use this relation and the original equation to eliminate
p. First we have
2x c =
4y
p
which implies
(2x c)
2
= 16y
y
p
2
=
16y
c
and nally 16y = c(2x c)
2
.
1.3 Linear Nonhomogeneous Problems
Variation of parameters
Consider a nonhomogeneous second order linear equation
L(y) = y

+a
1
y

+a
2
y =
and suppose {y
1
, y
2
} is a fundamental set. Then c
1
y
1
(t)+c
2
y
2
(t) is a general solution of L(y) = 0.
A method due to Lagrange, called the method of variation of parameters, for solving L(y) = is
based on the idea of seeking a solution as
y
p
(t) = c
1
(t)y
1
(t) +c
2
(t)y
2
(t).
Then
y

p
= c
1
y

1
+c
2
y

2
+c

1
y
1
+c

2
y
2
.
To simplify the algebra, we impose the auxiliary condition
c

1
y
1
+c

2
y
2
= 0.
Then
y

p
= c
1
y

1
+c
2
y

2
+c

1
y

1
+c

2
y

2
.
If we substitute into L(y) = , we want
c
1
(t)(y

1
+a
1
y

1
+a
2
y
1
) +c
2
(t)(y

2
+a
1
y

2
+a
0
y
2
) +c

1
y

1
+c
2
y

2
= (t).
Note that the two parenthesized expressions are zero because y
1
and y
2
are solutions of the homo-
geneous equation. Thus we need to solve
c

1
y
1
+c

2
y
2
= 0
c

1
y

1
+c

2
y

2
= .
By Cramers Rule
c

1
(t) =
y
2
(t)
1
(t)
W(y
1
, y
2
)(t)
, c

2
(t) =
y
1
(t)(t)
W(y
1
, y
2
)(t)
.
17
Thus a particular solution is given as
y
p
(t) = y
1
(t)
_
t
t
0
y
2
(s)(s)
W(s)
ds +y
2
(t)
_
t
t
0
y
1
(s)(s)
W(s)
ds
=
_
t
t
0
_
y
1
(s)y
2
(s) y
1
(s)y
2
(s)
W(y
1
, y
2
)(s)
_
(s) ds
=
_
t
t
0
g(x, s)(t) ds.
g(t, s) is called a Fundamental Solution.
The same method works, if not as smoothly, in the general case. Consider the nth order case
L(y) = y
(n)
+a
1
y
(n1)
+ +a
n1
y
(1)
+a
n
y =
and let {y
1
, . . . , y
n
} be a fundamental set of solutions of the homogeneous problem L(y) = 0. As
in the last section, given a basis of solutions {y
j
}
n
j=1
of the homogeneous problem Ly = 0 we seek
a solution of L(y) = in the form
y
p
(t) = u
1
(t)y
1
(t) + +u
n
(t)y
n
(t).
We seek a system of equations that can be solved to nd u

1
, . . . , u

n
. To this end we note that
by applying the product rule to y
p
and, collecting terms carefully, we can conclude that
u

1
y
1
+u

2
y
2
+ +u

n
y
n
= 0 y

p
= u
1
y

1
+u
2
y

2
+ +u
n
y

n
u

1
y

1
+u

2
y

2
+ +u

n
y

n
= 0 y

p
= u
1
y

1
+u
2
y

2
+ +u
n
y

n
u

1
y

1
+u

2
y

2
+ +u

n
y

n
= 0 y

p
= u
1
y

1
+u
2
y

2
+ +u
n
y

n
.
.
.
.
.
.
u

1
y
(n2)
1
+u

2
y
(n2)
2
+ +u

n
y
(n2)
n
= 0 y
(n1)
p
= u
1
y
(n1)
1
+u
2
y
(n1)
2
+ +u
n
y
(n1)
n
u

1
y
(n1)
1
+u

2
y
(n1)
2
+ +u

n
y
(n1)
n
= y
(n)
p
= u
1
y
(n)
1
+u
2
y
(n)
2
+ +u
n
y
(n)
n
+
which implies
L(y
p
) = u
1
L(y
1
) +u
2
L(y
2
) + +u
n
L(y
n
) + = .
Now we note that the system of equations becomes
_

_
y
1
y
2
y
n
y

1
y

2
y

n
.
.
.
.
.
.
.
.
.
y
(n1)
1
y
(n1)
2
y
(n1)
n
_

_
_

_
u
1
u
2
.
.
.
u
n
_

_
=
_

_
0
0
.
.
.

_
.
18
The determinant of the coefcient matrix is nonvanishing since it is the Wronskian W(t) of a set
of linearly independent solutions to an n-order linear differential equation (see equation (1.5.4) in
Section 1.5). Applying Kramers rule we can write the solutions as
u

k
(t) =
W
k
(t)
W(t)
, k = 1, , n
where W
k
(t) is the determinant of the matrix obtained from the coefcient matrix by replacing the
kth column
_
i.e.,
_
y
k
y

k
y
(n1)
k
_
T _
by the vector
_
0 0

T
If we dene
g(t, s) =
n

k=1
y
k
(t)W
k
(s)
W(s)
then a particular solution of L(y) = is
y
p
=
_
t
t
0
g(t, s) (s) ds.
Method of Undetermined Coefcients
As we have already learned, the method of variation of parameters provides a method of rep-
resenting a particular solution to a nonhomogeneous linear problem
Ly = y
(n)
+a
1
y
(n1)
+ +a
(n1)
y
(1)
+a
n
y = f
in terms of a basis of solutions {y
j
}
n
j=1
of the linear homogeneous problem. In the special case
in which the operator L has constant coefcients, we have just seen that it is possible to construct
such a basis of solutions for the homogeneous problem. Thus given any f we can write out a
formula for a particular solution in integral form
y
p
(t) =
_
t
t
0
g(t, s)f(s) ds.
Unfortunately, the method of variation of parameters often requires much more work than is
needed. As an example consider the problem
Ly = y

+y

+y

+y = 1
y(0) = 0, y

(0) = 1, y

(0) = 0.
Example 1.1. For the homogeneous problem we have
(D
3
+D
2
+D + 1)y = (D + 1)(D
2
+ 1)y = 0
so we can take
y
1
= cos t, y
2
= sin t, y
3
= e
t
.
19
Thus the wronskian is
W(t) =

cos t sin t e
t
sin t cos t e
t
cos t sin t e
t

and we can apply Abels theorem to obtain


W(t) = W(0)e

_
t
0
1 ds
=

1 0 1
0 1 1
1 0 1

e
t
= 2e
t
.
Thus by the variation of parameters formula y
p
= u
1
y
1
+u
2
y
2
where
u

1
=
1
2
e
t

0 sin t e
t
0 cos t e
t
1 sin t e
t

=
1
2
(cos t + sin t),
which implies
u
1
(t) =
1
2
(cos(t) sin(t)).
Similarly, we obtain
u

2
=
1
2
(cos t sin t), u
3
(t) =
1
2
e
t
,
which imply
u

2
=
1
2
(cos t + sin t), u
3
(t) =
1
2
e
t
,
So we get
y
p
= u
1
y
1
+u
2
y
2
=
1
2
(cos t sin t) cos t +
1
2
(sin t + cos t) sin t +
1
2
e
t
e
t
= 1
Wow! In retrospect it would have been easy to see that y
p
= 1 is a particular solution.
Now the general solution is
y = 1 +c
1
cos t +c
2
sin t +c
3
e
t
and we can apply the initial conditions to determine the constants which yields
y = 1 +
1
2
(sin t cos t e
t
).
20
We note that if we were to apply the method for nding a particlar solution with the properties
y
p
(0) = 0, y

p
(0) = 0, y

p
(0) = 0,
(as given in the proof of the n order case), then we would get
y
p
(t) = 1
1
2
(cos t + sin t +e
t
).
We note that the second term is part of the homogeneous solution so it can be excluded.
In any case this is a lot of work to nd such a simple particular solution. In case the function f
is a linear combination of:
1. polynomials,
2. polynomials times exponentials or,
3. polynomials times exponentials times sine or cosine,
i.e., if f is a solution of a linear constant coefcient homogeneous differential equation, one can
apply the method of undetermined coefcients.
The method goes as follows:
1. Let L = P(D) = D
n
+
n

j=1
a
j
D
nj
2. Let Ly = 0 have general solution y
h
=
n

j=1
c
j
y
j
.
3. Assume that M = Q(D) = D
m
+
m

j=1
b
j
D
mj
is a constant coefcient linear differential
operator such that Mf = 0.
4. Then

L = ML is a polynomial constant coefcient differential operator.
5. Notice that if y
p
is any solution of Ly = f and y
h
is the general solution of the homogeneous
problem, then we have

L(y
h
+y
p
) = 0. (1.3.1)
6. On the other hand we can write the general solution of this problem by simply factoring

L
and applying the results of the previous section.
7. Note that the solution y
h
=
n

j=1
c
j
y
j
is part of this general solution.
21
8. So let us denote the general solution by
y =
n

j=1
c
j
y
j
+
m

j=1
d
j
w
j
. (1.3.2)
9. Now we also know, by the variation of parameters formula, that there exists a particular
solution of Ly
p
= f.
10. But since we know the general solution of (1.3.1) is (1.3.2), this means that any particular
solution must also be a part of the full general solution of the large homogeneous problem,
i.e., y
p
=
n

j=1
c
j
y
j
+
m

j=1
d
j
w
j
.
11. We know that Ly
h
= 0 so we can choose y
p
=
m

j=1
d
j
w
j
.
12. We now substitute this expression into the original equation and solve for the constants {d
j
}.
Example 1.2. Example: Ly = (D
2
2D + 2)y = t
2
e
t
sin(t):
The general solution of the homogeneous equation Ly = 0 is
y
h
= c
1
e
t
cos(t) +c
2
e
t
sin(t)
According to the above disscussion we seek a differential operator M so that
M(t
2
e
t
sin(t)) = 0.
We immediately choose
M = (D
2
2D + 2)
3
and we need to compute the general solution to the homogeneous problem
MLy = (D
2
2D + 2)
3
(D
2
2D + 2)y = (D
2
2D + 2)
4
y = 0,
which implies
y = (c
1
+c
2
t +c
3
t
2
+c
4
t
3
)e
t
cos(t) + (d
1
+d
2
t +d
3
t
2
+d
4
t
3
)e
t
sin(t).
If we now remove the part of this function corresponding to the solution of the homogeneous
problem Ly = 0, we have
y
p
= (at
3
+bt
2
+ct)e
t
cos(t) + (dt
3
+ft
2
+gt)e
t
sin(t)
After a lengthy calculation the rst derivative
y

=
_
(d +a) t
3
+ (3 a +b +f) t
2
+ (2 b +c +g) t +c
_
e
t
cos(t)
+
_
(a +d) t
3
+ (b +f + 3 d) t
2
+ (c +g + 2 f) t +g
_
e
t
sin(t)
22
and the second derivative
y

=
_
2 dt
3
+ (6 d + 6 a + 2 f) t
2
+ (6 a + 4 b + 4 f + 2 g) t + 2 b + 2 c + 2 g
_
e
t
cos(t)
+
_
2 at
3
+ (6 a + 6 d 2 b) t
2
+ (4 b + 4 f + 6 d 2 c) t + 2 f + 2 g 2 c
_
e
t
sin(t)
Plugging all of this into the equation yields
y

2y

+ 2y =
_
6 dt
2
+ (6 a + 4 f) t + 2 g + 2 b
_
e
t
cos(t) +
_
6 at
2
+ (4 b + 6 d) t 2 c + 2 f
_
e
t
sin(t)
Equating coefcients with the right hand side leads to the equations
6 d = 0
6 a + 4 f = 0
2 g + 2 b = 0
6 a = 1
4 b + 6 d = 0
2 c + 2 f = 0
which have the solutions a = 1/6, b = 0, c = 1/4, d = 0, f = 1/4 and g = 0. Thus, a particular
solution of the equation is
y =
_

t
3
6
+
t
4
_
e
t
cos(t) +
t
2
4
e
t
sin(t)
The following table contains a guide for generating a particular solution when one applies the
method of undetermined coefcients. In particular, consider
Ly = f.
If f(t) = seek y
p
(t).
P
m
(t) = c
0
t
m
+ +c
m
x
s
(a
0
t
m
+ +a
m
)
P
m
(t)e
t
t
s
(a
0
t
m
+ +a
m
)e
t
P
m
(t)e
t
_
sin t
cos t
t
s
e
t
_
(a
0
t
m
+ +a
m
) cos t
+(b
0
t
m
+ +b
m
) sin t
_
Example 1.3. Returning to Example 1.1 we see that the operator M = D annihilates f = 1 so
we seek a particular solution y
p
= 1.
23
1.4 Some Numerical Methods for ODEs
Method: Collocation Method (a Weighted Residual Method)
Given a differential equation L[u] = 0 for u() with Q (Q some domain) and boundary
conditions B[u] = 0, we seek an approximate solution u() = w(; ) where = {
j
}
N
j=1
is a set
of parameters and B[w] = 0 for all choices of .
We try to determine the by requiring that the equation be satised by w at a set of points
S = {
j
}
N
j=1
Q. Thus we arrive at a system of N equations in the N unknowns :
L[w(
j
, )] = 0, j = 1, , N.
Example 1.4. Consider
L[u] = u

+u +x = 0, (1.4.1)
u(0) = 0, u(1) = 0
Suppose we choose to approximate the solution by
w(x) =
1
x(1 x) +
2
x(1 x
2
).
Note that w satises the boundary conditions. A straightforward calculation gives:
L[w(x)] =
1
(2 x +x
2
)
2
(5x +x
3
) +x.
Applying our collocation method at x
1
= 1/3 and x
2
= 2/3, we obtain the 2 2 system
(48/27)
1
+ (46/27)
2
= 1/3
(48/27)
1
+ (98/27)
2
= 2/3
which has solutions
1
= 9/416 and
2
= 9/52. Thus we obtain
w(x) =
9
416
x(1 x) +
9
52
x(1 x
2
).
The exact solution to this problem is
u(x) =
sin(x)
sin(1)
x
and the maximum difference between y and w on [0, 1] occurs at x = .7916 with a value of .00081.
Method: Taylor Series
This method yields an approximate solution to a differential equation near a single point a. The
method is applicable for differential equations in which all expressions are analytic functions of
the variables. The idea is to use the differential equation to obtain the coefcients in a Taylor series
about the point a. We note that this is really an application of the famous Cauchy-Kovalevskaya
theorem.
24
Example 1.5. We seek an approximate solution to
y

(x) = F(x, y), y(a) = y


0
in the form
y(x) =
N

j=0
y
(j)
(a)
j!
(x a)
j
.
The idea is to use the differential equation and initial condition to nd the Taylor coefcients.
y(a) = y
0
y

=F(x, y) implies
y

(a) = F(a, y
0
)
y

(x) =F
x
(x, y) +F
y
(x, y)y
x
implies
y

(a) = F
x
(a, y
0
) +F
y
(a, y
0
)F(a, y
0
),
etc.
Consider
y

= x
2
y
2
,
y(0) = 1
A straightforward calculation yields:
y

= x
2
y
2
,
y

= 2x 2yy

= 2 2(y

)
2
2yy

= 6y

2yy

from which we immediately obtain for a = 0


y

(0) = 1,
y

(0) = 2
y

(0) = 4
y

(0) = 20.
Thus we obtain the approximate solution
y = 1 x +
2
2!
x
2

4
3!
x
3
+
20
4!
x
4
= 1 x +x
2

2
3
x
3
+
5
6
x
4
25
Eulers Method:
This method, which can be derived many different ways, is not particularly practical but is by
far the simplest method and the starting point for many more complicated methods.
Unlike the methods discussed in the earlier section, this method does not produce a function
that can be evaluated at any point but rather is gives approximate values to the solution at points in
the form {(t
j
, y
j
)}
M+1
j=1
where
y(t
j
) y
j
, a = t
1
< t
2
< < t
M
< t
M+1
= b.
While any mesh can be used, we will select uniform mesh
t
k
= a +h(k 1), k = 1, , (M + 1), h =
(b a)
M
.
Assuming that y, y

and y

are continuous we can apply Taylors theorem at t


1
to obtain
y(t) = y(t
1
) +y

(t
1
)(t t
1
) +y

(c
1
)
(t t
1
)
2
2
, c
1
[t
1
, t].
Using y

(t
1
) = f(t
1
, y(t
1
)) and h = (t
2
t
1
) we get an approximation for y at t
2
y(t
2
) = y(t
1
) +hf(t
1
, y(t
1
)) +y

(c
1
)
h
2
2
.
For h sufciently small we write
y
2
= y
1
+hf(t
1
, y
1
)
to obtain an approximate value at t
2
. Repeating, we have
t
k+1
= t
k
+h, y
k+1
= y
k
+hf(t
k
, y
k
), k = 1, (M + 1) Eulers Method.
Assuming that at each step we begin at exactly y(t
k
) (which wont be quite true), we dene the
local truncation error (LTE) to be the error obtained at a given step. In this case the LTE is
y

(c
k
)
h
2
2
.
Summing the LTEs all the way to t
M
we get, roughly anyway, the so-called Global Truncation
Error (GTE). In this case we have
M

k=1
y
(2)
(c
k
)
h
2
2
y
(2)
(c)Mh
2
=
y
(2)
(c)
2
M
(b a)
M
h = O(h).
Thus we see that the GTE, E(h), for Eulers method is
E(h) Ch.
From this we have
E
_
h
2
_
C(h/2) =
1
2
Ch
1
2
E(h).
26
So cutting the step size in half roughly reduces the GTE by a factor of 1/2.
Note that if the equation is y

= f(t) with y(a) = 0 then this method give


y(b)
M

k=1
f(t
k
)h
which is a Riemann sum approximation to the integral
_
b
a
f(t) dt.
Modied Eulers Method:
Once again we consider (??) and apply the fundamental theorem of calculus to get
_
t
2
t
1
f(t, y(t)) dt =
_
t
2
t
1
y

(t) dt = y(t
2
) y(t
1
).
This implies that
y(t
2
) = y(t
1
) +
_
t
2
t
1
f(t, y(t)) dt.
Now use the trapezoid rule to evaluate the integral with step size h = t
2
t
1
to obtain
y(t
2
) y(t
1
) +
h
2
[f(t
1
, y(t
1
)) +f(t
2
, y(t
2
))].
Unfortunately, we do not know y(t
2
) on the right side, so we use, for example, Eulers method to
approximate it: y(t
2
) y(t
1
) + hf(t
1
, y(t
1
)). We thus obtain a numerical procedure by denoting
y(t
k
) by y
k
for each k we set
p
k
= y
k
+hf(t
k
, y
k
), t
k+1
= t
k
+h,
y
k
+ 1 = y
k
+
h
2
[f(t
k
, y
k
) +f(t
k+1
, p
k
)] .
Note that if the equation were y

= f(t) with y(0) = 0 then we would have


y(b)
h
2
M

k=1
[f(t
k
) +f(t
k+1
)]
which is exactly the trapezoid rule for numerical quadrature.
In this case the LTE for the trap rule is
y

(c
k
)
h
3
12
and the GTE is

k=1
y
(2)
(c
k
)
h
3
12

y
(2)
(c)(b a)
12
h
2
= O(h
2
).
27
Thus we see that the GTE E(h) for Modied Euler Method is
E(h) Ch
2
.
From this we have
E
_
h
2
_
C(h/2)
2
=
1
4
Ch
2

1
2
E(h).
So cutting the step size in half roughly reduces the GTE by a factor of 1/4. This is sometimes
called Huens method. See the codes a9_2.m and huen.m.
Taylors Method:
Assuming that y has derivatives of all order we could, again by Taylors theorem, for any N
write
y(t +h) = y(t) +y

(t)h +
y
(2)
(t)h
2
2
+ +
y
(N)
(t)h
N
N!
(1.4.2)
with a LTE of
y
(N+1)
(c)h
N+1
(N + 1)!
.
We can adapt this result to each interval [t
k
, t
k+1
] to obtain a numerical procedure
y
k+1
= y
k
+d
1
h +
d
2
h
2
2
+
d
3
h
3
6
+ +
d
N
h
N
N!
where d
j
= y
(j)
(t
k
) for j = 1, 2, , N. In this case the LTE is O(h
N+1
) and the GTE is
E
N
(h) Ch
N
= O(h
N
). Thus we have
E
N
_
h
2
_
=
1
2
N
E
N
(h).
Computing the values d
k
for a specic example is not to bad. Consider, for example, (see the
exercises)
y

=
t y
2
y
(2)
=
2 t +y
4
y
(3)
=
2 +t y
8
y
(4)
=
2 t +y
16
from which we readily compute the values d
j
.
There is a Taylors matlab code named taylor.m taken from John Mathews book Chapter 9. The
le a9_3.m runs an example.
Runge-Kutta Methods:
28
The dissadvantage of Taylors method is obvious. We have to do some analytic calculations on
every problem. To eliminate this difculty and still have a higher order method we consider the
one-step Runge-Kutta methods which are related to Taylors method but do not require separate
calculations.
We give a brief discussion of this method in the second order case. The fourth order case is
more common but the algebra is very messy.
In the second order case the idea is to look for a formula
y
k+1
= y
k
+hF(t
k
, y
k
, h, f)
with F in the form
F(t, y, h, f) =
1
f(t, y) +
2
f(t +h, y +hf(t, y).
where
1
,
2
, , are to be determined.
We apply Taylors theoremin two variable (t, y) applied to the second term(the termcontaining

2
) to obtain an approximation through the second derivative terms:
F(t, y, h, f) =
1
f(t, y)+
2
_
f(t, y)+h
_
f
t
+ff
y

+h
2
_
1
2

2
f
tt
+f
ty
f+
1
2

2
f
2
f
yy

_
+O(h
3
)
where
f
t
=
f
t
, f
y
=
f
y
, etc.
Similarly, we have
y

= f(t, y)
y

= f
t
+f
y
y

= f
t
+f
y
f
y

= f
tt
+ 2f
ty
f +f
yy
f
2
+f
t
f
y
+f
2
y
f.
Now if we expand y(t) in a Taylor polynomial expansion about t
k
we have
y(t
n
+h) = y(t
n
) +
y

(t
n
)
1
h +
y

(t
n
)
2
h
2
+
y

(t
n
)
6
h
3
+O(h
4
).
Let us denote y
(k)
(t
n
) = y
(k)
n
, then the LTE is
LTE =y(t
n+1
) y(t
n
) hF(t
n
, y(t
n
), h; f)
=hy
(1)
n
+
h
2
2
y
(2)
n
+
h
3
6
y
(3)
n
+O(h
4
) hF(t
n
, y(t
n
), h; f)
=h[1
1

2
]f +h
2
[(1/2
2
)f
t
+ (1/2
2
)f
y
f]
+h
3
[(1/6 1/2
2

2
)f
t
t + (1/3
2
)f
ty
f + (1/6 1/2
2

2
)f
yy
f
2
+ 1/6f
y
f
t
+f
2
y
f] +O(h
4
)
For general f we cannot eliminate the third term but by choosing

1
+
2
= 1

2
= 1/2

2
= 1/2
29
we can eliminate the rst two terms. This implies that the LTE is O(h
3
). The system of equations
is underdetermined but we can write

1
= 1
2
, = =
1
2
2
for arbitrary
2
.
Special Cases:
For
2
= 1/2 we get the modied Eulers Method
y
n+1
= y
n
+
h
2
[f(t
n
, y
n
) +f(t
n+1
, y
n
+hf(t
n
, y
n
))].
For
2
= 1 we get the so-called Midpoint Method
y
n+1
= y
n
+
h
2
[f(t
n
+h/2, y
n
) +f(t
n+1
, y
n
+ (h/2)f(t
n
, y
n
))].
We now consider choosing
2
in order to minimize the LTE at the O(h
3
) level. Note that
LTE = c(f,
2
)h
3
+O(h
4
)
where
c(f,
2
) =
_
_
1
6

1
8
2
_
f
tt
+
_
1
3

1
4
2
_
f
ty
f +
_
1
6

1
8
2
_
f
yy
f
2
+
1
6
f
y
f
t
+
1
6
f
2
y
f
_
.
Now applying the Cauchy-Schwartz inequality we get
|c(f,
2
)| c
1
(f)c
2
(
2
),
c
1
(f) =
_
f
2
tt
+f
2
ty
f
2
+f
2
yy
f
4
+f
2
y
f
2
t
+f
4
y
f
2
_
1/2
,
c
2
(
2
) =
_
_
1
6

1
8
2
_
2
+
_
1
3

1
4
2
_
2
+
_
1
6

1
8
2
_
2
+
1
18
_
1/2
.
We can compute the minimum of c
2
() to obtain

2
= 3/4, with c
2
(3/4) = 1/

18.
The resulting method is usually refered to as Huens Method which takes the form
y
k+1
= y
k
+
h
4
_
f(t
k
, y
k
) + 3f(t
k
+
2
3
h, y
n
+
2
3
hf(t
k
, y
k
))

.
30
There is a Huens matlab code named huen.m in Chapter 9 taken from John Mathews book.
This same analysis can be carried out for higher order methods but the algebra becomes very
messy. One method that was very popular until about 1970 was the 4th order Runge-Kutta (RK4)
method with a LTE of O(h
5
). If f does not depend on y this method reduces to simpson rule for
quadrature. The RK4 method goes like this
f
1
= f(t
k
, y
k
)
f
2
= f(t
k
+h/2, y
k
+h/2f
1
)
f
3
= f(t
k
+h/2, y
k
+h/2f
2
)
f
4
= f(t
k
+h, y
k
+hf
3
)
y
k+1
= y
k
+
h
6
(f
1
+ 2f
2
+ 2f
3
+f
4
).
Assignment 3:
1. Program Example 1.4 using Maple, plot y and w and check the error given in the example.
2. Try using two different functions for example to approximate the function w in Example 1.4.
3. Try using different points x
1
and x
2
, e.g. x
1
= 1/4 and x
2
= 3/4 in Example 1.4.
4. Use Maple to carry out the Taylor method up to order n for y

= F(x, y) with y(a) = y


0
.
Apply your program with n = 4, 6, 8 and plot the results. Use
a) F(x, y) = y
2
, y(1) = 1. How do your answers compare with the exact solution on
[1, 2]?
b) Same question with F(x, y) = 3x
2
y, y(0) = 1 on [0, 1].
5. Apply Eulers method to the following:
a) y

= t
2
y on [0, 2] with y(0) = 1. The exact answer is y = e
t
+t
2
2t +2. Use
h = .2, .1, .05.
b) y

=
1
1 t
2
on [0, 1] with y(0) = 1. Note that the exact answer doesnt exist on this
interval. Try the methods anyway with h = .1, .05, .025.
c) y

= e
2t
2y on [0, 2] with y(0) = 1/10 and h = .2, .1, .05. Here y = e
2t
/10 +
te
2t
.
6. Apply the midpoint method, the modied euler method and Huens method for the following
problem with the same h in each case.
y

= y +t + 1, 0 t 1, y(0) = 1.
What do you observe, i.e., how do they compare?
7. Solve the equation y

= 1 + y
2
using any method above and Taylors method of order 2, 4
and 6 on [0, 5] with y(0) = 1 and compare your answers to y = tan(t /4).
31
1.5 Wronskian and Linear Independence
Consider an nth order linear nonhomogeneous equation
y
(n)
+a
1
(t)y
(n1)
+a
2
(t)y
(n2)
+ +a
n
(t)y = (t) (1.5.1)
assuming a
i
(t), b
i
(t) C[a, b].
Let
L() =
d
n
()
dt
n
+a
1
d
n1
dt
n1
() + +a
n
().
Then (1.5.1) may be written as the linear nonhomogeneous system
L(y) = . (1.5.2)
The operator L is said to be linear since
L(cy
1
(t) +c
2
y
2
(t)) = c
1
L(y
1
(t)) +c
2
L(y
2
(t)).
It easily follows that the set of solutions of the homogeneous linear system
L(y) = 0 (1.5.3)
is a vector space.
The Wronskian of {y
j
(t)}
n
j=1
is dened as
W(t) W
_
{y
j
(t)}
n
j=1
_
(t) =

y
1
(t) y
n
(t)
.
.
.
.
.
.
.
.
.
y
(n1)
1
(t) y
(n1)
n
(t)

. (1.5.4)
Theorem 1.1. [Abels Formula] If y
1
, . . . y
n
are solutions of (1.5.3) , and t
0
(a, b), then
W(t) = W(t
0
) exp
_

_
t
t
0
a
1
(s)ds
_
.
Thus the Wronskian of {y
1
, y
n
} is never 0 or identically 0.
Proof. We compute
W

(t) =

1
y

n
y

1
y

n
.
.
.
.
.
.
.
.
.
y
(n1)
1
y
(n1)
1

y
1
y
n
y

1
y

n
y

1
y

n
.
.
.
.
.
.
.
.
.
y
(n1)
1
y
(n1)
n

+ +

y
1
y
n
y
1
1
.
.
.
.
.
.
.
.
.
y
(n2)
1
y
(n2)
n
y
(n)
1
y
(n)
n

32
=

y
1
y
n
y

1
y

n
.
.
.
.
.
.
.
.
.
y
(n2)
1
y
(n2)
n

j=1

j
y
(nj)
1

n

j=1

j
y
(nj)
n

y
1
y
n
y

1
y

n
.
.
.
.
.
.
.
.
.
a
1
(t)y
(n1)
1
a
1
(t)y
(n1)
n

= a
1
(t)W(t).
Hence
W(t) = K exp
_

_
t
t
0
a
1
(ts)ds
_
or, more explicitly,
W(t) = W(t
0
) exp
_

_
t
t
0
a
1
(s)ds
_
.
Denition 1.1. A collection of functions {y
i
(t)}
k
i=1
is linearly independent on (a, b) if
k

i=1
c
i
y
i
(t) = 0 for all x (a, b) c
j
= 0 for j = 1, , n.
Otherwise we say the set {y
i
(t)} is linearly dependent.
Theorem 1.2. Suppose y
1
, . . . , y
n
are solutions of (1.5.2). If the functions are linearly dependent
on (a, b) then W(t) = 0 for all t (a, b). Conversely, if there is an t
0
(a, b) so that W(t
0
) = 0,
then W(t) = 0 for all t (a, b) and the y
i
(t) are linearly dependent on (a, b).
Proof. If the {y
i
(t)} are linearly dependent, then there are c
i
(t) not all zero such that

i
c
i
y
i
(t) = 0 for all t (a, b)

c
i
y
(k)
i
(t) = 0 for all t and any k.
Hence, dening
M(t) =
_

_
y
1
(t) y
n
(t)
.
.
.
.
.
.
.
.
.
y
(n1)
1
(t) y
(n1)
n
(t)
_

_
, C =
_

_
c
1
.
.
.
c
n
_

_
,
33
the system can be written as
M(t)C = 0
and since C = 0 we see that M is singular and therefore
W(t) = det(M(t))0 for all x (a, b).
Conversely, if det(M(t)) = W(t
0
) = 0 then
M(t)C = 0
has a nontrivial solution. For this choice of c
i
s, let
y(t) =

c
i
y
i
(t).
Then
y(t
0
) = 0, y

(t
0
) = 0, , y
(n1)
(t
0
) = 0.
and since y is a solution of Ly = 0, from the uniqueness part of the fundamental existence uniqe-
ness theorem, we must have y(t) = 0 for all x (a, b).
Example 1.6. Consider y
1
= t
2
, y
2
= t|t|. Then
W(t) =

t
2
t|t|
2x 2x sgn(t)

= 2t
3
sgn(t) 2t
2
|t| 0.
However, y
1
(t), y
2
(t) are not linearly dependent. For suppose
c
1
y
1
(t) +c
2
y
2
(t) = 0, for all t.
Then
c
1
t +c
2
|t| = 0 for all t.
If t > 0,
c
1
t +c
2
t = 0 c
1
= c
2
while for t < 0,
c
1
t c
2
t = 0 c
1
= c
2
.
Hence c
1
= c
2
= 0 and so y
1
, y
2
are linearly independent on any interval (a, b) containing 0.
Thus y
1
, y
2
are not solutions of a linear homogeneous 2nd order equation on (a, b).
1.6 Completeness of Solution for Constant Coefcient ODE
We have already learned, in Section 1.2, how to nd a set of n solutions to any homogeneous
equation of the form Ly = 0 with L = D
(n)
+ a
1
D
(n1)
+ + a
n1
D + a
n
. Namely, we factor
the operator into a product of factors (Dr)
k
and (D
2
2D+
2
+
2
)
m
. Having done this we
34
simply observe that the general solution of the associated homogeneous problem for each of these
types of operators is easy to write out. Namely, we have
(D r)
k
y = 0 y =
k

j=1
c
j
t
j1
e
rt
(1.6.1)
(D
2
2D +
2
+
2
)
m
y = 0 y =
k

j=1
c
j
t
j1
e
t
cos(t)
+
k

j=1
c
j
t
j1
e
t
sin(t) (1.6.2)
In the case that the coefcients a
i
are constant, it is possible to describe the solutions explicitly
by simply solving the homogeneous equation for each factor and adding these terms together.
What we have not proved is that all such solutions give a basis for the null space of L, i.e., we
have not shown that the soutions are linearly independent. To show that these solutions are linearly
independent is not really difcult but to do it completely rigorously and carefully is a bit lengthy.
First we note that
Lemma 1.2. If = +i is a real ( = 0 ) or complex number, then
y =
_
k

j=1
c
j
t
j1
_
e
t
is the complete solution of (D )
k
y = 0.
Proof. Showing that the solutions of (D)
k
y = 0 are linearly independent amounts to showing
that
_
k

j=1
c
j
t
j1
_
e
t
= 0 for all t R c
j
= 0, j = 1, 2, , k.
But, on noting that e
t
= 0 and dividing, this result is obvious from the fundamental theorem of
algebra which says that a polynomial of degree k has exactly k zeros.
Lemma 1.3. If
1
=
2
are two complex numbers and
p(t) =
k

j=1
c
j
t
j1
and q(t) =

j=1
d
j
t
j1
,
are two polynomials, then
p(t)e

1
t
= q(t)e

2
t
for all t R p(t) = 0, q(t) = 0.
35
Proof. To see that this is true we rst multiply both sides of the equation by e

1
t
so that
p(t) = q(t)e
(
2

1
)t
for all t R.
Now consider the cases in which < 0, > 0 and = 0 where (
2

1
) + i. If < 0
then (using LHospitals rule in the rst term)
lim
t+
q(t)e
(
2

1
)t
= 0 while lim
t+
p(t) = (as c
k
is pos. or neg.).
So that we must have p(t) 0 and then q(t) 0. If > 0 we repeat the same argument with the
rst limit replace by t . Finally, in the case = 0 we divide both sides of the equation by
q(t) and collect real and imaginary parts to obtain
r
1
(t) +ir
2
(t) =
p(t)
q(t)
= e
it
= cos(t) +i sin(t)
where r
1
(t) and r
1
(t) are rational functions with real coefcients. Equating real and imaginary
parts we see that this would imply that
r
1
(t) = cos(t), r
2
(t) = sin(t)
which is impossible unless r
1
(t) = 0 and r
2
(t) = 0 since the right side has innitely many
zeros while the left can have only a nite number. This in turn implies that p(t) = 0 and also
q(t) = 0.
Lemma 1.4. If > 0,
1
=
2
are real or complex numbers and
(D
2
)

_
p(t)e

1
t
_
= 0
where p(t) is a polynomial, then p(t) 0.
Proof. We know that every solution of (D
2
)

y = 0 can be written as y =
_
q(t)e

2
t
_
for
some polynomial q(t) of degree at most ( 1). So the equestion is whether or not there exists a
polynomial q(t) so that
p(t)e

1
t
= q(t)e

2
t
.
We note that this is only possible when p(t) = 0 and q(t) = 0 by Lemma 1.3.
Lemma 1.5. If p(t) is any polynomial of degree less than or equal (n 1) then
(D
1
)
m
_
p(t)e

2
t
_
= q(t)e

2
t
where q(t) is a polynomial of degree at most the degree of p(t).
Proof. Consider the case m = 1. We have
(D
1
)
_
p(t)e

2
t
_
= q(t)e

2
t
where q(t) = p

(t) + (
2

1
)p(t) which is a polynomial of degree p(t). You can now iterate this
result for general > 0.
36
Lemma 1.6. If L(y) = y
(n)
+a
1
y
(n1)
+ +a
n
y has real coefcients and p(r) = r
n
+a
1
r
(n1)
+
+a
n
. Then p(z) = p(z) for all z C. Therefore if p( +i) = 0 then p( i) = 0.
Proof. For every z
1
, z
2
C, we have z
1
+z
2
= z
1
+ z
2
and z
1
z
2
= z
1
z
2
which also implies
z
n
1
= z
1
n
.
From Lemma 1.6 we know that for a differential operator L with real coefcients, all complex
roots must occur in complex conjugate pairs (counting multiplicity) and from Lemma 1.2 we know
that for a pair of complex roots = +i each of multiplicity k, a set of 2k linearly independent
solutions is given for j = 0, , (k 1) by
t
j
e
t
= t
j
e
t
_
cos(t) +i sin(t)
_
.
t
j
e
t
= t
j
e
t
_
cos(t) i sin(t)
_
.
From this we see that there is a set of real solutions given as a linear combination of these solutions
by
t
j
e
t
cos(t) =
1
2
t
j
_
e
t
+e
t
_
,
and
x
j
e
t
sin(t) =
1
2i
t
j
_
e
t
e
t
_
.
We already know from Lemma 1.2 that t
j
e
t
and t
j
e
t
are linearly independent. Suppose we
have a linear combination
c
j
t
j
e
t
cos(t) +d
j
t
j
e
t
sin(t) = 0.
This would imply that
(c
j
d
j
i)
2
t
j
e
t
+
(c
j
+d
j
i)
2
t
j
e
t
= 0,
but since these functions are independent this implies
(c
j
d
j
i) = 0, (c
j
+d
j
i) = 0, which implies c
j
= d
j
= 0.
Combining these results we have the main theorem:
Theorem 1.3. If L = y
(n)
+ a
1
y
(n1)
+ + a
n
y has real coefcients and we assume that the
polynomial p(r) = r
n
+a
1
r
(n1)
+ +a
n
has zeros given by
r
1
, r
1
, r
2
, r
2
, , r

, r

, r
2+1
, , r
s
where r
j
=
j
+
j
i, j = 1, , ,
j
,
j
R,
j
= 0 and r
j
for j = 2 +1, , s are real. Let
r
j
have multiplicity m
j
for all j. Then if p
j
(t) and q
j
(t) denote arbitrary polynomials (with real
coefcients) of degree (m
j
1), the general solution of Ly = 0 can be written as
y =

j=1
e

j
t
[p
j
(t) cos(
j
t) +q
j
(t) sin(
j
t)] +
s

j=2+1
p
j
(t)e
r
j
t
.
37
Proof. We need only prove that all the functions making up this general linear combination are
linearly independent. We already know that each particular term, i.e., a term of the form p
j
(t)e
r
j
t
or e

j
t
[p
j
(t) cos(
j
t) +q
j
(t) sin(
j
t)] consists of linearly independent functions. Note also that
by rewriting this last expression in terms of complex exponentials, we have the functions p
j
(t)e
r
j
t
and p
j
(t)e
r
j
t
. Thus let us suppose that we have a general linear combination of the form
m

j=1
p
j
(t)e
r
j
t
= 0, for some m,
where all we assume is that r
i
= r
j
for i = j. We want to show this implies that every polyniomial
p
j
0. We prove this by induction:
1. The case s = 1 have already done.
2. Assume that the statement holds for s = k 1, i.e.,
k1

j=1
p
j
(t)e
r
j
t
= 0 implies that every
p
j
(t) 0.
3. Assume that
k

j=1
_
p
j
(t)e
r
j
t
_
= 0. We now apply (D r
k
)
m
k
to this expression and note
that (D r
k
)
m
k
_
p
k
(t)e
r
k
t
_
= 0 so that the sum reduces to
k1

j=1
(D r
k
)
m
k
_
p
j
(t)e
r
j
t
_
= 0.
By Lemma 1.5 this sum can be written as
k1

j=1
q
j
(t)e
r
j
t
= 0
where
(D r
k
)
m
k
_
p
j
(t)e
r
j
t
_
= q
j
(t)e
r
j
t
By the induction hypothesis we have q
j
(t) = 0 for all j = 1, , (k 1). But this implies
that
(D r
k
)
m
k
_
p
j
(t)e
r
j
t
_
= 0, j = 1, , (k 1)
which by Lemma 1.4 implies that p
j
(t) = 0 for all j = 1, , (k 1). Finally we see that
the original expression reduces to
_
p
k
(t)e
r
k
t
_
= 0
which implies that p
k
(t) = 0.
38
Assignment 1
1. Solve the differential equations.
(a) y

+ 2xy +xy
4
= 0
(b) y

=
y
x
+ sin
y x
x
(c) (2x
3
y
2
+ 4x
2
y + 2xy
2
+xy
4
+ 2y)dx + 2(y
3
+x
2
y +x)dy = 0
(d) (y y

x)
2
= 1 + (y

)
2
(e) x
2
yy

+x
2
(y

)
2
5xyy

+ 4y
2
= 0
(f) y

= (5x +y)
2
4
(g) xydx + (x
2
+y
2
)dy = 0
(h) y =
y

x
2
8
_
x
y

_
2
(i) x =
y
3y

2y

y
2
(j) (y

)
4
(x + 2y + 1)(y

)
3
+ (x + 2y + 2xy)(y

)
2
2xyy

= 0
2. Solve 1 +yy

+ (y

)
2
= 0.
3. Consider a differential equation M(x, y) dx + N(x, y) dy = 0 and assume that there is an
integer n so that M(x, y) =
n
M(x, y), N(x, y) =
n
N(x, y) (i.e., the equation is
homogeneous).
Then show that = (xM +yN)
1
is an integrating factor provided that (xM +yN) is not
identically zero. Also, investigate the case in which (xM +yN) 0.
4. Solve the equations
(a) (x
4
+y
4
) dx xy
3
dy = 0
(b) y
2
dx + (x
2
xy y
2
) dy = 0
5. Find the general solution for the differential equation with independent variable x.
(a) y

+ 2y

8y

= 0
(b) y

+ 3y

+ 28y

+ 26y = 0
(c) y

9y

+ 27y

27y = 0
(d) y
(4)
+ 4y

+ 4y = 0
(e) (D 1)
2
(D + 3)(D
2
+ 2D + 5)
2
y = 0
6. Solve the initial value problem
y

4y

+ 4y = 0, y(0) = 4, y

(0) = 1, y

(0) = 19.
39
7. Find the general solution
(a) y

+ 2y

+ 10y = 25x
2
+ 3.
(b) y

+y

6y = 6x
3
+ 3x
2
+ 6x.
(c) y

+ 10y

+ 25y = e
5x
.
(d) y

+ 1.5y

y = 12x
2
+ 6x
3
x
4
with y(0) = 4 and y

(0) = 8.
(e) y

+ 2y

+y = e
x
cos(x).
(f) y

2y

+y = e
x
/x
3
.
(g) (x
2
D
2
2xD + 2)y = x
3
cos(x).
(h) (x
2
D
2
+xD 9)y = 48x
5
.
8. Find the general solution.
a) y

+y = sin x sin 2x
b) y

4y

+ 4y = e
x
+e
2x
c) y

+ 9y = sec 3x
d) y

2y

+y =
e
x
x
3
40

Das könnte Ihnen auch gefallen