Download as pdf or txt
Download as pdf or txt
You are on page 1of 37

SMS 2308 - Mathematical Methods

Lecture Notes
Samsun Baharin Haji Mohamad
March 30, 2012

1
Contents
1 Introduction to Differential Equations 3
1.1 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Solution of Differential Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Linearly Independent Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2 First Order and First Degree ODEs 5


2.1 Separation of Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Homogeneous Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2.1 Equations Reducible to Homogeneous Form . . . . . . . . . . . . . . . . . . 9
2.3 Linear First-order Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.3.1 Bernoulli’s Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.4 Exact Differential Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.4.1 Reduction to Exact Form, Integrating Factor . . . . . . . . . . . . . . . . . 16

3 Second Order Linear Differential Equation 18


3.1 Homogeneous Linear ODEs with Constant Coefficients . . . . . . . . . . . . . . . . 18
3.2 Non-homogeneous ODEs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.2.1 Method of Undetermined Coefficients . . . . . . . . . . . . . . . . . . . . . 21
3.2.2 Method of Variation of Parameters . . . . . . . . . . . . . . . . . . . . . . . 23

4 Other Types of ODE 24


4.1 ODE with y is missing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.2 ODE with x is missing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
d2 y
4.3 Equation of the type dx 2 = f (y) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.4 Euler-Cauchy Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.4.1 Method 1: Using substitution x = ez . . . . . . . . . . . . . . . . . . . . . . 27
4.4.2 Method 2: Using y = xm . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.5 One Solution is Known . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

5 Higher Order Linear ODEs 33


5.1 Homogeneous Linear ODEs with Constant Coefficients . . . . . . . . . . . . . . . . 33
5.2 Non-Homogeneous Linear ODEs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.2.1 Method of Variation of Parameters . . . . . . . . . . . . . . . . . . . . . . . 35
5.2.2 Annihilator Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

2
1 Introduction to Differential Equations
1.1 Definitions
A differential equation is an equation which involve differential coefficients or differentials. For
example, the equations below are all differential equations.

1. ex dx + ey dy = 0
d2 x
2. dt2 + n2 x = 0
dy
3. y = x dx + x dx
dy
  2 3/2 2
dy d y
4. 1 + dx / dx 2 = c

5. dx
dy − wy = a cos(pt), dy
dt + wx = a sin(pt)

6. x ∂u ∂u
∂x + y ∂y = 2u

∂2y 2
∂ y
7. ∂t2 = c2 ∂x 2

An ordinary differential equations (ODE) is differential equations where all the differential
coefficients have reference to a single independent variable. Item 1 to 5 in the list are all ODEs.
A partial differential equation (PDE) is differential equations which there are two or more
independent variables and partial differential coefficients with respect to any of them. Item 6 and
7 are PDEs.
The ORDER of a differential equation is the order of the highest derivative appearing in it.
The DEGREE of a differential equation is the degree of the highest derivative occuring in it,
after the equation has been expressed in a form free from any radicals or fractions as far as the
derivatives are concerned.
From the list above, we can see that

1. Item 1 is of the first order and first degree.


2. Item 2 is of the second order and first degree.
 2
dy dy
3. Item 3 written as y dx = x dx + x is clearly of the first order but of second degree.
  2 3  2 2
dy d y
4. Item 4 written as 1 + dx = c2 dx 2 is of the second order and second degree.

1.2 Solution of Differential Equations


A solution of a differential equation is a relation between the variables which satisfies the given
differential equation.

y = A cos(nx + α)
is a solution of

d2 y
+ ny 2 = 0
dx2
The general (or complete) solution of a differential equation is that in which the number of
arbitrary constants are equal to the order of the differential equation. Thus y = A cos(nx + α) is

3
d2 y
a solution for dx2 + ny 2 = 0 as the number of arbitrary constants (A, α) are the same as the order
2
d y
of + ny 2 = 0.
dx2
A particular solution is a solution that can be obtained from general solution by giving
particular values to the arbitrary constants. For example

y = A cos(nx + π/4)
2
d y 2
is the particular solution of the equation dx 2 + ny = 0 as it can be derived from the general
solution y = A cos(nx + α) by putting α = π/4.
A differential equation may sometimes have an additional solution which cannot be obtained
from the general solution by assigning a particular value to the arbitrary constant. Such a solution
is called a singular solution.

1.3 Linearly Independent Solution


Two solutions y1 (x) and y2 (x) of the differential equation

d2 y dy
+ P (x) + Q(x)y = 0
dx2 dx
are said to be linearly independent if c1 y1 (x) + c2 y2 (x) = 0 such that c1 = 0 and c2 = 0.
If c1 and c2 are not both zero, then the two solutions y1 (x) and y2 (x) are said to be linearly
dependent.
d2 y dy
If y1 (x) and y2 (x) any two solutions of dx 2 + P (x) dx + Q(x)y = 0, then their linear combination
d2 y dy
c1 y1 (x) + c2 y2 (x) where c1 and c2 are constants, is also a solution of dx2 + P (x) dx + Q(x)y = 0.

4
2 First Order and First Degree ODEs
Some special methods to find solutions for these ODEs will be discussed here,

1. Separation of Variables
2. Homogeneous equations

3. Linear equations
4. Exact equations.

2.1 Separation of Variables


If in an equation, it is possible to collect all function of x and dx on one side and all the functions
of y and dy on the other side, then the variables are said to be separable. Thus the general form
of such equation is

f (x)dx = g(y)dy
Integrating both sides, we get
Z Z
f (x)dx = g(y)dy + c

as its solution.

Example 1

Solve
dy x(2 log x + 1)
=
dx sin y + y cos y
We separate them into
(sin y + y cos y)dy = (x(2 log x + 1))dx
Integrating both side, we get
Z Z Z Z
sin ydy + y cos ydy = 2 log x · xdx + 2 xdx

x2 1 x2 x2
 Z   Z  
− cos y + y sin y − sin y · 1dy + c = 2 log x · − · dx +
2 x 2 2
2 2
x x
− cos y + y sin y + cos y + c = 2x2 log x − +
2 2
Hence the solution is
2x2 log x − y sin y = c

Example 2

Solve
dy
= e3x−2y + x2 e−2y
dx
We separate them into
e2y dy = (e3x + x2 )dx

5
Integrating both side, we get
Z Z
2y
e dy = (e3x + x2 )dx + c

e2y e3x x3
= + +c
2 3 3
Hence the solution is
3e2y = 2(e3x + x3 ) + 6c

Example 3

Solve
dy
= sin(x + y) + cos(x + y)
dx
Setting x + y = t so that dy/dx = dt/dx − 1. The given equation becomes

