You are on page 1of 97

TEGM3592: ENGINEERING MATHEMATICS II

University of Namibia
Faculty of Engineering & IT
Department of Mechanical Engineering

Mr. Naftali Indongo (MSc. Applied Mathematics (Stellenbosch))


Email: nindongo2@unam.na

25 September 2020

DIFFERENTIAL EQUATIONS
Chapter 3: Differential Equations
1. Introduction

2. 1st ORDER LINEAR ODEs


3. Applications of 1st Order ODEs
Population dynamics
Newton’s 2nd Law
Mixtures problems
4. Solution to 2nd Order Linear ODEs
Method of undetermined coefficients
Method of variation of parameters

DIFFERENTIAL EQUATIONS
(1.) INTRODUCTION
Definition 3.1
An equation involving derivatives of one or more dependent
variables with respect to one or more independent variables is
called differential equation.

Here are some examples of differential equations:


dy
dx = 2x
(1.)
 2
d 2y dy
(2.)
dx 2 + xy dx =0
∂V ∂V
(3.)
∂s + ∂t =V

Definition 3.2
A differential equation involving derivatives of one or more
dependent variables with respect to a single independent variable is
called an ordinary differentiable equation (ODE).
DIFFERENTIAL EQUATIONS
Here are some examples of ordinary differential equations:
d 2y
(1.)
dx 2
+ 4 dy
dx = 2x
dy
dx + xy = 0
(2.)

Definition 3.3
A differential equation involving partial derivatives of one or more
dependent variables with respect to more than one independent
variable is called a partial differential equation.

Here are some examples of partial differential equations:


∂2V 2
(1.)
∂s 2
+ ∂∂tV2 = V
∂2U ∂2U ∂2U
(2.)
∂x 2
+ ∂x∂y + ∂y 2
+9=0

Definition 3.4
The order of the highest ordered derivative involved in a differential
equation is called the order of the differential equation.
DIFFERENTIAL EQUATIONS
For example
∂2V 2
(1.)
∂s 2
+ ∂∂tV2 = V is a 2nd order PDE.
dy
(2.)
dx + xy = 0 is a 1st order ODE.

Definition 3.5
A linear ODE of order n in the dependent variable y with respect
to the independent variable x, is a n equation that can be written
in the form
d ny d n−1 y dy
a0 (x) n
+a1 (x) n−1
+· · ·+an−1 (x) +an (x)y = b(x) (3.1a)
dx dx dx
where a0 (x) 6= 0 is called a linear ODE.

For example
d 2y
(1.)
dx 2
+ 5 dy
dx + 6y = 0 is a 2
nd order linear ODE.

d 4y 2
(2.)
dx 4
+ x 2 ddxy2 + x 3 dy x th
dx = xe is a 4 oder linear ODE.
DIFFERENTIAL EQUATIONS
NB: If the ODE is not linear then it is called a non-linear. e.g.
dy
(1.)
dx + 2xy 2 = 3x
 2
d 2y dy
(2.)
dx 2
+ 2 dx +y =0

Figure 1: Classification of linear ODEs according to their coefficients.

NB: The right hand side, b(x) of Equation (3.1a) is called the
non-homogeneous term.
DIFFERENTIAL EQUATIONS
Definition 3.6
If the non-homogeneous term is equals to zero (b(x) = 0), then we
have an nth order linear homogeneous equation with either
constant or variable coefficients. i.e.
d ny d n−1 y dy
a0 (x) n
+ a 1 (x) n−1
+ · · · + an−1 (x) + an (x)y = 0 (3.1b)
dx dx dx

Example:
d 2y
(i)
dx 2
+ 2x dy
dx = 0 is a linear homogeneous ODE.
d 2y
(ii)
dx 2
+ 2x dy
dx = 2 sin x is a linear non-homogeneous ODE.
d 3y 2
(iii)
dx 3
+ 2 ddxy2 + 3 dy
dx + 2y = 0 is a linear homogeneous ODE.

DIFFERENTIAL EQUATIONS
Example 3.1

Show that;
dy
a) y = x + 3e −x is a solution to the ODE dx +y =x +1

b) y = e x + 2x 2 + 6x + 7 is a solution to the ODE


d 2y
dx 2
− 3 dy
dx + 2y = 4x
2

c) x 3 + 3xy 2 = 1 is an implicit solution of the differential


equation 2xy dy 2 2
dx + x + y = 0 on the interval 0 < x < 1.

DIFFERENTIAL EQUATIONS
Solution 3.1
dy
a) Since y = x + 3e −x , then dx = 1 − 3e −x . So,
dy
+ y = (1 − 3e −x ) + (x + 3e −x )
dx
=x +1
= RHS
dy
∴ y = x + 3e −x is a solution to the ODE dx + y = x + 1.
dy
b) Since y = e x + 2x 2 + 6x + 7, then dx = e x + 4x + 6 and
d 2y
dx 2
= e x + 4. Thus

d 2y dy
2
−3 + 2y = e x + 4 − 3(e x + 4x + 6) + 2(e x + 2x 2 + 6x + 7)
dx dx
= e x + 4 − 3e x − 12x − 18 + 2e x + 4x 2 + 12x + 1
= 4x 2 = RHS

DIFFERENTIAL EQUATIONS
c) Since x 3 + 3xy 2 = 1, then
d 3 dy
(x + 3xy 2 = 1) =⇒ 3x 2 + 3y 2 + 6xy =0
dx dx
dy 3(x 2 + y 2 )
=⇒ =−
dx 6xy
dy x2 + y2
=⇒ =−
dx 2xy
Thus,
 2
x + y2

dy
2xy + x 2 + y 2 = 2xy − + x2 + y2
dx 2xy
= −(x 2 + y 2 ) + x 2 + y 2
=0
= RHS

∴ x 3 + 3xy 2 = 1 is an implicit solution of the differential


equation 2xy dy 2 2
dx + x + y = 0 on the interval 0 < x < 1.
DIFFERENTIAL EQUATIONS
Initials and Boundary Values Problems (IVP & BVP)
dy
e.g. Find a solution y of the differential equation dx = 2x such
that at x = 1, the solution has a value 4.
Solution: We have that
Z Z
dy = 2xdx =⇒ y = x 2 + C

So,
y (1) = 4 =⇒ 1 + C = 4
=⇒ C = 3
dy
∴ y = x 2 + 3 is the solution to the ODE dx = 2x with the initial
condition y (1) = 4.
The solutions y = x 2 + C and y = x 2 + 3 are called the general
solution and particular solution respectively. Thus,
dy
= 2x x(1) = 4
dx
is called an initial value problem
DIFFERENTIAL EQUATIONS
Exercise 3.1

Verify that each function is a solution to the corresponding ODE.


dy
a) y = 2e 3x − 2x − 2, dx − 3y = 6x + 4
dy
b) y = e −3x + 2x + 3, dx + 3y = 6x + 11

DIFFERENTIAL EQUATIONS
(2.) 1st ORDER ODEs

Definition 3.7
The 1st ODE can be expressed in the form
dy
= F (x, y ) (3.2)
dx
or in differential form

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

DIFFERENTIAL EQUATIONS
Separable ODEs

Definition 3.8
An equation of the form

F (x)G (y )dx + f (x)g (y )dy = 0 (3.4)

is called an equation with variable separable or simply a


seperable equation

NB: Separable ODEs can be solved using integration techniques.

Example: Find the solution to the following separable equations.


