0% found this document useful (0 votes)
5 views

SMB2103Notes DE

The document outlines the course SMB2103 Differential Equations at Kyambogo University, detailing topics such as first and second order differential equations, their classifications, methods of solution, and applications. It includes a course structure with assessments, references, and facilitator contact information. The content is structured into chapters with objectives, methods of solution, and practical applications of differential equations in various fields.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

SMB2103Notes DE

The document outlines the course SMB2103 Differential Equations at Kyambogo University, detailing topics such as first and second order differential equations, their classifications, methods of solution, and applications. It includes a course structure with assessments, references, and facilitator contact information. The content is structured into chapters with objectives, methods of solution, and practical applications of differential equations in various fields.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

School of Education

Department: Foundations of Education and Educational Psychology

SMB2101 Differential Equations

Lecture Notes
Kyambogo University
School of Education
Course Outline: SMB2103 Differential Equations; 2 CUs
Detailed Course Description
1. First Order Differential Equations (DEs) and their Applications
Classification of Differential Equations: exact, separable, Homogeneous, Linear &
Nonlinear Differential Equations, Integrating Factors. Examples include: physical
processes, Chemical processes like radioactive processes and Biological processes;
(10hrs). Test 1; 1 hour.

2. Second Order Differential Equations and their Applications


Real roots, Complex roots, Uniqueness and Existence Theorem. Method of Undetermined
Coefficients, the Operator Method, Difference Equations. (10 Hrs) Test 2; 1 hour.

3. Higher Order Differential Equations


Constant Coefficients, Method of Undetermined Coefficients, Variation of Parameters.
Linear Independence and the Wronskian, Method of Order Reduction. (10 hrs)
Mode of Assessment:
Assignments and tests: 30%

Examination: 70%
Total: 100%

References
1. Boyce W. E. and Diprima R. C., (2021). Elementary differential Equations and
boundary value problems, 12th Ed., Wiley, New York, USA.
2. William F. Trench (2013). Elementary Differential Equations with Boundary Value
Problems; Texas, USA.
3. Edward C.H. and Penney D.E. (2008). Elementary Differential Equations; 6th
Edition, Prentice Hall International, New Jersey, USA.

Facilitator:
Dr. Rao Awichi
0701958101/0772862362.
[email protected] OR [email protected]
Contents

1 First Order ODEs 1

1.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.2.1 Illustration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

1.2.2 Order of a DE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

1.3 Methods of Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

1.3.1 Separation of Variables . . . . . . . . . . . . . . . . . . . . . . . . . . 4

1.3.2 Homogeneous DEs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

1.3.3 Exact DEs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

1.3.4 Integrating Factors, IFs . . . . . . . . . . . . . . . . . . . . . . . . . . 10

1.3.5 Linear Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

1.4 Bernoulli’s Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

1.5 Applications of First Order DEs . . . . . . . . . . . . . . . . . . . . . . . . . . 17

1.5.1 Basic Sciences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

1.5.2 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

2 Second Order DEs 21

2.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

2.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

2.3 Second Order Linear Equations . . . . . . . . . . . . . . . . . . . . . . . . . . 23

ii
2.4 Solving Second Order DE Using Wronskian . . . . . . . . . . . . . . . . . . . 26

2.5 Homogeneous DEs with Constant Coefficients . . . . . . . . . . . . . . . . . 28

2.6 Non-Homogeneous Linear Equations . . . . . . . . . . . . . . . . . . . . . . 31

2.6.1 Method of Undetermined Coefficients . . . . . . . . . . . . . . . . . . 32

2.6.2 The Principle of Superposition . . . . . . . . . . . . . . . . . . . . . . 36

2.7 Cauchy–Euler Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

3 Linear DEs of any Order 39

3.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

3.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

3.3 Homogeneous with Constant Coefficients . . . . . . . . . . . . . . . . . . . . 42

3.4 The Method of Undetermined Coefficients . . . . . . . . . . . . . . . . . . . . 44

3.4.1 Case 1: g(x) = q(x), a polyl of deg m . . . . . . . . . . . . . . . . . . . 45

3.4.2 Case 2: g(x) has exponential form . . . . . . . . . . . . . . . . . . . . 46

3.4.3 Case 3 and 4: g(x) has transcendental form . . . . . . . . . . . . . . . 47

3.5 Variation of Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

3.6 Generalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

iii
Chapter 1

First Order ODEs

Quotation:
“The mind once expanded to the dimensions of larger ideas, never returns to its original
size.” Oliver Wendell Holms.

1.1 Objectives

By the end of this topic, you will be able to:

• define an ODE

• describe the methods of solving a first order ODE

• apply the methods to many first order ODEs

• discuss real world practical applications of ODEs.

1.2 Introduction

A Differential Equation, DE is an equation which involves a function and its derivatives. If


this derivative has only one independent variable, then the DE is called ODE. A DE which
contains more than one independent variable is called PDE. Thus DEs are generally divided
into two classes: ODE and PDE.

1
1.2.1 Illustration

Data Science:
The advent of Data Science especially Deep Learning Revolution (AI, Machine/Statistics
Learning and Neural Networks) has brought with it new set of tools for performing large
scale optimizations over numerous data sets, for example, a time series data y(t) using the
following differential equation:
dy
= f (y, t : θ);
dt
y(t0 ) = y0

Indeed time series models are best handled using difference equations (for discrete data).
Banker’s Equation:
Consider the following equation which could be yours as a banker! Let’s assume that your
account earns an interest of say 10%, then your account may have an equation of the form;

dY
= 0.1Y
dt

where Y is the amount in your account.


This equation may keep changing depending on the deposits and withdrawals on your ac-
count.

Price Elasticity:
You could have probably used this common term in economics at high school: price elasticity
of demand. Do you still recall what it is? If yes, say amen. If no, open your kabiriti and talk
to Mr. Google (he knows it all).

Newton’s Law:
The famous equation of motion: F = ma.
EER: Write it in a DE format.

We could continue with the illustration but we need to get going · · ·

1.2.2 Order of a DE

The order of a DE is the order of the highest derivative contained in the equation e.g:

2
dy
• dx
+ xy = k: DE of order 1.
 4
d2 y dy
• dx2
+ 3 dx + 6y = 0: DE of order 2.

dy 2
= (sin xy + 2)2 : DE of order 1.

• dx

∂3u ∂u∂ 2 u
• ∂x3
+ ∂x∂t2
+ xtu = 0: PDE of order 3.

The degree of a DE is the power of the highest derivative in the DE, e.g:

• y ′′ + 2y ′ = 0: Order 2, deg. 1

• (y ′′ )2 + (y ′ )3 = k: Order 2, deg. 2

• y ′′′ + (y ′′ )2 = c: Order 3, deg. 1

The most general nth order DE is of the form

F (x, y, y ′ , y ′′ , · · · , y (n) ) = 0

This equation can also be written as,

y (n) = f (x, y, y ′ , · · · , y (n−1)

A solution to a given DE is a function say f(y) which satisfies the DE, e.g;
if y ′ = 2y − 4x then y = 2x + 1 is a solution. This can be checked by direct differentiation and
substitution of y into the DE.
We often wish to find a solution of a given DE that satisfies certain prescribed conditions
called initial conditions. For example, the famous Newton’s second law of motion implies that
a particle of fixed mass m moving along a straight line with acceleration ẍ will experience a
force F = mẍ. The initial conditions in such a case would be: x0 = a0 and ẋ0 = a1

1.3 Methods of Solution

We now turn our attention to the study of methods of solving first order DEs of the form

y ′ = f (x, y)

3
where f is a continuous function ∀(x, y) in a rectangle D where
D = {(x, y) : A1 < x < A2 ; B1 < y < B2 }.
We usually find the general solution to the above equation or a particular solution subject to
the initial condition, y(xo ) = ao .

1.3.1 Separation of Variables

A first order DE is separable if its of the form,

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

so that f (y)dy = g(x)dx. On integrating, F (y) = G(x) + k.


As an illustration, consider the equation, y ′ = 2 sin x
y+6
.
=⇒ (y + 6)dy = 2 sin xdx. EER: Integrate to solve it!.
Generally, a separable first order DE is of the form,

p(x) + q(y)y ′ = 0 ⇔ p(x)dx + q(y)dy = 0

Separable first order DEs can thus be solved by integration.

Examples

Q1. Solve the following IVP,

dy 2 + sin x
= ; y(0) = 2.
dx 3(y − 1)2

Losung:
3(y − 1)2 dy = (2 + sin x)dx
=⇒ (y − 1)3 = 2x − cos x + c
p
=⇒ y = 1 + 3 (2x − cos x + c)
When x = 0, y = 2;
p
=⇒ 2 = 1 + 3 (0 − cos 0 + c)
p
=⇒ 3 (c − 1) = 1; =⇒ c = 2
p
∴ y = 1 + 3 (2x − cos x + 2) ⊡

4
Q2. Solve the DE: y ′ = x2 (1 + y) subject to y(0) = 3.
Losung:
On separating;
dy
= x2 dx and integrating;
1+y

=⇒ ln (1 + y) = 13 x3 + c
When x = 0; y = 3;
=⇒ ln 4 = c
=⇒ ln (1 + y) = 13 x3 + ln 4
 x3
=⇒ ln 1+y4
= 3
1+y 1 3
=⇒ 4
= e3x
1 3
∴ y = 4e 3 x − 1 ⊡
Q3. Find the particular solution to the equation,

x3 y − y
y′ = ; y(0) = 1
y4 − y2 + 1

Losung:
Notice that the DE can be re-written as;
 
3 1
y −y+ dy = (x3 − 1) dx
y

On integrating we get;
y4 y2 x4
− + log|y| = −x+c
4 2 4
From the initial condition, check that c = − 14 .
Hence;
y 4 − 2y 2 + 4 log|y| = x4 − 4x − 1 ⊡

EER:
Q1. Find the general solutions to the following DEs:
i) y ′ = xy 2 − x ii) sin x cos2 y = y ′ cos2 x
2x3
p
iii) y ′ = (1 − y 2 )(1 − x2 ) iv) y′ = y(1+x4 )
.

Q2. Find particular solutions to the following IVPs:


2x3
i) y ′ = y(1+x4 )
; y(0) = −1 ii) xdy + y 2 dx = 0; y(1) = 0.5
dy
iii) cos x dx = y tan x; y( π3 ) = 2 iv) dR
dt
= 2R; R(0) = −1.