dt
− 1 = sin t + cos t
dx
dt
dx =
1 + sin t + cos t
Integrating both side, we get
Z Z
dt
dx = +c
1 + sin t + cos t
Z
2dθ
x= +c (setting t = 2θ)
1 + sin 2θ + cos 2θ
Z
2dθ
= c
2 cos2 θ + 2 sin θ cos θ
sec2 θ
Z
= dθ + c
1 + tan θ
= log(1 + tan θ) + c

Hence the solution is  


1
x = log 1 + tan (x + y) + c
2

Example 4

Solve
y dy x2 + y 2 − 1
+ =0
x dx 2(x2 + y 2 ) + 1
Setting x2 + y 2 = t, we get
dy dt
2x + 2y =
dx dx
y dy 1 dt
or = −1
x dx 2x dx

6
The given equation becomes
1 dt t−1
−1+ =0
2x dx 2t + 1
1 dt t−1 t+2
=1− =
2x dx 2t + 1 2t + 1
2t + 1
2xdx = dt
t+2
 
3
2xdx = 2 − dt
t+2

Integrating both side, we get


Z Z  
3
2xdx = 2− dt + c
t+2
x2 = 2t − 3 log(t + 2) + c

Hence the solution is


x2 + 2y 2 − 3 log(x2 + y 2 + 2) + c = 0

2.2 Homogeneous Equations


Homogeneous equations are of the form

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

where f (x, y) and g(x, y) are homogeneous functions of the same degree in x and y.
To solve a homogeneous equation,
dy
1. Set y = ux, then dx = u + x du
dx

2. Separate the variables u and x, and integrate.


Example 1

Solve
(x2 − y 2 )dx − xydy = 0
Rearrange the equation, we get
dy x2 − y 2
=
dx xy
dy
Setting y = ux, then dx = u + x du
dx , the equation becomes,

du 1 − u2
u+x =
dx u
du 1 − 2u2
x =
dx u
Separating the variables, we get
u dx
2
du =
1 − 2u x

7
Integrating both sides, we get
Z Z
u dx
du = +c
1 − 2u2 x
−4u
Z Z
1 dx
− du = +c
4 1 − 2u2 x
1
− log(1 − 2u2 ) = log x + c
4
4 log x + log(1 − 2u2 ) = −4c
log x4 (1 − 2u2 ) = −4c
y2
 
x4 1 − 2 2 = e−4c = c0 (Set u = y/x)
x

Hence the solution is


x2 (x2 − 2y 2 ) = c0

Example 2

Solve  y y  y
− y sec2
x tan dx + x sec2 dy = 0
x x x
The equation can be rearrange into homogeneous equation
dy y y y y
= sec2 − tan cos2
dx x x x x
dy
Setting y = ux, then dx = u + x du
dx , the equation becomes,

du
u+x = (u sec2 u − tan u) cos2 u
dx
du
x = u − tan u cos2 u − u
dx
Separating the variables, we get
sec2 u dx
du = −
tan u x
Integrating both side, we get

sec2 u
Z Z
dx
du = −
tan u x
log tan u = − log x + log c
x tan u = c

Hence the solution is


y
x tan =c
x

Example 3

Solve  
x
(1 + ex/y )dx + ex/y 1 − dy = 0
y

8
Rewrite the equation into its homogeneous form, we get
 
x/y x
dx e 1 − y
=− x/y
dy (1 + e )
dx
Setting x = uy, then dy = u + y du
dy , the equation becomes

du eu (1 − u)
u+y =−
dy (1 + eu )
du eu (1 − u) u + eu
y =− u
−u=−
dy (1 + e ) (1 + eu )

Separating the variables, we get

dy 1 + eu d(u + eu )
− = du =
y u + eu u + eu
Integrating both side, we get

d(u + eu )
Z Z
dy
− =
y u + eu
− log y = log(u + eu ) + c
y(u + eu ) = e−c = c0

Hence the solution is


x + yex/y = c0

2.2.1 Equations Reducible to Homogeneous Form


The equation of the form
dy ax + by + c
= 0
dx a x + b0 y + c0
can be reduced to the homogeneous form as follows:

a b
Case I. When a0 6= b0
Setting
x = X + h, y = Y + k, (h, k are constants)
and
dx = dX, dy = dY
the equation becomes
dY aX + bY + (ah + bk + c)
= 0
dX a X + b0 Y + (a0 h + b0 k + c0 )
dY
we choose h and k so that dX become homogeneous equation.
Set ah + bk + c = 0 and a0 h + b0 k + c0 = 0 so that
h k 1
= 0 = 0
bc0 0
−bc 0
ca − c a ab − ba0
or
bc0 − b0 c ca0 − c0 a
h= , and k =
ab0 − b0 a ab0 − ba0

9
Thus when ab0 − ba0 6= 0, dY
dX becomes

dY aX + bY
= 0
dX a X + b0 Y
which is homogeneous in X, Y and be solved by setting Y = uX.

Example

Solve
dy y+x−2
=
dx y−x−4
Setting
x = X + h, y = Y + k, (h, k are constants)
and
dx = dX, dy = dY
the equation becomes
dy y + x + (k + h − 2)
=
dx y − x + (k − h − 4)
Letting k + h − 2 = 0 and k − h − 4 = 0, then h = −1 and k = 3 then the equation will be
dY Y +X
dX = Y −X which is homogeneous in X and Y .
dY du
Setting Y = uX, then dX = u + X dX , the equation becomes,

du u+1
u+X =
dX u−1
du 1 + 2u − u2
X =
dX u−1
u−1 dX
du =
1 + 2u − u2 X
Integrating both sides, we get
2 − 2u
Z Z
1 dX
− du =
2 1 + 2u − u2 X
1
− log(1 + 2u − u2 ) = log X + c
2
Y2
 
2Y
log 1 + 2 − 2 + log X 2 = −2c
X X
log(X 2 + 2XY − Y 2 ) = −2c
X 2 + 2XY − Y 2 = e−2c = c0

Setting X = x − h = x + 1 and Y = y − k = y − 3, the previous equation becomes

(x + 1)2 + 2(x + 1)(y − 3) − (y − 3)2 = c0


x2 + 2xy − y 2 − 4x + 8y − 14 = c0

which is the required solution.

Case II. When aa0 = bb0


When ab0 − ba0 = 0, the above method fails as h and k become infinite or undetermined.

10
Set
a b 1
= 0 =
a0 b m
or
a0 = am, b0 = bm
dy
then dx becomes
dy (ax + by) + c
=
dx m(ax + by) + c0
dy dt dy
= 1b dxdt