a) (x − 4)y 4 dx − x 3 (y 2 − 3)dy = 0
dy
b)
dx = − (x 2x+1)
sin y
cos y
, y (1) = π
2

DIFFERENTIAL EQUATIONS
solution: We apply techniques of integration to solve the above
separable equations.
a) Since (x − 4)y 4 dx − x 3 (y 2 − 3)dy = 0, then
(x − 4)y 4 dx = x 3 (y 2 − 3)dy
Z 2
y −3 x −4
Z
4
dy = dx
y x3
Z   Z  
1 3 1 4
=⇒ − dy = − dx
y2 y4 x2 x3
Z Z
=⇒ (y −2 − 3y −4 )dy = (x −2 − 4x −3 )dx

=⇒ −y −1 + y −3 = −x −1 + 2x −2 + C
1 1 1 2
=⇒ − + 3 = − + 2 + C
y y x x
1 − y2 2−x
=⇒ = +C
y3 x2

∴ x 2 (1 − y 2 ) = y 3 (2 − x + Cx 2 ) is the general solution.


DIFFERENTIAL EQUATIONS
dy
b) Since dx = − (x 2x+1)
sin y
cos y
, then cos y
sin y dy = − x 2x+1 dx, So,
Z Z
cos y x
dy = − dx
sin y x2 +1

For cos y du du
R
sinRy dy let u = sin y , then dy = cos y =⇒ dy = cos y
and for x 2x+1 dx let v = x 2 + 1, then dv dx = 2x =⇒ dx = 2x .
dv

So,
Z Z Z Z
cos y du x dv du 1 dv
=− =⇒ =−
u cos y v 2x u 2 v
1
=⇒ ln |u| = − ln |v | + C
2
1
=⇒ ln | sin y | = − ln(x 2 + 1) + C
2
1
=⇒ ln | sin y | = ln(x 2 + 1)− 2 + C
 
1
=⇒ ln | sin y | = ln √ +C
x2 + 1

DIFFERENTIAL EQUATIONS
So,
1
sin y = √ e C Let A = e C
+1 x2
 
A −1 A
sin y = √ =⇒ y = sin √
x2 + 1 x2 + 1
 
Therefore, y = sin−1 √xA2 +1 is the general solution of the ODE

dy
dx = − (x 2x+1)
sin y
cos y
. Using the initial condition y (1) = π2 , we get
π  p √
A = sin 12 + 1 = 2
2
q 
−1 2
∴ y = sin x 2 +1
is the particular solution of the given ODE.

DIFFERENTIAL EQUATIONS
Exact Differential Equations

Definition 3.9
Let F = F (x, y ) be a function that has a continuous first partial
derivative in the domain D. The total differential function dF , of
the function F is defined by:

∂F (x, y ) ∂F (x, y )
dF (x, y ) = dx + dy (3.5)
∂x ∂y

for all (x, y ) ∈ D. Then the expression

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

is called an exact differential in a domain D if there exist a


function F (x, y ) such that

dF (x, y ) = M(x, y )dx + N(x, y )dy , for all (x, y ) ∈ D (3.6)

DIFFERENTIAL EQUATIONS
i.e. M(x, y )dx + N(x, y )dy is an exact differential in D if there
exist a function F (x, y ) such that

∂F ∂F
= M(x, y ) and = N(x, y ) (3.7)
∂x ∂y
If
M(x, y )dx + N(x, y )dy
is an exact differential, then the differential equation

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

is called an exact differential equation

DIFFERENTIAL EQUATIONS
Theorem 3.1
Consider the differential equation (3.3) where M and N have
continuous first partial derivatives at all points (x, y ) in the
domain D.
(1.) If the differential equation (3.3) is exact in D then:

∂M ∂N
= , for all (x, y ) ∈ D
∂y ∂x
(2.) Conversely, if ∂M ∂N
∂y = ∂x for all (x, y ) ∈ D, then the differential
equation (3.3) is exact in D.

DIFFERENTIAL EQUATIONS
Example: Determine whether y 2 dx + 2xydy = 0 is an exact DE.

Solution: We have that


∂F ∂F
= M = y2 and = N = 2xy
∂x ∂y
Thus,
Z Z
F = Mdx = y 2 dx = xy 2 + C (y ), and

Z Z
F = Ndy = 2xydy = xy 2 + C (x)

and
∂M ∂M
= 2y =
∂y ∂x
∴ y 2 dx + 2xydy = 0 is an exact differential equation

DIFFERENTIAL EQUATIONS
Solution to exact differential equations

Theorem 3.2
Suppose that the ODE

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

is an exact differential equation in the domain D, then a one


parameter family of solutions of this differential equation is give by:

F (x, y ) = C (3.8)

where F is a function such that


∂F ∂F
=M and =N for all (x, y ) ∈ D
∂x ∂y
and C is an arbitrary constant.

DIFFERENTIAL EQUATIONS
Examples
a) Solve the ODE (3x 2 + 4xy )dx + (2x 2 + 2y )dy = 0.
b) Solve the initial value problem (IVP),
(2x cos y + 3x 2 y )dx + (x 3 − x 2 sin y − y )dy = 0, y (1) = 0

Solution
a) We have that M = 3x 2 + 4xy and N = 2x 2 + 2y .

Step 1 : Check if the ODE is an exact differential equation.


∂M ∂N
= 4x =
∂y ∂x
∴ (3x 2 + 4xy )dx + (2x 2 + 2y )dy = 0 is an exact DE.

Step 2 : Find the function F = F (x, y ) such that


∂F ∂F
=M and =N
∂x ∂y
DIFFERENTIAL EQUATIONS
Z Z
∂F 2
= 3x + 4xy =⇒ ∂F (x, y ) = (3x 2 + 4xy )dx
∂x
=⇒ F = x 3 + 2x 2 y + c(y )

So,
∂F
= 2x 2 + c 0 (y ) =⇒ 2x 2 + c 0 (y ) = 2x 2 + 2y = N
∂y
=⇒ c 0 (y ) = 2y

Therefore,
Z
c(y ) = 2ydy

= y2 + C

∴ F (x, y ) = x 3 + 2x 2 y + y 2 + C is the general solution to the


exact differential equation (3x 2 + 4xy )dx + (2x 2 + 2y )dy = 0.
DIFFERENTIAL EQUATIONS
b) We have that M = 2x cos y + 3x 2 y and N = x 3 − x 2 sin y − y

Step 1 : Check if the ODE is an exact differential equation.

∂M ∂N
= 3x 2 − 2x sin y =
∂y ∂x

∴ (2x cos y + 3x 2 y )dx + (x 3 − x 2 sin y − y )dy is an exact DE.

Step 2 : Find the function F = F (x, y ) such that

∂F ∂F
=M and =N
∂x ∂y

Z Z
∂F
= 2x cos y + 3x 2 y =⇒ ∂F (x, y ) = (2x cos y + 3x 2 y )dx
∂x
=⇒ F = x 2 cos y + x 3 y + c(y )

DIFFERENTIAL EQUATIONS
So,
∂F
= x 3 − x 2 sin y + c 0 (y ) =⇒ x 3 − x 2 sin y + c 0 (y ) = x 3 − x 2 sin y − y
∂y
=⇒ c 0 (y ) = −y

Therefore,
y2
Z
c(y ) = − ydy = − +C
2
2
∴ F (x, y ) = x 2 cos y + x 3 y − y2 = A is the general solution to the
exact DE (2x cos y + 3x 2 y )dx + (x 3 − x 2 sin y − y )dy .

