You are on page 1of 44

A.C.

Croft: MAA255 Ordinary Differential Equations 1

Ordinary Differential Equations (ODEs)


09MAA255

Contents
PART A

1. Introduction

2. First order ordinary differential equations

PART B

3. General properties of linear ordinary differential equations

4. Linear second order odes with constant coefficients

5. Qualitative theory of differential equations

6. Methods of reduction of order and variation of parameters


A.C.Croft: MAA255 Ordinary Differential Equations 2

Ordinary Differential Equations - PART A


April 24, 2011

1 Introduction
• An Ordinary Differential Equation (ode) is an equation which involves at least one derivative of a
function of a single variable and, possibly, the function itself and the independent variable.

• The order of an ode is the order of the highest derivative.


 2
d3 y dy
e.g. 3
+ 6x + y2 = 0 is an ode of order 3.
dx dx
• A particular solution of an ode is a function which satisfies it.

• Solving an ode involves the process of integration.


Each step of integration introduces an arbitrary constant.
Thus the general solution of an nth order ode must include n arbitrary constants.

• Any particular solution may be obtained by taking particular values of the arbitrary constants.

• The arbitrary constants for any particular solution may be determined by boundary (or initial)
conditions.

1.1 Some examples

Example 1. Consider the equation


dy
= A cos(nx).
dx
This is a first order ode which can be solved simply by integration to obtain
A
y= sin(nx) + B
n
where B is an arbitrary constant of integration.
If it is known that y = y0 when x = 0, the constant of integration B must be equal to y0 , and the
particular solution of the ode satisfying this initial condition is
A
y = y0 + sin(nx).
n

Example 2. Consider the motion of a particle of mass m subject to a force given by P e−kt , where P
and k are constants.
The equation of motion is mẍ = P e−kt .
d2 x
(Note that a derivative with respect to time t is denoted by a dot. e.g. dx
dt = ẋ, and dt2 = ẍ.) Thus

P −kt
ẍ = e
m
integrating this gives
P −kt
ẋ = − e +A
mk
where A is an arbitrary constant of integration. Integrating again gives
P −kt
x= e + At + B
mk2
A.C.Croft: MAA255 Ordinary Differential Equations 3

where B is an arbitrary constant of integration.


If the particle is projected from the origin with speed V0 when t = 0.
i.e. when t = 0, x = 0 and ẋ = V0 , then
P P
A = V0 + , and B=− .
mk mk2
Thus
P  −kt 
x = V0 t + e − 1 + kt
mk2
This is the particular solution of the equation of motion subject to the given initial conditions.
Notice that the general solution of this second order ode contains two arbitrary constants A, B.

Example 3: Radioactivity.
The rate of decay of a radioactive substance is proportional to the amount of the substance which
remains. Denoting the amount of the substance by x, this implies that

ẋ = −kx (1)

where k is a positive constant.


Equation (1) can be rewritten as
dt 1
=−
dx kx
and this can be integrated with respect to x to give
1 dx 1
Z
t=− = − log x + c
k x k
where c is an arbitrary constant.
1
If x = x0 when t = 0, the constant c must be given by k log x0 . Thus

x
 
−kt = log x − log x0 = log
x0
and so
x = x0 e−kt .
i.e. the amount of radioactive material exponentially decays.

Example 4: Cooling.
The rate of change of the temperature of a body is proportional to the difference in temperature between
the body and its surroundings. Denoting temperature by θ, this implies that

= −k(θ − A) (2)
dt
where k is a positive constant and A is the temperature of the surroundings (assumed constant).
Equation (2) can be rewritten as
dt 1
=−
dθ k(θ − A)
and so
1 dθ 1
Z
t=− = − log(θ − A) + c
k θ−A k
where c is an arbitrary constant.
Again, if θ = θ0 when t = 0, we obtain
θ−A
 
−kt = log or θ = A + (θ0 − A)e−kt .
θ0 − A
A.C.Croft: MAA255 Ordinary Differential Equations 4

1.2 Notation
An nth order ode can be expressed in the form

f (x, y, y ′ , y ′′ , . . . , y (n) ) = 0. (1)

A general solution of this must contain n arbitrary constants. This may be expressed in the form

g(x, y, c1 , c2 , . . . , cn ) = 0. (2)

Provided the n constants in an equation of the form (2) are independent, it is possible to construct an
nth order ode (1) which they must satisfy. This is obtained by differentiating (2) n times and using the n
equations to eliminate the n arbitrary constants. Equation (2) is then called the primitive corresponding
to the differential equation (1).
e.g. Consider the primitive y = c log x, which contains one arbitrary parameter c. It can be seen that
y ′ = cx−1 . We can then eliminate c by putting c = xy ′ , to obtain y = xy ′ log x, or
dy y
= .
dx x log x

It is usual to be given the differential equation (1) and be required to find the general solution (2).
However, it is not always the case that a solution will exist or, if it does, that it will include all possible
solutions.

Example 5. Consider the first order ode

ẋ2 = k2 (a2 − x2 ) (3)

for constants a and k. This can be written as


dt 1
=± √ ,
dx k a − x2
2

which can be integrated to give


x
 
−1
kt = ± sin +c or x = ±a sin(kt − c). (4)
a
This is the general solution of (3) containing the single arbitrary constant c.

Note: There exist two special solutions of (3), namely x = a and x = −a which are not contained
in the general solution (4). These are known as singular solutions.
(In this case, they are the envelopes of the family of solutions (4).)

Questions concerning the existence and uniqueness of solutions, and the occurrence of singular solutions,
are advanced topics that will not be considered in this module.

2 First order ordinary differential equations

Consider here equations that can be written in the form

dy
= F (x, y).
dx

Many different techniques exist for solving odes of this type. These depend crucially on the character of
the function F (x, y).
A.C.Croft: MAA255 Ordinary Differential Equations 5

2.1 Separable equations

We have already considered first order odes of the form


dy dy
= f (x) and = g(y)
dx dx
and shown that these can be solved by direct integration as
dy
Z Z Z Z
dy = f (x) dx and = dx
g(y)
e.g.
dy
Z Z
= cos x ⇒ dy = cos x dx ⇒ dy = cos x dx ⇒ y = sin x + c.
dx

This approach can be extended to cases in which F can be written as the product of separate functions
of the dependent and independent variables. i.e. when the ode can be written in the form

dy
= f (x) g(y).
dx

In this case, the y- and x-dependent terms can be separated to give


dy
= f (x) dx,
g(y)

and a solution can be obtained by integration —


dy
Z Z
= f (x) dx.
g(y)

dy y+1
Example 1: Find the solution of the equation =
dx x−1
such that y = 1 when x = 0.
Separating variables (and noting that we need the solution near x = 0) gives

dy dx
Z Z
=−
y+1 1−x

log |y + 1| = log |1 − x| + A.
Putting A = log C for convenience, we obtain

y + 1 = C(1 − x).

But y = 1 when x = 0. Thus we require that C = 2, giving

y + 1 = 2(1 − x) or y = 1 − 2x.
A.C.Croft: MAA255 Ordinary Differential Equations 6

dy
Example 2: Consider x + cot y = 0.
dx
Separating variables gives
dx
Z Z
− tan y dy =
x
Thus
log(cos y) = log x + log C
or
cos y = C x
i.e.
y = cos−1 (C x).

dv
Example 3: Consider = g − k v2 .
dt
This is the equation of motion for a body falling vertically under the action of a gravitational force mg and
a resistance to the motion mkv 2 , which is proportional to the square of the speed: m dv dt = mg − mkv .
2

Separating variables gives


dv
Z Z
= k dt.
( kg − v 2 )
Integrating this gives
1 v
 
−1
q tanh q = k t + const.
g g
k k

If the body is dropped from rest (i.e. if v = 0 when t = 0), then the constant must be zero, and we
obtain
g
r p 
v= tanh gk t .
k
q
g
Thus, as t → ∞, v approaches the terminal speed of k.

dy x3
Example 4: Consider = 2.
dx y
Separating variables gives Z Z
y 2 dy = x3 dx.

Integrating this gives


y3 x4
= +c
3 4
or  1/3
3 4
y= 4x + 3c .

2.2 Homogeneous equations


Differential equations of the form

dy y
 
=f
dx x

are called homogeneous equations.


Specifically, this applies to equations that can be written in the form
dy P (x, y)
=
dx Q(x, y)
A.C.Croft: MAA255 Ordinary Differential Equations 7

where P and Q are homogeneous equations in x and y and are of the same degree.

P x3 + 2xy 2 + y 3 P ax2 + bxy + cy 2


For example = 2 or = 2
Q x y + xy 2 + 2y 3 Q lx + mxy + ny 2
Equations of this type can be transformed into separable equations by the substitution

y = vx

where v is a function of x.
dy dv
With this substitution =v+x , so that the equation becomes
dx dx
dv
v+x = f (v)
dx
which can be separated as
dv dx
Z Z
= .
f (v) − v x

(Note that a singular solution of the form y = kx may occur for this class of equations when k is a
root of the equation f (k) = k.)

dy
Example 1: Consider the equation 2xy = x2 + y 2 .
dx
This can be written as
dy 1 x y
 