5
1.3.2 Homogeneous DEs

A function f (x, y) is said to be homogeneous of degree n if ∃ z ∈ R s.t.

f (zx, zy) = zn f (x, y)

For example:
i) f (x, y) = x2 + y 2 is homogeneous of degree 2 since,

f (zx, zy) = (zx)2 + (zy)2

= z 2 (x2 + y 2 )

= z 2 f (x, y).

ii) f (x, y) = x3 + 2x2 y + 3xy 2 + 4y 3 is homogeneous of deg. 3 since,

f (zx, zy) = (zx)3 + 2(zx)2 (zy) + 3(zx)(zy)3 + 4(zy)3

= z 3 x3 + 2z 3 x2 y + 3z 3 xy 2 + 4z 3 y 3

= z 3 (x3 + 2x2 y + 3y 2 x + 4y 3 )

= z 3 f (x, y).

EER:
p
iii) Prove that h(x, y) = (x8 − 3x2 y 6 ) is homogeneous and state its degree.
iv) Show that f (x, y) = x3 − y 2 is not homogeneous.

Definition:
A first order DE, M (x, y)dx + N (x, y)dy = 0 is said to be homogeneous if M(x, y) and N(x, y)
are both homogeneous functions of the same degree.
Examples:
Q1. Show that the DE, (x2 − y 2 )dx + xydy = 0 is homogeneous.
Losung:

6
Now M(x, y) = x2 − y 2 . Let z ∈ R s.t,

M (zx, zy) = (zx)2 − (zy)2

= z 2 x2 − z 2 y 2

= z 2 (x2 − y 2 )

= z 2 M (x, y); deg. 2.

Also N(x, y) = xy, then,

N (zx, zy) = xz × zy

= z 2 xy

= z 2 N (x, y); deg. 2.

Hence both M(x, y) and N(x, y) are homog. of the same degree, 2.
To solve a homog. DE, use the substitution y = xv or change the variable y to xv so that
dy = xdv + vdx and use the method of separation of variables above.
Q2. Solve the equation, (x2 − y 2 )dx + xydy = 0.
Losung:
The DE is homogeneous.
=⇒ y = xv; dy = xdv + vdx
∴ [x2 − (xv)2 ]dx + x(xv)[xdv + vdx)] = 0
=⇒ x2 dx − x2 v 2 dx + x3 vdv + x2 v 2 dx = 0
=⇒ x2 dx + x3 vdv = 0
=⇒ x2 dx = −x3 vdv
dx
=⇒ x
= −vdv
dx
R R
=⇒ x
= − vdv
2
=⇒ ln x = − v2 + c
v2
=⇒ 2
= c − ln x; let c = ln a.
=⇒ v 2 = 2 ln xa ; v = y/x


=⇒ y 2 = 2 x2 ln xa ⊡


Q3. Solve the following IVP:

dy
x2 = y 2 − xy + x2 ; y(1) = 2.
dx

7
Losung:

dy y 2 − xy + x2
=
dx x2
 y 2 y
= − +1
x x
= v 2 − v + 1; v = y/x.

dy dv
From v = y/x; y = vx; =⇒ dx
= x dx + v.
dv
=⇒ x dx + v = v2 − v + 1
dv
=⇒ x dx = v 2 − 2v + 1 = (v − 1)2
x (v−1)2
=⇒ dx
= dv
dx dv
=⇒ x
= (v−1)2

=⇒ ln x = −(v − 1)−1 + c
=⇒ (v − 1)−1 = c − ln x = ln a

x
1
=⇒ v − 1 = a
ln ( x )
1
=⇒ v = 1 + a ;
ln ( x
v = y/x
 ) 
1
=⇒ y = x 1 + a
ln ( x )

From initial conditions, y(1) = 2, we see that a = e. Check it out!!


1

∴ y = x 1 − ln x−1 ⊡
EER:
Solve the following homogeneous equations
dy t2 +s2
i) y 2 = (xy − x2 ) dx ii) s ds
dt
= t
; s(2) = 1
dy dy y−6x
iii) x2 dx − (4x2 + xy + y 2 ) = 0; y(1) = -1 iv) dx = 2x−y
; y(0) = 1.

1.3.3 Exact DEs

For any function of two variables, e.g f (x, y), the total differential, df, is given as,

∂f ∂f
df = dx + dy
∂x ∂y

8
For example, if f (x, y) = x2 y + 6x − y 3 , then,

∂ 2 ∂ 2
df = (x y + 6x − y 3 ) dx + (x y + 6x − y 3 ) dy
∂x ∂y
= (2xy + 6) dx + (x2 − 3y 2 ) dy.

The general solution to the DE, df = 0 is of the form, f (x, y) = c.


The equation df = 0 with the solution f (x, y) = c is called an exact DE.
To determine whether a given DE M (x, y) dx + N (x, y) dy = 0 is exact, use the test for
exactness below:
∂M ∂N
= ; or My = Nx .
∂y ∂x
The DE (y 2 − 2x)dx + (2xy + 1)dy = 0 is exact since,

M (x, y) = y 2 − 2x; My = 2y,

N (x, y) = 2xy + 1; Nx = 2y,

=⇒ My = Nx

∂f ∂f
To find a solution, f (x, y) = c of the exact DE, integrate M (x, y) = ∂x
w.r.t x and N (x, y) = ∂y

w.r.t y and ‘merge’ the two integrals to obtain the general solution.
Examples:
Q1. Solve the exact DE, (y 2 − 2x)dx + (2xy + 1)dy = 0
Losung:
M (x, y) = y 2 − 2x.
R
=⇒ M (x, y) ∂x = y 2 x − x2 .
Also N (x, y) = 2xy + 1.
R
=⇒ N (x, y) ∂y = xy 2 + y.
∴ f (x, y) = xy 2 − x2 + y = c is the general solution.
Note that while ‘merging’ each term from each integral is written just once.
Q2. Find the general solution to the DE (2xy + x2 )y ′ + (1 + 2xy + y 2 ) = 0.
Losung:
Re-write the DE properly.
=⇒ (2xy + x2 )dy + (1 + 2xy + y 2 )dx = 0
R
=⇒ M (x, y) = 1 + 2xy + y 2 ; ⇒ M (x, y)∂x = x + x2 y + y 2 x.
R
Also N (x, y) = 2xy + x2 =⇒ N (x, y)∂y = xy 2 + x2 y.

9
∴ f (x, y) = x + x2 y + xy 2 = c ⊡
EER:
Solve the following DEs:
i) (3x2 y − 1) dx + (x3 + 6y − y 2 ) dy = 0; y(0) = 3
ii) (x cos xy) y ′ = −y cos xy + 2x; y(1) = 2
iii) sin t + t2 ey − 3)y ′ + (y cos t + 2tey ) = 0; y( π2 ) = 0
dy −3x2 +2xy
iv) dx
= x2 +y 2
; y(1) = −1.

1.3.4 Integrating Factors, IFs

If a DE of the form M (x, y) dx + N (x, y) dy = 0 is not exact, ∃ a function, µ(x, y) which when
multiplied into the DE makes the DE exact, i.e

(µM ) dx + (µN ) dy = 0 is exact.

Such a function µ(x, y) is called an integrating factor, IF.


Hence IFs turn non exact DEs into exact ones, provided µ(x, y) ̸= 0.
Alternatively, for any DE,
dy
p(x, y) + q(x, y) =0
dx
which is not exact, ∃µ(x, y) ̸= 0 s.t.
 
dy
µ(x, y) p(x, y) + q(x, y) = 0 is an exact equation.
dx

The solution to any exact DE is then obtained in the usual way.


The question is: how do you find an IF?
Two methods exist for finding IFs:

My −Nx
i) If µ = µ(x)– a function of only x i.e if N
= p(x), then

R
p(x) dx
µ(x) = e

10
My −Nx
ii) If µ = µ(y)– a function of only y i.e if −M
= q(y), then

R
q(y) dy
µ(y) = e

Consider the following DEs:

Qsn 1) The equation


(3xy − y 2 ) dx + x(x − y) dy = 0

is not exact since

∂ ∂ 2
My = (3xy − y 2 ) = 3x − 2y ̸= Nx = (x − xy) = 2x − y.
∂y ∂x

Now
My − Nx (3x − 2y) − (2x − y) 1
= = = p(x)
N x(x − y) x
Hence
R
p(x) dx
µ(x) = e = eln x = x.

Multiplying by this IF yields

µM
z }| {
(3x y − xy ) dx + (x3 − x2 y) dy = 0.
2 2
| {z }
µN

This is now exact since


(µM )y = 3x2 − 2xy = (µN )x .

EER 1: Now solve by the method of the exact DE. Ans.: x3 y − 21 x2 y 2 = c

Qsn 2) The equation


(x + y) sin y dx + (x sin y + cos y) dy = 0

is not exact, since


My = (x + y) cos y + sin y ̸= Nx = sin y.

however,
My − Nx (x + y) cos y + sin y − sin y cos y
= =− = q(y)
−M −(x + y) sin y sin y

11
Note that Z Z
cos y
q(y) dy = − dy = −ln (sin y);
sin y
−1
R
⇒ µ(y) = e q(y) dy
= e−ln (sin y) = eln (sin y) = (sin y)−1 .

Multiplying by this IF yields