Using the initial conditions y (1) = 0, we get


02
(1)2 cos(0) + (1)3 (0) − = A =⇒ A = 1
2
2
∴ F (x, y ) = x 2 cos y + x 3 y − y2 = 1 is the particular solution to
exact DE (2x cos y + 3x 2 y )dx + (x 3 − x 2 sin y − y )dy .
DIFFERENTIAL EQUATIONS
Exercise 3.2

1 Solve the following IVPs.


dr
a)
dθ = −r tan θ, r (π) = 2
dy 3x 2 +4x−4
b)
dx = 2y −4

2 Solve the following IVPs and find the interval of validity for
the solution.
a) 2xy − 9x 2 + (2y + x 2 + 1) dy
dx = 0, y (0) = −3
b) (2xy 2 + 4)dx = 2(3 − x 2 y )dy , y (−1) = 8

DIFFERENTIAL EQUATIONS
1st Order Linear ODEs: Method of Integrating Factor

Definition 3.10
A first order ODE is linear in the dependent variable y and the
independent variable x if it is or can be written in the form
dy
+ P(x)y = Q(x) (3.9)
dx

Theorem 3.3
dy
The linear differential equation dx + P(x)y = Q(x) has an
integration factor of the form
R
P(x)dx
I (x) = e (3.10)

We have that

DIFFERENTIAL EQUATIONS
Z Z
d
(y (x)I (x)) = Q(x)I (x) =⇒ d(yI (x)) = Q(x)I (x)dx
dx
Z
=⇒ y (x)I (x) = Q(x)I (x)dx
Z 
1
=⇒ y (x) = Q(x)I (x)dx
I (x)

A one-parameter family of solutions is given by:


Z 
1
y (x) = Q(x)I (x)dx (3.11)
I (x)

Example: Solve the following linear ODEs.


a) (x 2 + 1) dy + 4xy = x, y (2) = 1
dx 
dy
b)
dx + 2x+1
x = e −2x
DIFFERENTIAL EQUATIONS
Solution
a) We have that (x 2 + 1) dy dy 4x
dx + 4xy = x =⇒ dx + x 2 +1 y =
x
x 2 +1
,
then
4x x
P(x) = 2 and Q(x) = 2
x +1 x +1
Thus,
R
P(x)dx
I (x) = e
R 4x
dx du du
=e x 2 +1 Let u = x 2 + 1, then = 2x. So, dx =
dx 2x
4x du du
= e (2 )
R R
=e u 2x u

2 2 +1)2
= e 2 ln u = e ln u = e ln(x = (x 2 + 1)2
Thus,
Z  Z 
1 1 x 2 2
y (x) = Q(x)I (x)dx = 2 (x + 1) dx
I (x) (x + 1)2 x2 + 1
 4
x2
Z 
1 2 1 x
= 2 x(x + 1)dx = 2 + +C
(x + 1)2 (x + 1)2 4 2
DIFFERENTIAL EQUATIONS
h i
1 x4 2
Therefore, y (x) = (x 2 +1)2 4
+ x2 + C is the general solution to
the linear ODE (x 2 + 1) dydx + 4xy = x.

Since, y (2) = 1, then


1
[4 + 2 + C ] = 1 =⇒ 4 + 2 + C = 25
25
=⇒ C = 19
h 4 2
i
1 x x
∴ y (x) = (x 2 +1)2 4 + 2 + 19 is the particular solution to the
linear ODE (x 2 + 1) dy
dx + 4xy = x, with initial the condition
y (2) = 1.
b) Let P(x) = 2x+1
x and Q(x) = e −2x . So,
2x+1 1
= e (2+ x )dx
R R R
p(x)dx dx
I (x) = e =e x

= e 2x+ln x
= e 2x e ln x
= xe 2x
DIFFERENTIAL EQUATIONS
Thus,
Z  Z 
1 1 −2x 2x
y (x) = Q(x)I (x)dx = x e xe dx
I (x) xe
Z 
1
= x xdx
xe
1 x2
 
= x +C
xe 2
h 2 i
∴ y (x) = xe1x x2 + C is a general solution to the linear ODE
dy 2x+1
= e −2x .

dx + x

DIFFERENTIAL EQUATIONS
Bernoulli’s Equations

Definition 3.11
A 1st order ODE of the form:
dy
+ P(x)y = Q(x)y n (3.12)
dx
is called a Bernoulli’s Equation.

If n = 0 or 1, then Equation (3.12) is a linear ODE

Theorem 3.4
Suppose that n 6= 0 or 1, then the transformation v = y 1−n
reduces the Bernoulli’s equation (3.12) to a linear equation in v .

dy
Example: Solve the differential equation dx + y = xy 3 .

DIFFERENTIAL EQUATIONS
dy
Solution: The differential equation dx + y = xy 3 is a Bernoulli’s
equation with n = 3.

Let v = y 1−3 = y −2 . Then


dv dy dy y 3 dv
= −2y −3 =⇒ =−
dx dx dx 2 dx
dy dy
Replacing dx in the ODE dx + y = xy 3 , we get

y 3 dv y3
 
dv 2
− + y = xy 3 =⇒ − 2 = −2x ÷−
2 dx dx y 2
dv
=⇒ − 2y −2 = −2x
dx
dv
=⇒ − 2v = −2x
dx
So, P(x) = −2 and Q(x) = −2x, then
R R
I (x) = e p(x)dx
= e− 2dx
= e −2x

DIFFERENTIAL EQUATIONS
Therefore,
Z 
1
v (x) = I (x)Q(x)dx
I (x)
 Z  Z
1
= −2x −2 xe −2x dx use integration by parts for xe −2x dx
e
  
2x 1 −2x 1 −2x
=e −2 − xe − e +C
2 4
 
1
= e 2x xe −2x + e −2x + C
2
1
= x + + Ce 2x
2
v (x) = x + 21 + Ce 2x is the general solution to the linear ODE
dv −2 , then y = √1 .
dx − 2v = −2x. Since v = y v

1 dy
∴ y (x) = q is the general solution of dx + y = xy 3 .
x+ 12 +Ce 2x

DIFFERENTIAL EQUATIONS
Exercise 3.3
1. Solve the following initial value problems (IVPs).
dv
a)
dt = 9.8 − 0.196v , v (0) = 48
b) t dy 2
dt + 2y = t − t + 1, y (1) =
1
2

2. Solve the following IVPs and find the interval of validity for
the solution.
dy
a)
dx + x4 y = x 3 y 2 , y (2) = −1, x > 0
dy
b)
dx = 5y + e −2x y −2 , y (0) = 2

3. Consider the equation


dy
a + by = ke −λx
dx
where a, b and k are positive constant and λ is a nonnegative
constant.
DIFFERENTIAL EQUATIONS
1 Solve the equation
2 Show that if λ = 0, every solution approaches kb as x → ∞,
but if λ > 0 every solution approaches 0 as x → ∞.

DIFFERENTIAL EQUATIONS
(3.) APPLICATIONS OF 1st ODEs
Population Dynamics
Let us consider the initial population of 115 first year students in
my Engineering Mathematics II class, consisting of both male (M)
and female (F ) students. If a male and female student interact
(MF ), they will give birth to my grandstudent at a rate of b.
There is deaths due natural causes or corona virus at a rate of d.
Thus, the population increases at a rate of k = b − d.

Figure 2: Simple Population Dynamic.


DIFFERENTIAL EQUATIONS
Determine the population at time t where t is in years.