= + .
dx 2 y x
dy dv
Putting y = v(x)x, so that dx = v + x dx , this becomes

dv 1 1
 
v+x = +v
dx 2 v
or
dv 1 1
 
= −v
dx 2x v
in which the variables can be separated to give
2 v dv dx
Z Z
=
1 − v2 x
so that
1
− log(1 − v 2 ) = log x + log c, or = cx
1 − v2
and so
x2 √ q
= cx or x = c(x2 − y 2 ) or y= x x − 1c .
x2 − y 2

(Notice that the equation in this example admits the singular solutions y = ±x.)
A.C.Croft: MAA255 Ordinary Differential Equations 8

dy
Example 2: Consider the equation y 2 + (xy + x2 ) = 0.
dx
In this case,
dy y2
=− .
dx xy + x2
Putting y = v(x)x, this becomes
dv v2
v+x =−
dx v+1
so that
dv 1 v(2v + 1)
x =− (v 2 + v 2 + v) = − .
dx v+1 v+1
Separating the variables gives
(v + 1) dx
Z Z
dv = − .
v(2v + 1) x
The first integral can be expanded using partial fractions to give
dv dv dx
Z Z Z
− =− .
v 2v + 1 x
so that
log v − 21 log(2v + 1) = − log x + log c
or ! !
v2 c2 y2 c2
log = log or =
2v + 1 x2 2xy + x2 x2
i.e
2y 2c2 y
 
2 2
y =c +1 or x= .
x y 2 − c2

(Notice that the equation in this example admits the singular solution y = − 12 x.)

2.2.1 Equations that are reducible to homogeneous form


Consider first order differential equations of the form
dy ax + by + c
 
=f
dx lx + my + n
These equations would be homogeneous if the constants c and n were zero. However, it is possible to
use the substitutions (a shift in the origin of the coordinates)

x = X + α, y = Y +β

to reduce these terms to zero and hence to solve these equations by the above method.
Using these substitutions

ax + by + c = aX + bY + (aα + bβ + c), lx + my + n = lX + mY + (lα + mβ + n)

and, provided am − bl 6= 0, it is possible to choose α and β such that aα + bβ + c = 0 and


lα + mβ + n = 0, and the differential equation takes the form
dY aX + bY
 
=f
dX lX + mY
which is a homogeneous equation that can be solved by the above method.
A.C.Croft: MAA255 Ordinary Differential Equations 9

dy y−x+1
Example 3: Consider the equation = .
dx y+x+5
Put x = X + α, y = Y + β. Then

y − x + 1 = Y − X + (−α + β + 1), y + x + 5 = Y + X + (α + β + 5)

It can then be seen that −α + β + 1 = 0 and α + β + 5 = 0 if α = −2, β = −3.


With this choice, the differential equation becomes
dY Y −X
= .
dX Y +X
dY dv
Putting Y = v(X)X, so that dX = v + X dX , this becomes

dv v−1
v+X =
dX v+1
so that
dv v−1 v − 1 v2 + v v2 + 1
X = −v = − =− .
dX v+1 v+1 v+1 v+1
Separating the variables gives
v+1 dX
Z Z
2
dv = −
v +1 X
which can be integrated to yield
1
2 log(v 2 + 1) + tan−1 v = − log X + log c

or
log X 2 + log(v 2 + 1) = log c2 − 2 tan−1 v
or
X 2 (v 2 + 1) = c2 e−2 tan v
−1

or !
Y2 Y
 
2
X +1 = c2 exp −2 tan−1
X2 X
and thus we obtain
y+3
 
2 2 2 −1
(x + 2) + (y + 3) = c exp −2 tan .
x+2

(Notice that no singular solutions occur for the equation in this example.)

dy x−y+1
Example 4: Consider the equation = .
dx 2x − 2y + 3

Notice that, in this equation, it is not possible to shift the origin of the coordinates to remove the constant
terms. However, in this case, it is possible to proceed by putting

z = x − y.

i.e. we put y = x − z(x), so that


dy dz
=1−
dx dx
and the equation becomes
dz z+1
1− =
dx 2z + 3
or
dz z+1 z+2
=1− = .
dx 2z + 3 2z + 3
A.C.Croft: MAA255 Ordinary Differential Equations 10

It is then possible to separate the variables to obtain


2z + 3 1
Z Z   Z
dz = 2− dz = dx
z+2 z+2
so that
2z − log(z + 2) = x + c
or
2(x − y) − log(x − y + 2) = x + c or x − 2y − c = log(x − y + 2).

2.3 Linear equations

dy
Example 1. Find the general solution of the equation x + y = ex .
dx
It may immediately be noticed that this equation can be expressed in the form
d
(xy) = ex
dx
which can immediately be integrated to give

x y = ex + c.

Thus
ex + c
y= .
x

It may also be noticed that the above ode is equivalent to either of the forms
dy 1 dy y ex
x2 + x y = x ex or + 2 = 2.
dx x dx x x
These equations may therefore also be integrated as above by first multiplying by 1/x or x2 respectively.
This approach may be formalised as follows:

Consider linear ordinary differential equations of the form

dy
a(x) + b(x) y = f (x).
dx

d
It may be observed that if b(x) = dx a(x), then the left hand side is

d dy da
 
a(x) y = a(x) + y.
dx dx dx
Since the left hand side in this case is an exact differential, the solution can be obtained by integrating
to obtain Z
a(x) y = f (x) dx
or
1
Z
y= f (x) dx.
a(x)
d
If b(x) 6= dx a(x), it is always possible to multiply both sides of the equation by a particular function
such that this condition is satisfied. We proceed as follows.
First divide by a(x) , to write the general first order linear ode in the form

dy
+ p(x) y = q(x).
dx
A.C.Croft: MAA255 Ordinary Differential Equations 11

Then multiply by an integrating factor (IF) r(x) giving


dy
+ r(x) p(x) y = r(x) q(x).
r(x)
dx
This is of the required form for exact integration if
d dr
r(x) p(x) = dx r(x) or = r p(x).
dx
Separating the variables gives
dr
Z Z
= log r = p(x) dx.
r
Hence the required integrating factor for the above equation with a specific p(x) is given by
R
p(x)dx
r(x) = e .

Once this is known, the differential equation can be written as


d h i
r(x) y = r(x) q(x),
dx
and the solution is obtained by evaluating
1
Z
y= r(x) q(x) dx.
r(x)

Note 1. When evaluating an integrating factor, the constant of integration is irrelevant as it simply
corresponds to multiplying the equation by a constant.
R R R
p(x)dx p(x)dx+c p(x)dx c
e.g. r(x) = e →e =e e.
The factor ec is just an arbitrary multiplicative constant.
When applied to a linear ode, it may be chosen for convenience.
Z
Note 2. The constant of integration in the final integration of r(x) q(x) dx is essential. This constant
must be inserted when the integral is evaluated. It results in a term in the solution of the form
c
y = ...... + .
r(x)
The constant of integration is not added afterwards.

Example 2. Find the general solution of the equation