µM  
z }| { cos y
(x + y) dx + x + dy = 0.
sin y
| {z }
µN

This is now exact since


(µM )y = 1 = (µN )x .

EER 2: Now solve by the method of the exact DE. Ans.: 21 x2 + xy + ln | sin y| = c

Examples:
Q1. Solve the IVP,
(3xy − y 2 ) dx + x(x − y) dy = 0; y(1) = 1.

Losung:
Now M(x, y) = 3xy − y 2 ; =⇒ My = 3x − 2y.
Also N(x, y) = x2 − xy; =⇒ Nx = 2x − y.
Thus My ̸= Nx ; =⇒ DE is not exact.
Now
My − Nx 3x − 2y − 2x + y x−y
= = = x−1 ; a fxn of only x.
N x(x − y) x(x − y)
But
My − Nx x−y
= 2 ; not a fxn of y alone !
−M y − 3xy

R
p(x) dx
∴ µ(x, y) = e
1
R
dx
=e x

= eln x

= x.

12
∴ µM (x, y) + µN (x, y) = 0 is now exact. Check that (µM )y = (µN )x !
Integrating µM and µN ;
Z Z
1
µM (x, y) ∂x = (3x2 y − xy 2 ) ∂x = x3 y − x2 y 2
2
Z Z
1
µN (x, y) ∂y = (x3 − x2 y) ∂y = x3 y − x2 y 2
2
∴ f (x, y) = x3 y − 21 x2 y 2 = c
From initial conditions, y(1) = 1, c = 1/2.
=⇒ x3 y − 21 x2 y 2 = 1
2

Q2. Solve the equation, (xy 2 + y) + (x2 y − x)y ′ = 0.


Losung:
The DE can be written as (xy 2 + y) dx + (x2 y − x) dy = 0
⇒ M (x, y) = xy 2 + y; My = 2xy + 1
⇒ N (x, y) = x2 y − x; Nx = 2xy − 1; =⇒ My ̸= Nx
My −Nx 2 My −Nx −2
Check: N
= x(yx−1)
and −M
= y(xy+1)
!!
Now consider µ(x, y) = (xy)−1 ;

xy 2 + y 1
=⇒ µM = =y+ ; ⇒ (µM )y = 1,
xy x
x2 y − x 1
=⇒ µN = =x− ; ⇒ (µN )x = 1.
xy y
Hence the IF, µ(x, y) = (xy)−1 .
Now Z Z
1
µM ∂x = (y + ) ∂x = xy + ln |x|
x
Also Z Z
1
µN ∂y = (x − ) ∂y = xy − ln |y|
y
=⇒ f (x, y) = xy + ln |x| − ln |y| = c
=⇒ xy + ln | xy | = c ⊡

EER:
Q1. Obtain the general solution to the non exact DE,

1 2
(x + y) sin y dx + (x sin y + cos y) dy = 0. Ans: x + xy + ln | sin y| = c
2

13
Q2. Solve the IVP,

1
(3ex y + x) dx + ex dy = 0; y(0) = 1. Ans: y = [3e−3x + (1 − 2x)e−x ]
4

Q3. Given that the non exact DE, (5xy 2 − 2y) dx + (3x2 y − x) dy = 0 has an IF of the form
µ(x, y) = xa y b ; a, b ∈ Z+ , find the general solution to the DE.
Ans: x5 y 3 − 12 x4 y 2 = c.

1.3.5 Linear Equations

An equation of the form, y ′ + P (x)y = Q(x) or a0 y ′ + a1 (x)y = b(x) is called a first order linear
DE. The method of solving such equations is similar to the IF method above. Once the DE
R
P dx
is in standard form, we obtain the IF, µ(x) = e
The LHS of the DE can be written in a simpler way as follows:

dy dy R
µ + µP y = µ + e P dx P y
dx dx
dy d  R P dx 
=µ +y e
dx dx
dy dµ
=µ +y
dx dx
d
= (µy).
dx

Therefore the DE becomes,


d
(µy) = µQ
dx
So that on integrating both sides, Z
µy = (µQ) dx

Notice that if Q(x) = 0, the DE is a separable one!


Examples:
Q1. Solve the DE, y ′ + 2xy = x
Losung:
The DE is already in standard form, hence P(x) = 2x and Q(x) = x.
2
R R
P dx 2x dx
=⇒ µ(x) = e =e = ex

14
Multiplying through by the IF and simplifying, we get

d x2 2
(e y) = xex
dx

Integrating both sides, Z


x2 2
e y= xex dx

2 1 2
ex y = ex + k
2
1 −2
=⇒ y = + kex ⊡
2
Q2. Solve the IVP,
dy
+ x−1 y = sin x; y(π) = 1.
dx
Losung:
x−1 dx
R
P (x) = x−1 =⇒ µ(x) = e = eln x = x.
d
=⇒ dx
(xy) = x sin x
R
=⇒ xy = x sin x dx = −x cos x + sin x + c
From initial conditions, y(π) = 1, c = 0 (verify!!!)
∴ xy = sin x − x cos x
sin x
=⇒ y = x
− cos x ⊡
Q3. Solve the DE, y ′ = 2y + x; y(0) = 2.
Losung:
Write the DE as; y ′ − 2y = x; y(0) = 2 =⇒ P = −2; Q(x) = x.
R
−2 dx
=⇒ µ(x) = e = e−2x
=⇒ e−2x (y ′ − 2y) = xe−2x
=⇒ d
dx
(ye−2x ) = xe−2x
=⇒ ye−2x = xe−2x dx = c − x 1
e−2x (by Parts)
R 
2
+ 4

=⇒ y = ce2x − x2 + 14


From initial conditions, y(0) = 2; c = 9/4


∴ y = 94 e2x − x
2
− 14 ⊡

EER:
1 2
Q1. Find the general solution to the DE, (x + 1)y ′ = 1/y. Ans: (x + 1)e− 2 y = c
Q2. Solve the DE, x2 y ′ = −2y. Ans: y = ce2/x

15
1.4 Bernoulli’s Equation

The DE,
dy
+ P (x)y = y n Q(x)
dx
is called Bernoulli’s equation.
If n = 0, the equation reduces to the first order linear equation and if n = 1 the equation can
be written as,
y ′ + P (x)y = yQ(x) ⇔ y ′ + [P (x) − Q(x)]y = 0.

For any other values of n, the equation is no-longer linear, but can be transformed into a
linear equation by first multiplying throughout by y −n i.e

y −n y ′ + P (x)y 1−n = Q(x)

Then use the substitution, say, 


 ω = y 1−n
 ω ′ = (1 − n)y −n y ′

The equation thus becomes,

1
ω ′ + P (x) ω = Q(x); linear in ω
1−n

and can now be solved using the methods of linear equations.


Examples:
Q1. Solve the Bernoulli equation, y ′ + xy = xy 3 .
Losung:
Notice that n = 3
∴ y −3 y ′ + y −3 xy = y −3 xy 3
=⇒ y −3 y ′ + xy −2 = x
Let ω = y 1−3 = y −2 ; ω ′ = −2y −3 y ′ =⇒ y −3 y ′ = − 12 ω ′
The equation thus becomes, ω ′ − 2xω = −2x
2
R R
−2x dx
IF µ = e P dx
=e = e−x
Multiplying through by the IF, we have,
2 2 2
e−x ω ′ − 2xe−x ω = −2xe−x
2 2
=⇒ d
dx
(e−x ω) = −2xe−x

16
Integrating both sides,
2 2
e−x ω = e−x + k
2
=⇒ ω = y −2 = 1 + kex ⊡
Q2. Solve the following equation, y ′ − 5y = − 25 xy 3
Losung:
Here, n = 3.⇒ y −3 y ′ − 5y −2 = − 25 x. Let ω = y −2 .
=⇒ ω ′ = −2y −3 y ′ ; =⇒ y −3 y ′ = − 12 ω ′
The transformed equation is:
1 5
− ω ′ − 5ω = − x
2 2
=⇒ ω ′ + 10ω = 5x; =⇒ P (x) = 10
R
10 dx
=⇒ µ = e = e10x
Multiplying thru: by the IF and simplifying, we get,

d
(ωe10x ) = 5xe10x
dx

Integrating both sides;


Z
10x
ωe =5 xe10x dx
(by Parts)
 
x 10x 1 10x
=5 e − e +k
10 100
x 1
= e10x − e10x + k.
2 20

=⇒ ω = y −2 = x
2
− 1
20
+ ke−10x ⊡
EER:
Solve the following Bernoulli equations:
2
1) y ′ + xy = xy 3 Ans: y −2 = 1 + kex
− 21
2) xy ′ = y + ex y 3 ; x>0 Ans: y = (cx−2 − 2x−1 ex + 2x−2 ex )

1.5 Applications of First Order DEs

In this section, we look at some common applications of ODEs in real life.

17
1.5.1 Basic Sciences

You have possibly heard of the Radioactive Decay Law or Newton’s Law of Cooling in Physics
or the the Population Growth Rate in Biology or Price Elasticity of Demand in Economics or
the Safe Drug Dosage in Medicine or Rate of Diffusion/Absorption in Chemistry. All these
are applications of first order ODEs. E.g:

• Radioactive Decay (Half life): dN


dt
= −kN =⇒ N = No e−kt

dN
• Population Growth Rate: dt
= kN =⇒ N = No ekt

dP
• Price of Commodities: dt
= k(D − S) k > 0 &P ↑ ses if D exceeds S

dT
• Newton’s Law of cooling: dt
= −k(T − θr )

• Electrical and Electronics Engineering

• Several other fields

1.5.2 Examples

Q1. Thorium (232 Th), a heavy metal is a radioactive material of atomic weight 232. The half-
life of 232 Th is approximately 1.4 × 1010 years. Compute the radioactive decay constant k for
232
Th. If a piece of the thorite mineral (in which 232 Th commonly occurs) initially contained 2
grams of 232 Th, how many years must elapse before 1.9 grams remain?
Losung:
For half-life cases, dN
dt
= kN =⇒ N (τ ) = No e−kτ = No
2

If τ = 1.4 × 1010 , then using No e−kτ = No


2
, we see that

1
e−kτ = =⇒ kτ = ln 2; ∴k∼
= 0.495 × 10−10 .
2

Let No = 2 g and t1 be the time that elapses before 1.9 g remains. Then N (t1 ) = 2e−kt1 .
Thus,
1.9
N (t1 ) = 1.9 = 2e−kt1 ; =⇒ e−kt1 = ; ∴ t1 ∼
= 0.104 × 1010 years
2

18
Q2. According to Newton’s law of cooling, the rate of fall of temperature of a body is directly
proportional to the excess of its temperature over the surrounding, i.e

dT
∝ (T − θr ), where θr is room temperature.
dt

Given that the temperature of an object falls from 200 °C to 100 °C in 40 minutes in a room
temperature of 10 °C. Show that T can be written as T = 10 + 190e−kt ; k ∈ R. Find the time
taken for the temperature of the body to reach 50 °C.
Losung:
dT dT dT
R R
dt
∝ (T − θr ); =⇒ dt
= −k(T − θr ); =⇒ T −θr
= −k dt; =⇒ ln (T − θr ) = −kt + c
=⇒ T = θr + Ae−kt ;
From initial conditions, θr = 10, t = 0, T = 200; =⇒ A = 190
Thus T = 10 + 190e−kt ⊡
1
Also if t = 40 , T= 100, =⇒ k = 40
ln (19/9)
When T = 50; then