Setting ax + by = t, so that a + b dx = dx or dx − a , then the previous equation becomes
 
1 dt t+c
−a =
b dx mt + c0
dt bt + bc
=a+
dx mt + c0
(am + b)t + ac0 + bc
=
mt + c0
so the variables are separable. In the solution, setting t = ax + by, we get the required solution of
dy
dx

Example

Solve
(3y + 2x + 4)dx − (4x + 6y + 5)dy = 0
The equation can be rearrange as
dy (2x + 3y) + 4
=
dx 2(2x + 3y) + 5
dy dt
Setting 2x + 3y = t, then 2 + 3 dx = dx The equation becomes,
 
1 dt t+4
−2 =
3 dx 2t + 5
dt 7t + 22
=
dx 2t + 5
2t + 5
dt = dx
7t + 22
Integrating both sides,
Z Z
2t + 5
dt = dx
7t + 22
Z  
2 9 1
− · =x+c
7 7 7t + 22
2 9
t− log(7t + 22) = x + c
7 49
Setting t = 2x + 3y, we have

14(2x + 3y) − 9 log(14x + 21y + 22) = 49x + 49c


21x − 42y + 9 log(14x + 21y + 22) = c0

which is the required solution.

11
2.3 Linear First-order Equations
A differential equation is said to be linear if the dependent variable and its differential coefficients
occur only in the first degree and not multiplied together.
Thus the standard form of a linear equation of the first order is,
dy
+ Py = Q
dx
where P Q are the functions of x. R
To solve the equation, we multiply both sides by e P dx , so we get
dy R P dx  R  R
·e + y e P dx P = Qe P dx
dx
d  R P dx  R
ye = Qe P dx
dx
Integrating both side, we get
R
Z R
P dx P dx
ye = Qe +c

as the required solution.

Example 1

Solve
dy
(x + 1) − y = e3x (x + 1)2
dx
Divide the equation with (x + 1), we get

dy y
− = e3x (x + 1)
dx x + 1
1
Here P = − x+1 and
Z Z
dx
P dx = − = − log(x + 1) = log(x + 1)−1
x+1
The integrating factor is
R
P dx −1 1
e = elog(x+1) =
x+1
Thus the solution for the equation is
Z
y 1
= [e3x (x + 1)] dx + c
x+1 x+1
Z
= e3x dx + c
1 3x
= e +c
3
So the solution is  
1 3x
y= e + c (x + 1)
3

12
Example 2

Solve √ !
e−2 x dx
√ =1
x dy
Rewrite the equation into √
dy y e−2 x
+√ = √
dx x x
where P = √1 and
x

Z Z
1
P dx = √ =2 x
x
R √
P dx
then the integrating factor becomes e = e2 x

The solution for the equations is



√ e−2 x 2√x
Z
2 x
y·e = √ ·e dx + c
x
Z
1
= √ dx + c
x
So the solution is √ √
y · e2 x
=2 x+c

Example 3

Solve
dy
3x(1 − x2 )y 2 + (2x2 − 1)y 3 = ax3
dx
dy dz
Setting z = y 3 and 3y 2 dx = dx , the equation becomes

dz
x(1 − x2 ) = (2x2 − 1)z = ax3
dx
dz 2x2 − 1 ax3
+ z =
dx x − x3 x − x3
2x2 −1
Here P = x−x3 and

2x2 − 1
Z Z
P dx = dx
x − x3
Z  
1 1 1 1 1
= − − + dx
x 21+x 21−x
1 1
= − log x − log(1 + x) − log(1 − x)
h p 2 i 2
= − log x 1 − x2

The integrating factor is

2x2 − 1 √
Z  h p i−1
− log[x 1−x2 ] 2
exp dx = e = x 1 − x
x − x3

13
So the solution is
x3
Z
z 1
 √  =a · √ dx + c
x 1 − x2 x(1 − x2 ) x 1 − x2
Z
=a x(1 − x2 )−3/2 dx + c
Z
a
=− (−2x)(1 − x2 )−3/2 dx + c
2
z
 √  = a(1 − x2 )−1/2 + c
x 1 − x2
Inserting z = y 3 , we get p
y 3 = ax + cx 1 − x2

2.3.1 Bernoulli’s Equation


The equation
dy
+ P y = Qy n
dx
where P, Q are function of x is reducible to linear equation of the first order. This is a Bernoulli’s
equation.
To solve it, we divide both sides with y n so that
dy
y −n + P y 1−n = Q
dx
Setting y 1−n = z so that
dy dz
(1 − n)y −n =
dx dx
Then, the equation becomes
1 dz
+ Pz = Q
1 − n dx
dz
+ P (1 − n)z = Q(1 − n)
dx
which is a linear equation of the first order and can be solved easily.

Example

Solve
dy
x + y = x3 y 6
dx
.
Divide both sides with xy 6 , we get
dy y −5
y −6 + = x2
dx x
Setting y −5 = z and
dy dz
−5y −6 =
dx dx
The equation becomes
1 dz z
− + = x2
5 dx x
dz 5
− z = −5x2
dx x

14
dy
which is the same as dx + P y = Q pattern. So we can use the integrating factor.
Integrating factor is
R R
e P dx
= e− (5/x)
dx
−5 log x
=e
−5
= elog x
= x−5

The solution is
Z
z · x−5 = (−5x2 ) · x−5 dx + c

x−2
y −5 x−5 = −5 · +c
−2
Divide both side with y −5 x−5 , we get

1 = (2.5 + cx2 )x3 y 5

which is the required solution.

2.4 Exact Differential Equations


A differential equation of the form

M (x, y)dx + N (x, y)dy = 0

is said to be exact if its left hand side member is the exact differential of some function u(x, y)
which is
du ≡ M dx + N dy = 0
The solution is therefore
u(x, y) = c
From calculus, we see that the partial derivatives of u(x, y) is
∂u ∂u
du = dx + dy
∂x ∂y
Comparing with du ≡ M dx + N dy, then we see that
∂u ∂u
=M =N
∂x ∂y
If we differentiate M with respect to y and N with respect to x, we get
∂M ∂2u
=
∂y ∂y∂x
∂N ∂2u
=
∂x ∂x∂y
or
∂M ∂N
=
∂y ∂x
∂u
We integrate ∂x = M with respect to x, we get
Z
u = M dx + k(y) k(y) is a constant

15
∂u ∂u
To determine k(y), we derive ∂y from this equation, and use ∂y = N to get dk/dy, and integrate
dk/dy to get k.

Example

Solve
cos(x + y)dx + (3x2 + 2y + cos(x + y))dy = 0
Test for exactness