Solution: The rate at which the population changes at time t is


proportional to a total population P = P(t). Thus,
dP dP
∝ P =⇒ = kP
dt dt
where k = b − d, such that b and d are the death and birth rates,
respectively.

b > d
 =⇒ Growth
b=d =⇒ No growth

b<d =⇒ Extinction

So, we have the following initial value problem:


dP
= kP, P(0) = 115
dt
which can be solved using separation of variables.
DIFFERENTIAL EQUATIONS
So, the population at time t is
Z Z
dP
= kdt =⇒ ln P = kt + C
P
=⇒ P = e kt+C
=⇒ P = e C e kt
=⇒ P = P0 e kt where P0 = e C
Since P(0) = 115, then 115 = P0 e 0 = P0 .

∴ P(t) = 115e kt is the population at time t as are shown below.

Figure 3: Simple Population Dynamic.


DIFFERENTIAL EQUATIONS
Logistic Population Model
Definition 3.12
A logistic population model is given by the equation
dP
= aP(k − P) (3.13)
dt
where P(0) = P0 and k is the population carrying capacity.

The logistic population model is a separable equation.Thus,


Z Z Z  
dP A B
= a dt =⇒ + dP = at + C
P(k − P) P k −P
Z  
1 1
=⇒ + dP = at + C
kP k(k − P)
Z  
1 1 1
=⇒ + dP = at + C
k P k −P
1
=⇒ (ln P − ln(k − P)) = at + C
k DIFFERENTIAL EQUATIONS
 
P P
ln = akt + kC =⇒ = e akt+kC = e kC e akt
k −P k −P
=⇒ P = (k − P)C0 e akt where C0 = e kC
=⇒ P = kC0 e akt − PC0 e akt
=⇒ P + PC0 e akt = kC0 e akt
=⇒ P(1 + C0 e akt ) = kC0 e akt
kC0 e akt
=⇒ P =
1 + C0 e akt

kC0
P(0) = P0 =⇒ = P0
1 + C0
=⇒ kC0 = P0 + C0 P0
P0
=⇒ C0 =
k − P0
Therefore,
DIFFERENTIAL EQUATIONS
 
P0
k e akt
k−P0
P(t) =  
P0
1 + k−P 0
e akt
kP0 e akt
=
k + P0 (e akt − 1)
k
is the solution to the Logistic equation (3.13). limt→∞ P(t) = P0

DIFFERENTIAL EQUATIONS
Radioactive decay
Let C (t) be the concentration of the radioactive nuclei at time t
as shown on Figure 4 below.

Figure 4: Concentration of a radioactive nuclei at time t.

The rate at which the radioactive atom decay is inversely


proportional to its concentration at time t. Thus
dC
= −rC , C (0) = C0
dt
where C0 is the initial concentration and r is the rate of decay.
DIFFERENTIAL EQUATIONS
Z Z
dC
= −r dt =⇒ ln C = −rt + k
C
=⇒ C = e k e −rt
=⇒ C = Ae −rt

Since C (0) = C0 , then A = C0 . Therefore

C (t) = C0 e −rt

is the concentration at time t.

DIFFERENTIAL EQUATIONS
Exercise 3.4

The rate at which a radioactive nuclei decay is proportional the


amount of such a nuclei that is present in the given sample. Half
of the original number of radioactive nuclei have under gone
disintegration in a period of 1500 years.

a) What percentage of the radioactive nuclei will remain after


4500?
b) In how many years will one tenth of the original number will
remain?

DIFFERENTIAL EQUATIONS
Newton’s 2nd Law
The time rate of change of momentum of a body is proportional to
the resultant force acting on the body and it is in the direction of
the this resultant force. i.e.
d
(mv ) = ma
dt
Recall: The gravitational force that the earth exerts on the body is
equal to the weight of the body.
w = mg
Rectilinear motion

Figure 5: Body moving in linear motion.


DIFFERENTIAL EQUATIONS
For rectilinear motion:
dx
v= ≡ instantaneous velocity
dt
and
dv d 2x
a= = 2 ≡ instantaneous acceleration
dt dt
Furthermore, note that
dv dv dx
=
dt dx dt
dv
=v
dx
Thus,
dv dv
F = ma = m = mv
dt dx
where F is the force acting on the body.
DIFFERENTIAL EQUATIONS
Falling body problems
The amount of air resistance depends upon the velocity (speed) of
the body. i.e.

R = kv or R = kv 2

Example: An 8lb object falls from rest toward the earth from a
great height. As it falls, air resistance act upon it and we assume
that this air resistance in pounds is numerically equals to 2v ,
where v is the velocity in (feet per per second). Find the velocity
and the distance fallen at time t seconds.

DIFFERENTIAL EQUATIONS
Solution: Consider the figure below.

Figure 6: Falling body.

w = 8lb (w = mg ). At rest, we have that:

v (0) = 0 and x(0) = 0

and air resistance is:


R = 2v
DIFFERENTIAL EQUATIONS
Thus,
 
dv w
w − R = ma =⇒ 8 − 2v = m m=
dt g
8 dv
=⇒ 8 = + 2v
32 dt
dv
=⇒ + 8v = 32
dt
which is a 1st order linear ODE of the form dv
dt + P(t)v = Q(t),
where P(t) = 8 and Q(t) = 32. Thus,
R R
P(t)dt 8dt
I =e =e = e 8t
Therefore,
Z 
1
v (t) = IQdt
I
Z 
−8x 8t
=e 32e dt

= e −8t 4e 8t + C = 4 + Ce −8t
 

DIFFERENTIAL EQUATIONS
Since v (0) = 0, then C = −4. ∴ v (t) = 4(1 − e −8t ) is the
particular solution to the ODE dv
dt + 8v = 32.
dx
Since v = dt , then the displacement x(t) is given by:
Z
x(t) = v (t)dt
Z
= (4 − 4e −8t )dt
1
= 4t + e −8t + C1
2
Since x(0) = 0, then C1 = − 21 . ∴ x(t) = 4t + 12 (e −8t − 1) is the
particular solution to the ODE dx −8t )
dt = 4(1 − e

DIFFERENTIAL EQUATIONS
Mixtures Problems

Problem: A tank initially contains 50 gallons of pure water.


Starting at time t = 0, a brine (salt solution) containing 2lb of
dissolved salt per gallon flows into the tank at the rate of 3
gal/min. The mixture is kept uniform by staring and the well
stared mixture flows out of the tank at the same rate.

a) How much salt is in the tank at any time t > 0?


b) How much salt is present at the end of 25 minutes?
c) How much salt is present after a long time?

DIFFERENTIAL EQUATIONS
Solution: Consider the figure below:

Figure 7: Mixture problem.

a) Let X (t) be the amount of salt in the tank at time t. The


rate of change of the amount of salt at time t is given by
dX (t)
= (rate in) − (rate out)
dt
where (rate in) is the rate at which salt enters the tank and
(rate out) is the rate at which salt leaves the tank. Thus,
DIFFERENTIAL EQUATIONS
  
lb gal
rate in = 2 3 = 6 lb/min
gal min

The tank always contains 50 gallons of water, so the concentration


at time is X50
(t)
(measured in lb/gal). Since the brine flows out at a
rate of 3 gal/min, we have

  
X (t) lb gal 3X (t)
rate out = 3 = lb/min
50 gal min 50

Therefore,
dX 3X 300 − 3X
=6− = , X (0) = 0
dt 50 50
Which is a separable differential equation. Thus,