1
50 = 10 + 190e−kt ; =⇒ t = ln (19/4) = 83.41 mins ⊡
k

Q3. Econ: The equation for the growth of an investment with continuous compounding of
interest is a first-order differential equation. Let S(t) be the value of the investment at time t,
and let r be the annual interest rate compounded after every time interval δt. We can also
include deposits (or withdrawals). Let k be the annual deposit amount (k > 0) or withdrawal
(k < 0), and suppose that an installment is deposited after every time interval δt. The value
of the investment at the time t + δt is then given by

S(t + δt) = S(t)) + (rδt)S(t) + kδt,

where at the end of the time interval δt, rδtS(t) is the amount of interest credited and kδt is
the amount of money deposited (k > 0) or withdrawn (k < 0).
The equation above can be rearranged into a DE as follows:

S(t + δt) − S(t))


= rS(t) + k
δt

19
The equation for continuous compounding of interest and continuous deposits is obtained
by taking the limit δt → 0. The resulting differential equation is

dS
= rS(t) + k,
dt

which can solved with the initial condition S(0) = S0 , where S0 is the initial capital. We can
solve either by separating variables or by using an integrating factor.
As a simple illustration, consider the account held $10, 000 at time t, and r = 6% per year
and k = $12, 000 per year, say, and the compounding and deposit period is δt = 1 month =
1/12 year, then the interest awarded after one month is rδtS = (0.06/12) × $10, 000 = $50,
and the amount deposited is kδt = $1000.

dN
Q4. Logistic Equation: Consider the Malthusian exponential population growth: dt
=
kN =⇒ N = No ekt ; where No is the initial population size. However, when the population
growth is constrained by limited resources, a heuristic modification to the Malthusian growth
model results in the Verhulst equation,
 
dN N
= rN 1−
dt K

where K is called the carrying capacity of the environment. Making the equation dimension-
less using τ = rt and x = N/K leads to the logistic equation,

dx
= x(1 − x).

The logistic equation can then be solved using separable technique to the effect that the
population grows in size until it reaches the carrying capacity of its environment; i.e.

lim N (t) = K
t→∞

EER: Solve the logistic equation above.

20
Chapter 2

Second Order DEs

Quotation:

“An idea which can be used once is a trick. If it can be used more than once it becomes a
method.”
George Polya and Gabor Szego.

2.1 Objectives

By the end of this topic, you will be able to:

• identify a second order DE

• describe the methods of solving second order ODEs

• apply the methods to many second order ODEs

2.2 Introduction

Second order DEs involve 2nd derivatives of the unknown function. The general solution of
nearly all 2nd DEs contains two arbitrary constants and particular solutions require two initial
values.

21
A 2nd DE is an equation of the form,

y ′′ = f (x, y, y ′ ); y(xo ) = ao ; y ′ (xo ) = a1 .

OR
d2 y dy
2
+ p(x) + q(x)y = 0; y(xo ) = ao , y ′ (xo ) = a1
dx dx
Equations of the form,
F (x, y ′ , y ′′ ) = 0 (2.1)

OR
F (y, y ′ , y ′′ ) = 0 (2.2)

may be reduced to first order (which could be linear) and then solved using first order meth-
ods of Chapter (1). Notice that (2.1) is independent of y and (2.2) is independent of x.
Examples:
Q1. Solve the IVP: xy ′′ + 2y ′ + x = 1, y(1) = 2, y ′ (1) = 1
Solution:
This is of type (2.1) above, independent of y.
Let y ′ = p so that y ′′ = p′
=⇒ xy ′′ + 2y ′ + x = xp′ + 2p + x
∴ xp′ + 2p + x = 1
=⇒ p′ + x2 p + 1 = 1
x
(linear in p).
2 2
R
=⇒ p′ + x2 p = 1
x
− 1; (IF, µ(x) = e x
dx
= eln x = x2 .)
=⇒ x2 (p′ + x2 p) = x2 ( x1 − 1)
d
=⇒ dx
(x2 p) = x − x2 . Integrating both sides;
=⇒ x2 p = 12 x2 − 13 x3 + c1
=⇒ p = 1
2
− x
3
+ c1 x−2
From initial condition, y ′ (1) = 1; p = y ′ ⇒ c1 = 5/6
=⇒ y ′ = p = 12 − x3 + 56 x−2
=⇒ y = ( 12 − x3 + 56 x−2 ) dx = x
− 16 x2 + 65 x−1 + c2
R
2

Also from y(1) = 2; c2 = 5/2;

x 1 2 5 −1 5
∴y= − x + x + ⊡
2 6 6 2

22
Q2. Solve y ′′ + (y ′ )3 y = 0; y(0) = 1; y ′ (0) = −1
Solution:
This is of type (2.2) above i.e it is independent of x. Let y ′ = p.
dp dp dy dp
=⇒ y ′′ = dx
= .
dy dx
= p dy
Hence y becomes the independent variable.
dp
=⇒ y ′′ + (y ′ )3 y ≡ p dy + p3 y = 0 (separable)
2c−y 2
=⇒ p−2 dp = −ydy =⇒ − p1 = − 12 y 2 + c = 2
−2
=⇒ p = 2c−y 2
. From y ′ (0) = −1, c = 3/2.
=⇒ p = y ′ = 2
y 2 −3

=⇒ (y 2 − 3)dy = 2dx; =⇒ 13 y 3 − 3y = 2x + c2
From y(0) = 1, ⇒ c2 = −8/3

1 8
∴ y 3 − 3y = 2x − ⊡
3 3

2.3 Second Order Linear Equations

A general 2nd order linear DE is of the form,

a(x)y ′′ + b(x)y ′ + c(x)y = d(x); a(x) ̸= 0

OR
y ′′ + p(x)y ′ + q(x)y = r(x)

If r(x) ≡ 0; i.e
y ′′ + p(x)y ′ + q(x)y = 0,

then the DE is referred to as homogeneous; e.g y ′′ − 2y ′ + y = 0; while y ′′ − 2y ′ + y = x is


non-homogeneous.
The functions p(x) and q(x) are coefficients of the linear homogeneous equation. When p(x)
and q(x) are constants, then the DE is said to have constant coefficients.

23
Important Results

• If y1 (x) and y2 (x) are linearly independent (LI) solutions of the linear homogeneous
equation, then every solution is a linear combination of y1 (x) and y2 (x),i. e

y = c1 y1 (x) + c2 y2 (x); c1 , c2 ∈ R

• If ȳ is a particular solution to the non-homogeneous equation and if yh is the general


solution (aka complimentary function) of the corresponding homogeneous equation,
then the general solution of the linear non-homogeneous equation is

y = ȳ + yh .

For example:
For the DE
y ′′ + y = 0 : y1 = cos x & y2 = sin x

are both solutions (verify by differentiating and substituting).


Hence for c1 , c2 ∈ R; y = c1 y1 + c2 y2 are also solutions(verify).

Definition:
Given that y1 (x) and y2 (x) are solutions to the DE,

y′′ + b1 (x)y′ + b0 (x)y = 0,

define the determinant,

y1 (x) y2 (x)
W(y1 , y2 ) = = y1 y2′ − y2 y1′ .
y1′ (x) y2′ (x)

The determinant W(y1 , y2 ) is called the Wronskian.


If y1 , y2 , · · · , yn are solutions to the DE,

an y n + an−1 y n−1 + · · · + a1 y ′ + ao y = 0,

24
then a necessary and sufficient condition for the solutions {yi }ni=1 to be LI is that their Wron-
skian is identically different from zero, i.e

W(y1 , y2 , · · · , yn ) ̸= 0.

Always differentiate (n − 1) times.


Examples:
Compute the Wronskian of the following functions:
i) y1 = x2 , y2 = 3x − 1 (n = 2) ii) y1 = 1, y2 = x, y3 = x2 (n=3)
Solutions:
i)

x2 3x − 1
W (y1 , y2 ) =
2x 3

= 2x − 3x2

ii)

1 x x2
W (y1 , y2 , y3 ) = 0 1 2x
0 0 2

= 1.1.2

=2

EER:
Q1. Determine whether the set of solutions given alongside the DEs are either LI or LD:
i) y ′′ + 3y ′ + 2y = 0; y1 = e−2x & y2 = e−2x + e−x
ii) y ′′ + 9y = 0; y1 = cos 3x & y2 = cos(3x + π3 )
iii) y ′′ − 2y ′ + y = 0; y1 = ex & y2 = xex
Q2. Show that y = cx + c2 x ln x is a general solution of x2 y ′′ − xy ′ + y = 0; x > 0. Find the
solutions to this equation that satisfy the initial conditions below:
(i) y(1) = 1, y ′ (1) = 0 (ii) y(2) = 0, y ′ (2) = 0 (iii) y(1) = 1, y ′ (1) = −1.
Q3. Show that y1 = x2 and y2 = x−1 are LI solutions to the DE x2 y ′′ − 2y = 0. Find the unique
solution subject to y(1) = -2 and y ′ (1) = 7.

25
Theorem:
Let y1 and y2 be LI solutions to the 2nd order DE: a2 (x)y ′′ + a1 (x)y ′ + a0 (x)y = 0, then the
Wronskian W (y1 , y2 ) satisfies the first order DE,

a1 (x)
W′ + W =0
a2 (x)

Proof:
Since y1 and y2 be LI solutions to the DE;

a1 ′ a0
a2 y1′′ + a1 y1′ + a0 y1 = 0 ⇔ y1′′ + y + y1
a2 1 a2
 
a1 ′ a0
=⇒ y1′′ = − y
a2 1
+ y
a2 1
 
a1 ′ a0
Similarly, y2′′ =− y
a2 2
+ y
a2 2

Now W (y1 , y2 ) = y1 y2′ − y1′ y2 ; =⇒ W ′ (y1 , y2 ) = y1 y2′′ − y1′′ y2


Substituting y1′′ and y2′′ and simplifying, we get:

=−W
z }| {a a1
1

W = (y2 y1′ − y1 y2′ ) = −W
a2 a2

Thus
a1
W′ + W =0
a2
This is a separable first order DE where the solution can be given as,

R a1
− dx
W = ke a2
; k ∈ R; usually k = 1.

2.4 Solving Second Order DE Using Wronskian

For y1 and y2 LI solutions of the 2nd DE, then

d y1 y2′ − y2 y1′ W
(y2 /y1 ) = 2
= 2
dx y1 y1

from which y2 can be obtained if y1 is given or vice versa.


Example:
2
Solve the DE; xy ′′ − 2y ′ + ( x x+2 )y = 0 given that y1 = x sin x is one of the LI solutions.

26
Solution:
Comparing the DE with a standard 2nd order DE; a2 y ′′ + a1 y ′ + ao y = 0, we see that;
x2 +2
a2 = x; a1 = −2; ao = x
, thus;

R a1
− dx
W = ke a2

−2
R
= ke− x
dx

2
= keln x ; k = 1

= x2 .

d W
Using (y /y1 )
dx 2
= y12
,
d x2
=⇒ (y /y1 )
dx 2
= (x sin x)2
,
d 1
=⇒ (y /y1 )
dx 2
= sin2 x
= cosecx ,
y2
R
=⇒ y1
= cosecx dx = − cot x
=⇒ y2 = −y1 cot x = −x cos x; y1 = x sin x
∴ y = c1 y1 + c2 y2 = c1 x sin x − c2 x cos x ⊡

Q2. Solve the DE: (x2 + 1)y ′′ − 2xy ′ + 2y = 0 given that y1 = −x is one of the LI solutions to
the DE.
Solution:
On comparison: a2 = x2 + 1; a1 = −2x; and ao = 2. Therefore;

R a1
− dx
W = ke a2

−2x
R
− dx
= ke x2 +1x

2 +1)
= keln (x ; k=1

= x2 + 1.

d W x2 +1
Now (y /y1 )
dx 2
= y12
= (−x)2
,
y2 x2 +1 1
R
=⇒ y1
= x2
dx = x − x

=⇒ y2 = −y1 (x − x1 ) = 1 − x2 ; y1 = −x
∴ y = c1 y1 + c2 y2 = −c1 x + c2 (1 − x2 ) ⊡

Q3. Solve the DE, xy ′′ + (1 − 2x)y ′ + (x − 1)y = 0 given that y = ex is one of the LI solutions
to the DE. Find the unique solution subject to y(1) = e; y ′ (1) = −3e.
Solution:

27
Here, a2 = x; a1 = 1 − 2x; ao = x − 1
W = x−1 e2x Verify!!!!
=⇒ d
(y /y1 )
dx 2
= W
y12
= x−1 e2x .e−2x = x−1
∴ y2 = y1 ln x = ex in x
=⇒ y = c1 ex + c2 ex ln x
From initial conditions, y(1) = e; =⇒ c1 = 2; verify
Now y ′ = c1 ex + c2 [ex ln x + x−1 ex ]. Work it out!
Also from y ′ (1) = −3e; c2 = −5. Check it out!
∴ y = 2ex − 5ex ln x ⊡

2.5 Homogeneous DEs with Constant Coefficients

These are equations of the form,

ay ′′ + by ′ + cy = 0; a, b, c ∈ R.

The equation may be written as,

am2 + bm + c = 0; a ̸= 0

This equation is variously called Auxiliary Quadratic Equation, AQE or Characteristic Equa-
tion or Quadratic Polynomial Equation. The root of the AQE is given as,
p
−b ± (b2 − 4ac)
m= .
2a

Three cases arise from the root, depending on the discriminant, i.e

• b2 > 4ac – real and distinct roots.

• b2 = 4ac – real and repeated roots.

• b2 < 4ac – complex roots.

28
Case I: Real and Distinct Roots

For real roots say λ1 and λ2 , the general solution to the DE is given by,

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

The Wronskian is given as

eλ1 x eλ2 x
W(y1 , y2 ) = = (λ2 − λ1 )e(λ1 +λ2 )x .
λ1 eλ1 x λ2 eλ2 x

Since λ1 ̸= λ2 , W (y1 , y2 ) ̸= 0, hence y = c1 eλ1 x + c2 eλ2 x is a solution.


Examples:
Q1. Solve the DE; y ′′ + 3y ′ − 10y = 0
Solution:
AQE: m2 + 3m − 10 = 0
=⇒ (m − 2)(m + 5) = 0
=⇒ m = 2, m = −5; i.e λ1 = 2; λ2 = −5
∴ y = c1 y1 + c2 y2 = c1 e2x + c2 e−5x ⊡

Q2. Find the general solution to y ′′ + y ′ − y = 0.


Solution:
AQE: m2 + m − 1 = 0
√ √ √
−1± (1+4) −1+ 5 −1− 5
=⇒ m = ; λ1 = ; λ 2 =
h2 √ i h2 √ i 2
−1+ 5 −1− 5
∴ y = c1 exp ( 2 )x + c2 exp ( 2 )x ⊡

Case II: Real and Repeated Roots

Here, λ1 = λ2 = λ and y1 = eλx ; y2 = xeλx


⇒ y = c1 eλx + c2 xeλx
Example:
Solve the DE: y ′′ + 2y ′ + y = 0 subject to y(0) = 1, y ′ (0) = −2
Solution:
AQE: m2 + 2m + 1 = 0
=⇒ (m + 1)2 = 0; ⇒ m = −1 (repeated)

29
∴ y = c−x
e + c2 xe
−x

From initial conditions, y(0) = 1; ⇒ c1 = 1, check it out.


Also y ′ = −c1 e−x + c2 (e−x − xe−x ); c2 = −1 from y ′ (0) = −2
∴ y = e−x − xe−x = (1 − x)e−x ⊡

Case III: Complex Roots

If the roots of the AQE are complex (b2 < 4ac) i.e λ1 = u + iv and λ2 = u − iv = λ̄1 , then the
general solution to the DE is given as,

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

where,
eλ1 x = e(u+iv)x = eux . eivx = eux (cos vx + i sin vx)

and
eλ2 x = eux (cos vx − i sin vx)

The general solution can thus be written as,

y = eux (c1 cos vx + c2 sin vx)

Examples:
Q1. Solve the DE, y ′′ + 6y ′ + 25y = 0
Solution:
AQE: m2 + 6m + 25 = 0

−b± (b2 −4ac)
=⇒ m = 2a
= −3 ± 4i (verify)
Thus y = e−3x (c1 cos 4x + c2 sin 4x) ⊡

Q2. Solve the following IVP; y ′′ − 6y ′ + 13y = 0; s.t. y(0) = 1, y ′ (0) = 2.


Solution:
AQE: m2 − 6m + 13 = 0

−b± (b2 −4ac)
=⇒ m = 2a
= 3 ± 2i (verify)
=⇒ y = e3x (c1 cos 2x + c2 sin 2x)
From initial conditions, y(0) = 1, verify that c1 = 1. Also check that;
y ′ = 3c1 e3x cos 2x − 2c1 e3x sin 2x + 3c2 e3x sin 2x + 2c2 e3x cos 2x

30
From y ′ (0) = 2, check that c2 = −1/2.
∴ y = e3x (cos 2x − 21 sin 2x) ⊡

EER:
Solve the following DEs:

1. y ′′ − 2y ′ − 3y = 0;

2. y ′′ − y ′ − 6y = 0; y(0) = 0, y ′ (0) = −1

d2 B
3. dx2
− 10 dB
dx
+ 25B = 0

4. y ′′ + 2y ′ + 10y = 0

5. y ′′ + 4y ′ = 0; y(0) = 2, y ′ (0) = −1

6. y ′′ − 2y ′ + 17y = 0, y(0) = 0, y ′ (0) = 0

7. y ′′ + 2y ′ + 3y = 0; y(0) = 0, y ′ (0) = 3
2
d y dy
8. 2 dx2 − 2 dx + y = 0.

2.6 Non-Homogeneous Linear Equations

A 2nd order non-homogeneous linear DE with constant coefficients is of the form,

ay ′′ + by ′ + cy = g(x); a ̸= 0, b, c ∈ R & g(x) ̸= 0.

Let L(y) = g(x), L a linear operator defined as,

d2 d
L= 2
+ b1 (x) + b0 (x)
dx dx

with properties;

• L(cy) = cL(y)

• L(y1 + y2 ) = Ly1 + Ly2

The general solution of L(y) = g(x) is obtained as follows:

31
Step 1: Find the complimentary function yc of the homogeneous part,
L(y) = 0 i.e yc = c1 y1 + c2 y2 .

Step 2: obtain the particular solution, yp of the non homogeneous equation,


L(y) = g(x)

Step 3: Write down the general solution y of the DE as,

y = y c + yp .

There are several methods of determining yp as discussed below:

2.6.1 Method of Undetermined Coefficients

This is based on the form of g(x), i.e whether its a polynomial or exponential or trigonometric
(transcendental or sinusoidal) function.

Case I: g(x) is Polynomial

We discuss them by use of examples:


Example 1:
Solve: y ′′ − 3y ′ − 4y = 3x + 1
Solution:
For L(y) = 0; i.e y ′′ − 3y ′ − 4y = 0:
AQE: r2 − 3r − 4 = 0; =⇒ (r − 4)(r + 1) = 0; ⇒ r = 4; r = −1 (real parts)
∴ yc = c1 e4x + c2 e−x .
For g(x) = 3x − 1, (polyl of deg. 1), yp is of the form Ax + B.
=⇒ yp = Ax + B; yp′ = A; yp′′ = 0
Substituting in the DE;
⇒ 0 − 3A − 4(Ax + B) = 3x + 1.
By collecting like terms and comparing coefficients, A = -3/4 and B = 5/16.
∴ yp = − 43 x + 5
16

=⇒ y = yc + yp = c1 e4x + c2 e−x − 43 x + 5
16

If g(x) were of deg. 2, then yp would be of the form Ax2 + Bx + C; etc and proceed as above.
Example 2:

32
Solve the equation: y ′′ − 3y ′ − 4y = 4x2 .
Solution:
As before, yc = c1 e4x + c2 e−x .
Now yp = Ax2 + Bx + C.
Differentiate, substitute and solve for A, B and C. Ans: A = -1, B = 3/2 and C = -13/8.
∴ y = c1 e4x + c2 e−x − x2 + 23 x − 13
8

Case II: g(x) is Exponential

The function g(x) here is of the type, keax . The trial solution may take the following forms:

g(x) yp
eax Aeax
kxex (Ax + B)ex
x2 e−x (Ax2 + Bx + C)e−x
ax2 + ke2x Ax2 + Bx + C + (Dx + E)e2x

OR more generally, for any form of g(x) in exponential form, the trial solution may be written
as,
yp = peax + qx + k

Example 1:
2
Solve: 10 ddt2x + 13 dx
dt
− 3x = 21e2t − 6t + 2
Solution:
Complimentary function: 10x′′ + 13x′ − 3x = 0.

2 −b± (b2 −4ac)
AQE: =⇒ 10λ + 13λ − 3 = 0; ⇒ λ = 2a
= (−3/2, 1/5) (real and distinct)
3 1
∴ xc = c1 e− 2 t + c2 e 5 t
Let xp = pe2t + qt + k, ⇒ x′p = 2pe2t + q; x′′p = 4pe2t
Substituting in the equation,
⇒ 10(4pe2t ) + 13(2pe2t + q) − 3(pe2t + qt + k) = 21e2t − 6t + 2
Collecting like terms and equating coefficients of the like terms and simplifying; we get: p
=1/3, q = 3 and k = 8.
3 t
∴ x = xc + xp = c1 e− 2 t + c2 e 5 + 13 e2t + 2t + 8

Example 2:
Solve; y ′′ + 3y ′ + 2y = 10e3x ; y(0) = 1, y ′ (0) = 0.

33
Solution:
Complimentary function: y ′′ + 3y ′ + 2y = 0.

−b± (b2 −4ac)
AQE: =⇒ λ2 + 3λ + 2 = 0; ⇒ λ = 2a
= (−1, −2) (real and distinct)
∴ yc = c1 e−x + c2 e−2x
Let yp = Ae3x , ⇒ yp′ = 3Ae3x ; yp′′ = 9Ae3x
Substituting in the equation and solving for A, we get A = 1/2.
∴ y = yc + yp = c1 e−x + c2 e−2x + 12 e3x
From initial conditions, y(0) = 1 and y’(0) = 0; after substituting and solving the resulting
simultaneous equation, c1 = −1/2; c2 = 1
⇒ y = − 12 e−x + e−2x + 12 e3x ⊡

Example 3:
Solve the IVP: y ′′ + 3y ′ + 2y = 6xex ; y(0) = 1; y ′ (0) = 0.
Solution: y = 72 e−x − 35 e−2x + (x − 56 )ex ⊡ (Working left as EER!!)

Case III: g(x) is Trigonometric

The complimentary function is obtained as before. For yp , if g(x) is of the form a sin kx +
b cos kx, then the particular solution takes the form, p sin kx + q cos kx. OR one may consider
the following table:

g(x) yp
sin 2α A cos 2α + B sin 2α
2 cos 2α A cos 2α + B sin 2α
x sin 3α (Ax + B) cos 3α + (Cx + D) sin 3α
x sin α + 2 cos α (Ax + B) cos α + (Cx + D) sin α

Example 1:
Find the solution to the DE: y ′′ + 3y ′ + 2y = cos x, y(0) = 0 = y ′ (0).
Solution:
Complimentary function:
=⇒ λ2 + 3λ + 2 = 0; ⇒ (λ + 1)(λ + 2) = 0; ⇒ λ = (−1, −2)
∴ yc = c1 e−x + c2 e−2x
For the particular solution:
yp = p cos α + q sin α; yp′ = −p sin α + q cos α; yp′′ = −p cos α − q sin α

34
Substituting in the DE and solving the resulting simultaneous equation, p = 1/10 and q =
3/10.
1 3
∴ yp = 10
cos α + 10
sin α
=⇒ y = c1 e−x + c2 e−2x + 1
10
cos α + 3
10
sin α
Solving for c1 and c2 from initial conditions, we find that,
y = 52 e−2x − 21 e−x + 1
10
(cos α + 3 sin α) ⊡

Example 2:
Solve the equation: y ′′ − 3y ′ − 4y = 2 sin α
Solution:
AQE: λ2 − 3λ − 4 = 0; ⇒ (λ − 4)(λ + 1) = 0; ⇒ λ = (4, −1); yc = c1 e4x + c2 e−x
For yp ; use yp as p cos α + q sin α, differentiate it twice, substitute in the DE and solve for p
and q to obtain p =-5/17 and q = 3/17.
∴ y = c1 e4x + c2 e−x − 5
17
cos α + 3
17
sin α ⊡

EER:
Q1. Find the general solution to the following:
(i) y ′′ + y = 1 + x (ii) y ′′ + 4y = e3x (iii) y ′′ + y ′ + 3y = e2x
(iv) y ′′ − y ′ + 2y = x (v) y ′′ − 5y ′ + 6y = e−x (vi) y ′′ − y = 5 − 3x
Q2. Solve the following IVPs:
(i) y ′′ − y = e2x , y(0) = −1; y ′ (0) = 1 (ii)y ′′ + y = 2ex ; y(0) = 1; y ′ (0) = −1
(iii) B ′′ − 4B ′ + 4B = x; B(0) = 0; B ′ (0) = 1 (iv) y ′′ − 4y ′ + 3y = ex ; y(0) = y ′ (0) = 0

Common term in Complimentary and Particular Solution

If yp has a term in yc , then the choice of yp is modified by attaching a polynomial of multiplicity


(n − 1) where n is the degree of the DE.
Example 1:
Solve: y ′′ − 3y ′ − 4y = e−x .
Solution:
yc :AQE:λ2 − 3λ − 4 = 0 as before.
⇒ λ = (4, −1); ⇒ yc = c1 e4x + c2 e−x
For yp : Let yp = Ae−x : (cf Ae−x and c2 ex )
=⇒ yp′ − −Ae−x ; yp′′ = Ae−x
Substituting in the DE;

35
Ae−x + 3Ae−x − 4Ae−x = e−x ⇔ 0 = e−x !!; x undefined!!
Now attach a polyl of multiplicity n − 1 = 2 − 1 = 1 to yp , i.e;
yp = xAe−x ; yp′ = −xAe−x + Ae−x ; yp′′ = xAe−x − 2Ae−x
Substituting in the DE and solving for A, we find that A = -1/5.
∴ y = c1 e4x + c2 e−x − x5 e−x ⊡

Example 2:
Solve the DE: y ′′ − 4y ′ = 2x
Solution:
For yc : AQE: λ2 − 4λ = 0; ⇒ λ = (0, 4); ↱ yc = c1 + c2 e4x
For yp : g(x) = 2x; ⇒ yp = Ax + B (cf c1 and B)!!
=⇒ yp′ = A; yp′′ = 0
=⇒ −4A = 2x!! yet A ∈ R!!
Now use yp = x(Ax + B).
Differentiating twice and substituting into the DE and solving simultaneously:
A = −1/4 and B = −1/8.
x x
∴ y = c1 + c2 e4x − 4
− 8

2.6.2 The Principle of Superposition


n
For the DE: ay ′′ + by ′ + cy = g(x) with g(x) = gi (x) and L(y) = ay ′′ + by ′ + cy; then the
P
i=1
particular solution my be given as follows:
L(y) = g1 (x) gives yp1
L(y) = g2 (x) gives yp2
.. .. ..
. . .
L(y) = gn (x) gives ypn
Then yp = yp1 + yp2 + · · · + ypn

Example 1:
Solve the IVP: y ′′ − y ′ − 6y = −ex + 12x; y(0) = 1; y ′ (0) = −2
Solution:
For yc : AQE: λ2 − λ − 6 = 0; =⇒ λ = (−2, 3) =⇒ yc = c1 e−2x + c2 e3x .
For yp : g(x) = 12x − ex
For g1 (x) = 12x; yp1 = Ax + B; yp′ 1 = A; yp′′1 = 0

36
Substituting: 0 − A − 6(Ax + B) = 12x and solving for A and B, we get A = −2 and B = 1/3.
∴ yp1 = −2x + 1/3
Similarly for g2 (x) = −ex ; yp2 = Aex ; yp′ 2 = Aex ; yp′′2 = Aex
Substituting: Aex − Aex − 6Aex = −ex and solving for A, we get A = 1/6.
∴ yp2 = 61 ex ; =⇒ yp = yp1 + yp2 = 61 ex − 2x + 13 .
=⇒ y = c1 e−2x + c2 e3x + 16 ex − 2x + 31 .
From initial conditions: c1 = 1/3; c2 = 1/6
∴ y = 13 (e−2x + 1) + 16 (e3x + ex ) − 2x ⊡

Example 2:
Find the complete solution to the equation: y ′′ + 4y = x sin 2x + 8
Solution:
y = c1 cos 2x + c2 sin 2x − 81 x2 cos 2x + 1
16
x sin 2x + 2 (verify).

2.7 Cauchy–Euler Equation

This is an equation of the form;

ax2 y ′′ + bxy ′ + cy = 0

OR
b ′ c
y ′′ + y + 2 y = 0; a, x ̸= 0
ax ax
To solve such an equation, use the substitution x = et to change the given equation to a
standard 2nd order DE; i.e;
dx
= et = x
dt
dy dy dx dy
=⇒ = × =x
dt dx dt dx
and
d2 y d2 y
   
d dy dx dy d dy dy
2
= x = × +x× = + x2 2
dt dt dx dt dx dx dt dt dx
2
2dy d2 y dy
=⇒ x = 2 −
dx2 dt dt
OR alternatively, one may use the substitution, y = xm and solve for m.
If y = xm , y ′ = mxm−1 ; y ′′ = m(m − 1)xm−2 . Substituting in the DE yields the following

37
cases:(for m1 and m2 roots):

Case 1: m1 and m2 distinct roots: y = c1 xm1 + c2 xm2

Case 2: m1 = m2 = m then y = c1 xm + c2 xm ln x

Case 3: m1 and m2 complex roots (= r ± is): y = xr [c1 cos(sln x) + c2 sin(sln x)]

Example:
Solve the equation: x2 y ′′ − 3xy ′ + 3y = 0
Solution:
y = xm obtain y ′ and y ′′ as above. Substituting into the equation, simplifying and solving for
m, we find m = (1, 3) (real and distinct roots).
∴ y = c1 x + c2 x 3
EER: Find a particular solution s.t y(1) = 2 and y ′ (0) = 1.

38
Chapter 3

Linear DEs of any Order

Quotation:
“I believe that mathematical reality lies outside us, that our function is to discover or observe
it, and that the theorems which we prove, and which we describe grandiloquently as our
“creations,” are simply the notes of our observations.” Hardy, Godfrey H. (1877 - 1947)

3.1 Objectives

By the end of this topic, you will be able to:

solve higher order linear DEs using several methods e.g. undetermined coefficients, Wron-
skian, variation of parameters, order reduction, etc

3.2 Introduction

A linear DE of order n is of the form:

an y (n) + an−1 y (n−1) + · · · + a1 y ′ + a0 y = h(x); an ̸= 0.

This equation can also be written as;

y (n) + bn−1 y (n−1) + · · · + b1 y ′ + b0 y = g(x)

39
Both of these equations will have n initial conditions of the form;

y(x0 ) = a0 ; y ′ (x0 ) = a1 ; ··· ; y (n−1) (x0 ) = an−1 .

The solution will also have n arbitrary constants. The equations may be homogeneous or
non homogeneous depending on the right hand functions, h(x) or g(x).
If the coefficients bj s are constants, then the equation is called constant coefficient equation.
Using the L operator notation i.e.

dn dn−1 d
L= n
+ b n−1 n−1
+ · · · + b1 + b0 (x),
dx dx dx

the equation can be written as,

L(y) = g(x) − − − non homogeneous or

L(y) = 0 − − − homogeneous

Recall that L has the following properties:

L(cy) = cL(y) and L(c1 y1 + c2 y2 ) = c1 L(y1 ) + c2 L(y2 )

The equation x2 y (iv) + 5x3 y ′′ + 8y = 4x2 can be written as y (iv) + 5xy ′′ + 8x−2 y = 4 in which
case L is,
d4 d3 d2 d
L= 4
+ 0. 3
+ 5x 2
+ 0. + 8x−2
dx dx dx dx
with b3 = 0, b2 = 5x, b1 = 0, b0 = 8x−2 , and g(x) = 4.
d
The other notation is to use D for the differential operator, dx
e.g,
For the DE, 2y ′′′ + y ′′ + 4y ′ − 6y = sin x we have,

L = 2D3 + D2 + 4D − 6

and g(x) = sin x


Theorem
If y1 , y2 , · · · , yn are solutions to L(y) = 0 and c1 , c2 , · · · , ck ∈ R then

y = c1 y1 + c2 y2 + · · · + ck yk

40
is a solution to L(y) = 0
For example, if the solutions to the DE (D3 − 4D2 + 5D − 2)y = 0 are:
y1 = ex , y2 = xex , and y3 = e2x then

y = c1 ex + c2 xex + c3 e2x ; ci ∈ R

is also a solution.
If yi }ki=1 are solutions to L(y) = 0, then the yi s are LI if