dy 2
+ y = x2
dx x
This is in the standard form of a first order linear ode in which p(x) = x2 .
Thus, the integrating factor is
R R
p(x)dx ( x2 )dx 2)
r(x) = e =e = e2 log x = elog(x = x2 .
Multiplying the ode by the IF x2 gives
dy
x2 + 2 x y = x4
dx
or
d h 2 i
x y = x4 ,
dx
which integrates to give
x2 y = 1
5 x5 + c.
x3 c
Thus, the general solution is y= + 2.
5 x
A.C.Croft: MAA255 Ordinary Differential Equations 12

dy
Example 3. Find the general solution of the equation + (x + 1) y = ex . x
dx
This can be written in the standard form of a first order linear ode as
dy 1 1 x
 
+ 1+ y= e
dx x x

in which p(x) = 1 + x1 and q(x) = 1


x ex .
Thus, the integrating factor is
R R
p(x)dx (1+ x1 )dx
r(x) = e =e = ex+log x = ex elog x = x ex .

Multiplying the ode by the IF x ex gives


d h x i
x e y = e2x ,
dx
which integrates to give Z
x ex y = e2x dx = 21 e2x + c.

ex c e−x
Thus, the general solution is y= + .
2x x

df
Example 4. Find the general solution of the equation + sin θ f = 1. cos θ

This can be written in the standard form of a first order linear ode as
df
+ tan θ f = sec θ.

in which p(θ) = tan θ.
Thus, the integrating factor is
R R
p(θ)dθ tan θ
r(θ) = e =e dθ = e− log cos θ = elog sec θ = sec θ.

Multiplying the ode by the IF sec θ gives


d h i
sec θ f = sec2 θ,

which integrates to give Z
sec θ f = sec2 θ dθ = tan θ + c.

Thus, the general solution is


f = sin θ + c cos θ.

2.4 Some special cases


It was seen above that, using the substitutions x = X + α and y = Y + β, differential equations of
the form
dy ax + by + c
 
=f
dx lx + my + n
could be reduced to equations of homogeneous type, namely
dy y
 
=F .
dx x
Many other differential equations can similarly be solved after using appropriate transformations of the
variables.
A.C.Croft: MAA255 Ordinary Differential Equations 13

2.4.1 Bernoulli equations


An equation of the type
dy
+ p(x) y = q(x) y n
dx
where n is a constant and p(x) and q(x) are given functions is called a Bernoulli equation.
Dividing by y n gives
dy
y −n + p(x) y 1−n = q(x).
dx
It can be seen that this can be simplified by putting
dz dy
z = y 1−n so that = (1 − n)y −n
dx dx
and the equation takes the form
1 dz
+ p(x) z = q(x)
(1 − n) dx
or
dz
+ (1 − n)p(x) z = (1 − n)q(x)
dx
which is a linear equation in z, and can be solved using a standard integrating factor.

Notice that the case when n = 0 is linear and, when n = 1, the equation has separable variables.
Otherwise n can be any real number.

dy
Example 1. Consider the equation = xy 3 + 2xy.
dx
This is a Bernoulli equation with n = 3, which can be rewritten as
1 dy 2x
− = x.
y 3 dx y 2
dz dy
Put z = y −2 , = −2y −3 to obtain
dx dx
1 dz
− 2x z = x
(−2) dx
or
dz
+ 4x z = −2x
dx
which is a linear equation for which the integrating factor is
R R 2
p(x)dx 4x dx
r(x) = e =e = e2x .

Multiplying by this, we obtain


d h 2x2 i 2
e z = −2x e2x
dx
which can be integrated to give
2 2
e2x z = − 21 e2x + c
or
2
z = − 12 + c e−2x
or
1
y=q .
c e−2x − 12
2
A.C.Croft: MAA255 Ordinary Differential Equations 14

2.4.2 Riccati equations


An equation of the type
dy
= P (x) y 2 + Q(x) y + R(x) (1)
dx
is called a Riccati equation.

Notice that the equation is linear when P = 0, and is a Bernoulli equation when R = 0.

No method exists which will always give the general solution of this equation.
However, a general solution can be obtained if a particular solution is first known.

Suppose that y = u(x) is a known particular solution of (1). i.e. it satisfies the equation

u′ = P u2 + Qu + R.

Now consider the function

y = u(x) + 1/z(x) so that y ′ = u′ − z ′ /z 2 .

Substituting this into (1) gives

z′ 2u 1 1
   
u − 2 = P u2 +

+ 2 +Q u+ + R.
z z z z

But u′ = P u2 + Qu + R, and we obtain

−z ′ = P (2uz + 1) + Qz

or
z ′ + (2P u + Q)z + P = 0 (2)
which is a linear equation whose general solution can be obtained.

Theorem: If u(x) is a known solution of (1), and if a general solution of (2) can be found for z(x), then
y = u + 1/z is a general solution of (1).

Proof: If u satisfies (1) and z satisfies (2), y = u + 1/z must satisfy (1).
If z is a general solution of (2), it must contain an arbitrary constant.
Hence, y = u + 1/z contains an arbitrary constant.
Thus it must be the general solution of (1).

dy y 3
Example 2. Consider the equation = y2 + − 2 .
dx x x
It can be seen that y = 1/x satisfies this equation.
Thus, substitute y = 1/x + 1/z to obtain

1 z′ 1 2 1 1 1 3
   
− 2
− 2 = + + + + −
x z x2 xz z 2 x2 xz x2
or
z′ 2 1 1
− 2
=+ + 2+
z xz z xz
or
3
z′ +
z = −1
x
which is a linear equation for which the integrating factor is
R R
p(x)dx ( x3 )dx 3)
r(x) = e =e = e3 log x = elog(x = x3 .
A.C.Croft: MAA255 Ordinary Differential Equations 15

Multiplying by this gives


dh 3 i
x z = −x3
dx
which implies that
c x
x3 z = − 14 x4 + c or z= 3

x 4
and thus
1 4x3
y= + .
x 4c − x4

2.5 Exact differential equations


dy
It was shown above that the component + p(x) y could be multiplied by the integrating factor
dx i
R d h
r(x) = e p(x)dx to obtain the form r(x) y which is an exact derivative.
dx
e.g. in example 4 above, the primitive
sec x y = tan x + c (1)
corresponds to the differential equation
dy
sec x + sec x tan x y = sec2 x (2)
dx
although this would normally be written as
dy
+ tan x y = sec x. (3)
dx
Equation (2) is said to be exact because it can immediately be integrated to give (1). (It is the exact
derivative of (1).) However, the equivalent equation (3) is not exact.

Consider a primitive of the form


φ(x, y) = c. (1)
Differentiating this with respect to x gives
∂φ ∂φ dy
+ = 0.
∂x ∂y dx
Thus (1) is a solution of the differential equation
dy
P (x, y) + Q(x, y) =0 (2)
dx
∂φ ∂φ
if P (x, y) = and Q(x, y) = .
∂x ∂y
Thus, differential equations of the form (2) can be solved as exact equations if there exists a function
φ(x, y) such that the components P and Q are respectively the x and y partial derivatives of φ.

dy
Example 1. Consider the equation y cos x − y 2 sin x + (sin x + 2y cos x) = 0.
dx
It can be seen that this has the solution
y sin x + y 2 cos x = c,
∂ ∂
since ∂x [y sin x + y 2 cos x] = y cos x − y 2 sin x and ∂y [y sin x + y 2 cos x] = sin x + 2y cos x.
However, it may be noticed that the differential equation would usually be written as
dy y (1 − y tan x)
=
dx tan x + 2y
and this only becomes exact after multiplying both sides by (sin x + 2y cos x) and rearranging.
A.C.Croft: MAA255 Ordinary Differential Equations 16

Theory: A differential equation of the form

dy
P (x, y) + Q(x, y) =0
dx

can be solved as an exact equation if there exists a function φ(x, y) such that

P (x, y) = φx and Q(x, y) = φy

where the suffices denote partial derivatives.


∂2 ∂2
It is known that partial derivatives commute (i.e. = ).
∂x∂y ∂y∂x
In this case φxy = φyx . Thus

Py = Qx .

In fact, this is a necessary and sufficient condition for the existence of a function φ such that P = φx
and Q = φy . The solution of the differential equation is then given by φ = c, where φ is obtained
by solving these equations.

Notice that, if Py 6= Qx , an exact equation can sometimes be obtained by multiplying by a suitable


function.

dy 2x2 − 2y + y 2
Example 2. Consider the equation = .
dx x(1 − y)
Rewrite this as
dy
2x2 − 2y + y 2 + (−x + xy) = 0.
dx
dy
This is of the form P (x, y) + Q(x, y) dx =0 where P = 2x2 − 2y + y 2 , Q = −x + xy.
This is an exact equation if Py = Qx .
But
Py = −2 + 2y, Qx = −1 + y.
Thus it is not an exact equation. However, multiplying by 2x gives
dy
4x3 − 4xy + 2xy 2 + (−2x2 + 2x2 y) = 0,
dx
Which has the above form with P = 4x3 − 4xy + 2xy 2 , Q = −2x2 + 2x2 y, for which

Py = −4x + 4xy, Qx = −4x + 4xy,

which satisfies the condition Py = Qx .


Thus there exists a function φ(x, y) such that

∂φ ∂φ
= P = 4x3 − 4xy + 2xy 2 and = Q = −2x2 + 2x2 y.
∂x ∂y
By direct inspection, it can be seen that φ must have the form

φ = x4 − 2x2 y + x2 y 2 + const.

Thus the differential equation has the solution

x4 − x2 y(2 − y) + c = 0.
A.C.Croft: MAA255 Ordinary Differential Equations 17

2.6 Summary

For first order odes, we consider equations of the form


dy
= F (x, y).
dx
We have considered techniques for solving such equations when the function F (x, y) has any of the
following forms.

If F = f (x) g(y) the equation may be integrated after separating the variables.

y Put y = v(x) x.
 
If F =f the equation is homogeneous.
x The equation is then separable.

ax + by + c Shift the origin to remove c and n.


 
If F =f with am − bl 6= 0.
lx + my + n The equation is then homogeneous.

ax + by + c Put z = ax + by.
 
If F =f with am − bl = 0.
lx + my + n The equation is then separable.

R
p(x)dx
If F = q(x) − p(x) y the equation is linear. Use the integrating factor r(x) = e .

If F = q(x) y n − p(x) y – a Bernoulli equation. Put z = y 1−n to obtain a linear eqn.

If F = P (x) y 2 + Q(x) y + R(x) – a Riccati equation. Need a particular solution first.

P (x, y)
If F =− where Py = Qx , the equation is exact.
Q(x, y)

First order odes with some other forms for F (x, y) can be solved by special methods. However, for
the general case, no analytic methods are known for generating solutions given in terms of elementary
functions. Even for the above methods, the remaining integrals involved often cannot be evaluated
explicitly in terms of elementary functions.
A.C.Croft: MAA255 Ordinary Differential Equations 18

Ordinary Differential Equations PART B


09MAA255

Part B Contents
PART B

3. General properties of linear ordinary differential equations

4. Linear second order odes with constant coefficients

5. Qualitative theory of differential equations

6. Methods of reduction of order and variation of parameters


A.C.Croft: MAA255 Ordinary Differential Equations 19

Ordinary Differential Equations - PART B

3 General properties of linear ODEs


Second order linear ODEs generally have the form
d2 y dy
a(x) 2
+ b(x) + c(x) y = f (x), (1)
dx dx
where a, b, c and f are arbitrary functions of x.

Generally, linear nth order odes have the form


n
X di y
ai (x) = f (x).
i=0
dxi

They are called homogeneous if f (x) = 0.

The following notes concentrate on second order equations, but the general properties of nth order linear
odes can be immediately deduced.

3.1 Superposition of solutions

Initially consider the homogeneous case in which f (x) = 0. i.e. consider

d2 y dy
a 2
+b + c y = 0.
dx dx
(2)
Note first some general properties

• If y(x) is a solution of (2), then A y(x), where A is a constant, is also a solution.

• If y1 (x) and y2 (x) are any two solutions of (2),


then y1 (x) + y2 (x) is also a solution.

Proof; a (y1′′ + y2′′ ) + b (y1′ + y2′ ) + c (y1 + y2 )


= (a y1′′ + b y1′ + c y1 ) + (a y2′′ + b y2′ + c y2 ) = 0

Since a general solution of a second order ODE must contain two arbitrary constants, it follows that, if
y1 (x) and y2 (x) are two linearly independent solutions of (2), then the general solution is given by

y = A y1 (x) + B y2 (x),

where A and B are arbitrary constants.

d2 y
Example 1. The ode +y =0
dx2
has solutions y = sin x, 2 sin x, cos x, . . . etc.
Since sin x and cos x are linearly independent functions, the general solution is

y = A sin x + B cos x.

All solutions of y ′′ + y = 0 may be written in this form.


A.C.Croft: MAA255 Ordinary Differential Equations 20

d2 y dy
Example 2. The ode (1 − x2 ) 2
− 2x + 2y = 0
dx dx
x 1+x
 
has solutions y = x, and y = log − 1.
2 1−x
Since these are linearly independent, the general solution is
x 1+x
   
y = Ax + B log −1 .
2 1−x
Consider the linear second order ordinary differential equation
d2 y dy
a 2
+b + c y = f (x) (1)
dx dx
and the associated reduced equation in which f (x) is replaced by 0
d2 y dy
a 2
+b + c y = 0. (2)
dx dx
Theorem 1: If y1 (x) is a solution of (2), and y3 (x) is a solution of (1), then y1 (x) + y3 (x) is also
a solution of (1).

Proof: For y = y1 + y3 consider


a (y1′′ + y3′′ ) + b (y1′ + y3′ ) + c (y1 + y3 )
= (a y1′′ + b y1′ + c y1 ) + (a y3′′ + b y3′ + c y3 )
= 0 + f (x)
thus satisfying (1).
Theorem 2: If y3 (x) is a solution of (1), and Ay1 (x) + By2 (x) is the general solution of the reduced
equation (2) , then y = y3 (x) + Ay1 (x) + By2 (x) is the general solution of the complete
equation (1).

Proof: By Theorem 1, y = y3 (x) + Ay1 (x) + By2 (x) is a solution of (1). And, since it contains two
arbitrary constants, it must also be the general solution of (1).

The general solution of the reduced eqn (2) is known as the complementary function (CF).
A solution of the complete equation (1) is known as a particular integral (PI).
Thus, the general solution of the complete equation (1) is given by
GS = PI + CF

d2 y
Example 3: For the ode +y =x
dx2
CF: y = A sin x + B cos x
PI: y=x
GS: y = x + A sin x + B cos x

To solve non-homogeneous odes of the form (1), we need to find both the CF and the PI.

Similarly, the general solution of an nth order linear ode


n
X di y
ai (x) = f (x)
i=0
dxi
is the sum of a particular solution (PI) and the general solution (CF) of the reduced equation
n
X di y
ai (x) =0
i=0
dxi
which must contain n arbitrary constants.
A.C.Croft: MAA255 Ordinary Differential Equations 21

4 Linear, second order ODEs with constant coefficients


4.1 Complementary functions

We need to find the general solution of the homogeneous (or reduced) equation

d2 y dy
a 2
+b + c y = 0.
dx dx
(2)
for the case in which a, b and c are constants.
Consider a possible trial solution of the form

y = emx . (3)

Then, y ′ = m emx , y ′′ = m2 emx , and substituting into (2) gives

(a m2 + b m + c) emx = 0.

But emx 6= 0. Thus (3) is a solution of (2) only if m is a root of the quadratic

a m2 + b m + c = 0.
(4)
This is known as the auxiliary equation. It gives two possible solutions for m :
√ √
−b + b2 − 4ac −b − b2 − 4ac
m1 = , m2 = .
2a 2a
This gives two possible solutions of the reduced equation (2) :

y1 (x) = em1 x , y2 (x) = em2 x .

Provided m1 and m2 are distinct, the general solution of the homogeneous equation (2) can be expressed
as

y = A em1 x + B em2 x
(5)
where A and B are arbitrary constants.

Three cases need to be distinguished ;


(1) b2 > 4ac : m1 , m2 are distinct and real.
(2) b2 < 4ac : m1 , m2 are complex conjugates.
(3) b2 = 4ac : There is only one (repeated) root for m.

Case (1) b2 > 4ac : The auxiliary equation has distinct real roots m1 , m2 .
The general solution is

y = A em1 x + B em2 x .
(5)

d2 y dy
Example 1: 2
−3 + 2y = 0
dx dx
The auxiliary equation is m2 − 3 m + 2 = 0
A.C.Croft: MAA255 Ordinary Differential Equations 22

i.e. (m − 1)(m − 2) = 0
This has roots m1 = 1, m2 = 2
The general solution is y = A ex + B e2x

Example 2: ẍ − 3ẋ + x = 0
The auxiliary equation is m2 − 3 m + 1 = 0
This has roots √
3± 9−4 1 √
m= = (3 ± 5)
2 2
1
√ 1

The general solution is x = A e 2 (3+ 5)t
+ B e 2 (3− 5)t

Case (2) b2 < 4ac : The auxiliary equation has complex conjugate roots.
Put √
b 4ac − b2
− = α, =β
2a 2a

−b ± b2 − 4ac
so that m= can be written as
2a

m = α ± iβ.

Then y = e(α+iβ)x and y = e(α−iβ)x are solutions of (2).


The general solution can be written as

y = A1 e(α+iβ)x + A2 e(α−iβ)x .

For the solution to be real, it is necessary that A2 = A1 . thus


 
y = A1 eiβx + A1 e−iβx eαx
h i
= A1 (cos βx + i sin βx) + A1 (cos βx − i sin βx) eαx
h i
= (A1 + A1 ) cos βx + i(A1 − A1 ) sin βx eαx

Putting A1 = 21 (A − iB), the general solution can be written in the form

y = (A cos βx + B sin βx)eαx .

Also consider putting A = C sin φ, B = C cos φ, where C and φ are constants, so that

y = C( sin φ cos βx + cos φ sin βx)eαx

or

y = C eαx sin(βx + φ).

This replaces the two constants A and B (or the real and imaginary parts of A1 ) by an arbitrary amplitude
C and phase φ.
A.C.Croft: MAA255 Ordinary Differential Equations 23

d2 y dy
Example 3: 2
−2 + 2y = 0
dx dx
The auxiliary equation is m2 − 2 m + 2 = 0

2± 4−8
This has roots m= 2 =1±i
i.e. α = 1, β = 1
The general solution is y = (A cos x + B sin x)ex

Example 4: The equation for simple harmonic motion ẍ + n2 x = 0


This arises from an equation of motion such as —
mass × acceleration (mẍ) = a restoring force proportional to displacement (−mn2 x)
The auxiliary equation is m2 + n 2 = 0
This has roots m = ±in
i.e. α = 0, β = n
The general solution is x = A cos nt + B sin nt
or x = C sin(nt + φ).

Case (3) b2 = 4ac : The auxiliary equation has a repeated root.


b
m = − 2a (repeated)

We know that y = emx is a solution of (2). To form a general solution, we need a second independent
solution.
Putting c = b2 /4a, we rewrite the equation a y ′′ + b y ′ + c y = 0 as

d2 y b dy b2
+ + y=0 or y ′′ − 2m y ′ + m2 y = 0.
dx2 a dx 4a2
Now look for a second solution of the form y = f (x) emx .
Substituting this with y ′ = mf emx + f ′ emx , and y ′′ = m2 f emx + 2mf ′ emx + f ′′ emx gives
 
m2 f + 2mf ′ + f ′′ − 2m(mf + f ′ ) + m2 f emx = 0

which is only satisfied if f ′′ = 0. i.e. if f (x) = A + B x.


Thus, a general solution of (2) is given by

y = (A + B x) emx .

Notice that this includes the initial solution emx and a second linearly independent solution x emx .

d2 y dy
Example 5: −4 + 4y = 0
dx2 dx
The auxiliary equation is m2 − 4 m + 4 = 0
i.e. (m − 2)2 = 0
This has a repeated root m = 2.
The general solution is y = (A x + B) e2x
A.C.Croft: MAA255 Ordinary Differential Equations 24

Summary
For the homogeneous linear ode with constant coefficients

d2 y dy
a 2
+b + cy = 0 (2)
dx dx
the auxiliary equation is
a m2 + b m + c = 0

(1) If this has distinct real roots m1 , m2 ,


the general solution of (2) is
y = A em1 x + B em2 x

(2) If it has complex conjugate roots m = α ± iβ,


the general solution can be written as either

y = (A cos βx + B sin βx)eαx

or
y = C eαx sin(βx + φ)

(3) If it has a repeated root m,


the general solution is
y = (A + B x) emx

4.2 Particular integrals


Now return to the nonhomogeneous equation

d2 y dy
a +b + c y = f (x),
dx2 dx
(1)
where a, b and c are constants.
We have shown that, if y = y3 (x) is a particular solution (PI) of this equation (1),
and if y = Ay1 (x) + By2 (x) is the general solution (CF) of the reduced equation (2) ,
then y = y3 (x) + Ay1 (x) + By2 (x) is the general solution of the complete equation (1).
The remaining problem is to find a particular integral y3 (x) for any given function f (x).
The basic method is to use a trial solution which is an initial “guess” involving a number of parameters
whose values can be determined by substituting into the complete equation.
For common functions, use the following suggestions.

If f (x) = p (const), then y3 = p/c


If f (x) = p x + q, try y =P x+Q
If f (x) = p x2 + q x + r, try y = P x2 + Q x + R
If f (x) = p enx , try y = P enx
If f (x) = p sin nx, try y = P sin nx + Q cos nx
If f (x) = p cos nx, try y = P sin nx + Q cos nx
A.C.Croft: MAA255 Ordinary Differential Equations 25

where p, q, r and n are given constants, and P , Q and R are constants that can be determined by
substituting into (1).
If a particular f (x) (or the obvious trial solution) is included in the complementary function, multiply the
appropriate trial solution by x.

d2 y dy
Example 6: −3 + 2 y = 2 x2
dx2 dx
The CF (example 1) is y = A ex + B e2x
When looking for a PI, notice that putting y = x2 immediately cancels the right-hand side. However, the
derivative terms introduce a multiple of x and a constant. Such terms have to be removed by including
extra terms in the trial solution.
Thus, for a PI, try

y = P x2 + Q x + R
y′ = 2 P x + Q
y ′′ = 2 P

Then

y ′′ − 3y ′ + 2y = 2 P − 3(2P x + Q) + 2(P x2 + Qx + R)
= 2P x2 + (2Q − 6P )x + (2R − 3Q + 2P )

This is equal to 2x2 if P = 1, Q = 3, R = 72 .


7
Thus, the general solution is y = x2 + 3 x + 2 + A ex + B e2x .

d2 y dy
Example 7: 2
−2 + 2 y = 3 sinh 2x
dx dx
The CF (example 3) is y = (A cos x + B sin x)ex
For a PI, try

y = P sinh 2x + Q cosh 2x

y ′ = 2P cosh 2x + 2Q sinh 2x
y ′′ = 4P sinh 2x + 4Q cosh 2x

Then

y ′′ − 2y ′ + 2y = 4P sinh 2x + 4Q cosh 2x − 2(2P cosh 2x + 2Q sinh 2x) + 2(P sinh 2x + Q cosh 2x)
= (6P − 4Q) sinh 2x + (−4P + 6Q) cosh 2x

This is equal to 3 sinh 2x if 6P − 4Q = 3 and −4P + 6Q = 0.


9
i.e. if P = 10 , and Q = 35 .
9 3
Thus, the general solution is y = (A cos x + B sin x)ex + 10 sinh 2x + 5 cosh 2x.

d2 y dy
Example 8: 2
−2 + 2 y = ex − 1
dx dx
The CF (examples 3 & 7) is y = (A cos x + B sin x)ex
For a PI, try

y = P ex + Q

y ′ = P ex
y ′′ = P ex
A.C.Croft: MAA255 Ordinary Differential Equations 26

Then

y ′′ − 2y ′ + 2y = P ex − 2 P ex + 2(P ex + Q)
= P ex + 2Q

This is equal to ex − 1 if P = 1, and Q = − 12 .


Thus, the general solution is y = (A cos x + B sin x)ex + ex − 12 .

d2 y dy
Example 9: 2
−3 + 2 y = 2 ex
dx dx
The CF (examples 1 & 6) is y = A ex + B e2x
Notice that the rhs of the equation is contained within the CF of the reduced equation.
Thus, any multiple of ex cannot be a particular integral.
For a PI in this case try

y = P x ex

y ′ = P ex + P x ex
y ′′ = 2P ex + P x ex

Then

y ′′ − 3y ′ + 2y = 2P ex + P x ex − 3(P ex + P x ex ) + 2(P x ex )
= −P ex

This is equal to 2 ex if P = −2.


Thus, the general solution is y = A ex + B e2x − 2 x ex .

Example 10: ẍ + 2ẋ + x = t + 3e−t


For the reduced equation ẍ + 2ẋ + x = 0, the auxiliary equation is m2 + 2m + 1 = 0,
i.e. (m + 1)2 = 0.
This has a repeated root m = −1, so the CF is

x = (A + B t) e−t .

From the form of the rhs, we would expect a PI to have the form x = P t + Q + R e−t .
However, the term R e−t is already included in the CF.
We would next consider replacing this by R t e−t , but this is also contained in the CF.
Thus, we must now consider a PI of the form

x = P t + Q + R t2 e−t

ẋ = P − R t2 e−t + 2R t e−t
ẍ = R t2 e−t − 4R t e−t + 2R e−t

Thus

ẍ + 2ẋ + x = R t2 e−t − 4R t e−t + 2R e−t + 2(P − R t2 e−t + 2R t e−t ) + P t + Q + R t2 e−t


= P t + (2P + Q) + 2R e−t

This is equal to t + 3e−t if P = 1, Q = −2 and R = 32 .


Thus, the general solution is  
x = A + B t + 23 t2 e−t + t − 2.
A.C.Croft: MAA255 Ordinary Differential Equations 27

Example 11: Forced damped harmonic motion

mass × = restoring + damping + forcing


acceleration force term term

m ẍ = − mn2 x − 2mk ẋ + mC sin pt

Divide by m giving

d2 x dx
2
+ 2k + n2 x = C sin pt.
dt dt

To find the Complementary Function, consider the reduced equation

ẍ + 2k ẋ + n2 x = 0.

The auxiliary equation is m2 + 2k m + n2 = 0.



−2k ± 4k2 − 4n2 p
i.e. m= = −k ± k2 − n2
2

(1) For light damping k < n



put β = n2 − k 2 , so that m = −k ± iβ.
The CF is x = (A cos βt + B sin βt)e−kt .
These are exponentially damped oscillations.

(2) For heavy damping k > n


√ √
put m1 = −k + k2 − n2 , m2 = −k − k 2 − n2 .
√ √
Then the CF is x = A e−(k− k 2 −n2 )t + B e−(k+ k 2 −n2 )t .
A.C.Croft: MAA255 Ordinary Differential Equations 28

(3) For critical damping k = n


Then m = −k.
The CF is x = (A t + B)e−kt .

Notice that, for all three cases, x → 0 as t → ∞.

We are considering the equation ẍ + 2k ẋ + n2 x = C sin pt.


For a Particular Integral, try a solution of the form

x = P sin pt + Q cos pt

then
ẋ = pP cos pt − pQ sin pt
ẍ = −p2 P sin pt − p2 Q cos pt
Substituting gives

−p2 P sin pt − p2 Q cos pt + 2kpP cos pt − 2kpQ sin pt


+n2 P sin pt + n2 Q cos pt = C sin pt.

Equating coefficients of sin pt and cos pt gives

−p2 P − 2kp Q + n2 P = C (1)


2 2
−p Q + 2kp P + n Q = 0 (2)

(2) → 2kp P + (n2 − p2 ) Q = 0 ⇒ Q = − n22kp


−p2 P .
4k 2 p2
Then (1) → (n2 − p2 ) P + n2 −p2 P =C , giving

(n2 − p2 ) C 2kp C
P = , Q=− .
(n2 − p2 )2 + 4k2 p2 (n2 − p2 )2 + 4k2 p2
Thus, the Particular Integral is
C 
2 2

x= (n − p ) sin pt − 2kp cos pt .
(n2 − p2 )2 + 4k2 p2
Since the Complementary Function approaches zero as t → ∞, this is the steady state solution for
forced damped harmonic motion.

4.3 The equidimensional equation


Consider equations of the form

d2 y dy
a x2 2
+ bx + c y = h(x),
dx dx
(1)
A.C.Croft: MAA255 Ordinary Differential Equations 29

where a, b and c are constants and h is an arbitrary function of x.


Consider also the associated reduced equation

d2 y dy
a x2 + bx + c y = 0.
dx2 dx
(2)
This is known as the equidimensional equation (or Euler’s equation) because it does not depend on the
dimension of x. (It is invariant under the scaling x → kx for any constant k.)
(Equation (1) is sometimes known as the Cauchy–Euler equation.)

To find the general solution of these equations, we need to find two linearly independent solutions of (2).

First note that the equation has a singular point at x = 0. Solutions are not defined at this point.

Then consider a trial solution of the form

y = xn ,
(3)
dy d2 y
so that = n xn−1 , and = n(n − 1) xn−2 .
dx dx2
Substituting these into (2) gives
 
an(n − 1) + bn + c xn = 0.

Since xn 6= 0, it can be seen that (3) is a solution of (2) if

an2 + (b − a)n + c = 0.

This is a quadratic which gives two possible values of n.


A general solution of (2) (or a CF for (1)) is thus given by

y = A |x|n1 + B |x|n2 .

Note 1: These solutions are given in terms of |x| because the solution is not defined at x = 0 and the
equation is invariant under the transformation x → −x.

Note 2: It has been assumed above that n1 and n2 are real and distinct. This only occurs if (b− a)2 >
4ac.

d2 y dy
Example 1: Solve the equation 2 x2 2
− 3x + 2 y = 0.
dx dx
Substituting the trial solution y = xn , y ′ = nxn−1 , y ′′ = n(n − 1)xn−2 gives
 
2n(n − 1) − 3n + 2 xn = 0,

which is only satisfied if


2n2 − 5n + 2 = 0.
i.e.
(2n − 1)(n − 2) = 0,
so that n = 12 or n = 2.
Thus the general solution is
y = A x1/2 + B x2 ,
where A and B are arbitrary constants.
A.C.Croft: MAA255 Ordinary Differential Equations 30

Example 2: Solve the equation 2 x2 y ′′ − 3 x y ′ + 2 y = 3 x3 .


The CF is given above.
For a PI, consider a solution of the form y = P x3 so that y ′ = 3P x2 , y ′′ = 6P x.
Substituting these gives
(12 − 9 + 2)P x3 = 3 x3 ,
which is satisfied if P = 35 .
Thus the general solution is
y = A x1/2 + B x2 + 53 x3 ,
where A and B are arbitrary constants.

An alternative method
As an alternative approach to equations of the form
d2 y dy
a x2 2
+ bx + c y = h(x), (1)
dx dx
where a, b, c are constants, consider the change of variable

x = et or t = log x.

Then
dy dt dy 1 dy
= =
dx dx dt x dt
and
d2 y d dy d 1 dy 1 dt d dy 1 dy 1 d2 y 1 dy
     
2
= = = − 2
= 2 2
− 2 .
dx dx dx dx x dt x dx dt dt x dt x dt x dt
Substituting these, (1) becomes
!
d2 y dy dy
a − +b + c y = h(et ),
dt2 dt dt
or
a ÿ + (b − a) ẏ + c y = h(et ),
which is a linear equation with constant coefficients.

Note: The transformation x = et deals only with the range x > 0, while the singular point at x = 0
corresponds to t = −∞.

5 Qualitative theory of differential equations


Consider the equation
ẍ + n2 x = 0.
This has the solution x = A cos nt + B sin nt.
This describes oscillatory motion with frequency n.
This general description is often more useful than the exact expression of the solution.

Consider the more general linear ode


a ẍ + b ẋ + c x = 0
where a, b and c are constants. The roots of the auxiliary equation are given by

−b ± b2 − 4ac
m= .
2a
A.C.Croft: MAA255 Ordinary Differential Equations 31

If b2 > 4ac, the solution has two exponential components.


The signs of these roots determines whether solutions exponentially increase or exponentially decrease.
Thus, the signs of these roots is all we need to know to determine the general character of the solutions.

If b2 < 4ac, the roots of the auxiliary equation are complex.


p
Put m = α ± iβ where α = −b/2a β= 4ac − b2 /2a
so that the solution is given by y = (A cos βt + B sin βt)eαt .
Thus the solutions oscillate with frequency equal to the imaginary part of m.
The oscillations exponentially grow if the real part of m is positive,
and exponentially decay if the real part of m is negative.

i.e.
The qualitative character of all possible solutions is determined by the real and imaginary parts of m.

For a physical system, there is often some uncertainty in the values of the parameters in the equations.
An understanding of the qualitative behaviour of solutions is often more useful than explicit solutions.

5.1 Phase plane diagrams


Consider second order odes which can be written in the form
ẍ = Q(x, ẋ).
Putting y = ẋ, these can always be written as the coupled pair of equations
ẋ = y, ẏ = Q(x, y).
In fact, we can also consider the more general family of equations that can be written as
ẋ = P (x, y), ẏ = Q(x, y).
Any particular solution of these equations will have particular values of x and y at any time t. As t
increases, the values of x and y change. This can be represented as a curve drawn on an x-y-plane.
y
6

-x
-

The x-y-plane is known as the phase plane.


Each particular solution has its own trajectory in the phase plane.
Each trajectory is marked with an arrow indicating the direction of increasing t.

Note 1: Only one trajectory passes through any point of the phase plane.
Proof: Any point is represented by the values x = x0 , y = y0 .
This will give particular values of P (x0 , y0 ) and Q(x0 , y0 ).
And these give unique values of ẋ and ẏ.
Thus the trajectory through (x0 , y0 ) must be unique.

Note 2: The only exceptions are critical points or nodes at which P = 0 and Q = 0.
A solution at a critical point stays there indefinitely (as ẋ = 0 and ẏ = 0).
A.C.Croft: MAA255 Ordinary Differential Equations 32

5.2 Phase plane diagrams for linear equations with constant coeffts
Consider linear 2nd -order homogeneous odes
a ẍ + b ẋ + c x = 0 (2)
where a, b and c are constants. The roots of the auxiliary equation are given by
√ √
−b + b2 − 4ac −b − b2 − 4ac
m1 = , m2 =
2a 2a
and equation (2) can be written as two coupled first order equations

 ẋ = y
 ẏ = − ac x − b
a y

This system has the single critical point x = 0, y = 0 which corresponds to the trivial solution of (2).

5.2.1 Nodes
Consider the case in which m1 and m2 are both real and negative. m2 < m1 < 0
i.e. when b2 > 4ac and a, b and c have the same sign.
The general solution is then given by
x = A em1 t + B em2 t
(

y = m1 A em1 t + m2 B em2 t
When B = 0 or A = 0, it is clear that
y = m1 x or y = m2 x
These indicate straight line trajectories.
They are four trajectories in the 2nd and 4th quadrants (since m1 , m2 < 0).
Also since m1 , m2 < 0, x → 0 and y → 0 as t → ∞.
y
6
B
B
BN ?
PP ^ B
PP PP
PP s
PP B
qP
P
PP B
PBP - x
B PPP
B Pi
P
PP
 k PPP
B PP
B ]
6 BMB y = m1 x
BB
B
y = m2 x

Since m2 < m1 < 0, em2 t approaches zero faster than em1 t as t → ∞.


Thus
x → A em1 t , y → m1 A em1 t as t → ∞.
Thus (except when A = 0) all trajectories asymptotically approach the trajectory y = m1 x near the
origin of the phase plane.

Definition: In this case, the critical point at the origin is called a node.
All nodes have this type of structure.

Note: If m1 and m2 were positive, the trajectories would have the same structure, but would be pointed
away from the origin. Moreover, since the em2 t term would dominate at large times, all trajectories
(except that for which B = 0) would become parallel to the line y = m2 x.
A.C.Croft: MAA255 Ordinary Differential Equations 33

5.2.2 Saddle points


Consider the case in which m1 and m2 have different signs.
i.e. when a and c have different signs and b2 > 4ac.
Consider the specific case in which a > 0, b > 0 and c < 0.
Thus m1 > 0 and m2 < 0.
The general solution is given by
(
x = A em1 t + B em2 t ,
y = m1 A em1 t + m2 B em2 t .

When B = 0 or A = 0,
y = m1 x or y = m2 x
These are four straight line trajectories to or from the critical point at the origin.
Since m1 > 0, the trajectories on y = m1 x are away from the origin.
Since m2 < 0, the trajectories on y = m2 x are toward the origin.
This gives the following trajectories in the phase plane
y
6
B
B y = m1 x
BN
B 
B 1



B 
 -x
B
 B

)

 B
 B
BM
B
B
y = m2 x

Since m1 > 0 and m2 < 0, the term em1 t will dominate for large positive times, and the term em2 t
will dominate for large negative times. Thus, all trajectories with A, B 6= 0 will start at large negative
times parallel to y = m2 x, and at large positive times become parallel to y = m1 x.
y
6
B
B z y = m1 x
BN
B  z
B 1



B 
  -x
 B
 B


)
 y B  
 B