M = cos(x + y)
N = (3x2 + 2y + cos(x + y))

Thus
∂M
= − sin(x + y)
∂y
∂N
= − sin(x + y)
∂x
So the equation is exact.
Implicit general solution
Z
u= M dx + k(y)
Z
= cos(x + y)dx + k(y)

= sin(x + y) + k(y)

To find k(y), we differentiate u = sin(x + y) + k(y) with respect to y, we get

∂u dk
= cos(x + y) +
∂y dy
N = 3y 2 + 2y + cos(x + y)
dk
So, dy is
dk
= 3y 2 + 2y
dy
By integration k(y) is
k(y) = y 3 + y 2 + c∗
Inserting k(y) into u = sin(x + y) + k(y), we obtain the answer

u(x, y) = sin(x + y) + y 3 + y 2 = c

2.4.1 Reduction to Exact Form, Integrating Factor


We can transform a non-exact equation,

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

by multiplying it with a function F (x, y) producing an exact equation

F P dx + F Qdy = 0

16
which can be solve by using the method from the previous section. F (x, y) is called Integrating
Factor.

How to find Integrating factor

For M dx + N dy = 0, the exactness condition is ∂M/∂y = ∂N/∂x. For F (x) and F P dx +


F Qdy = 0, the exactness condition is

∂(F P )/∂y = ∂(F Q)/∂x

By product rule, we get


F Py = F 0 Q + F Qx
Dividing by F Q and rearrange, we get
 
1 dF 1 ∂P ∂Q
=R where R= −
F dx Q ∂y ∂x

If we integrate the equation with respect to x and taking the exponent on both side, we get
the integrating factor which is Z
F (x) = exp R(x)dx

and if our initial is F (y), we get


Z  
1 ∂Q ∂P
F (y) = exp R(y)dy where R(y) = −
P ∂x ∂y

Example

Find an integrating factor and solve the initial value problem of

(ex+y + yey )dx + (xey − 1)dy = 0, y(0) = 1

Test for exactness


∂P
= ex+y + ey + yey
∂y
∂Q
= ey
∂x
∂Q
Since ∂P
∂y 6= ∂x , so we have to find the integrating factor to make it an exact equation.
R(x) fail, since it on both x and y, so we have to use R(y), which is
 
1 ∂Q ∂P
R(y) = −
P ∂x ∂y
1
= x+y (ey − (ex+y + ey + yey ))
e + yey
= −1

Hence the integrating factor is F (y) = exp −1dy = e−1 . Multiplying the integrating factor to
R

the original equation, we get


(ex + y)dx + (x − e−y )dy = 0

17
which is an exact equation and be solve using the previous method.
Z
u = (ex + y)

= ex + xy + k(y)
∂u dk
=x+ = N = x − e−y
∂y dy
dk
= −e−y
dy
k = e−y + c∗

Hence, the general solution is


u(x, y) = ex + xy + e−y = c
The particular solution is

u(0, 1) = e0 + 0 · 1 + e−1 = 3.72


ex + xy + e−y = 3.72

3 Second Order Linear Differential Equation


3.1 Homogeneous Linear ODEs with Constant Coefficients
A second-order homogeneous linear ODEs with constant coefficient is
00 0
y + ay + by = 0

The solution is

y = eλx
0
y = λeλx
00
y = λ2 eλx

If we put into the equation and rearrange, we will get

(λ2 + aλ + b)eλx = 0

Hence λ is a solution of the important characteristic equation

λ2 + aλ + b = 0

The roots for this quadratic equation is


1 p 1 p
λ1 = (−a + a2 − 4b) λ2 = (−a − a2 − 4b)
2 2
then the function
y1 = eλ1 x y2 = eλ2 x
are solutions for second-order homogeneous linear ODEs with constant coefficient.
From algebra, we know that the quadratic equation might have three different kind of roots,
depending on the sign of the discriminant a2 − 4b, which are
1. Two real roots if a2 − 4b > 0.
2. A real double root if a2 − 4b = 0.

18
3. Complex conjugate roots if a2 − 4b < 0

Case I: Two Distinct Real Root λ1 and λ2

In this case, the basic solution is

y1 = eλ1 x and y2 = eλ2 x

and the general solution is


y = c1 eλ1 x + c2 eλ2 x

Example

Solve the initial value problem


00 0 0
y + y − 2y = 0, y(0) = 4, y (0) = −5

The characteristics equation is


λ2 + λ − 2 = 0
Its roots are,
λ1 = 1 and λ2 = −2
So the general equation is
y = c1 ex + c2 e−2x
For finding particular solution, we differentiate once
0
y = c1 ex − 2c2 e−2x

and using the initial condition, we get

y = ex + 3e−2x

Case II: Real Double Root λ = −a/2

When a2 − 4b = 0 we only get one root, λ = λ1 = λ2 = −a/2, hence the only solution is

y1 = e−(a/2)x