c1 y1 + c2 y2 + · · · + ck yk = 0.

A Linearly independent set of n solutions of a homogeneous equation is also called a


fundamental set of the solutions.
To decide whether or not a given set of n solutions is a fundamental set, compute the
Wronskian, i.e.
y1 y2 ··· yn
y1′ y2′ ··· yn′
W(y1 , y2 , · · · , yn ) = .. .. ..
. . ··· .
(n−1) (n−1) (n−1)
y1 y2 ··· yn

Iff W(y1 , y2 , · · · , yn ) ̸= 0 then the set {y1 , y2 , · · · , yn } is a fundamental set of the homoge-
neous equation.
For example, the equation (D3 − 4D2 + 5D − 2)y = 0 has solutions y1 = ex , y2 = xex y3 = e2x .
The Wronskian is computed as;

ex xex e2x
W (y1 , y2 , y3 ) = ex ex + xex 2e2x
ex 2ex + xex 4e2x

= e4x ̸= 0

Hence {ex , xex , e2x } is a fundamental set for the equation. A general solution is thus given
as,
y = c1 ex + c2 xex + c3 e2x ⊡

Theorem
If yp is a particular solution to the non homogeneous equation whose corresponding homo-

41
geneous equation has {y1 , y2 , · · · , yn } as a fundamental set, then the general solution of the
non homogeneous equation is written as,