DIFFERENTIAL EQUATIONS
Z Z
dX dt t
= = +C
300 − 3X 50 50
R dX dU
For 300−3X , let U = 300 − 3x, then dX = −3 =⇒ dX = − dU
3 .
Thus,
Z Z
dX 1 dU
=−
300 − 3X 3 U
1
= − ln |U|
3
1
= − ln |300 − 3X |
3
Therefore,
3t
ln |300 − 3X | = − + C0 (C0 = −3C )
50
3t
=⇒ 300 − 3X = e − 50 +C0

DIFFERENTIAL EQUATIONS
3t
3X = 300 − e C0 e − 50
1 3t

X = 300 − Ae − 50 (A = e C0 )
3
1 3t
= 100 − Ae − 50
3
Since X (0) = 0, then A = 300.
3t
∴ X (t) = 100 − 100e − 50 is the amount of salt in the tank at t > 0.

b The amount of salt left in the tank at the end of 25 minutes is


3(25)
X (25) = 100 − 100e − 50 = 77.69 gal

c After a long time, the amount of salt present is

lim X (t) = 100 gal


t→∞

DIFFERENTIAL EQUATIONS
Basic Theory of Linear Homogeneous ODEs

Let f1 , f2 , . . . , fn be any “n” solution of the homogeneous linear


ODE (3.1b), then c1 f1 + c2 f2 + · · · + cn fn is also a solution (3.1b).
Where c1 , c2 , . . . , cn are “n” arbitrary constants.

Definition 3.13
If f1 , f2 , . . . , fn are any “n” given functions, then the expression
c1 f1 + c2 f2 + · · · + cn fn is called a linear combination of
f1 , f2 , . . . , fn .

Theorem 3.5
Any linear combination of solutions of the homogeneous linear
ODE (3.1b) is also a solution of (3.1b). i.e.
c1 f1 + c2 f2 + · · · + cn fn is a solution of (3.1b).

DIFFERENTIAL EQUATIONS
Definition 3.14
The “n” functions f1 , f2 , . . . , fn are called linearly dependent on
the interval [a, b] if the there exits constants c1 , c2 , . . . , cn not all
zeros such that

c1 f1 + c2 f2 + · · · + cn fn = 0, for all x ∈ [a, b]

In particular, f1 and f2 are linearly dependent on [a, b] if there exits


constants c1 , c2 not all zeros such that c1 f1 + c2 f2 = 0 for all
x ∈ [a, b].

Definition 3.15
The “n” functions f1 , f2 , . . . , fn are called linearly independent on
[a, b] if the there exits constants c1 , c2 , . . . , cn such that

c1 f1 + c2 f2 + · · · + cn fn = 0, for all x ∈ [a, b]

Provided that c1 = c2 = · · · = cn = 0.
DIFFERENTIAL EQUATIONS
Theorem 3.6
The nth order homogeneous linear ODE (3.1b) always posses “n”
linearly independent solutions.

“n” linearly independent solutions f1 , f2 , . . . , fn to (3.1b) can be


expressed as a linear combination c1 f1 + c2 f2 + · · · + cn fn .

Definition 3.16
If f1 , f2 , . . . , fn are “n” linearly independent solution of of the nth
order homogeneous linear ODE (3.1b) on the interval [a, b], then
the set {f1 , f2 , . . . , fn } is called a fundamental set of solutions of
(3.1b) and the function defined by

f (x) = c1 f1 + c2 f2 + · · · + cn fn , x ∈ [a, b]

where c1 , c2 , . . . , cn are a arbitrary constants is called a general


solution of equation (3.1b) on [a, b].

DIFFERENTIAL EQUATIONS
Let f1 , f2 , . . . , fn be “n” real valued functions, each of which has an
(n − 1)th derivatives on the interval [a, b].

We use the determinant



f1 f 2 . . . f n
0 0 0

f1 f2 ... fn
W (f1 , f2 , . . . , fn ) = .. .. .. (3.14)

..
. . . .
(n−1) (n−1) (n−1)
f f2 . . . fn
1

called the Wronskian to check if functions f1 , f2 , . . . , fn are linearly


independent.

DIFFERENTIAL EQUATIONS
Theorem 3.7
The “n” solution f1 , f2 , . . . , fn of the nth order homogeneous linear
ODE (3.1b) are linearly independent if and only if

W (f1 , f2 , . . . , fn ) 6= 0, ∀x ∈ [a, b] (3.15)

Theorem 3.8
The Wronskian of any solutions f1 , f2 , . . . , fn of the nth order
homogeneous linear ODE (3.1b) is either zero or nonzero on the
interval [a, b].

Example: show that


a) y1 = sin x and y2 = cos x are linearly independent solutions of
d 2y
dx 2
+ y = 0.
b) y1 = e x , y2 = e −x and y3 = e 2x are linearly independent
solutions of y 000 − 2y 00 − y 0 + 2y = 0.
DIFFERENTIAL EQUATIONS
Solution: By using the Wronskian:
a) Let y1 = sin x = f1 and y2 = cos x = f2 , then y10 = cos x,
y20 = − sin x, y100 = − sin x and y200 = − cos x. Since

y100 + y10 = − sin x + sin x = 0 and


y200 + y2 = − cos x + cos x = 0
d 2y
Thus, y1 = sin x and y2 = cos x are solutions dx 2
+ y = 0.
Furthermore,

f1 f2
W = 0 0
f1 f2

sin x cos x
= = −(sin2 x + cos2 x) = −1 6= 0
cos x − sin x
∴ y1 = sin x and y2 = cos x are linearly independent solutions
of y 0 + y = 0. i.e y = c1 sin x + c2 cos x where c1 and c2 are
constants is the general solution of y 00 + y = 0.
DIFFERENTIAL EQUATIONS
b) Let y1 = e x = f1 , y2 = e −x = f2 and y3 = e 2x , then y10 = e x ,
y20 = −e −x , y30 = 2e 2x , y100 = e x , y200 = e −x , y200 = 4e 2x ,
y1000 = e x , y200 = −e −x and y3000 = 8e 2x . Since
y1000 − 2y100 − y10 + 2y1 = e x − 2e x − e x + 2e x = 0
y2000 − 2y200 − y20 + 2y2 = −e −x − 2e −x + e −x + 2e −x = 0
y3000 − 2y300 − y30 + 2y3 = 8e 2x − 8e 2x − 2e 2x + 2e 2x = 0

Thus, y1 = e x = f1 , y2 = e −x = f2 and y3 = e 2x are solutions


of y 000 − 2y 00 − y 0 + 2y = 0.
Furthermore,

f1 f2 f3
W = f10 f20 f30

f 00 f 00 f 00
1 2 3
−x
x 2x

e
x e −x e 2x
= e −e 2e
e x e −x 4e 2x
DIFFERENTIAL EQUATIONS
−x
2e 2x −e −x
x
2e 2x
x
−e
x −x e
2x e

W = e −x −e x +e x
e 4e 2x e 4e 2x e e −x
= e x (−6e x ) − e −x (2e 3x ) + e 2x (2)
= −6e 2x − 4e 2 + 2e 2x
= −6e 2x 6= 0

∴ y1 = e x , y2 = e −x and y3 = e 2x are linearly independent


solutions of y 000 − 2y 00 − y 0 + 2y = 0. i.e y = c1 e x + c2 e −x + c3 e 2x
where c1 , c2 and c3 are constants is the general solution of
y 000 − 2y 00 − y 0 + 2y = 0.