y BM
B
B
y = m2 x

Definition: In this case, the critical point at the origin is called a saddle point.

5.2.3 Degenerate nodes


Consider the case in which m1 and m2 are the same.
 b b2 
i.e. when b2 = 4ac. The linear equation has the form ẍ + ẋ + 2 x = 0.
a 4a
A.C.Croft: MAA255 Ordinary Differential Equations 34

In this case m1 = m2 = −b/2a.


The general solution is given by
(
x = (A + B t)emt ,
y = (mA + B + mB t)emt .

Initially assume that b and a have the same sign, so that m < 0.
In this case all trajectories approach the critical point at the origin as t → ∞.
When B = 0 y = m x.
These are two straight line trajectories toward the origin.
When B 6= 0 y = mx + B emt . i.e. all trajectories approach y = m x as t → ∞.
But, as t → ∞, x → B t emt , and y → mB t emt .

y
6

U 
PP
PP R
PP
PP
q
PP
PP
PP - x
PP
PP
i
P
PP
PP
PP
I PP
P
 K y = mx

For B > 0 (i.e. for trajectories above the line y = m x), x > 0 and y < 0 as t → ∞.
Thus, these trajectories approach y = m x < 0 as t → ∞.
For B < 0 (i.e. for trajectories below the line y = m x), x < 0 and y > 0 as t → ∞.
Thus, these trajectories approach y = m x > 0 as t → ∞.

Definition: A critical point of this type is called a degenerate node.

Note: If a and b have different signs, then m > 0.


In this case, the line y = m x will be in different quadrants, and all trajectories diverge from the origin.
However, the structure of the phase portrait is the same, as can be seen by considering behaviour as
t → −∞.

5.2.4 Vortex points


Consider linear odes of the form
ẋ = y
(
2
ẍ + n x = 0 or
ẏ = −n2 x

In this case, the roots of the auxiliary equation m1 and m2 are purely imaginary, and the general solution
is given by
x = A cos nt + B sin nt, y = −nA sin nt + nB cos nt.
A.C.Croft: MAA255 Ordinary Differential Equations 35

All solutions are periodic, and it can be seen that

y2
x2 + = A2 + B 2 .
n2
Thus the trajectories in the phase plane are ellipses.
y
6

R
R
R
-x
I
I
I

All trajectories are clockwise about the origin.

The origin is again a critical point (obtained when A = B = 0), but solutions neither approach or diverge
from the origin (they orbit about it).

Definition: A critical point of this type is called a vortex point.

5.2.5 Spiral points


Consider linear odes of the form

 ẋ = y
a ẍ + b ẋ + c x = 0 or
 ẏ = − c x − b
y
a a

in the case when b2 < 4ac.


In this case the roots m1 and m2 of the auxiliary equation are a complex conjugate pair.
Putting √
b 2
m = α ± iβ where α = − 2a , β = 4ac−b
2a

The general solution can be written as

x = (A cos βt + B sin βt) eαt




 
 y = (αA + βB) cos βt + (αB − βA) sin βt eαt

Clearly both x and y oscillate about zero with frequency β and amplitudes which exponentially increase
(or decrease) as eαt .
If α < 0 (i.e. if a and b have the same sign), then x and y both approach 0 as t → ∞.
All trajectories in the phase plane are therefore spirals which approach the origin as t → ∞.
A.C.Croft: MAA255 Ordinary Differential Equations 36

y
6

R
R
R
-x
I
I
I

Definition: A critical point of this type is called a spiral point.

Note: If α > 0 (i.e. if a and b have different signs), then all trajectories spiral away from the origin as
t → ∞.

5.3 Phase plane diagrams for nonlinear equations


The solutions of all linear second order odes can be described globally by one of the above five types of
phase diagrams. Some nonlinear equations are approximately linear in some region of the phase plane,
and sometimes critical points can be characterised as above.
C
Example. The simple pendulum C
The equation of motion is given by C
φC
φ̈ = −n2 sin φ Cℓ
C
where n2 = g/ℓ. C
C
C
CCt
For small oscillations |φ| ≪ 1, sin φ ∼ φ φ̇
and the equation of motion is approximately 6

φ̈ + n2 φ = 0 R
R
R
which has a vortex point at the origin. -φ
I
I
I

However, the full nonlinear equation can be written as



 φ̇ = θ
 θ̇ = −n2 sin φ
And this has the phase plane diagram
φ̇
6
z z
j j
j j
R R
R R
R R
- φ
I I
I I
I I
Y Y
Y Y
y y
A.C.Croft: MAA255 Ordinary Differential Equations 37

Notice that this has vortex points at φ = 0, 2π, 4π, . . . (these are the stable equilibrium points),
and saddle points at φ = −π, π, 3π, . . . (These correspond to unstable equilibrium points – the pendulum
is at rest vertically above the fixed point).

6 Methods of reduction of order and variation of parameters


6.1 Obvious reductions of order
We have already seen (Example 3 of Section 2) that the equation of motion for a body falling vertically
under the action of a gravitational force mg and a resistance to the motion mk( dx 2
dt ) , which is proportional
2
to the square of the speed, is given by m ddt2x = mg − mk( dx 2
dt ) , so that
2
d2 x dx

2
=g−k .
dt dt
dx
Putting v= , this becomes
dt
dv g
 
=k − v2 .
dt k
This has reduced the original second order equation to a first order equation that can be solved by
separating the variables to obtain
dv
Z Z
= k dt,
( kg − v 2 )
and hence s s
k k

tanh−1 v = k t + const.
g g
Thus
dx g
r p 
= tanh gk t + α
dt k
where α is a constant, and so
1 p 
x= log cosh gk t + α + x0 ,
k
where x0 is a constant.

As another example, consider linear equations of the form

a(x) y ′′ + b(x) y ′ = 0.

(i.e. when the usual additional term c(x) y vanishes.)


Such equations can be written as
y ′′ b(x)

=− ,
y a(x)
which, for any given functions a(x) and b(x), can be integrated to give

b(x)
Z

log y = − dx.
a(x)
A.C.Croft: MAA255 Ordinary Differential Equations 38

Example 1: Consider the equation (1 + x2 ) y ′′ − 2x y ′ = 0.


This can be written as
y ′′ 2x
= ,
y ′ 1 + x2
which can be integrated to give
log y ′ = log(1 + x2 ) + log B or y ′ = B(1 + x2 ).
This is a first integral of the original equation.
The complete integral can obviously be obtained in this case as
y = A + B(x + 31 x3 ).

Example 2: Freely-hanging uniform chain


Consider a uniform chain hanging freely from two fixed points.

y
6
T


ψ
s

T0 
-x

Consider a section of chain of length s, and the tensions T0 and T at each end of this section.
Equating forces horizontally and vertically gives the equations
T cos ψ = T0
T sin ψ = ws
where w is the weight per unit length of the chain.
If the chain is given by the curve y = y(x) then, at any point
dy ws
= tan ψ = .
dx T0
Putting T0 = wk, where k is a constant, and differentiating gives
d2 y 1 ds
2
= .
dx k dx
s
2
ds dy

p
But the small element ds is given by ds = dx2 + dy 2 so that = 1+ .
dx dx
Thus, the equation for the curve is given by
s
2
d2 y dy

k 2 = 1+ .
dx dx
This is a second order (non-linear) ode.
But, since it does not contain y explicitly, it can be solved by putting u = y ′ to give
du p du
Z Z
k = 1+u , 2 and hence k √ = dx
dx 1 + u2
Thus
dy (x − c)
k sinh−1 u = x − c or = sinh .
dx k
Thus, the curve of the chain is given by
(x − c)
y = k cosh + c0 .
k
A.C.Croft: MAA255 Ordinary Differential Equations 39

6.2 Reduction of order using a known solution


To find the general solution of a linear ode a y ′′ + b y ′ + c y = 0, we need two linearly independent
solutions.
If one solution y1 (x) is known, the general solution must contain terms of the form A y1 .
One more (independent) solution is required with one more arbitrary constant.
Thus, only one more integration is required.
To exploit this potential simplification, we consider solutions of the form

y = f (x) y1 (x).

i.e. we replace the initial arbitrary constant by a function. Then

y ′ = f y1′ + f ′ y1 , and y ′′ = f y1′′ + 2f ′ y1′ + f ′′ y1 .

Substituting these gives

a(f y1′′ + 2f ′ y1′ + f ′′ y1 ) + b(f y1′ + f ′ y1 ) + c f y1 = 0

i.e.
a(2f ′ y1′ + f ′′ y1 ) + b(f ′ y1 ) + f (a y1′′ + b y1′ + c y1 ) = 0
i.e.
a y1 f ′′ + (2a y1′ + b y1 )f ′ = 0
or
2 y1′ b
 
′′
f + + f′ = 0
y1 a
which is a linear equation that already has one known solution: f = A.
The other solution can be found by writing it in the form

f ′′ 2 y1′ b

+ + = 0.
f y1 a

Each of these terms can be integrated to give (if a and b are constants)
b
log f ′ + 2 log y1 + a x = log B,

where B is an arbitrary constant. Thus


B −(b/a)x
f′ = e .
y1 2

Since y1 (x) is a known function, it may be possible to integrate this equation to obtain f (x).

d2 y dy
Example 1: Consider the equation 2
−3 + 2y = 0
dx dx
The auxiliary equation is m2 − 3 m + 2 = 0 or (m − 1)(m − 2) = 0,
so that the general solution is y = A ex + B e2x .
Suppose we only knew the solution y1 = ex .
We could then consider further solutions of the form y = f (x) ex , so that

y ′ = f ex + f ′ ex , y ′′ = f ex + 2f ′ ex + f ′′ ex .

Substituting gives
f ex + 2f ′ ex + f ′′ ex − 3(f ex + f ′ ex ) + 2 f ex = 0
i.e.
f ′′
f ′′ − f ′ = 0 or = 1.
f′
A.C.Croft: MAA255 Ordinary Differential Equations 40

Thus
log f ′ = x + log B or f ′ = B ex
which can be integrated to give f = A + B ex , so that the complete solution is given by

y = (A + B ex ) ex = A ex + B e2x ,

which is the known solution.

Example 2: Consider the equation y ′′ − 4 y ′ + 4 y = 0.


The auxiliary equation is m2 − 4 m + 4 = 0 or (m − 2)2 = 0.
Having a single (repeated) root, this just gives the initial solution y1 = e2x .
We could then consider further solutions of the form

y = f (x) e2x .

Then
y ′ = (f ′ + 2f )e2x , y ′′ = (f ′′ + 4f ′ + 4f )e2x .
Substituting these gives

(f ′′ + 4f ′ + 4f )e2x − 4(f ′ + 2f )e2x + 4 f e2x = 0,

which implies that


f ′′ = 0 or f = A + B x.

The complete solution is thus given by

y = (A + B x) e2x ,

as previously shown.

d2 y dy
Example 3. Consider the equation (1 − x2 ) 2
− 2x + 2y = 0
dx dx
This has the obvious solution y = x.
Now look for a second solution of the form

y = f (x) x.

Then
y ′ = f ′ x + f, y ′′ = f ′′ x + 2f ′ .
Substituting these gives

(1 − x2 )(f ′′ x + 2f ′ ) − 2x (f ′ x + f ) + 2 f x = 0

i.e.
(1 − x2 )x f ′′ + 2(1 − 2x2 )f ′ = 0
or
f ′′ 2 − 4x2
= − .
f′ x(1 − x2 )
Expanding the rhs in partial fractions gives

f ′′ 2 1 1

=− + − .
f x 1−x 1+x
A.C.Croft: MAA255 Ordinary Differential Equations 41

Integrating this gives


log f ′ = −2 log x − log(1 − x) − log(1 + x) + log B,
or
B
f′ = .
x2 (1 − x)(1 + x)
Again expanding in partial fractions
1 1
!
′ 1 2 2
f =B + + .
x2 1 − x 1 + x
Hence
1 1 1
 
f = B − − log(1 − x) + log(1 + x) + A
x 2 2
1 1+x 1
   
= A+B log −
2 1−x x
Thus, the general solution is given by
x 1+x
   
y = f (x) x = A x + B log −1 .
2 1−x

6.3 Reduction of order in general


Consider the linear second order ordinary differential equation
d2 y dy
a 2
+b + c y = f (x) (1)
dx dx
dy
Putting z = , this can be written as
dx
dz
+ b z + c y = f (x)
a
dx
Thus the 2nd order equation (1) can be written as two coupled first order equations
dy


 =z
dx

 dz c b f (x)
=− y− z+


dx a a a
nd
These are often easier to analyse than the 2 order equation (1).

In terms of different variables, it can be seen that the linear ode


ẍ + p(t) ẋ + q(t) x = f (t)
with y = ẋ, can be expressed as the coupled pair of first order equations
ẋ = y
(

ẏ = −q(t) x − p(t) y + f (x)


which can also be expressed as
d x 0 1 x 0
      
= +
dt y −q −p y f

Note 1: In fact, all nth -order linear odes can be written in the form
ẋ = A x + u,
where x and u are n-dimensional vectors (column matrices) and A is an n × n matrix.

Note 2: This process has effectively reduced an nth -order ode to n first order equations. This reduction
is usually very helpful.
A.C.Croft: MAA255 Ordinary Differential Equations 42

6.4 Variation of parameters


We consider this method as an explicit technique for constructing particular integrals.

Consider the linear homogeneous ode


d2 y dy
2
+ p(x) + q(x) y = 0. (2)
dx dx
Its solution can be expressed in terms of two linearly independent solutions y1 (x) and y2 (x) in the form
y = A y1 (x) + B y2 (x).
First note that the 2nd order equation (2) can be written as two coupled first order equations
dy


 =z
dx

 dz

 = −q y − p z
dx
and that the solution of these equations is given by
y = A y1 (x) + B y2 (x)
(
(3)
z = A y1′ (x) + B y2′ (x)

Now consider the inhomogeneous equation


d2 y dy
2
+ p(x) + q(x) y = f (x) (1)
dx dx
which can be rewritten as
dy


 =z
dx

 dz

 = −q y − p z + f
dx
We now assume that a solution of these equations can be written in the form (3), but with the arbitrary
constants A and B replaced by functions which we denote as u1 (x) and u2 (x).
i.e. we assume that (
y = u1 y1 + u2 y2
z = u1 y1′ + u2 y2′
Substituting these gives
u1 y1′ + u2 y2′ + u′1 y1 + u′2 y2 = u1 y1′ + u2 y2′
u1 y1′′ + u2 y2′′ + u′1 y1′ + u′2 y2′ = −q(u1 y1 + u2 y2 ) − p(u1 y1′ + u2 y2′ ) + f
and, since y1 and y2 satisfy (2), these reduce to
u′1 y1 + u′2 y2 = 0
u′1 y1′ + u′2 y2′ = f
Since y1 and y2 are known, these are two linear equations for u′1 and u′2 .
Moreover, since y1 and y2 are linearly independent, unique solutions for u′1 and u′2 can always be obtained.
Specifically, we obtain
y2 y1
u′1 = − ′ ′ f, u′2 = f
y1 y2 − y2 y1 y1 y2 − y2 y1′

Note 1: If these expressions can be integrated, this technique can be used to obtain particular integrals.

Note 2: This method is also particularly useful for analysing approximate solutions when the inhomoge-
neous term f (x) corresponds to a small perturbation.
A.C.Croft: MAA255 Ordinary Differential Equations 43

Example 1: Consider the equation y ′′ − 3 y ′ + 2 y = 2 x2


(This is example 6 of section 4.2)
The auxiliary equation of the reduced equation is m2 − 3 m + 2 = 0 or (m − 1)(m − 2) = 0,
so that the CF y = A ex + B e2x .
The reduced equation y ′′ − 3 y ′ + 2 y = 0 can be written as

y′ = z
(

z ′ = −2 y + 3 z

This has the solution


y = A ex + B e2x
(

z = A ex + 2B e2x

The complete equation y ′′ − 3 y ′ + 2 y = 2 x2 can be written as

y′ = z
(

z ′ = −2 y + 3 z + 2 x2

and we look for a solution of this which has the form


y = u1 ex + u2 e2x
(

z = u1 ex + 2u2 e2x

where u1 (x) and u2 (x) are now functions.


Substituting the trial solution gives

 u1 ex + 2u2 e2x + u′1 ex + u′2 e2x = u1 ex + 2u2 e2x
 u ex + 4u e2x + u′ ex + 2 u′ e2x = −2(u ex + u e2x ) + 3(u ex + 2u e2x ) + 2 x2
1 2 1 2 1 2 1 2

i.e.
u′1 + u′2 ex = 0 (a)
u′1 + 2 u′2 ex = 2 x2 e−x (b)

Then 2(a) − (b) gives u′1 ex = −2 x2


and (b) − (a) gives u′2 e2x = 2 x2 .
i.e.
u′1 = −2 x2 e−x , u′2 = 2 x2 e−2x .
Integrating by parts gives
Z Z
2 −x −x 2 −2x
u1 = 2 x e −4 xe dx, u2 = −x e +2 x e−2x dx
Z Z
u1 = 2 x2 e−x + 4 x e−x − 4 e−x dx, u2 = −x2 e−2x − x e−2x + e−2x dx

Thus
u1 = (2 x2 + 4 x + 4)e−x + A, u2 = −(x2 + x + 12 )e−2x + B
The general solution is then given by y = u1 ex + u2 e2x , or

y = 2 x2 + 4 x + 4 + A ex − x2 − x − 1
2 + B e2x
7
i.e. y = x2 + 3 x + 2 + A ex + B e2x as obtained previously.
A.C.Croft: MAA255 Ordinary Differential Equations 44

Example 2: Consider the equation y ′′ + y = sec x


The CF is y = A sin x + B cos x.
However, it is not clear what the form of the PI will be. “Variation of parameters” is the only method
for finding a PI.
The reduced equation y ′′ + y = 0 can be written as

y′ = z
(

z ′ = −y

and this has the solution (


y = A sin x + B cos x
z = A cos x − B sin x

But the complete equation can now be written as

y′ = z
(

z ′ = −y + sec x

and we consider a solution of the form


(
y = u1 sin x + u2 cos x
z = u1 cos x − u2 sin x

Substituting this into the equations gives

u1 cos x − u2 sin x + u′1 sin x + u′2 cos x = u1 cos x − u2 sin x


−u1 sin x − u2 cos x + u′1 cos x − u′2 sin x = −u1 sin x − u2 cos x + sec x

i.e.
u′1 sin x + u′2 cos x = 0
u′1 cos x − u′2 sin x = sec x
and hence
u′1 = 1, u′2 = − tan x.
Thus
u1 = x + A, u2 = log | cos x| + B,
and the complete solution is

y = x sin x + cos x log | cos x| + A sin x + B cos x.

Note 2: This example illustrates the power of this method for finding PIs when trial solutions are not
obvious.

You might also like