y = yc + yp

where yc = c1 y1 + c2 y2 + · · · + cn yn .
Examples:
Determine whether or not the solutions given are a fundamental set of the given DEs:
1) y ′′′ − 3y ′′ + 2y ′ = 0 : y1 = 1, y2 = ex , y3 = e2x .
2) (D4 − 8D3 + 24D2 − 32D + 16)y = 0 : y1 = e2x , y2 = xe2x , y3 = x2 e2x , y4 = x3 e2x .
3) y ′′′ − 3y ′′ − y ′ + 3y = 0 : y1 = e3x + ex + e−x , y2 = 2e3x + 3ex − e−x , y3 = 3e3x + 4ex .
4) x2 y ′′′ + xy ′ − y ′ = 0 : y1 = 1 + x2 , y2 2 + x2 , y3 = ln x.
5) y ′′′ − 3y ′′ − y ′ + 3y = 0 : y1 = e3x + ex , y2 = ex − e−x , y3 = e3x + e−x .

3.3 Homogeneous with Constant Coefficients

The nth order homogeneous equation is one of the form,

L(y) = (Dn + bn−1 D(n−1) + · · · + b1 D + b0 )y = 0; bi ∈ R

The characteristic polynomial of this equation is written as;

p(λ) = λn + bn−1 λn−1 + · · · + b1 λ + b0

The characteristic equation (CE) is thus,

λn + bn−1 λn−1 + · · · + b1 λ + b0 = 0

The roots of the CE are the roots of the nth order homogeneous equation above. If the CE
has n distinct roots, {λ1 , · · · , λn } then the set {y1 = eλ1 x , y2 = eλ2 x , · · · , yn = eλn x } is a
fundamental set for the nth order DE.
Examples:
Q1. Find the general solution to the DE, y ′′′ − 2y ′′ − y ′ + 2y = 0
Solution:

42
CE: λ3 − 2λ2 − λ + 2 = 0.
If λ = 1 then LHS of the CE is zero, so (λ − 1) is a factor to the CE. Factorizing (or performing
the long division), we obtain,
λ3 − 2λ2 − λ + 2 = (λ − 1)(λ2 − λ − 2)
But (λ2 − λ − 2) = (λ − 2)(λ + 1)
=⇒ (λ − 1)(λ − 2)(λ + 1) = 0
∴ λ = (1, 2, −1). Real and distinct roots.
=⇒ y1 = ex , y2 = e2x , y3 = e−x .
Thus the general solution to the DE is: y = c1 ex + c2 e2x + c3 e−x

Q2. Obtain an expression for the general solution to the DE: (D2 − 1)(D2 + 4) = 0.
Solution:
CE: (λ2 − 1)(λ2 + 4) = 0
=⇒ λ = ±1 real and distinct roots and λ = ±2i complex roots.
∴ y1 = ex , y2 = e−x , y3 = e2ix , y4 = e−2ix .
Recall that for complex roots, y = eux (c1 cos vx + c2 sin vx)
Hence y3,4 = e0 (c1 cos 2x + c2 sin 2x) = c3 cos 2x + c4 sin 2x
Thus,

y = c1 y1 + c2 y2 + c3 y3 + c4 y4

= c1 ex + c2 e−x + c3 cos 2x + c4 sin 2x

Q3. Solve the IVP: y ′′′ − y ′′ + y ′ − y = 0; y(0) = y ′ (0) = 0, y ′′ (0) = 1.


Solutions:
CE: λ3 − λ2 + λ − 1 = 0.
Factors: (λ − 1)(λ2 + 1)
=⇒ (λ − 1)(λ2 + 1) = 0; =⇒ λ = 1 and λ = ±i
=⇒ y1 = ex , y2,3 = c2 cos x + c3 sin x
∴ y = c1 ex + c2 cos x + c3 sin x
From initial conditions, substituting one at a time,
we see that c1 = 1/2, c2 = c3 = −1/2

1 1 1
∴ y = ex − cos x − sin x ⊡
2 2 2

43
Q4. Find the fundamental set of solutions to the DE below and compute the Wronskian at
x = 0; (D3 + D2 − 4D − 4)y = 0
Solution:
CE: λ3 + λ2 − 4λ − 4 = 0
Factors: (λ + 1)(λ − 2)(λ + 2) =⇒ λ = (2, −1, −2)
Fundamental set = {e2x , e−x , e−2x }
Thus,
e2x e−x e−2x
W (y1 , y2 , y3 ) = 2e2x −e−x −2e−2x
4e2x e−x 4e−2x

Verify that at x = 0, W (y1 , y2 , y3 ) = −12.

Note that if a root to the CE has multiplicity m > 1, then the set,

{eλx , xeλx , x2 eλx , · · · , xm−1 eλx }

are LI solutions.

EER:
Q1. Solve the following IVPs
i) (D − 2)3 y = 0; y(0) = 1, y ′ (0) = −1, y ′′ (0) = 0
ii) y ′′′ − y ′′ + y ′ − y = x; y(0) = y ′ (0) = 0; y ′′ (0) = 1.
Q2. Find the fundamental set and compute the Wronskian at x = 0 for the following DEs:
i) y ′′′ + 2y ′′ + 5y ′ = 0 ii) (D − 1)3 y = 0.

3.4 The Method of Undetermined Coefficients

This is an extension from 2nd order DEs to the nth order DEs:

Ly = y (n) + bn−1 y (n−1) + · · · + b1 y ′ + b0 y = g(x).

The function g(x) may be categorized as follows:

• a polyl in x of degree m i.e g(x) = q(x).

44
• g(x) = eαx q(x); α ∈ R, q(x) a polyl of deg m

• g(x) = eαx q(x) sin βx

• g(x) = eαx q(x) cos βx

The characteristic polynomial of the homogeneous part is thus,

p(λ) = λn + bn−1 λn−1 + · · · + b1 λ + b0 .

The CE will have n roots, some of which with multiplicities bigger than 1.

3.4.1 Case 1: g(x) = q(x), a polyl of deg m

–obtain the zeros of the CE as usual; yc


–yp is obtained by the trial solution: yp = A0 + A1 x + · · · + Am xm
–if λ = 0 is a solution of multiplicity r > 0, then use yp as,

yp = xr (A0 + A1 x + · · · + Am xm )

–the general solution y is then, y = yc + yp .