DIFFERENTIAL EQUATIONS
Solution to the nth Order Homogeneous ODE

The homogeneous linear ODE

d ny d n−1 y dy
a0 n
+ a 1 n−1
+ · · · + an−1 + an y = 0 (3.16)
dx dx dx
where a0 , a1 , . . . , an are constants, has a solution of the form

y = e rx (3.17)

where is a chosen r constant.

By substituting (3.17) in Equation (3.16), we get

a0 r n + a1 r n−1 + · · · + an−1 r + an = 0 (3.18)


Equation (3.18) is called the Auxiliary/characteristic equation
of the homogeneous ODE (3.16).

DIFFERENTIAL EQUATIONS
Types of Roots of the Homogeneous ODE (3.16)

(1.) Real and distinct roots


If r1 , r2 , . . . , rn are real distinct roots of the auxiliary Equation
(3.18), then e r1 x , e r2 x , . . . , e rn x are linearly independent solutions
of Equation (3.16). The general solution is given by

y = c1 e r1 x + c2 e r2 x + · · · + cn e rn x (3.19)
where c1 , c2 , . . . , cn are arbitrary constants.

Example: Find the general solution of the ODE y 00 − 3y 0 + 2y = 0.

Solution: We seek the solution of the form y = e rx , so that


r 2 − 3r + 2 = 0 is the auxiliary equation of y 00 − 3y 0 + 2y = 0.

r 2 − 3r + 2 = 0 =⇒ (r − 1)(r − 2) = 0

Therefore, we have real and distinct roots r1 = 1 and r2 = 2.


DIFFERENTIAL EQUATIONS
Thus, y1 = e x and y2 = e 2x are two linearly independent solutions
of y 00 − 3y 0 + 2y = 0. The general solution is given by

y = c1 e x + c2 e 2x

where c1 and c2 are constants.

(2.) Real and repeated roots


If the auxiliary equation (3.18) of the ODE (3.16) has a root
repeated “n” number of times, then the general solution is:

y (x) = c1 e rx + c2 xe rx + · · · + cn x n−1 e rx (3.20)

where c1 , c2 , . . . , cn are arbitrary constants.

Note: If r1 = r2 , then y1 = e r1 x and y2 = xe r1 x ; and if r1 = r2 = r3 ,


then y1 = e r1 x , y2 = xe r1 x and y3 = x 2 e r1 x .

DIFFERENTIAL EQUATIONS
Example: Find the general solution of y 000 − 4y 00 − 3y 0 + 18y = 0.

Solution: We seek the solution of the form y = e rx , so that


r 3 − 4r 2 − 3r + 18 = 0 is the auxiliary equation of
y 000 − 4y 00 − 3y 0 + 18y = 0.

r 3 − 4r 2 − 3r + 18 = 0 =⇒ (r + 2)(r − 3)2 = 0

Therefore, we have real roots r1 = −2 and r2 = 3 (twice).

Thus, y1 = e −2x , y2 = e 3x and y3 = xe 3x are linearly independent


solutions of y 000 − 4y 00 − 3y 0 + 18y = 0 and the general solution is.

y (x) = c1 e −2x + c1 e 3x + c3 xe 3x

DIFFERENTIAL EQUATIONS
(3.) Complex roots
If the auxiliary equation (3.18) of the 2nd order ODE of the form
(3.16) has complex roots of the form r1 = α + βi and r2 = α − βi,
then

y (x) = c1 e r1 x + c2 e r2 x
= c1 e (α+βi)x + c2 e (α−βi)x
= c1 e αx e βxi + c2 e αx e −βxi
= c1 e αx (cos βx + i sin βx) + c2 e αx (cos βx − i sin βx)
= e αx [(c1 + c2 ) cos βx + (c1 − c2 )i sin βx]
= e αx [A cos βx + B sin βx]

where A = c1 + c2 and B = (c1 − c2 )i are arbitrary constants.

Therefore,
y (x) = e αx [A cos βx + B sin βx] (3.21)
is the general solution.
DIFFERENTIAL EQUATIONS
Example: Find the general solutions of the following ODEs:

a) y 00 + y = 0
b) y 00 − 6y 0 + 25y = 0, y (0) = −3 and y 0 (0) = −1

Solution
a) We have that r 2 + 1 = 0 is the auxiliary equation of
y 00 + y = 0.

r 2 + 1 = 0 =⇒ r = ± −1
=⇒ r = ±i

Therefore, we have complex roots r1 = −i and r2 = i and the


general solution is:

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

DIFFERENTIAL EQUATIONS
b) We have that r 2 − 6r + 25 = 0 is the auxiliary equation of
y 00 − 6y 0 + 25y = 0.

r 2 − 6r + 25 = 0 =⇒ r = 3 ± −16
=⇒ r = 3 ± 4i

Therefore, we have complex roots r1 = 3 − 4i and r2 = 3 + 4i


and the general solution is:

y (x) = e 3x [A cos 4x + B sin 4x]

y 0 (x) = 3e 3x [A cos 4x +B sin 4x]+e 3x [−4A sin 4x +4B cos 4x].


Using the initial conditions y (0) = −3 =⇒ A = −3 and
y 0 (0) = −1 =⇒ 3(−3) + 4B = −1 =⇒ B = 2.

Therefore,
y (x) = e 3x [−3 cos 4x + 2 sin 4x]
is the general solution of y 00 − 6y 0 + 25y = 0.
DIFFERENTIAL EQUATIONS
SOLUTION 2nd LINEAR NON-HOMOGENEOUS ODE

We are looking at methods for finding a solution to a 2nd -order


nonhomogeneous linear ODE with constant coefficients, that is, an
equation of the form:

a0 y 00 + a1 y 0 + a2 y = G (x) (3.22)

where a0 , a1 and a2 are constants and G is a continuous function.


The related homogeneous equation

a0 y 00 + a1 y 0 + a2 y = 0 (3.23)

is called the complementary equation and it plays an important


role in finding the solution to the nonhomogeneous linear ODE
(3.22).

DIFFERENTIAL EQUATIONS
Theorem 3.9
The general solution of the nonhomogeneous ODE (3.22) can be
written as

y (x) = yc (x) + yp (x) (3.24)


where yc is called the complementary solution; which is the
general solution of the complementary Equation (3.23), and yp is
called the particular solution of (3.22).

DIFFERENTIAL EQUATIONS
(1.) The Method of Undetermined Coefficients

Definition 3.17
We call the function G (x) an undetermined coefficient function if
it is either:
(1.) A function defined by one of the following:
i) x n , where n is a positive integer or zero.
ii) e ax , where a is a constant, a 6= 0.
iii) sin(bx + c) or cos(bx + c) where a, b are constants, b 6= 0.

or,

(2.) A function defined as a finite product of one or more functions


of the above mentioned functions. e.g. x n e ax , x n sin(bx + c).

The table below show some of the common undetermined


coefficients functions with their undetermined coefficients sets.
DIFFERENTIAL EQUATIONS
Undetermined Coefficient function Undetermined Coefficient set
xn {x n , x n−1 , . . . , x 2 , x, 1}
e ax {e ax }
sin(bx + c) or cos(bx + c) {cos(bx + c), sin(bx + c)}
x n e ax {x n e ax , x n−1 e ax , . . . , xe ax , e ax }
n
x sin(bx + c)/ cos(bx + c) {x n cos(bx + c), x n sin(bx + c)
. . . , sin(bx + c), cos(bx + c)}
e ax sin(bx + c)/ cos(bx + c) {e ax cos(bx + c), e ax sin(bx + c)}
Table 1: Undetermined coefficients functions and their sets