To obtain the second independent solution y2 , we set y2 = uy1 . Substitute this and its derivative
0 00
y2 and y2 , we get
00 0
(u00 y1 + 2u0 y 0 + uy1 ) + (a(u0 y1 + uy1 ) + buy1 = 0
Collecting term 0 00 0
u00 y1 + u0 (2y1 + ay1 ) + u(y1 + ay1 + by1 ) = 0
The second and third expression is zero, so we are left with

u00 y1 = 0

By two integrations, we get


u = c1 x + c2

19
we choose c1 = 1 and c2 = 0 then u = x, so y2 = xy1 , so the general solution is

y = (c1 + c2 x)e−(a/2)x

Example

Solve the initial value problem

y 00 + y 0 + 0.25y = 0 y(0) = 3.0, y 0 (0) = −3.5

The characteristic equation is

λ2 + λ + 0.25 = (λ + 0.5)2 = 0

It has double root λ = −0.5, this give the general solution as

y = (c1 + c2 x)e−0.5x

Taking the derivative and find c1 and c2 , so we get the particular solution as

y = (3 − 2x)e−0.5x

1 1
Case III: Complex Roots − + iω and − − iω
2 2

The discriminant is a2 − 4b < 0, two complex roots, or we can obtain a real solution by using

y1 = e−ax/2 cos ωx and y2 = e−ax/2 sin ωx


1
where ω = b − a2 . The real general solution for Case III is
4

y = e−ax/2 (A cos ωx + B sin ωx)

where A, B are arbitrary constants.

Example

Solve the initial value problem

y 00 + 0.4y 0 + 9.04y = 0, y(0) = 0, y 0 (0) = 3

The characteristic equation is


λ2 + 0.4λ + 9.04 = 0
so the roots are λ1 = −0.2 + 3i and λ1 = −0.2 − 3i. Hence ω = 3. The general solution is

y = e−0.2x (A cos 3x + B sin 3x)

Differentiate the general solution and using the initial value, we get the particular solution as

y = e−0.2x sin 3x

20
3.2 Non-homogeneous ODEs
A general solution for a non-homogeneous ODEs

y 00 + p(x)y 0 + q(x)y = r(x), r(x) 6= 0

on open interval I is a solution of the form

y(x) = yh (x) + yp (x)

where, yh = c1 y1 + c2 y2 is a general solution from homogeneous ODE and yp is any solution of


non-homogenous ODE containing no arbitrary constant.

3.2.1 Method of Undetermined Coefficients


Method of undetermined coefficients is suitable for linear ODEs with constant coefficients a and b,

y 00 + ay 0 + by = r(x)

when r(x) is an exponential function, a power of x, a cosine or sine, or sums or products of such
functions. These functions have derivative similar to r(x) itself. So, we choose a form for yp similar
to r(x), but with unknown coefficients to be determined by substituting yp and its derivatives into
the ODE. Table below shows the choice for yp for important form of r(x).

Term in r(x) Choice for yp


keγx Ceγx
kxn (n = 0, 1, · · · ) Kn xn + Kn−1 xn−1 + · · · + K1 x + K0
k cos ωx K cos ωx + M sin ωx
k sin ωx K cos ωx + M sin ωx
keαx cos ωx eαx (K cos ωx + M sin ωx)
keαx sin ωx eαx (K cos ωx + M sin ωx)

And the choice of rules for the method of undetermined coefficients are
1. Basic Rule: If r(x) is one of the functions in the first column from the table, choose yp
from the same line and determine the coefficients by substituting yp and its derivatives into
the equation
2. Modification rule: If a term in our choice for yp happens to be a solution of the ho-
mogeneous ODE corresponding to the equation, we multiply the choice of yp by x or x2
etc.
3. Sum Rule: If r(x) is a sum of functions in the first column of the table; we choose yp by
summing up the functions in the corresponding line.

Example 1: Rule 1

Solve the initial value problem

y 00 + y = 0.001x2 , y(0) = 0, y 0 (0) = 1.5

The general solution for homogeneous ODE y 00 + y = 0 is

yh (x) = A cos x + B sin x


00
Solution for non-homogeneous ODE, setting yp = Kx2 , then yp = 2K. Substitute into the
equation, we get
2K + Kx2 = 0.001x2

21
Comparing both sides, we see that

2K = 0, K = 0.001

which the value of K contradict each other, so yp = Kx2 is not the solution for this equation.
Looking from the table, the choice of yp for the term r(x) = Kxn is yp = K2 x2 + K1 x + K0 ,
then 00
yp + yp = 2K2 + 2K2 x2 + K1 x + K0 = 0.001x2
Comparing both sides, we get

K2 = 0.001, K1 = 0, K0 = −0.002

This gives
yp = 0.001x2 − 0.002
and the general solution becomes,

y = yh + yp = A cos x + B sin x + 0.001x2 − 0.002

To find the value for A and B, we use the initial condition

y(0) = A cos 0 + B sin 0 + 0.001(0)2 − 0.002


= A − 0.002 = 0

So, A = 0.002. To find B, we diffentiate the general solution once and put the initial condition
0 0
y 0 = yh + yp
= −A sin x + B cos x + 0.002x
0
y (0) = −A sin 0 + B cos 0 + 0.002(0)
= B = 1.5

So, B = 1.5. This gives the answer as

y = 0.002 cos x + 1.5 sin x + 0.001x2 − 0.002

Example 2: Rule 2

Solve the initial value problem

y 00 + 3y 0 + 2.25y = −10e−1.5x , y(0) = 1, y 0 (0) = 0

The general solution for the homogeneous ODE,

y 00 + 3y 0 + 2.25y = 0

where λ2 + 3λ + 2.25 = (λ + 1.5)2 = 0 is

yh = (c1 + c2 x)e−1.5x

The solution of non-homogeneous ODE cannot be taken as yp = Ce−1.5x since this a solution
for homogeneous ODE. So, by using rule number 2, we modify our choice function by x2 . That is,
we use

yp = Cx2 e−1.5x
0
yp = C(2x − 1.5x2 )e−1.5x
00
yp = C(2 − 3x − 3x + 2.25x2 )e−1.5x

22
Substitute these equations into the main equation, by ignoring the e−1.5x , we get

C(2 − 6x + 2.25x2 ) + 3C(2x − 1.5x2 ) + 2.25Cx2 e−1.5x = −10

Comparing both sides, we get 2C = −10, so C = −5 and the solution is

yp = −5x2 e−1.5x

Hence the general equation becomes

y = yh + yp = (c1 + c2 x)e−1.5x − 5x2 e−1.5x

Using the initial condition to find c1 and c2 , we get

c1 = 1, and c2 = 1.5

This give the answer which is

y = (1 + 1.5x)e−1.5x − 5x2 e−1.5x

Example 3: Rule 3

Solve the initial value problem

y 00 + 2y 0 + 5y = e0.5x + 40 cos 10x − 190 sin 10x, y(0) = 0.16, y 0 (0) = 40.08

The general solution for homogeneous ODE y 00 + 2y 0 + 5y = 0 from the characteristics equation

λ2 + 2λ5 = (λ + 1 + 2i)(λ + 1 − 2i) = 0

is
yh = e−x (A cos 2x + B sin 2x)
The solution for non-homogeneous ODE, we choose our yp as summation of two function from
the table, that is
yp = Ce0.5x + K cos 10x + M sin 10x
Substitute into the equation and comparing both side, we get

C = 0.16, K = 0, M =2

Hence the solution is

y = yh + yp = e−x (A cos 2x + B sin 2x) + 0.16e0.5x + 2 sin 10x

From the initial condition, we found that A = 0 and B = 10, hence the complete solution is

y = 10e−x sin 2x + 0.16e0.5x + 2 sin 10x

3.2.2 Method of Variation of Parameters


A particular solution yp for non-homogeneous linear ODE where r(x) is not an exponential function
ex , a power of x, a cosine or sine, or sums or products of such functions can be determine by using
the following formula
Z Z
y2 r(x) y1 r(x)
yp (x) = −y1 dx + y2 dx
W W

23
where y1 and y2 are solutions for the corresponding homogeneous ODE,

y 00 + P (x)y 0 + Q(x)y = 0
and W is the Wronskian of y1 , y2 ,
0 0
W = y1 y2 − y2 y1

Example

Solve the non-homogeneous ODE

y 00 + y = sec x
From the homogeneous solution we get y1 = cos x and y2 = sin x. Using these information, we
can get the Wronskian as

W = cos x · cos x − sin x · (− sin x) = 1


By using the formula, yp is

sin x · sec x cos x · sec x


Z Z
yp = − cos x dx + sin x dx
1 1
= cos x ln | cos x| + x sin x

The complete solution will be

y = yh + yp
= c1 cos x + c2 sin x + cos x ln | cos x| + x sin x
y = (c1 + ln | cos x|) cos x + (c2 + x) sin x

4 Other Types of ODE


4.1 ODE with y is missing
The equation which do not contain y directly can be written as
 2 
d y dy
f , ,x = 0
dx2 dx

on substituting
dy
=p
dx
d2 y dp
=
dx2 dx
we get  
dp
f , p, x =0
dx

24
Example

Find the solution for this ODE

(1 − x2 )D2 − xD = 2
dy d2 y dp
By setting dx = p and dx2 = dx , we get

dp
(1 − x2 )
− xp = 2
dx
dp x 2
− 2
p=
dx 1 − x 1 − x2
Integrating factor is
R x

− 1−x2
I.F = e
2
= e−1/2·log(1−x )

2
= elog 1−x
p
= 1 − x2

Hence, the solution is


Z √
p 1 − x2
p· 1− x2 =2 dx
1 − x2
Z
2
= √ dx
1 − x2
= 2 sin−1 x + c1
2 sin−1 x c1
or p = √ +√
1−x 2 1 − x2
−1
dy 2 sin x c1
or = √ +√
dx 1−x 2 1 − x2
On integrating with respect to x, we get

y = (sin−1 x)2 + c1 sin−1 x + c2

4.2 ODE with x is missing


The equations that do not contain x directly are of the form
 2 
d y dy
f , ,y = 0
dx2 dx
On substituting
dy
=p
dx
2
d y dp dp dy
2
= = ·
dx dx dy dx
d2 y dp
2
= ·p
dx dy

25
we get  
dp
f , p, y =0
dx

Example

Solve the following equation


2
d2 y

dy dy
y + =
dx2 dx dx
dy d2 y dp
Put dx = p and dx2 = dy · p into the equation, we get

dp
y · p + (p)2 = p
dy
dp
or y =1−p
dy
dp dy
or =
1−p y
or − log(1 − p) = log y + log c1
1
or = c1 y
1−p
1
or p = 1 −
c1 y
dy c1 y − 1 dy
or = ∵ =p
dx c1 y dx
c1 y
or dy = dx
c1 y − 1
 
1
or 1+ dy = dx
c1 y − 1
1
∴y+ log(c1 y − 1) = x + c2
c1

d2 y
4.3 Equation of the type dx2
= f (y)
dy
Multiplying with 2 dx , we get
dy d2 y dy
2 · =2 · f (y)
dx dx2 dx
Integrating with respect to x, we get
 2 Z
dy
= 2 f (y)dy + c1
dx
Z
= φ(y), ∵ φ(y) = 2 f (y)dy + c1
dy p
= φ(y)
dx
dy
p = dx
φ(y)
So the solution is Z
dy
p = x + c2
φ(y)

26
Example

Solve the following equation


d2 y √ 2
2
= y, y(0) = 1, y 0 (0) = √
dx 3
dy
Multiplying with 2 dx , we get
dy d2 y dy √
2 · =2 · y
dx dx2 dx
Integrating with respect to x,we get
 2
dy 4
= y 3/2 + c1
dx 3
4
= y 3/2 , ∵ c1 = 0 using IVP
3
dy 2
= √ y 3/4
dx 3
−3/4 2
y dy = √ dx
3
Integrating both side and using IVP values, we get
2
y 1/4 = √ x + c2
3
2
= √ x + 1, ∵ c2 = 1 using IVP
3

4.4 Euler-Cauchy Equation


An equation of the form
d2 y dy
a 2 x22
+ a1 x + a0 y = r(x)
dx dx
where a0 , a1 anda2 are constants is called Euler-Cauchy Equation. We will discuss two method
which can be use to solve this equation.

4.4.1 Method 1: Using substitution x = ez


An Euler-Cauchy equation can be reduced to a linear equation with constant coefficients by chang-
ing the independent variable from x to z where
d
x = ez , z = log x, =D
dz
dy
For x dx
dy dy dz
= ·
dx dz dx
1 dy
= ·
x dz
dy dy
x =
dx dz
dy
x = Dy
dx

27
2
d y
And for x2 dx 2 , we get

d2 y
 
d dy
=
dx2 dx dx
 
d 1 dy
= ·
dx x dz
1 dy 1 d2 y dz
=− 2 +
x dz x dz 2 dx
1 dy 1 d2 y 1
=− 2 + 2 x
xdz x dz
2
1 d y dy
= 2 −
x dz 2 dz
1
= 2 (D2 − D)y
x
2
d y
x2 2 = (D2 − D)y
dx
2
dy d y
Substitution of x dx = Dy and x2 dx 2
2 = (D − D)y into the first equation will reduces equation

into a differential equation with constant coefficients.

Example

Solve the following equation


d2 y dy
x2 − 2x − 4y = x4
dx2 dx
Set
d dy d2 y
x = ez , z = log x, = D, x = Dy, x2 = (D2 − D)y
dz dx dx2
The equation becomes
D(D − 1)y − 2Dy − 4y = e4z
(D2 − 3D − 4)y = 0
Since m1 = −1 and m2 = 4, then the homogeneous solution is
yh (z) = c1 e−z + c2 e4z
And by using method of undetermined coefficient where we set yp = C ·x·e4z , the non-homogeneous
solution is
(D2 − 3D − 4)y = 8Ce4z + 16Cze4z − 3(Ce4z + 4Cze4z ) − 4Cze4z
= 5Ce4z
e4z = 5Ce4z

Comparing both side, we get C = 15 , thus particular solution is


1 4z
yp (z) = ze
5
So the solution is
y(z) = yh (z) + yp (z)
ze4z
= c1 e−z + c2 e4z +
5

28
But since our original independent variable is x, we substitute back x = ez and z = ln x into the
equation to get our final solution,
c1 1
y(x) = + c2 x4 + x4 ln x
x 5

4.4.2 Method 2: Using y = xm


We write the Euler-Cauchy equation in the form

x2 y 00 + axy 0 + by = 0
Substituting

y = xm
y 0 = mxm−1
y 00 = m(m − 1)xm−2

into Euler-Cauchy equation, we get

x2 m(m − 1)xm−2 + axmxm−1 + bxm = 0 or


m(m − 1) + am + b = 0
m2 + (a − 1)m + b = 0

The roots are calculated using this formula

r
1 1
m1 = (1 − a) + (1 − a)2 − b
2 4
r
1 1
m2 = (1 − a) − (1 − a)2 − b
2 4

Case I: Real roots, m1 6= m2

If the roots m1 and m2 are real and different, the solutions are

y1 = xm 1 , y2 = xm2
and the general solution will be

y = c1 x m 1 + c2 x m 2

Example

Solve the following Euler-Cauchy equation

x2 y 00 + 1.5xy 0 − 0.5y = 0
the auxiliary equation is

m2 + (1.5 − 1)m − 0.5 = 0


The roots are m1 = 0.5 and m2 = −1, so the general solution is

29
√ c2
y = c1 x +
x

Case II: Real double roots, m1 = m2

The first solution is (from m1 = 12 (1 − a))

y1 = x(1−a)/2
To find a second linearly independent solution, we use the reduction of order method by setting
y2 = u · y1 where we get
Z  Z 
1
u= exp − p dx dx
y12
where p = xa , which after some manipulation, we get u as

u = ln x
Therefore, the second linearly independent solution is

y2 = u · y1
= ln x · x(1−a)/2

Then, the general solution will be

y = (c1 + c2 ln x)x(1−a)/2

Example

Solve the Euler-Cauchy equation

x2 y 00 − 5xy 0 + 9y = 0

Answer

The auxiliary equation is

m2 − 6m + 9 = 0
which give double real roots m1 = m2 = 3, so the general solution is

y = (c1 + c2 ln x)x3

Case III: Complex Roots, m1,2 = γ ± iω

We show one example

Example

Solve the Euler-Cauchy equation

x2 y 00 + 0.6xy 0 + 16.04y = 0

30
the auxilirary equation is

m2 − 0.4m + 16.04 = 0
which give complex roots

m1 = 0.2 + 4i
m2 = 0.2 − 4i

The basis solution

y1 = xm1 = x0.2+4i = x0.2 (eln x )4i = x0.2 e(4 ln x)i


y2 = xm2 = x0.2−4i = x0.2 (eln x )−4i = x0.2 e−(4 ln x)i

Using Euler’s Formula and t = 4 ln x, we get

y1 = xm1 = x0.2 [cos(4 ln x) + i sin(4 ln x)]


y2 = xm2 = x0.2 [cos(4 ln x) − i sin(4 ln x)]

After some manipulation we get (try to prove yourself)

y1 = x0.2 cos(4 ln x)
y2 = x0.2 sin(4 ln x)

Hence the general solution is

y = x0.2 [A cos(4 ln x) + B sin(4 ln x)

4.5 One Solution is Known


If y = u is a given solution belonging to the homogeneous equation of the differential equation,
then put y = u · v is other solution for differential equation. Let

d2 y dy
+ P (x) + Q(x)y = R(x) (1)
dx2 dx
Since u is a solution of the differential equation, we can write

d2 u du
+ P (x) + Q(x)u = 0
dx2 dx
For y = u · v

y =u·v
dy du dv
=v +u
dx dx dx
d2 y d2 u dv du d2 v
= v + 2 + u
dx2 dx2 dx dx dx2

31
2
dy d y
Substituting y, dx and dx 2 into (1), we get

d2 u d2 v
 
dv du du dv
v + 2 + u + P (x) v + u + Q(x)uv = R(x)
dx2 dx dx dx2 dx dx
Rearrange, we get
 2   2 
d u du d v dv du dv
v + P (x) + Q(x)u + u + P (x) +2 = R(x)
dx2 dx dx2 dx dx dx
The first bracket is equal to 0, so the remaining equation divided by u, we get
d2 v dv 2 du dv R(x)
+ P (x) + =
dx2 dx u dx dx u
d2 v
 
2 du dv R(x)
+ P (x) + =
dx2 u dx dx u
Thus, the formula to find v is

d2 v
 
2 du dv R(x)
2
+ P (x) + = (2)
dx u dx dx u

Example

Solve the following equation, given that y = u = x is a homogeneous solution for this equation
d2 v
 
2 du dv R(x)
+ P (x) + =
dx2 u dx dx u
2
 
d v −2x(1 + x) 2 dv x
+ + (1) =
dx2 x2 x dx x
2
d v dv
−2 =1
dx2 dx
dz dv
or − 2z = 1, ∵ z =
dx dx
The last equation is linear differential equation, its solution is
Z
−2x
ze = 1 · e−2x dx + c1

e−2x
= + c1
−2
1
z = + c1 e2x
−2
dv 1
= + c1 e2x
dx −2
1
dv =( + c1 e2x )dx
−2
−x c1 2x
v = + e + c2
2 2
Then, the complete solution y = u · v is
 
−x c1 2x
y =u·v =x + e + c2
2 2

32
5 Higher Order Linear ODEs
An Higher Order ODE which can be written as below

y n + pn−1 (x)y n−1 + . . . + p1 (x)y 0 + p0 (x)y = r(x)


is called Higher Order Linear ODE. The general solution can be represent as

y(x) = c1 y1 (x) + . . . + cn yn (x).

5.1 Homogeneous Linear ODEs with Constant Coefficients


We consider nth-order homogeneous linear ODEs with constant coefficient which can write in form

y n + an−1 y n−1 + . . . + a1 y 0 + a0 y = 0
Substituting y = eλx , we obtain the characteristic equation,

λn + an−1 λn−1 + . . . + a1 λ + a0 = 0
By factoring the equation or using other methods we can determine the roots for this equation.

Distinct Real Roots

If all the roots we get are real and different, (λ1 6= λ2 6= . . . 6= λn ), then the n solutions,

y1 = eλ1 x , . . . , yn = eλn x
cosntitute the basic solution for

y = c1 eλ1 x + c2 eλ2 x + . . . + cn−1 eλn−1 x + cn eλn x

Example

Solve the ODE

y 000 − 2y 00 − y 0 + 2y = 0

Answer

The characteristic equation is

λ3 − 2λ2 − λ + 2 = 0
The roots are λ1 = −1, λ2 = 1 and λ3 = 2. Therefore, the general solution is

y = c1 e−x + c2 ex + c3 e2x

Simple Complex Roots

If complex roots occur, they exist in conjugate pairs. Thus if λ = γ + iω is a complex root
exist then it conjugate λ∗ = γ − iω will also exist. The two corresponding linearly independent
solutions are

y1 = eγx cos(ωx), y2 = eγx sin(ωx)

33
Example

Solve the ODE

y 000 − y 00 + 100y 0 − 100y = 0

Answer

The characteristic equation is

λ3 − λ2 + 100λ − 100 = 0
The roots are λ1 = 1, λ2 = 10i and λ2 = −10i which has a complex roots. The general solution
will be

y = c1 ex + c2 e0·x cos 10x + c3 e0·x sin 10x


= c1 ex + c2 cos 10x + c3 sin 10x
y = c1 ex + A cos 10x + B sin 10x

Multiple Real Roots

If among the nth roots we have a real double root occur, for example λ1 = λ2 , we take y1 and
xy1 as the corresponding linearly independent solutions.
In general, if we have λ as a real root of order m, the m corresponding linearly independent
solution are

eλx , xeλx , x2 eλx , . . . , xm−1 eλx .

Example

Solve the ODE

y 00000 − 3y 0000 + 3y 000 − y 00 = 0

Answer

The characteristic equation is

λ5 − 3λ4 + 3λ3 − λ2 = 0
The roots are λ1 = λ2 = 0 and λ3 = λ4 = λ5 = 1. So the general solution will be

y = c1 + c2 x + (c3 + c4 x + c5 x2 )ex

Multiple Complex Roots

The general solution will be the same as Simple Complex Roots except if λ = γ + iω is a
complex double root with corresponding linearly independent solutions are

34
eγx cos(ωx), eγx sin(ωx), xeγx cos(ωx), xeγx sin(ωx)
and the corresponding general solution are

y = eγx [(A1 + A2 x) cos ωx + (B1 + B2 x) sin ωx]

5.2 Non-Homogeneous Linear ODEs


We consider nth-order non-homogeneous linear ODEs with constant coefficient which can write in
form

y n + an−1 y n−1 + . . . + a1 y 0 + a0 y = r(x)


The general solution is in the form

y(x) = yh (x) + yp (x)


where, yh (x) is the general solution for the corresponding homogeneous ODE. yp (x) is the
particular solution and can be found by using one of these methods.

1. Method of Undetermined Coefficients (same as for Second Order ODE)


2. Method of Variation of Parameters
3. Annihilator Method (guessing yp pattern)

5.2.1 Method of Variation of Parameters


The particular solution for the non-homogeneous higher order ODEs can be determined using the
following formula

n Z
X Wk (x)
yp (x) = yk (x) r(x) dx
W (x)
k=1
Z Z
W1 (x) Wn (x)
= y1 (x) r(x) dx + . . . + yn (x) r(x) dx
W (x) W (x)

Example

Solve the non-homogeneous Euler-Cauchy equation

x3 y 000 − 3x2 y 00 + 6xy 0 − 6y = x4 ln x, (x > 0)

Answer

For general homogeneous solution, we use y = xm which give

m(m − 1)(m − 2) − 3m(m − 1) + 6m − 6 = 0


The roots are 1, 2, 3 and give as a basis

y1 = x, y2 = x2 , y3 = x3 .
Hence the corresponding general solution of the homogeneous ODE is

35
yh = c1 x + c2 x2 + c3 x3 .
For particular non-homogeneous solution, we start by finding the Determinants


x x2 x3
= 1 2x 3x2 = 2x3

W
0 2 6x
2

0 x x3
= 0 2x 3x2 = x4

W1
1 2 6x

x 0 x3
= 1 0 3x2 = −2x3

W2
0 1 6x

x x2 0
= 1 2x 0 = x2

W3
0 2 1

Putting all the result into the standard equation, we get

Z Z Z
W1 (x) W2 (x) W3 (x)
yp = y1 (x) r(x) dx + y2 (x) r(x) dx + y3 (x) r(x) dx
W (x) W (x) W (x)
x4 −2x3 x2
Z Z Z
2 3
=x x ln x dx + x x ln x dx + x x ln x dx
2x3 2x3 2x3
Z Z Z
x 1
=x x ln x dx − x2 x ln x dx + x3 x ln x dx
2 2x
x x3 x3
 2
x2 x3
  
x
= ln x − − x2 ln x − + (x ln x − x)
2 3 9 2 4 2
 
1 11
yp = x4 ln x −
6 6

Hence the complete solution is

y = yh + yp
 
1 11
= c1 x + c2 x2 + c3 x3 + x4 ln x −
6 6

5.2.2 Annihilator Method


Here we try to make r(x) becomes 0 by multiplying the non-homogeneous equation with fixed
Differential operator.

1. for r(x) = erx , we mulitply the non-homogeneous equation with (D−r) to get (D−r)r(x) = 0
Example

Derx = rerx
(D − r)erx = 0

2. for r(x) = xk erx we multiply the non-homogeneous equation with (D − r)k+1 to get (D −
r)k+1 r(x) = 0

36
Example

D(erx u) = erx Du + rerx u = erx (D + r)u


0 = D(erx u) − erx Du − rerx u
D2 (erx u) = erx D2 u + 2rerx Du + r2 erx u = erx (D + r)2 u
0 = D2 (erx u) − erx D2 u − 2rerx Du − r2 erx u

3. for r(x) = cos βx or sin βx, we multiply the non-homogeneous equation with (D2 + β 2 ) to
get (D2 + β 2 )r(x) = 0
Example

D(cos βx) = −β sin βx


D2 (cos βx) = −β 2 cos βx
0 = D2 (cos βx) + β 2 cos βx

4. for r(x) = xk eαx cos βx or xk eαx sin βx, we multiply the non-homogeneous equation with
 k+1  k+1
(D − α)2 + β 2 to get (D − α)2 + β 2 r(x) = 0

Example

Find a general solution for the following non-homogeneous ODEs using Annihilator method,

y 000 − 3y 00 + 4y = xe2x

Answer

For homogeneous solution we use

(D3 − 3D2 + 4)y(x) = (D + 1)(D − 2)2 y(x) = 0.


To annihilate r(x) = xe2x we multiply both side with (D − 2)2 , we get

(D − 2)2 (D3 − 3D2 + 4)y(x) = (D − 2)2 (xe2x )


(D − 2)2 (D + 1)(D − 2)2 y(x) = 0
(D + 1)(D − 2)4 y(x) = 0

The general solution is

y(x) = c1 e−x + c2 e2x + c3 xe2x + c4 x2 e2x + c5 x3 e2x


which comprise of

yh = c1 e−x + c2 e2x + c3 xe2x


yp = c4 x2 e2x + c5 x3 e2x

Using method of undetermined coefficients, we get c4 = −1/18 and c5 = 1/18, so the general
solution is
1 2 2x 1
y(x) = c1 e−x + c2 e2x + c3 xe2x − x e + x3 e2x
18 18

37

You might also like