Examples:
Q1. Solve the DE: y ′′′ − 3y ′′ + 2y ′ = 1 − x2 .
Solution:
CE: λ3 − 3λ2 + 2λ = 0; ⇒ λ(λ2 − 3λ + 2) = 0
=⇒ λ(λ − 1)(λ − 2) = 0
=⇒ λ = 0 (multiplicity 1); λ = (1, 2)
=⇒ yc = c1 e0 + c2 ex + c3 e2x = c1 + c2 ex + c3 e2x
For yp :
Use yp = x1 (A0 + A1 x + A2 x2 ) = A0 x + A1 x2 + A2 x3
∴ yp′ = A0 + 2A1 x + 3A2 x2 ; yp′′ = 2A1 + 6A2 x; yp′′′ = 6A2
Substituting yp and its derivatives into the DE and solving, we find,

1 3 5
A2 = − ; A1 = − , A0 = −
6 4 4

45
=⇒ yp = x(− 54 − 43 x − 61 x2 )
∴ y = c1 + c2 ex + c3 e2x + − 45 x − 34 x2 − 16 x3 ⊡

Q2. Solve the IVP: y ′′′ + y ′ = x + 2; y(0) = y ′ (0) = 0; y ′′ (0) = 1


Solution:
CE: λ3 + λ = 0; =⇒ λ = 0(r = 1); λ = ±i
=⇒ yc = c1 + c2 cos x + c3 sin x
For yp :
Take yp = x(A0 + A1 x). Differentiate yp thrice, substitute into the DE and solve for the Ai s to
find that A0 = 2; A1 = 1/2
=⇒ yp = x(2 + 12 x)
=⇒ y = c1 + c2 cos x + c3 sin x + 2x + 12 x2
From initial conditions, one at a time, we see that c1 = c2 = 0, c3 = −2.
∴ y = −2 sin x + 2x + 21 x2 ⊡

3.4.2 Case 2: g(x) has exponential form

– yc is obtained as usual.
–for yp : Trial solution: yp = (A0 + A1 x + · · · + Am xm )eαx if α is not a root for yc .
–if α is a characteristic root of multiplicity r > 0, then the trial solution is:
yp = xr (A0 + A1 x + · · · + Am xm )eαx
–the general solution is then; y = yc + yp .

Q3. Solve the DE: N ′′′ − N = xex


Solution:
CE: λ3 − 1 = 0; ⇒ (λ − 1)(λ2 + λ + 1) = 0 be ware of λ3 = 1!!!

i 3
=⇒ λ = (1, − 12 ± 2
)
1
√ √
=⇒ yc = c1 ex + e− 2 x (c2 cos 2
3
x + c3 sin 2
3
x)
For yp : Note that α = λ = 1 (multiplicity 1).
=⇒ yp = x(A0 + A1 x)ex .
Differentiating it three times and substituting into the DE and solving (by equating coeffi-
cients), we find that A1 = 1/6, A0 = −1/3.
=⇒ yp = x(− 13 + 61 x)ex
1
√ √
∴ y = c1 ex + e− 2 x (c2 cos 2
3
x + c3 sin 2
3
x) + x(− 31 + 16 x)ex ⊡

46
3.4.3 Case 3 and 4: g(x) has transcendental form

The trial solution for either of the transcendental form is,

yp = eαx (A0 + A1 x + · · · + Am xm ) cos βx + eαx (B0 + B1 x + · · · + Bm xm ) sin βx

where α + iβ is not a characteristic root of the associated homogeneous equation. If α + iβ


is a characteristic root of multiplicity r > 0, the trial solution is of the form,

yp = eαx xr (A0 + A1 x + · · · + Am xm ) cos βx + eαx xr (B0 + B1 x + · · · + Bm xm ) sin βx

Q4. Find the solution to the DE: y ′′′ + 8y = sin x.


Solution:
CE: λ3 + 8 = 0; ⇒ (λ + 2)(λ2 − 2λ + 4) = 0 be ware of λ3 = −8!!!
√ √ √
=⇒ λ = (−2, 1 ± i 3); ∴ yc = c1 e−2x + ex (c2 cos 3x + c3 sin 3x)
For yp , use yp = A0 cos x + B0 sin x.
Differentiate thrice, substitute into the DE and solve to find that A0 = 1/65; B0 = 8/65.
√ √
∴ y = c1 e−2x + ex (c2 cos 3x + c3 sin 3x) + 651
(cos x + 8 sin x) ⊡

EER:
See Exercise 4.3 (Nos 1–20), page 222, Miller 2008.

3.5 Variation of Parameters

Consider the second order DE:

a2 y ′′ + a1 y ′ + a0 y = f (x)

OR
y ′′ + p(x)y ′ + q(x)y = g(x)

If y1 and y2 are two LI solutions of the second equation, then y = c1 y1 + c2 y2 is also a


solution. The method of variation of parameters simply replaces c1 and c2 with functions

47
v1 (x) and v2 (x) respectively; i.e

y = v1 (x)y1 + v2 (x)y2

The replacements are made while obtaining the trial solution, yp . Hence

yp = v1 (x)y1 + v2 (x)y2 .

=⇒ yp′ = v1 y1′ + v1′ y1 + v2 y2′ + v2′ y2

To ease calculations, set v1′ y1 + v2′ y2 to zero so that

yp′ = v1 y1′ + v2 y2′

=⇒ yp′′ = v1 y1′′ + v1′ y1′ + v2 y2′′ + v2′ y2′

When yp′′ is substituted into the standard 2nd order DE: y ′′ + b1 y ′ + b0 y = g(x) and simplified,
we obtain the equations:
v1′ y1 + v2′ y2 = 0

v1′ y1′ + v2′ y2′ = g(x)

Solving for v1′ and v2′ , we get,

−gy2 gy1
v1′ = and v2′ =
y1 y2′ − y2 y1′ y1 y2′ − y2 y1′

Recall that W (y1 , y2 ) = y1 y2′ − y2 y1′ .

−gy2
Z Z
gy1
∴ v1 = dx and v2 = dx
W (y1 , y2 ) W (y1 , y2 )
For example:
Solve the DE: y ′′ + y = tan x; x ∈ (− π2 , π2 ).
Solution:
AQE: λ2 + 1 = 0; =⇒ λ = ±i
=⇒ y1 = cos x and y2 = sin x =⇒ yp = v1 cos x + v2 sin x Differentiating yp twice (not-
ing that v1′ cos x + v2′ sin x = 0), substituting into the DE and solving the resulting equation

48
simultaneously, we get,

v1 = sin x − ln (| sec x + tan x|) and v2 = − cos x

Substituting and simplifying for yp ;

yp = − cos x × ln (| sec x + tan x|)

The general solution is then given as,

y = yc + yp = c1 cos x + c2 sin x − cos x × ln (| sec x + tan x|)

Example 2:
ex
Solve: y ′′ − 2y ′ + y = (1+x2 )
using the method of variation of parameters.
Solution:
AQE: λ2 − 2λ + 1 = 0; =⇒ λ = 1(repeated, r = 1).
=⇒ yc = c1 ex + c2 xex
Trial solution: yp = v1 ex + v2 xex . Differentiate twice, substitute into the DE and solve the
resulting equation to give v2 = tan−1 x and v1 = − 12 ln (1 + x2 )
⇒ yp = − 12 ln (1 + x2 )ex + xex tan−1 x

1
∴ y = c1 ex + c2 xex − ln (1 + x2 )ex + xex tan−1 x ⊡
2

3.6 Generalization

For an nth order DE, i.e an y n + an−1 y (n−1) + · · · + a1 y ′ + a0 y = g(x) with y1 , y2 , · · · , yn as LI


solutions to the homogeneous part L(y) = 0, the method of variation of parameters takes
the following form;
yp = v1 y1 + v2 y2 + · · · + vn yn .

=⇒ yp′ = v1′ y1 + v2′ y2 + · · · + vn′ yn + v1 y1′ + v2 y2′ + · · · + vn yn′ .

Setting v1′ y1 + v2′ y2 + · · · + vn′ yn to zero,

=⇒ yp′ = v1 y1′ + v2 y2′ + · · · + vn yn′ .

49
And likewise for higher derivatives.
The Wronskian is obtained from.

y1 y2 ··· yn
y1′ y2′ ··· yn′
W(y1 , · · · , yn ) = .. .. .. ̸= 0
. . ··· .
(n−1) (n−1) (n−1)
y1 y2 ··· yn

If Wk is the Wronskian obtained by replacing the k th column of W by (0, 0, · · · , g(x))T , then


by Cramer’s Rule,
Wk (x)
Vk′ =
W (x)
Z
Wk (x)
=⇒ Vk = dx
W (x)
Example:
Solve the DE, y ′′′ − y ′′ − y ′ + y = e5x
Solution:
CE: λ3 − λ2 − λ + 1 = 0
Now λ3 − λ2 − λ + 1 = (λ − 1)(λ2 − 1) = (λ − 1)2 (λ + 1)
=⇒ λ = (1, −1) with r = 2 for λ = 1.
=⇒ y1 = ex , y2 = xex , y3 = e−x ; ∴ yc = c1 ex + c2 xex + c3 e−x
now the Wronskian:
ex xex e−x
W (y1 , y2 , y3 ) = ex (x + 1)ex −e−x = 4ex
ex (x + 2)ex e−x

0 xex e−x
=⇒ W1 = 0 (x + 1)ex −e−x = (−2x − 1)e5x
e5x (x + 2)ex e−x

ex 0 e−x
=⇒ W2 = ex 0 −e−x = −2e5x
ex e5x e−x

50
ex xex 0
=⇒ W3 = ex (x + 1)ex 0 = e7x
ex (x + 2)ex e5x

W1
∴ V1′ = = 14 e4x − 21 xe4x
=⇒ V1 = { 41 e4x − 21 xe4x } dx = 18 (1 − 2x)e4x
R
W

Also V2′ = W 1 4x 1
e dx = − 81 e4x
R 4x
W
2
= − 2
e =⇒ V 2 = − 2

And V3′ = W = 14 e6x =⇒ V3 = 41 e6x dx = 24 1 6x


R
W
3
e
Now yp = V1 y1 + V2 y2 + V3 y3 = 16 − 38 x e5x .


 
x x −x 1 3
∴ y = c1 e + c2 xe + c3 e + − x e5x
6 8

EER:
Solve the following DEs by the method of variation of parameters:
a) y ′′ − 5y ′ + 6y = 2ex b) y ′′ − y ′ − 2y = 2e−x c) y ′′ + 4y ′ + 4y = x−2 e−2x

51

You might also like