Examples: Solve the following ODEs using the method of


Undetermined Coefficients.

a) y 00 + y 0 − 2y = x 2
b) y 00 + 4y = e 3x
c) y 00 + y 0 − 2y = sin x
DIFFERENTIAL EQUATIONS
Solution: By making use of appropriate undetermined coefficients
sets, we have the following:
a) The auxiliary equation of y 00 + y 0 − 2y = 0 is
r 2 + r − 2 = 0 =⇒ (r − 1)(r + 2) = 0
Therefore, we have real and distinct roots r1 = 1 and
r2 = −2. So, the complementary solution is
yc (x) = c1 e x + c2 e −2x
Since G (x) = x 2 , which is a polynomial of degree 2, then we
seek a particular solution of the form
yp = Ax 2 + Bx + C
And yp0 = 2Ax + B and yp00 = 2A. Substituting into the given
ODE, we have
yp00 + yp0 − 2yp = (2A) + (2Ax + B) − 2(Ax 2 + Bx + C ) = x 2
=⇒ −2Ax 2 + (2A − 2B)x + (2A + B − 2C ) = x 2
DIFFERENTIAL EQUATIONS
Polynomials are equal, when their coefficients are equal. Thus,

−2A = 1; 2A − 2B = 0; 2A + B − 2C = 0

The solution to the above system is


1 1 3
A=− ; B=− ; C =−
2 2 4
Therefore, the particular solution is given by:
1 1 3
yp (x) = − x 2 − x −
2 2 4
and the general solution is given by
1 1 3
y (x) = yc (x) + yp (x) = c1 e x + c2 e −2x − x 2 − x −
2 2 4

DIFFERENTIAL EQUATIONS
b) The auxiliary equation of y 00 + 4y = 0 is r 2 + 4 = 0 with
complex roots r1 = −2i and r2 = 2i. The complementary
solution is given by

yc (x) = c1 cos 2x + c2 sin 2x

Since G (x) = e 3x , then the particular solution is of the form


yp = Ae 3x and, yp0 = 3Ae 3x , yp00 = 9Ae 3x . Substituting in the
given ODE we get

yp00 + 4yp = e 3x =⇒ (9Ae 3x ) + 4(Ae 3x ) = e 3x


1
=⇒ 13Ae 3x = e 3x =⇒ A =
13
1 3x
Therefore, the particular solution is given by yp (x) = 13 e
and the general solution is
1 3x
y (x) = yc (x) + yp (x) = c1 cos 2x + c2 sin 2x + e
13
DIFFERENTIAL EQUATIONS
c) The complementary solution is as in a). Since G (x) = sin x,
then the particular solution is of the form:
yp (x) = A cos x + B sin x
and,
yp0 = −A sin x + B cos x and yp00 = −A cos x − B sin x = −yp
Thus,
yp00 + yp0 − 2yp = yp0 − 3yp = sin x
=⇒ (−A sin x + B cos x) − 3(A cos x + B sin x) = sin x
=⇒ (−3A + B) cos x + (−A − 3B) sin x = sin x
Which yields the following system of equations
−3A + B = 0; −A − 3B = 1
whose solution is
1 3
A=− ; B=−
10 10
DIFFERENTIAL EQUATIONS
Therefore, the particular solution is given by
1 3
yp (x) = − cos x − sin x
10 10
and the general solution is
1 3
y (x) = yc (x) + yp (x) = c1 e x + c2 e −2x − cos x − sin x
10 10

Theorem 3.10
If G (x) is the product of functions of the preceding types, then we
take the trial solution to be the product of the same type. For
example, in solving the ODE

y 00 + 2y 0 + 4y = x cos 3x

we would try

yp (x) = (Ax + B) cos 3x + (Cx + D) sin 3x


DIFFERENTIAL EQUATIONS
Theorem 3.11
If G (x) is a sum of functions of these types, we use the principle of
superposition, which says that if yp1 and yp2 are solutions of

a0 y 00 + a1 y 0 + a2 y = G1 (x) and a0 y 00 + a1 y 0 + a2 y = G2 (x)

respectively, then yp1 + yp2 is a solution of

a0 y 00 + a1 y 0 + a2 y = G1 (x) + G2 (x)

Example: Solve y 00 − 4y = xe x + cos 2x

Solution: The auxiliary equation is r 2 − 4 = 0 with roots r1 = −2


and r2 = 2. So, the complementary solution is:
yc (x) = c1 e −2x + c2 e 2x
For y 00 − 4y = xe x , we have
yp1 = (Ax + B)e x
DIFFERENTIAL EQUATIONS
Then yp0 1 = (Ax + A + B)e x , yp001 = (Ax + 2A + B)e x . Thus,

yp001 − 4yp1 = (Ax + 2A + B)e x − 4(Ax + B)e x = xe x


=⇒ (−3Ax + 2A − 3B)e x = xe x

Then, −3A = 1; 2A − 3B = 0, so A = − 31 and B = − 92 , and


 
1 2
yp1 (x) = − x − ex
3 9

For y 00 − 4y = cos 2x, we have

yp2 = C cos 2x + D sin 2x

yp0 2 = −2C sin 2x + 2D cos 2x, yp002 = −4C cos 2x − 4D sin 2x. So,

yp002 − 4yp2 = −4C cos 2x − 4D sin 2x − 4(C cos 2x + D sin 2x) = cos 2x
=⇒ −8C cos 2x − 8 sin 2x = cos 2x

DIFFERENTIAL EQUATIONS
Therefore, −8C = 1 and −8D = 0. So, C = − 81 and D = 0.
1
yp2 (x) = − cos 2x
8
By Theorem (3.11), the general solution is
 
−2x 2x 1 2 1
y (x) = yc +yp1 +yp2 = −c1 e +c2 e + − x − e x − cos 2x
3 9 8
We summarize the Method of Undetermined Coefficients as
follows:
1 If G (x) = e ax P(x), where P(x) is a polynomial of degree n,

then yp (x) = e ax Q(x), where Q(x) the nth order polynomial


(whose coefficients are determined by substituting in the given
ODE).
2 If G (x) = e ax cos(mx) or G (x) = e ax sin(mx), where P is a

polynomial of degree n, then


yp (x) = e ax Q(x) cos mx + e ax R(x) sin mx, where Q and R
are polynomials of degree n.
DIFFERENTIAL EQUATIONS
Example: Determine the form of the trial solution of the ODE
y 00 − 4y 0 + 13y = e 2x cos 3x.

Solution: G (x) has the form of part 2, where a = 2, m = 3 and


P(x) = 1. The form of the trial solution would be

yp (x) = e 2x (A cos 3x + B sin 3x)

But the auxiliary equation is r 2 − 4r + 13 = 0, with roots


r = 2 ± 3i, so the complementary solution is

yc (x) = e 2x (c1 cos 3x + c2 sin 3x)

This means we have to multiply the suggested trial solution by x.


So, instead, we have

yp (x) = xe 2x (A cos 3x + B sin 3x)

DIFFERENTIAL EQUATIONS
Exercise 3.5
1 Solve the following IVP using the method of undetermined
coefficients.
a) y 00 − 4y 0 + 3y = 9x 2 + 4, y (0) = 6, y 0 (0) = 8
b) y 00 + 5y 0 + 4y = 16x + 20e −x , y (0) = 0, y 0 (0) = 3

2 The differential equation of the a strut with both ends fixed


by a clamping couple K and with two compressive equal and
opposite forces P acting at the ends is
d 2y P K
2
+ y=
dx EL EL
Using the method of undetermined coefficients, show that if
y (0) = 0 = y 0 (0), then
r !
K P
y= 1 − cos
P EL

DIFFERENTIAL EQUATIONS
(2.) The Method of Variation of Parameters

Definition 3.18
Suppose we already solved the homogeneous ODE
a0 y 00 + a1 y 0 + a2 y = 0 and written the solution as

yc (x) = c1 y1 (x) + c2 y2 (x) (3.25)

where y1 and y2 are linearly independent solutions. By replacing


the constants c1 and c2 in Equation (3.25) with arbitrary functions
u1 (x) and u2 (x), we look for a particular solution of the
nonhomogeneous ODE a0 y 00 + a2 y 0 + a2 y = G (x) of the form

yp (x) = u1 (x)y1 (x) + u2 (x)y2 (x) (3.26)

This is called variation of parameters because we have varied the


parameters c1 and c2 to make then functions u1 (x) and u2 (x).

DIFFERENTIAL EQUATIONS
By differential Equation (3.26) w.r.t x, we get

yp0 = (u10 y1 + u20 y2 ) + (u1 y10 + u2 y20 ) (3.27)

Since u1 and u2 are arbitrary functions (varied parameters


/constants), then
u10 y1 + u20 y2 = 0 (3.28)
Then
yp00 = u10 y10 + u20 y20 + u1 y100 + u2 y200
Substituting the above equation in the given ODE, we get

a0 (u10 y10 + u20 y20 + u1 y100 + u2 y200 ) + a1 (u1 y10 + u2 y20 )+


a2 (u1 y1 + u2 y2 ) = G

or

u1 (a0 y100 +a1 y10 +a2 y1 )+u2 (a0 y200 +a1 y20 +cy2 )+a0 (u10 y10 +u20 y20 ) = G
(3.29)
DIFFERENTIAL EQUATIONS
Since y1 and y2 are solutions of the complementary equations, then

a0 y100 + a1 y10 + a2 y1 = 0 and a0 y200 + a1 y20 + cy2 = 0

Equation (3.29) simplifies to

G
u10 y10 + u20 y20 = (3.30)
a0

Equations (3.28) and (3.30) form a system of two equations in


unknown functions u10 and u20 . After solving the system we can
integrate to find u1 and u2 and hence find the particular solution.

Example: Solve the following ODEs using the Method of Variation


of Parameters.
a) y 00 + y = tan x, 0 < x < π
2
b) y 00 − 3y 0 + 2y = 1
1+e −x

DIFFERENTIAL EQUATIONS
Solution: We make use the system of equations

G
u10 y1 + u20 y2 = 0 and u10 y10 + u20 y20 =
a0

a) The auxiliary equation is r 2 + 1 = 0, with roots r = ±i. The


complementary solution is given by

yc (x) = c1 cos x + c2 sin x

Thus, y1 = cos x, y2 = sin x, y10 = − sin x and y20 = cos x. The


particular solution is of the form

yp (x) = u1 (x) cos x + u2 (x) sin x


Thus, substituting y1 , y2 , y10 and y20 into Equations (3.28) and
(3.30) we obtain the following system of equations:

DIFFERENTIAL EQUATIONS
cos x 0
u10 y1 + u20 y2 = 0 =⇒ u10 cos x + u20 sin x = 0 =⇒ u20 = − u
sin x 1
and

G (x)
u10 y10 + u20 y20 = =⇒ −u10 sin x + u20 cos x = tan x
a0
cos2 x 0
=⇒ −u10 sin x − u = tan x
sin x 1
(sin2 x + cos2 x)
=⇒ −u10 = tan x
sin x
sin2 x cos2 x − 1
=⇒ u10 = − = = cos x − sec x
cos x cos x
and
cos x 0 cos x sin2 x
u20 = − u1 = = sin x
sin x sin x cos x
DIFFERENTIAL EQUATIONS
Z
u1 = u10 dx
Z
= (cos x − sec x)dx

= sin x − ln | sec x + tan x|


and
Z
u2 = sin xdx = − cos x

Since sec x + tan x > 0 for 0 < x < π/2, then the particular
solution is given by
yp (x) = − cos x sin x + cos x[sin x − ln(sec x + tan x)]
= − cos x ln(sec x + tan x)
and the general solution is
y (x) = yc (x) + yp (x) = c1 cos x + c2 sin x − cos x ln(sec x + tan x)

DIFFERENTIAL EQUATIONS
b) The auxiliary equation is r 2 − 3r + 2 = 0, with roots r1 = 1
and r2 = 2. The complementary solution is given by:

yc (x) = c1 e x + c2 e 2x

Thus, y1 = e x , y2 = e 2x , y10 = e x and y20 = 2e 2x . So, the


particular solution is of the form:

yp (x) = u1 (x)e x + u2 (x)e 2x

Thus, substituting y1 , y2 , y10 and y20 into Equations (3.28) and


(3.30) we obtain the following system of equations:

1
u10 e x + u20 e 2x = 0 and u10 e x + 2u20 e 2x =
1 + e −x

By making using of the substitution


ex 0
u20 = − u = −e −x u10
e 2x 1
DIFFERENTIAL EQUATIONS
We have that
1
u10 e x +2(−e −x u10 )e 2x =
1 + e −x
1
=⇒ u10 e x − 2u10 e x =
1 + e −x
ex
=⇒ −u10 e x =
1 + ex
1
=⇒ u10 = −
1 + ex
and
1 1
u20 = e −x x
= x
1+e e (1 + e x )
Thus,
Z Z
1 1
u1 = − dx = −  x 2 dx
1 + ex
1+ e2
x x
2 sec2 θ
Let e 2 = tan θ, then 21 e 2 dx = sec2 θdθ =⇒ dx = tan θ dθ. So,
DIFFERENTIAL EQUATIONS
Z
1
u1 = − dx
1 + ex
sec2 θ
Z
=− dθ
tan θ(1 + tan2 θ)
Z Z
dθ cos θ
=− =− dθ
tan θ sin θ
= − ln | sin θ|
x
!
e2
= − ln √
1 + ex
and,
Z
1
u2 = dx
e x (1 + ex )
Z  
A B
= + dx ( A = 1 and B = −1)
ex 1 + ex
Z  
1 1
= − dx
ex 1 + ex
DIFFERENTIAL EQUATIONS
Z Z
−x 1
u2 = e dx − dx
1 + ex
x
!
e2
= −e x + ln √
1 + ex

Therefore, the particular solution is given by


x
! x
!
e2 e2
yp (x) = − ln √ x
e + (ln √ − e −x )e 2x
1 + ex 1 + ex
x √
= (e x − e 2x ) + ln( 1 + e x )(e x − e 2x )
2
and the general solution is

y (x) = yc (x) + yp (x)


x √
= c1 e x + c2 e 2x + (e x − e 2x ) + ln( 1 + e x )(e x − e 2x )
2
DIFFERENTIAL EQUATIONS
Exercise 3.6

Solve the following ODEs using the Method Variation of


Parameters
e −3x
a) y 00 + 6y 0 + 9y = x3
b) y 00 − 2y 0 + y = xe x ln x (x > 0)
c) y 00 + 4y = sec2 2x

DIFFERENTIAL EQUATIONS

You might also like