Sma 2271: Ordinary Differential Equations: Course Content

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

SMA 2271: ORDINARY DIFFERENTIAL EQUATIONS

⃝Francis
c O. Ochieng
[email protected]

Department of Pure and Applied Mathematics


Jomo Kenyatta University of Agriculture and Technology

Course content
• Introduction to differential equations: definitions, classification of differential equations,
formation of ordinary differential equations.

• First order differential equations of first degree: solution by separation of variables, homogeneous,
exact and integrating factor.

• Second order linear differential equations: homogeneous with constant and variable coefficients,
using inverse differential operators, undetermined coefficients, variation of parameters.

• Systems of linear ordinary differential equations of first order.

• Laplace transform: methods of solution.

• Power series solutions of linear ordinary differential equations, including Bessel and Legendre
equations and functions.

• Applications: dynamics, catenaries, circuits and wave motion.

• Sets: elements, specification, finite and infinite, universal, empty and disjoint. Subsets. Venn
diagram: union, intersection, complement, difference, number of elements and logical arguments.

• Boolean algebra: truth values, logical equivalence, truth tables, NOT, OR and AND operators,
and their applications to electric circuits.

References
[1] Ordinary and Partial Differential Equations by M. D. Raisinghania. S.Chand and Company
Limited, 18th edition.

[2] Elementary Differential Equations and boundary value problems, by William E. Boyce, Richard
C. DiPrima, Wiley, 10th edition, 2013.

[3] Calculus With Analytic Geometry (5th edition) by Larson Roland E., Hostetler Robert P., and
Bruce H. Edwards

[4] Advanced Engineering Mathematics (10th ed.) by Erwin Kreyszig

[5] Calculus II Lecture Notes.

Lecture 1

1
⃝Francis
c Oketch

1 Definitions and basic concepts


Definition 1.1 (Dependent and independent variables).

 Suppose y is a function of x, i.e., y = y(x), then x is the independent variable (or input) while y
is the dependent variable (or output). In this case, the function y involves ordinary derivatives
dy d2 y d3 y
such as , , , etc.
dx dx2 dx3
 Also, suppose z is a function of x and y, i.e., z = z(x, y), then x and y are the independent
variables while z is the dependent variable. In this case, the function z involves partial derivatives
∂z ∂z ∂ 2 z ∂ 2 z ∂ 2 z
such as , , , , , etc.
∂x ∂y ∂x2 ∂x∂y ∂y 2

Definition 1.2 (Differential equation (DE)). A differential equation is an equation involving


derivatives or differentials of one or more dependent variables with respect to one or more
independent variables.

For example,

d2 y dy 2
2
+x + 3y = 2xex (1)
dx dx

∂z ∂z
x +y + 4z = x2 − y 2 (2)
∂x ∂y
There are two types of differential equations: ODE and PDE.

Definition 1.3 (Ordinary differential equation (ODE)). This is a differential equation in which the
unknown functions depend on only one independent variable.

For example, equation (1) is an ODE since it contains ordinary derivatives.

Definition 1.4 (Partial differential equation (PDE)). This is a differential equation in which the
unknown functions depend on more than one independent variables.

For example, equation (2) is a PDE since it contains partial derivatives. Other examples of PDEs are:
∂u ∂2u
 = α2 2 (1D heat equation)
∂t ∂x
∂2 u 2
2 ∂ u (1D wave equation)
 = c
∂t2 ∂x2
∂2 u ∂2u ∂2 u
 + 2 + = 0 (3D Poisson equation)
∂x2 ∂y ∂z 2

1.1 Classification of ODEs


Ordinary differential equations are classified into: order, degree, linear (or nonlinear) with constant
coefficients (or variable coefficients).

Definition 1.5 (Order of a differential equation). This is the order of the highest derivative that
occurs in the differential equation.

For example, the equation

d2 y dy
−3 + 2y = ex (3)
dx2 dx
d2 y
is of order 2 since is the highest derivative that occurs in the equation (3).
dx2

2
1.1 Classification of ODEs ⃝Francis
c Oketch

Definition 1.6 (Degree of a differential equation). This is the greatest power of the highest-order
derivative that occurs in the differential equation.
d2 y
For example, equation (3) is of degree 1 since is the highest derivative and its power is 1.
dx2
→ Note: If the differential equation involves fractional powers, then rationalize the equation by
removing the fractional powers of all derivatives.

Example(s):
1. Determine the order and degree of the following differential equations.
dy
(a) + y 2 = cos x, (order 1, degree 1)
dx
( )2
dy
(b) + y = sin x, (order 1, degree 2)
dx
( )3
d2 y dy
(c) 2
+ + y = ex , (order 2, degree 1)
dx dx
√ ( ) ( )2
d3 y dy 3 d3 y
(d) = 1 + , (order 3, degree 2) since the equation contains the term
dx3 dx dx3
after it is rationalized.

Exercise:

1. Determine the order and degree of the following differential equations.


d4 y d2 y
(a) − − 6y = 0.
dx4 dx2
( )3 ( )4 ( )5
d2 y d2 y dy
(b) + x 2 −x + 3y = ex .
dx2 dx dx
[ ( )2 ]2/3
d2 y dy
(c) − 1+ = 0.
dx2 dx

Definition 1.7 (Linear ODE). A linear ODE of order n in the dependent variable y and independent
variable x is one which can be expressed in the form

dn y dn−1 y dn−2 y d2 y dy
an (x) n
+ a n−1 (x) n−1
+ a n−2 (x) n−2
+ · · · + a2 (x) 2
+ a1 (x) + a0 (x)y = R(x), (4)
dx dx dx dx dx
where an (x) ̸= 0 and which is such that
dy
(i) There are no products of the dependent variable, y, and/or its derivatives. For example, y ,
( )3 dx
d2 y √
, y2, y, etc., are absent.
dx2

(ii) There are no transcendental functions of the dependent variable, y, and its derivatives. For
example, cos(y), ln y, ey , etc., are absent.
→ Note: trigonometric, exponential, and logarithmic functions are called transcendental functions.

Examples of linear differential equations are:


d2 y dy
 −7 − 3y = 0 - is a linear ODE with constant coefficients.
dx2 dx
d4 y 3 2
2 d y + x3 d y − e−x y = cos(x) - is a linear ODE with variable coefficients.
 x − x
dx4 dx3 dx2

3
1.2 Origin/formation of ODEs ⃝Francis
c Oketch

Definition 1.8 (Nonlinear ODE). A nonlinear ODE is an ODE that is not linear.

In other words, a nonlinear ODE doesn’t satisfy all the above two conditions. Examples of nonlinear
differential equations are:
d2 y dy dy
 2
+ xy + y 2 = ex - is nonlinear because the term xy involves a product of the dependent
dx dx dx
2
variable y and its derivative. Also, the term y involves a product of the dependent variable.
d2 y
 + cos(y) = ln x - is nonlinear because cos(y) is a transcendental function of the dependent
dx2
variable, y.

Exercise:
Classify the following ODEs into linear or nonlinear, giving reasons.
( )2
d2 y dy
(a) 2
−7 − 4y = 0.
dx dx
d3 y dy
(b) 3
−5 + 6y 2 = 9.
dx dx
( )2
d2 y dy
(c) x + x −y − 3y 2 = 0.
dx2 dx

1.2 Origin/formation of ODEs


Ordinary differential equations occur in connection to numerous problems that we encounter in various
branches of science and engineering: geometric problems, physical problems, and primitives.

1.2.1 Geometric problem

Example(s):
A curve, in two-dimensional Cartesian plane, is defined by the condition that at each point on the
curve the slope is twice the sum of the coordinates. Form an ODE from the information given.

Solution
∆y dy
The general slope/gradient of the curve is defined by lim = . Thus, from the given
∆x→0 ∆x dx
dy
information, we have = 2 (x + y), which is the required ODE.
dx

1.2.2 Physical problem

Example(s):
Powdered milk is being transformed to liquid milk at a rate that is directly proportional to the
unconverted milk. If originally there was 30kg of powdered milk. Find the ODE describing this
information.

Solution
Let y kg be the mass of converted milk at any time t. Thus, the mass of unconverted milk at time t
dy dy
is (30 − y) kg. From the given statement, we have ∝ (30 − y) ⇒ = k(30 − y), where k is a
dt dt
constant of proportionality.

4
1.2 Origin/formation of ODEs ⃝Francis
c Oketch

1.2.3 Elimination of essential arbitrary constants from primitives


Definition 1.9 (Arbitrary constants). Are undefined constants in a function.

For example, consider the function

y = ax3 + bx2 + cx2 + 3x + 4 (5)

From equation (5), the constants 3 and 4 are defined constants while a, b and c are undefined constants.
Thus, a, b and c are called arbitrary constants.

Definition 1.10 (Essential arbitrary constants). Are arbitrary constants that cannot be reduced to a
lower number of constants.

For example, equation (5) can be simplified as

y = ax3 + (b + c)x2 + 3x + 4 ⇒ y = ax3 + dx2 + 3x + 4 (6)

The arbitrary constants, a, b and c, in equation (5) are not all essential constants because they can be
reduced to 2 constants by replacing (b + c) by another constant d, as shown in equation (6). Hence,
there are only 2 essential arbitrary constants, i.e., a and d in equation (6).

Definition 1.11 (Primitive). A primitive is a function which involves essential arbitrary constants.

For example, the function (6) is called a primitive.

→ Note: to obtain a differential equation from a primitive, follow these steps:

 Step 1: Differentiate the given primitive a number of times equal to the number of essential
arbitrary constants

 Step 2: Manipulate the primitive and its derivatives algebraically to eliminate the essential
arbitrary constants.

→ Note: a primitive involving n essential arbitrary constants gives rise to a differential equation of
order n, free of arbitrary constant.

Example(s):
Obtain a differential equation associated with the following primitives

(a) y = Ae2x + Be−3x .

Solution
Since there are two essential arbitrary constants, we differentiate the given primitive 2 times.
Thus,

y = Ae2x + Be−3x · · · (i)


y ′ = 2Ae2x − 3Be−3x · · · (ii)
y ′′ = 4Ae2x + 9Be−3x · · · (iii)

Eliminate A between equations (i) to (iii):

(i) y = Ae2x + Be−3x (i) y = Ae2x + Be−3x


(ii) y ′ = 2Ae2x − 3Be−3x (iii) y ′′ = 4Ae2x + 9Be−3x
(∗) y ′ − 2y = −5Be−3x (∗∗) y ′′ − 4y = 5Be−3x

Eliminate B between equations (∗) and (∗∗):

(∗) y ′ − 2y = −5Be−3x
(∗∗) y ′′ − 4y = 5Be−3x
y ′′ + y ′ − 6y = 0

5
1.2 Origin/formation of ODEs ⃝Francis
c Oketch

Therefore, the ODE associated with the given primitive is

d2 y dy
y ′′ + y ′ − 6y = 0 or 2
+ − 6y = 0
dx dx
Alternatively, equations (i), (ii) and (iii) can be written in matrix form as
    
e2x e−3x −y A 0
 2x −3x −y ′  B  = 0
 2e −3e    
4e2x 9e−3x −y ′′ 1 0

The above matrix is a homogeneous system of equations in the unknowns A and B. To obtain a
non-trivial solution (i.e., for A ̸= 0 and B ̸= 0), the determinant of the coefficient matrix should
be equal to zero. That is,
e2x e−3x −y

2x
2e −3e−3x −y ′ = 0
2x
4e 9e−3x −y ′′
⇒ e2x [3e−3x y ′′ + 9e−3x y ′ ] − e−3x [−2e2x y ′′ + 4e2x y ′ ] − y[18e−x + 12e−x ] = 0
y ′′ + y ′ − 6y = 0

(b) y = Ax3 + Bx2 + C.

Solution
Since there are three essential arbitrary constants, we differentiate the given primitive 3 times.
Thus,

y = Ax3 + Bx2 + C · · · (i)


y ′ = 3Ax2 + 2Bx · · · (ii)
y ′′ = 6Ax + 2B · · · (iii)
y ′′′ = 6A · · · (iv)

Eliminate A between equations (i) to (iv):

(i) y = Ax3 + Bx2 + C (i) y = Ax3 + Bx2 + C (i) y = Ax3 + Bx2 + C


(ii) y ′ = 3Ax2 + 2Bx (iii) y ′′ = 6Ax + 2B (iv) y ′′′ = 6A
(∗) 3y − xy ′ = Bx2 + 3C (∗∗) 6y − x2 y ′′ = 4Bx2 + 6C (∗ ∗ ∗) 6y − x3 y ′′′ = 6Bx2 + 6C

Eliminate B between equations (∗) to (∗ ∗ ∗):

(∗) 3y − xy ′ = Bx2 + 3C (∗) 3y − xy ′ = Bx2 + 3C


(∗∗) 6y − x2 y ′′ = 4Bx2 + 6C (∗ ∗ ∗) 6y − x3 y ′′′ = 6Bx2 + 6C
(p) x2 y ′′ − 4xy ′ + 6y = 6C (q) x3 y ′′′ − 6xy ′ + 12y = 12C

Eliminate C between equations (p) and (q) and simplify to get x2 y ′′′ − 2xy ′′ + 2y ′ = 0.

(c) y = e2x (A cos x + B sin x).

Solution
Since there are two essential arbitrary constants, we need to differentiate the given primitive 2
times. Now,

y = e2x (A cos x + B sin x) ⇒ ye−2x = A cos x + B sin x (i)

Differentiating implicitly, using product rule on the left hand side, yields

e−2x [y ′ − 2y] = −A sin x + B cos x (ii)

6
1.3 Initial Value Problem ⃝Francis
c Oketch

Differentiating again yields

e−2x [y ′′ − 4y ′ + 4y] = −(A cos x + B sin x) (iii)

Substituting equation (i) into (iii) yields

e−2x [y ′′ − 4y ′ + 4y] = −ye−2x ⇒ y ′′ − 4y ′ + 5y = 0

Exercise:
1. Obtain a differential equation associated with the following primitives

(a) y = Ae2x + Bex + C. [ans: y ′′′ − 3y ′′ + 2y ′ = 0]


(b) y = A sin(4x + B) + Ce3x . [ans: y ′′′ − 3y ′′ + 16y ′ − 48y = 0]
(c) y = Ae2x + Bex + Ce−x . [ans: y ′′′ − 2y ′′ − y ′ + 2y = 0]
(d) y = Ax2 + Bx. [ans: x2 y ′′ − 2xy ′ + 2y = 0]
(e) y = e4x (A cos 3x + B sin 3x). [ans: y ′′ − 8y ′ + 25y = 0]
(f) y = x2 + Ae2x + Be3x . [ans: y ′′ − 5y ′ + 6y = 6x2 − 10x + 2]
(h) y = A cos 2x + B sin 2x. [ans: y ′′ + 4y = 0]

2. Obtain a differential equation satisfied by family of curves

(a) Ax2 + By 2 = 1. [ans: xyy ′′ + x(y ′ )2 − yy ′ = 0]


(b) x2 + y 2 + 2ax + 2by + c = 0. [ans: [1 + (y ′ )2 ]y ′′′ − 3y ′ (y ′′ )2 = 0]

1.3 Initial Value Problem


An Initial Value Problem (IVP) is a differential equation along with initial condition(s). Examples of
IVPs are:
dy
2x + 4y = 3; y(1) = −4
dx
d2 y dy 1 3
4x2 2 + 12x + 3y = 0; y(4) = , y ′ (4) = −
dx dx 8 64
→ Note: the number of initial conditions in an IVP must be equal to the order of the ODE.

1.4 Solution of differential equations


Definition 1.12 (Solution). This is any function that satisfies the differential equation.

Example(s):
1. Show that the functions y = e2x and y = Ae−3x are both solutions to the differential equation
d2 y dy
defined by 2
+ − 6y = 0 − − − (∗)
dx dx

Solution
dy d2 y
From y = e2x − − − (i) ⇒ = 2e2x and = 4e2x . Substituting these derivatives into
dx dx2
the given differential equation yields
( )
4e2x + 2e2x − 6 e2x = 0

Therefore, (i) is a solution to the given differential equation (∗).


dy d2 y
Similarly, y = Ae−3x − − − (ii) ⇒ = −3Ae2x and = 9Ae2x . Substituting these
dx dx2
derivatives into the given differential equation yields
( )
9Ae2x − 3Ae2x − 6A e−3x = 0

7
1.4 Solution of differential equations ⃝Francis
c Oketch

Therefore, (ii) is a solution to the given differential equation (∗).

→ Note: if the functions y1 , y2 , · · · , yn are independent solutions of a differential equation, then


their linear combination is also a solution to the differential equation. The linear combination
of the independent solutions is given by

y = c1 y1 + c2 y2 + · · · + cn yn ,

where ci , i = 1, 2, 3, · · · , n are arbitrary constants. Therefore, y = c1 e2x + c2 e−3x is also a


solution of the given differential equation (∗).

Exercise:

1. Verify that the given function is a solution of the corresponding differential equation.
d2 y
(a) + y = 0; y = a cos x + b sin x.
dx2
d2 y dy
(b) 4x2 2 + 12x + 3y = 0; y = x−3/2 , for x > 0.
dx dx
dy ( )
(c) + 2y = 6ex + 4xe−2x ; y = e−2x 2x2 + 2e3x + 3 .
dx
2. Find the values of a and b given that the primitive y = a + sin(bx) is a solution of the differential
d2 y
equation + 4y = 6. [ans: a = 1.5, b = ±2]
dx2
→ Note: there are two types of solutions of a differential equation: general solution and particular
solution.

1.4.1 General and particular solutions


Definition 1.13 (General solution). This is the primitive associated with the differential equation.

For example, the primitive y = mx + c is the general solution of the equation y ′′ = 0, where m and c
are essential arbitrary constants. The function y = mx + c is a family of straight lines on the xy-plane.

Definition 1.14 (Particular solution). It is obtained from the general solution by assigning numerical
values to the essential arbitrary constants.

For example, if we are given the initial conditions, say y(0) = 3 and y ′ (0) = 4, then we would get the
particular solution as y = 4x + 3. The function y = 4x + 3 is a single straight line on the xy-plane.

→ Note: general and particular solutions can further be classified as explicit or implicit.

1.4.2 Explicit and implicit solutions


Definition 1.15 (Explicit solution). A solution of an ODE is said to be explicit if it is given in the
form y = f. (x) , i.e., y is expressed as a function of x.

Definition 1.16 (Implicit solution). A solution of an ODE is said to be implicit if it is given in the
form f (x, y). = C , i.e., y is not expressed as a function of x.

dy x
For example, given the IVP = ; y(2) = −1. The implicit solution is y 2 − x2 = −3 while the
√ dx y
explicit solution is y = x2 − 3.

→ Note: the solutions of an ODE are often given implicitly.

8
⃝Francis
c Oketch

Lecture 2

2 First order and first degree ODEs


An ordinary differential equation of first order and first degree takes the general form:
. (x, y)dy = 0
M (x, y)dx + N (7)

Equation (7) can be categorized into 5 groups:


1. Separable equation

2. Homogeneous equation

3. Exact differential equation

4. Linear differential equation

5. Bernoulli’s equation

2.1 Separable equations


If equation (7) can be rearranged to take the form A(x)dx + B(y)dy = 0, then equation (7) is said to
be an equation with variables separable. The solution is then obtained by integrating directly, i.e.,
∫ ∫
A(x)dx + B(y)dy = C,

where C is a constant of integration.

Example(s):
Solve the following differential equations
dy x
(a) =
dx y

Solution
Multiplying the equation through by ydx and rearranging yields xdx − ydy = 0. Integrating
yields
∫ ∫ ∫
x2 y 2 C
xdx − ydy = 0 ⇒ − =
2 2 2
Multiplying by 2, we get the general solution as

x2 − y 2 = C,

where C is a constant of integration.

(b) (y 2 − 1)dx − 4xydy = 0

Solution
1 4y
Dividing the equation through by x(y 2 − 1), we get dx − 2 dy = 0. Integrating yields
x (y − 1)
∫ ∫ ∫
1 4y
dx − dy = 0 ⇒ ln |x| − 2 ln |y 2 − 1| = ln |C|
x (y 2 − 1)

x
Applying the laws of logarithm yields ln 2 = ln |C|. Taking exponential on both sides,
(y − 1)
2
we get
x
= C or x = C(y 2 − 1)2 ,
(y − 1)2
2

where C is a constant of integration.

9
2.1 Separable equations ⃝Francis
c Oketch

(c) (x2 y 2 + x2 + y 2 + 1)dx + (xy + y)dy = 0

Solution
The given equation can be rewritten as follows (factorization):

(x2 y 2 + x2 + y 2 + 1)dx + (xy + y)dy = 0 ⇒ (x2 + 1)(y 2 + 1)dx + y(x + 1)dy = 0


∫ ∫ ∫
x2 + 1 y
Dividing through by (x + 1)(y 2 + 1) and integrating we get dx + 2
dy = 0.
x+1 y +1
By long division,
x−1
)
x+1 x2 +1
− x2 − x
−x+1
x+1
2
x2 + 1 2
So, = (x − 1) + . Thus, we have
x+1 x+1
∫ ∫ ∫ ∫
2 y
(x − 1)dx + dx + dy = 0
x+1 y2 + 1
x2 1
⇒ − x + 2 ln |x + 1| + ln |y 2 + 1| = C
2 2

dy
(d) (x + 1) = y − y2
dx

Solution
The given equation can be rewritten as (y 2 − y)dx + (x + 1)dy = 0. Separating the variables and
integrating yields ∫ ∫ ∫
1 1
dx + dy = 0 (∗)
x+1 y(y − 1)
By partial fractions, we have
1 A B
= + ⇒ A(y − 1) + By = 1
y(y − 1) y y−1
1 1 1
Putting y = 0 yields A = −1. Also, putting y = 1 yields B = 1. Thus, = − .
y(y − 1) y−1 y
Therefore, equation (∗) becomes
∫ ∫ ( ) ∫
1 1 1
dx + − dy = 0 ⇒ ln |x + 1| + [ln |y − 1| − ln |y|] = ln |C|
x+1 y−1 y

(x + 1)(y − 1)
Applying the laws of logarithm yields ln = ln |C|. Taking exponential on both

y
sides yields
(x + 1)(y − 1)
= C or (x + 1)(y − 1) = Cy.
y

Exercise:

1. Find the general solution of the following differential equations


dy y
(a) x = y + y2. [ans: = C]
dx x(1 + y)
[ans: x2 + ln(xy) = C or xy = a1 e−x ]
2
(b) (2x2 y + y)dx + xdy = 0.

10
2.2 Reduction to separable equation ⃝Francis
c Oketch

dy y2 − 1 y−1
(c) = . [ans: = Cx2 ]
dx x y+1
(d) sin x cos ydx + cos x sin ydy = 0. [ans: cos x cos y = C]
dy
[ans: y 2 + 2y = 1 + Ce−x ]
2
(e) (y + 1) + x(y 2 + 2y) = x.
dx
(f) y(1 + x)dx + x(1 − y)dy = 0. [ans: xy = Cey−x ]
(g) tan xdy − cos2 ydx = 0. [ans: sin x = Cetan y ]
dx 2 +4t
(h) = tx + 4x + 3t + 12. [ans: x + 3 = Ce0.5t ]
dt
2. Determine the family of curves such that at each point the slope is given by 2xy 2 . [ans:
1
x2 + = C]
y
3. Show that the solution of the initial value problem (1 + y 2 )dx + (1 + x2 )dy = 0; y(0) = −1 is
xy − x − y − 1 = 0.
dy
4. Solve the initial value problem (x2 + 9) + xy = 0; y(0) = 2. [ans: y 2 (x2 + 9) = 36]
dx
dp
5. The price of shares of a blue chip company satisfy the differential equation = 0.8 − 0.2p.
dt
Show that p(t) = 4 + ce−0.2t , where c is an arbitrary constant. Hence, evaluate lim p(t) and
t→∞
interpret the results.

2.2 Reduction to separable equation


2.2.1 Substitution method
Consider equation (7) such that the functions of x and y in both M and N are scalar multiples of
each other. Then, equation (7) can be reduced to an equation with variables separable by letting the
common factor be u.

Example(s):
Solve the following differential equations

(a) (x + 2y + 1)dx + (3x + 6y + 5)dy = 0.

Solution
1
Let u = x + 2y ⇒ du = dx + 2dy ⇒ dy = (du − dx). Substituting into the given
2
differential equation, we get

1 (3u + 5)
(u + 1)dx + (3u + 5)(du − dx) = 0 ⇒ dx − du = 0
2 u+3
∫ ∫ ∫
3u + 5 3u + 5 4
Integrating yields dx − du = 0. By long division, = 3− . So we have
u+3 u+3 u+3
∫ ∫ ( ) ∫ ∫ ∫ ∫
4 4
dx − 3− du = 0 ⇒ dx − 3du + du = C
u+3 u+3
⇒ x − 3u + 4 ln |u + 3| = C
⇒ x − 3(x + 2y) + 4 ln |x + 2y + 3| = C
⇒ x + 3y − 2 ln |x + 2y + 3| = a1

dy
(b) = (x + y)2
dx

Solution

11
2.2 Reduction to separable equation ⃝Francis
c Oketch

The given equation can be rewritten as

dy − (x + y)2 dx = 0

Let u = x + y ⇒ du = dx + dy ⇒ dy = du − dx. Substituting into the given differential


equation yields
(du − dx) − u2 dx = 0 ⇒ du − (1 + u2 )dx = 0
Rearranging and integrating we get
∫ ∫
du
= dx (∗)
1 + u2
Let u = tan θ ⇒ du = sec2 θdθ. Therefore, equation (∗) becomes
∫  ∫ ∫ ∫
sec2 θdθ
⇒ ⇒
2
= dx dθ = dx θ = x + C,
1+
 tan θ
where C is a constant of integration. Back substitution yields

tan−1 (u) = x + C ⇒ tan−1 (x + y) = x + C ⇒ x + y = tan (x + C)

dy
(c) = sin(x + y).
dx

Solution
The given equation can be rewritten as

sin(x + y)dx − dy = 0

Let u = x + y ⇒ du = dx + dy ⇒ dy = du − dx. Substituting into the given differential


equation yields
sin udx − (du − dx) = 0 ⇒ (1 + sin u)dx − du = 0
Rearranging and integrating we get
∫ ∫ ∫
du
dx − = 0 (∗)
1 + sin u
Using the t-method of substitution, let t = tan( u2 ).
( )
dt 1 u 2dt 2dt 2dt
⇒ = sec2 ⇒ du = 2 u = 2
(u) =
du 2 2 sec ( 2 ) 1 + tan 2 1 + t2

Consider the following triangle

√ ( ) ( ) ( )
1 + t2 u u u u 2t
sin u = sin + = 2 sin cos =
t 2 2 2 2 1 + t2
u
. 2 du 2dt/(1 + t2 ) 2dt 2dt
∴ = 2t = 2 =
1 1 + sin u 1 + 1+t 2 t + 2t + 1 (t + 1)2

Therefore, equation (∗) becomes


∫ ∫ ∫
2dt 2
dx − = 0 ⇒ x+ = C,
(t + 1)2 t+1
where C is a constant of integration. Back substitution yields
2 2
x+ (u) =C ⇒ x+ ( ) =C
tan 2 +1 tan x+y
+1
2

12
2.2 Reduction to separable equation ⃝Francis
c Oketch

Exercise:

1. Find the general solution of the following differential equations


dy ( )
(a) = sin(x + y) + cos(x + y). [hint: put u = x + y, ans: 1 + tan x+y2 = Cex ]
dx
(b) (x + y)dx + (3x + 3y − 4)dy = 0. [hint: put u = x + y, ans: x + 3y + 2 ln(x + y − 2) = C]
dy x+y+4
(c) = . [hint: put u = x + y, ans: x − y + 5 ln |x + y − 1| = C]
dx x+y−6
dy x+y+1 2 1
(d) = . [hint: put u = x + y, ans: (x + y) + ln |3x + 3y + 4| = x + C]
dx 2y + 3 + 2x 3 9
dy 1 ( )
(e) = (4x + y + 1)2 . [hint: put u = 4x + y + 1, ans: tan−1 4x+y+1 2 = x + C]
dx 2 ( )
x+y
(f) cos(x + y)dy = dx. [hint: put u = x + y, ans: y − tan 2 = C]
(g) (3y + 2x + 4)dx − (4x + 6y + 5)dy = 0. [hint: put u = 2x + 3y, ans: ]
dy
2. Solve the initial value problem = (4x + y + 1)2 ; y(0) = 1. [hint: put u = 4x + y + 1, ans:
π
dx
4x + y + 1 = 2 tan(2x + 4 )]

13
2.2 Reduction to separable equation ⃝Francis
c Oketch

Lecture 3

2.2.2 Homogeneous equations


A function f (x, y) is said to be homogeneous of degree n if and only if there exists a positive real
number λ such that
f (λx, λy) =. λn f (x, y)

For example,

Let f (x, y) = x3 + x2 y + 4y 2 x
⇒ f (λx, λy) = (λx)3 + (λx)2 (λy) + 4(λy)2 (λx)
= λ3 x3 + λ3 x2 y + 4λ3 y 2 x
= λ3 (x3 + x2 y + 4y 2 x)
= λ3 f (x, y)

Therefore, f (x, y) is homogeneous of degree 3. Equation (7) is said to be homogeneous if and only if
both M (x, y) and N (x, y) are homogeneous and of the same degree.

→ Note: alternative ways of verifying a homogeneous ODE

 If the sum of the powers of the variables in each term of equation (7) is the same, then the ODE
is said to be homogeneous of degree equal to the sum.

dy . y
 If equation (7) can be rewritten to take the form = g( ) , then the ODE is said to be
dx x
homogeneous.

If equation (7) is homogeneous, then the substitution y = ux reduces it to an equation with variables
separable as follows.
y = ux ⇒ dy = udx + xdu
Thus, equation (7) reduces to the simpler form

M (x, ux)dx + N (x, ux)[udx + xdu] = 0


⇒ xn M (u)dx + xn N (u)[udx + xdu] = 0, x ̸= 0
⇒ [M (u) + uN (u)]dx + xN (u)du = 0
dx N (u)du
⇒ + = 0
x M (u) + uN (u)
∫ ∫ ∫
dx N (u)du
⇒ + = 0
x M (u) + uN (u)

N (u)du
⇒ ln |x| + = C
M (u) + uN (u)

Example(s):
Solve the following differential equations
dy
(a) xy = y 2 + 2x2 .
dx

Solution
The given differential equation can be written as (y 2 + 2x2 )dx − xydy = 0 − − − (∗). Clearly,
equation (∗) is homogeneous of degree 2. Next, let

y = ux ⇒ dy = udx + xdu

14
2.2 Reduction to separable equation ⃝Francis
c Oketch

Substituting into equation (∗) yields


( ) ( )
u2 x2 + 2x2 dx − x2 u(udx + xdu) = 0 ⇒ u2 + 2 dx − u(udx + xdu) = 0
∫ ∫ ∫
2dx
⇒ 2dx − xudu = 0 ⇒ − udu = 0
x
1 ( )
⇒ 2 ln |x| − u2 = −C ⇒ u2 = 2 C + ln(x2 ) ⇒ y 2 = 2x2 (C + ln x2 )
2
(√ )
(b) x2 − y 2 dx = ydx − xdy.

Solution
Clearly, the given equation is homogeneous of degree 1. Next, let

y = ux ⇒ dy = udx + xdu

Substituting into the given differential equation yields


(√ ) (√ )
x2 − u2 x2 − ux dx + x(udx + xdu) = 0 ⇒ 1 − u2 − u dx + (udx + xdu) = 0
(√ ) ∫ ∫ ∫
dx du
⇒ 1 − u2 dx + xdu = 0 ⇒ + √ = 0, [hint: put u = sin θ]
x 1 − u2
( )
−1 y −1 y
⇒ ln |x| + sin−1 u = − ln |C| ⇒ − sin = ln |Cx| ⇒ Cx = e− sin ( x )
x

dy
(c) x = x cos(y/x) + y.
dx

Solution
( )
dy y y
The given differential equation can be written as = cos + − − − (∗). Clearly, equation
dx x x
(∗) is homogeneous of degree 1. Next, let

y = ux ⇒ dy = udx + xdu

Substituting into equation (∗) yields

udx + xdu du du
= cos (u) + u ⇒ u+x = cos (u) + u ⇒ x = cos (u)
dx dx dx
Separating the variables and integrating yields
∫ ∫ ∫ ∫
1 1 1
du = dx ⇒ sec(u)du = dx ⇒ ln | sec u + tan u| = ln |x| + ln |C|
cos u x x
Applying the laws of logarithms, we have

sec u + tan u = Cx

Back substitution yields


sec(y/x) + tan(y/x) = Cx

Exercise:

1. Find the general solution of the following differential equations.


dy y2 x
(a) x =y+ [ans: − = ln x + C]
dx x y

(b) xdy − ydx = x2 + y 2 dx [ans: sinh−1 (y/x) = ln x + C]

15
2.3 Equations reducible to homogeneous equations ⃝Francis
c Oketch

dy √ 1√ 2
(c) xy = y 2 + x x2 + y 2 [ans: x + y 2 = ln x + C]
dx x
dy 2xy + 3y 2
(d) = 2 [ans: x3 = C(xy + y 2 )]
dx x + 2xy
y3
(e) (y 3 + x4 cos x)dx − xy 2 dy = 0 [ans: = 3 sin x + C]
x3
( ) ( )
2. Solve the initial value problem 3x2 + 9xy + 5y 2 dx − 6x2 + 4xy dy = 0; y(2) = −6. [ans:
2( 2 )2
x5 = y + 3xy + 3x2 ]
9

2.3 Equations reducible to homogeneous equations


Consider the differential equation of the form
dy a1 x + b1 y + c1
= (8)
dx a2 x + b2 y + c2
a1 b1
̸= , a2 ̸= 0, b2 ̸= 0, and at least c1 ̸= 0 or c2 ̸= 0. In
where a1 , b1 , c1 , a2 , b2 , c2 are constants,
a2 b2
general, equation (8) is non-homogeneous and can be reduced to a homogeneous equation by making
the following substitutions. Let
x = X + h, y = Y + k,
where h and k are constants to be determine. Thus, the differentials become dx = dX and dy = dY .
Under these transformations, equation (8) becomes

dY a1 X + b1 Y + (a1 h + b1 k + c1 )
= (∗)
dX a2 X + b2 Y + (a2 h + b2 k + c2 )

In order for equation (∗) to be homogeneous, we impose the condition that a1 h + b1 k + c1 = 0 and
a2 h + b2 k + c2 = 0. Solving these simultaneously yields the value of h and k. Thus, equation (∗)
reduces to
dY a1 X + b1 Y
= ,
dX a2 X + b2 Y
which is homogeneous of degree 1 in X, Y and can be solved by making the substitution Y = U X
(where U is a function of X) and dY = U dX + XdU .

Example(s):

dy y+x−2
(a) Solve = .
dx y−x−4

Solution
The given equation can be rewritten as
dy x+y−2
= (∗)
dx −x + y − 4
a1 b1
Here, a1 = 1, a2 = −1, b1 = 1, b2 = 1. Clearly, equation (∗) is non-homogeneous and ̸= .
a2 b2
 Step 1: Reduce equation (∗) to a homogeneous equation by making the following
substitutions.

Let x = X + h, y = Y + k ⇒ dx = dX, dy = dY . Substituting into equation (∗)


yields
dY X + Y + (h + k − 2)
= (∗∗)
dX −X + Y + (−h + k − 4)

16
2.3 Equations reducible to homogeneous equations ⃝Francis
c Oketch

In order for equation (∗∗) to be homogeneous, impose the condition that h + k − 2 = 0 and
−h + k − 4 = 0. Solving these simultaneously yields h = −1 and k = 3. Thus, equation
(∗∗) reduces to the simpler form

dY X +Y
= ⇒ (X + Y )dX − (−X + Y )dY = 0, (∗ ∗ ∗)
dX −X + Y
which is a homogeneous equation of degree 1 in the new variables X and Y .
 Step 2: Solve the homogeneous equation (∗ ∗ ∗).

Let Y = U X ⇒ dY = U dX + XdU . Substituting into equation (∗ ∗ ∗) yields

(X +U X)dX −(−X +U X)[U dX +XdU ] = 0 ⇒ (1+U )dX +(1−U )[U dX +XdU ] = 0

⇒ (1 + 2U − U 2 )dX + (1 − U )XdU = 0
Separating the variables and integrating, we have
∫ ∫ ∫
1 1−U 1 1
dX + dU = 0 ⇒ ln |X| + ln |1 + 2U − U 2 | = ln |C|
X (1 + 2U − U 2 ) 2 2

Applying the laws of logarithm, we obtain

X 2 (1 + 2U − U 2 ) = C

Y
Back substitution yields (put U = )
X
Y Y2
X 2 (1 + 2 − 2) = C ⇒ X 2 + 2XY − Y 2 = C
X X
Expressing X and Y in terms of x and y, respectively, we get

x=X +h ⇒ x=X −1 ⇒ X =x+1

y =Y +k ⇒ y =Y +3 ⇒ Y =y−3
Thus, replacing X and Y yields the general solution as

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

Exercise:
Solve the following differential equations
dy x − 2y − 3
(a) = . [ans: (y + 2)2 + 4(x + 1)(y + 2) − (x + 1)2 = c]
dx 2x + y + 4
−1 y−1
(b) (x + 3y − 4)dx − (3x − y − 2)dy = 0. [ans: (x − 1)2 + (y − 1)2 = Ae6 tan ( x−1 ) ]
dy x+y−2 [ { }] ( )
(c) = . [ans: ln C (y − 2)2 + x2 = 2 tan−1 y−2
]
dx x−y+2 x

dy y+x−5
(d) = . [ans: ]
dx y − 3x − 1
dy 2x + 2y − 2
(e) = . [ans: (y − x + 3)4 = c(2x + y − 3)]
dx 3x + y − 5
(f) (x + 2y − 2)dx + (2x − y + 3)dy = 0. [ans: x2 + 4xy − y 2 − 4x + 6y = c]

(g) (x + 2y − 3)dx − (2x − y + 1)dy = 0. [ans: 5(x2 + xy + y 2 ) − 9x − 15y = c]

17
2.4 Exact differential equations ⃝Francis
c Oketch

Lecture 4

2.4 Exact differential equations


Equation (7) is said to be an exact differential if there exists a function (or solution) ϕ(x, y) (read as
“phi”) such that the total differential of phi (dϕ) is equal to the left-hand side of equation (7). That
is,
dϕ = M (x, y)dx + N (x, y)dy (∗)
∂ϕ ∂ϕ
From differential calculus, we have dϕ = dx + dy. Thus, equation (∗) becomes
∂x ∂y
∂ϕ ∂ϕ
dx + dy = M (x, y)dx + N (x, y)dy
∂x ∂y
Equating the coefficients of the corresponding differentials, we have
∂ϕ ∂ϕ
M (x, y) = − −(i), and N (x, y) = − −(ii)
∂x ∂y

Differentiating equation (i) partially with respect to y and equation (ii) partially with respect to x,
we get

∂M ∂2ϕ ∂N ∂2ϕ
= and = ,
∂y ∂y∂x ∂x ∂x∂y

∂2ϕ ∂2ϕ
respectively. From differential calculus, = . Therefore,
∂y∂x ∂x∂y

∂M . ∂N
= (9)
∂y ∂x

Equation (9) is the necessary and sufficient condition for equation (7) to be exact. Now, from equation
(i), we have ∂ϕ = M (x, y)∂x. Integrating yields
∫ ∫ ∫
∂ϕ = M (x, y)∂x ⇒ ϕ(x, y) = M (x, y)∂x + g(y), (∗∗)

where g is an arbitrary function. Equation (∗∗) is the solution of equation (7) so long as g(y) is
determined as follows: differentiating (∗∗) partially with respect to y, we get

∂ϕ ∂
= M (x, y)∂x + g ′ (y)
∂y ∂y


Comparing with equation (ii), we obtain M (x, y)∂x + g ′ (y) = N (x, y). Therefore,
∂y
∫ [ ∫ ]

g(y) = N (x, y) − M (x, y)∂x dy + C,
∂y
where C is a constant of integration.

Example(s):
Verify that the following differential equations are exact and hence find their general solutions.

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

Solution
First, we need to test whether the given differential equation is exact. Here,

M = x + 2y − 2 and N = 2x − y + 3

18
2.4 Exact differential equations ⃝Francis
c Oketch

∂M ∂N
⇒ =2 and =2
∂y ∂x
∂M ∂N
Since = = 2, therefore, the given differential equation is exact. Now, let the solution
∂y ∂x
to the given differential equation be ϕ(x, y) (which we need to determine) such that dϕ =
M dx + N dy. That is,
∂ϕ ∂ϕ
dx + dy = (x + 2y − 2)dx + (2x − y + 3)dy
∂x ∂y
Equating the coefficients of the corresponding differentials, we have
∂ϕ ∂ϕ
= x + 2y − 2 − − − (i) and = 2x − y + 3 − − − (ii)
∂x ∂y
From equation (i), we have ∂ϕ = (x + 2y − 2) ∂x. Integrating partially with respect to x, yields
∫ ∫
∂ϕ = (x + 2y − 2)∂x + g(y)

Thus,
1
ϕ(x, y) = x2 + 2xy − 2x + g(y), (∗)
2
where g(y) is an arbitrary function of integration. Equation (∗) is the solution provided g(y) is
determined. Differentiating equation (∗) partially with respect to y yields
∂ϕ
= 2x + g ′ (y)
∂y
Comparing with equation (ii), we have

1
2x + g ′ (y) = 2x − y + 3 ⇒ g ′ (y) = −y + 3 ⇒ g (y) = (−y + 3)dy = − y 2 + 3y + C
2
Therefore, the solution (∗) of the given differential equation is
1 1
ϕ(x, y) = x2 + 2xy − 2x − y 2 + 3y + C
2 2
Hence, the general solution of the given differential equation is given implicitly by
1 2 1
x + 2xy − 2x − y 2 + 3y = C1
2 2
or
x2 + 4xy − 4x − y 2 + 6y = c,
where c is an arbitrary constant.

(b) (x3 + x tan y)dx + (y ln y + 12 x2 sec2 y)dy = 0.

Solution
First, we need to test whether the given differential equation is exact. Here,
1
M = x3 + x tan y and N = y ln y + x2 sec2 y
2
∂M ∂N
⇒ = x sec2 y and = x sec2 y
∂y ∂x
∂M ∂N
Since = = x sec2 y, therefore, the given differential equation is exact. Now, let the
∂y ∂x
solution to the given differential equation be ϕ(x, y) (which we need to determine) such that
dϕ = M dx + N dy. That is,
∂ϕ ∂ϕ 1
dx + dy = (x3 + x tan y)dx + (y ln y + x2 sec2 y)dy
∂x ∂y 2

19
2.4 Exact differential equations ⃝Francis
c Oketch

Equating the coefficients of the corresponding differentials, we have


∂ϕ ∂ϕ 1
= x3 + x tan y − − − (i) and = y ln y + x2 sec2 y − − − (ii)
∂y ∂x 2
From (i), we have ∂ϕ = (2xy + cos y) ∂x. Integrating partially with respect to x, yields
∫ ∫
∂ϕ = (x3 + x tan y)∂x + g(y)

Thus,
x4 1 2
ϕ(x, y) =
+ x tan y + g(y), (∗)
4 2
where g(y) is an arbitrary function of integration. Equation (∗) is the solution provided g(y) is
determined. Differentiating equation (∗) partially with respect to y yields
∂ϕ 1
= x2 sec2 y + g ′ (y)
∂y 2
Comparing with equation (ii), we have

1 2 2 1
x sec y + g ′ (y) = y ln y + x2 sec2 y ⇒ ′
g (y) = y ln y ⇒ g (y) = y ln ydy + C
2 2
Integration by parts yields [hint: put u = ln y, dv = ydy]:
( )
1 1
g(y) = y 2 ln y − +C
2 2
Therefore, the solution (∗) of the given differential equation is
( )
1 1 1 1
ϕ(x, y) = x4 + x2 tan y + y 2 ln y − +C
4 2 2 2
Hence, the general solution of the given differential equation is given implicitly by
( )
1 4 1 2 1 1
x + x tan y + y 2 ln y − = C1
4 2 2 2
or
x4 + 2x2 tan y + y 2 (2 ln |y| − 1) = c,
where c is an arbitrary constant.

Exercise:

1. Verify that the following differential equations are exact and hence find their general solutions.

(a) (2x + sin x tan y)dx − cos x sec2 ydy = 0. [ans x2 − cos x tan y = c]
(b) (3x2 + 4xy)dx + (2x2 + 2y)dy = 0. [ans x3 + 2x2 y + y 2 = c]
3 1 2
(c) (3xy 4 + x)dx + (6x2 y 3 − 2y 2 + 7)dy = 0. [ans: x2 y 4 + x2 − y 3 + 7y = c]
2 2 3
( )
(d) (2x + 3y cos(xy)) dx + 2e2y + 3x cos(xy) dy = 0. [ans: x + 3 sin(xy) + e2y = c]
2
( 2
) ( 2
) 2
(e) y 2 exy + 4x3 dx + 2xyexy − 3y 2 dy = 0. [ans: exy + x4 − y 3 = c]
( ) dy
(f) (y cos x + 2xey ) + sin x + x2 ey − 1 = 0. [ans: y sin x + x2 ey − y = c]
dx
dy 2x − y
(g) = . [ans: x2 − xy − y 2 + 5y = c]
dx x + 2y − 5
2. (a) Find the value of n such that when the differential equation (x + y 3 )dx + 6xy 2 dy = 0 is
multiplied by xn makes it exact and hence solve it. [ans:
n = − 2 , ϕ(x, y) = 2x y + 3 x + C]
1 1/2 3 2 3/2

20
2.5 Linear differential equations of first-order ⃝Francis
c Oketch

(b) Show that the homogeneous equation (Ax2 + Bxy + Cy 2 )dx + (Dx2 + Exy + F y 2 )dy = 0
is exact if B = 2D and E = 2C.
dy
(c) Find the values of the constant λ such that (2xey + 3y 2 ) + (3x2 + λey ) = 0 is exact.
dx
Further, for this value of λ, solve the equation. [ans: λ = 2, x3 + 2xey + y 3 = c]
( ) ( )
3−y y 2 − 2x
3. Show that the differential equation dx + dy = 0 is exact. Hence, find ϕ(x, y)
x2 xy 2
y−3 2
given that ϕ(−1, 2) = 0. [ans: ϕ(x, y) = + − 2]
x y

2.5 Linear differential equations of first-order


Suppose equation (7) can be rewritten to take the form
dy
+ P (x)y = Q(x), (10)
dx
then equation (10) is said to be linear in the dependent variable y. In general, equation (10) is not
exact and it can be transformed to an exact differential equation by multiplying the equation by
an integrating factor denoted by I(x), which is a function of the independent variable x. The
integrating factor (I.F) is defined by

I(x) = e. P (x)dx
(11)

Proof. Multiplying equation (10) by I(x), we get


dy
I(x) + I(x)P (x)y = I(x)Q(x) ⇒ [I(x)P (x)y − I(x)Q(x)] dx + I(x)dy = 0 (∗)
dx
Comparing equation (∗) with equation (7), we have
M (x, y) = I(x)P (x)y − I(x)Q(x) and N (x, y) = I(x)
∂M ∂N
Since equation (∗) is exact, we require that = . Now,
∂y ∂x
∂M ∂N dI(x)
= I(x)P (x) and = I ′ (x) =
∂y ∂x dx
dI(x) dI(x)
Equating yields = I(x)P (x). Separating the variables, we get = P (x)dx. Integrating
dx I(x)
yields ∫ ∫ ∫
dI(x)
= P (x)dx ⇒ ln [I(x)] = P (x)dx
I(x)

P (x)dx
Taking exponential on both sides yields I(x) = e .

→ Note: in finding the integrating factor, we don’t write the constant of integration.

To solve equation (10), we first determine an integrating factor of the form (11). Then, multiplying
the equation by the integrating factor yields
∫ ∫ ∫ d ( ∫ ) ∫
P (x)dx dy
e + P (x)e P (x)dx
y = Q(x)e P (x)dx
⇒ ye P (x)dx
= Q(x)e P (x)dx
dx dx
Integrating both sides with respect to x yields
∫ ∫ ∫
P (x)dx P (x)dx
ye = Q(x)e dx + C

This is the general solution of a linear ODE of first-order, where C is a constant of integration (or a
parameter).

Example(s):
Solve the following differential equations

21
2.5 Linear differential equations of first-order ⃝Francis
c Oketch

dy
(a) + 2y = 1.
dx

Solution
The
∫ given differential
∫ equation is linear in the dependent variable y. Here, P (x) = 2 ⇒
P (x)dx = 2dx = 2x. Therefore, the integrating factor is

P (x)dx
I.F = e = e2x

Multiplying the given differential equation by e2x yields


dy d ( 2x )
e2x + 2e2x y = e2x ⇒ ye = e2x · · · (∗)
dx dx
→ Note: after multiplying a linear differential equation of first-order by an integrating factor,
the left-hand side of the resulting equation is expressed as the derivative with respect to the
independent variable of the product of the dependent variable and the integrating factor.

( )
Multiplying equation (∗) through by dx, we get d ye2x = e2x dx. Integrating yields

1 1
ye2x = e2x dx ⇒ ye2x = e2x + C ⇒ y= + Ce−2x
2 2
1
Thus, the solution is y = + Ce−2x , where C is a constant of integration (or a parameter).
2
(b) (y + x3 )dx − xdy = 0.

Solution
The given differential equation can be rewritten as
dy 1
− y = x2 · · · (∗) (linear ODE in dependent variable y)
dx x
∫ ∫
1 1
Here, P (x) = − ⇒ P (x)dx = − dx = − ln x = ln(1/x). Therefore, the integrating
x x
factor is ∫
P (x)dx 1
I.F = e = eln(1/x) =
x
1
Multiplying equation (∗) by yields
x
( )
1 dy 1 d y
− y=x ⇒ =x
x dx x2 dx x
Integrating with respect to x yields

y y 1 1
= xdx ⇒ = x2 + C ⇒ y = x3 + Cx
x x 2 2
1
Thus, the solution is y = x3 + Cx, where C is a constant of integration.
2
(c) y 2 dx + (2xy − 4y 3 )dy = 0.

Solution
The given differential equation can be rewritten as
dx 2
+ x = 4y · · · (∗) (linear ODE in dependent variable x)
dy y

22
2.5 Linear differential equations of first-order ⃝Francis
c Oketch

∫ ∫
2 2
Here, P (y) = ⇒ P (y)dy = dy = 2 ln y = ln(y 2 ). Therefore, the integrating factor
y y
is ∫ 2
I.F = e P (y)dy
= eln(y ) = y 2
Multiplying equation (∗) by y 2 yields

dx d ( 2)
y2 + 2yx = 4y 3 ⇒ xy = 4y 3
dy dy
Integrating with respect to y yields

xy 2 = 4y 3 dy ⇒ xy 2 = y 4 + C

Thus, the solution is xy 2 = y 4 + C, where C is a constant of integration.

Exercise:

1. Find the general solution of the following differential equations


dy
[ans: y = 1 + Ce−x ]
2
(a) + 2xy = 2x.
dx
dy
(b) + y tan x = sin 2x. [ans: y = −2 cos2 x + C cos x]
dx
(c) (1 + y)dx − (1 − y + xy)dy = 0. [hint: linear in x, ans: x(1 + y) = y + Cey ]
( ) −1
(d) (1 + y 2 )dx + x − tan−1 y dy = 0. [hint: linear in x, ans: x + 1 − tan−1 (y) = Ce− tan y ]
dy y
(e) x − 2y = x4 ex . [ans: 2 = (x − 1)ex + C]
dx x
dy y
(f) x − 2y = x6 sin x. [ans: 2 = (6x − x3 ) cos x + (3x2 − 6) sin x + C
dx x
dy
(g) tan x + y = sec x. [ans: y sin x + ln(cos x) = C]
dx
dy
(h) (x + 2y 3 ) = y. [hint: linear in x, ans: x/y = y 2 + C]
dx
df (y) dy
2. Show that the transformation u = f (y) reduces the equation · + P (x)f (y) = Q(x) to
dy dx
a linear differential equation. Hence, solve
dy
[ans: y 2 + 2y = 1 + Ce−x ]
2
(a) (y + 1) + x(y 2 + 2y) = x.
dx
dy 1
[ans: tan y = (x2 − 1) + Ce−x ]
2
(b) + x sin(2y) = x3 cos2 (y).
dx 2
3. Solve the following initial value problems.
dC 2 12
(a) t2 + 2tC = 2; C(2) = 4. [ans: C = + 2]
dt t t
dy
(b) + ky = b sin(mx); y(0) = 1, where b, k and m are constants. [ans:
dx ( )
b {k sin(mx) − m cos(mx)} + k 2 + m2 + bm
y= ]
k 2 + m2

23
2.6 Bernoulli’s equation ⃝Francis
c Oketch

Lecture 5

2.6 Bernoulli’s equation


This is a differential equation of the form
dy
+ P (x)y = Q(x)y n , (12)
dx
where n is a real number. Equation (12) is linear if n = 0 or n = 1 (separable equation). Otherwise,
it is nonlinear and can be reduced to a linear equation by making the following substitution.

z = y. 1−n

Proof. Dividing equation (12) by y n yields

dy
y −n + P (x)y 1−n = Q(x) (13)
dx
Let z = y 1−n . Differentiating both sides with respect to the independent variable x, using chain rule,
dz dz dy
we have = . Thus,
dx dy dx
dz dy dy 1 dz
= (1 − n)y −n ⇒ y −n =
dx dx dx 1 − n dx
1 dz
Substituting into equation (13), we get + P (x)z = Q(x). Multiplying through by (1 − n)
1 − n dx
yields
dz
+ (1 − n)P (x)z = (1 − n)Q(x),
dx
which is a linear ODE in the dependent variable z and independent variable x.

→ Note: to solve a nonlinear ODE of Bernoulli’s type, follow these steps

 Step 1: Reduce the Bernoulli’s equation to a linear ODE.

 Step 2: Solve the resulting linear ODE by the integrating factor method.

Example(s):

1. Find the general solution of the following differential equations

dy y
(a) − = y3.
dx x
Solution
Dividing the given ODE by y 3 , we get
dy 1
y −3 − y −2 = 1 − − − (∗)
dx x
dz dz dy dy dy 1 dz
Let z = y −2 . From chain rule, = = −2y −3 ⇒ y −3 = − .
dx dy dx dx dx 2 dx
Substituting into equation (∗) yields

1 dz 1
− − z=1
2 dx x

24
2.6 Bernoulli’s equation ⃝Francis
c Oketch

dz
Making the coefficient of equal to 1 (i.e., multiply the ODE through by −2), we get
dx
dz 2
+ z = −2 − − − (∗∗) (linear ODE in dependent variable z)
dx x
The integrating factor is
∫ 2 2)
dx
I.F = e x = e2 ln x = eln(x = x2

Multiplying equation (∗∗) through by x2 yields

dz d
x2 + 2xz = −2x2 ⇒ (zx2 ) = −2x2
dx dx
Integrating with respect to x, we obtain

2
zx = −2
2
x2 dx + C ⇒ zx2 = − x3 + C
3

x2 2 3
Back substitution yields + x = C.
y2 3
dy
(b) + y = xy 4 .
dx
Solution
Dividing the given ODE by y 4 , we get
dy
y −4 + y −3 = x − − − (∗)
dx
dz dz dy dy dy 1 dz
Let z = y −3 From chain rule, = = −3y −4 ⇒ y −4 = − .
dx dy dx dx dx 3 dx
Substituting into equation (∗) yields

−1 dz
+z =x
3 dx
dz
Making the coefficient of equal to 1 (i.e., multiply the ODE through by −3), we get
dx
dz
− 3z = −3x − − − (∗∗) (linear ODE in dependent variable z)
dx
The integrating factor is ∫
−3dx
I.F = e = e−3x
Multiplying equation (∗∗) through by e−3x yields

dz d
e−3x − 3e−3x z = −3xe−3x ⇒ (ze−3x ) = −3xe−3x
dx dx
Integrating with respect to x yields

ze−3x = −3 xe−3x dx + C. (put u = x, dv = e−3x dx)
( )
1 −3x
= x+ e +C
3
1
∴ z = x + + Ce3x
3
Back substitution and rearranging yields 3y −3 = 3x + 1 + Ce3x .

25
2.6 Bernoulli’s equation ⃝Francis
c Oketch

dy y x2
2. Solve the initial value problem 2 = + ; y(1) = 2.
dx x y

Solution
The given equation can be rewritten as
dy 1
2 − y = x2 y −1
dx x
Dividing both sides by y −1 yields
dy 1
2y − y 2 = x2 − − − (∗)
dx x
dz dz dy dy
Let z = y 2 . From chain rule, = = 2y . Substituting into equation (∗) yields
dx dy dx dx
dz 1
− z = x2 − − − (∗∗) (linear ODE in dependent variable z)
dx x
The integrating factor is
∫ −1 ) 1
I.F = e−
1
x
dx
= e− ln x = eln(x =
x
1
Multiplying equation (∗∗) through by yields
x
1 dz 1 d
− z=x ⇒ (z/x) = x
x dx x2 dx
Integrating with respect to x yields

z y2 x2
= xdx + C ⇒ = +C
x x 2
7
Applying the given initial condition, we get C = . Therefore,
2
y2 x2 7
= +
x 2 2

Exercise:

1. Solve the following differential equations


dy
(a) + y = y 2 (sin x + cos x).
dx
Solution
dy dy
+ y = y 2 (sin x + cos x) ⇒ y −2 + y −1 = sin x + cos x
dx dx
dy dz
Let z = y −1 ⇒ dz = −y −2 dy ⇒ y −2 = − . So,
dx dx
dz
− z = −(sin x + cos x) − − − (∗) (linear in z)
dx
The integrating factor is ∫
I.F = e (−1)dx
= e−x
Multiplying equation (∗) through by e−x , we get
dz d
e−x − e−x z = −e−x (sin x + cos x) ⇒ (ze−x ) = −e−x (sin x + cos x)
dx dx

26
2.7 Applications of first order ODEs ⃝Francis
c Oketch

∫ [∫ ∫ ]
⇒ ze−x = − e−x (sin x + cos x)dx = − e−x sin xdx + e−x cos xdx

Now, using the idea of Euler’s representation of a complex number, we have


∫ ∫ ∫ ∫ ∫
−x −x −x −x
e cos xdx + i e sin xdx = e (cos x + i sin x)dx = e · e dx =
ix
e(i−1)x dx
1 (i−1)x e−x
= e +C =− (1 + i)eix + C
i−1 2
e−x
= − (1 + i)(cos x + i sin x) + C
2
e−x e−x
= − (cos x − sin x) − i (cos x + sin x) + C
2 2
∫ ∫
e−x e−x
⇒ e−x cos xdx = − (cos x−sin x)+a1 and e−x sin xdx = − (cos x+sin x)+a2
2 2
Therefore,
[ ]
e−x e−x
ze−x =− − (cos x + sin x) + a1 − (cos x − sin x) + a2 = e−x cos x + C
2 2

⇒ z = cos x + Cex ⇒ y −1 = cos x + Cex ⇒ y (cos x + Cex ) = 1


( )
dy 1 1 3 x
(b) − 1+ y = y3. [ans: = Ce−x − 6]
dx 2 x x y2
y
(c) x(6x2 − y − 1)dy + 2ydx = 0. [ans: 2 = 6 + Ce−y ]
x
dy 2
(d) + x(x + y) = x3 (x + y)3 − 1. [hint: put u = x + y, ans: (x2 + 1 + Cex )(x + y)2 = 1]
dx
2 y2 )
(e) ydx + (x + x3 y 2 )dy = 0. [ans: y = Ce1/(2x ]
dy x
[ans: y 4 = 1 + 15e−2x ]
2
2. Solve the initial value problem + xy = 3 ; y(0) = 2.
dx y

2.7 Applications of first order ODEs


In application problems involving first order ODEs, follow these steps
 Step 1: Form the ODE governing the given problem.

 Step 2: Classify the ODE into either separable, homogeneous, exact, linear, or nonlinear of
Bernoulli’s type and find its general solution.

 Step 3: Impose the given initial conditions (if any) to find the particular solution.

→ Note: first order ODEs are applied in geometry, orthogonal trajectories and physical problems.

2.7.1 Geometry

Example(s):
(a) A curve, in two-dimensional Cartesian plane, is defined by the condition that at each point on
the curve the slope is twice the sum of the coordinates. Find the equation of the curve given
that it passes through the origin.

Solution
From the given information, we have
dy dy
= 2(x + y) ⇒ − 2y = 2x
dx dx

27
2.7 Applications of first order ODEs ⃝Francis
c Oketch

1
which is linear in y. The general solution is y = −x − + Ce2x . Applying the initial condition
2
1 1 1
y(0) = 0 yields C = . Therefore, the particular solution is y = −x − + e2x .
2 2 2

Exercise:
(a) Determine the family of curves such that at each point the slope is given by 2xy 2 . [ans:]

2.7.2 Orthogonal trajectories


Let F (x, y) = c be a family of curves. Then if there exists another family of curves G(x, y) = k such
that each curve in the family G intersects with every curve in the family F at 90o , then F and G are
said to be orthogonal trajectories of each other. The product of their gradients is −1. In case the two
families are identical, then we say that the family is self-orthogonal.

The ODE corresponding to the first family,


F (x, y) = c, is given by dF = 0, i.e.,

∂F ∂F
dx + dy = 0
∂x ∂y
The ODE corresponding to the orthogonal
family (i.e., the second family of curves) is
dy dx
obtained by replacing by − (since the
dx dy
product of their gradients is −1). That is,

∂F ∂F
dy − dx = 0. (∗)
∂x ∂y

The general solution of (∗) gives the required


orthogonal trajectories.
→ Note: orthogonal trajectories has important applications in the field of physics and engineering.
For example, the equipotential lines and the streamlines in an irrotational two-dimensional flow are
orthogonal.

Example(s):
1. Find the orthogonal trajectories of the following family of curves.

(a) x + y = c.

Solution
Here, F (x, y) = x + y. The ODE corresponding to the first family of curves is given by
∂F ∂F ∂F ∂F
dx + dy = 0. Now, = 1 and = 1. Therefore, dx + dy = 0. The ODE for the
∂x ∂y ∂x ∂y
dy dx
orthogonal trajectories is obtained by replacing by − to get
dx dy
dy − dx = 0

Integrating yields y − x = k, which is the required orthogonal trajectories.


x
(b) y = .
c+x
Solution
x x
We first make the constant c the subject, i.e., − x = c. Here, F (x, y) = − x. The
y y
∂F ∂F
ODE corresponding to the first family of curves is given by dx + dy = 0. Now,
∂x ∂y

28
2.7 Applications of first order ODEs ⃝Francis
c Oketch

( ) ( )
∂F 1 ∂F x 1 x
= −1 and = − 2 . Therefore, − 1 dx − 2 dy = 0. The ODE for the
∂x y ∂y y y y
dy dx
orthogonal trajectories is obtained by replacing by − to get
dx dy
( )
1 x
− 1 dy + 2 dx = 0
y y
( )
Separating the variables yields y − y 2 dy +xdx = 0. Integrating yields 3y 2 −2y 3 +3x2 = k,
which is the required orthogonal trajectories.

Exercise:

1. Find the orthogonal trajectories of the curves defined by the following equations.

(a) cx2 + y 2 = 1. [ans: orthogonal trajectories are x2 + y 2 − 2 ln y = k]


(b) x2 + y 2 = cx. [ans: orthogonal trajectories are x2 + y 2 = ky]

2. (a) Find the orthogonal trajectories of family of straight lines through the origin. [hint:
the equation of the family of straight lines through the origin is y = cx, ans: orthogonal
trajectories are x2 + y 2 = k]
(b) Find the orthogonal trajectories of all parabolas having their vertices at the origin and foci
on the x-axis. [hint: y 2 = 4cx, ans: 2x2 + y 2 = k family of ellipses with major axis on the
y-axis]
dy −x
(c) Determine a family of curves that satisfies the equation = . Hence, find the equation
dx y
of the orthogonal trajectories of the curves. On the same axes, sketch the curves and their
orthogonal trajectories. [ans: F (x, y) = x2 + y 2 = c are concentric circles with center at
y
origin, G(x, y) = = k are straight lines through the origin]
x

2.7.3 Cooling of a substance


The cooling of a substance is governed by Newton’s law of cooling which states that “the rate
at which a substance cools is directly proportional to the excess temperature above the surrounding
temperature”, i.e.,
dT . − T0 ) ,
∝ (T
dt
where T is the temperature of the substance at time t and T0 denotes the surrounding (or room)
temperature.

Example(s):

(a) A substance cools from 100o C to 60o C in 10 seconds. Find the temperature of the substance
after 40 seconds, assuming room temperature to be 20o C.

Solution
Let T be the temperature of the substance at time t. Then, Newton’s law of cooling becomes:
dT dT
∝ (T − 20) ⇒ = k(T − 20),
dt dt
where k is a constant of proportionality. Separating the variables, we obtain
dT
= kdt.
T − 20

29
2.7 Applications of first order ODEs ⃝Francis
c Oketch

Integrating over the given initial conditions, we get


∫60 ∫10 [ ]60 [ ]10
dT
= kdt ⇒ ln(T − 20) = kt ⇒ k = 0.1 ln(0.5)
T − 20 100 0
100 0
[ ]T [ ]40
Also, ln(T − 20) = kt ⇒ ln(T − 20) − ln(80) = 40k
100 0

T − 20
⇒ = e40k = e40×0.1 ln(0.5) = e4 ln(0.5) ⇒ T = 80e4 ln(0.5) + 20 = 25
80
Therefore, T = 25o C when t = 40 seconds.

Exercise:
(a) Detectives discover a murdered victim at 6.00 a.m. and the body temperature of the victim is
25o C. In 30 minutes later, the police surgeon arrives and the body temperature of the victim is
found to be 22o C. If the air temperature is 15o C and the normal body temperature is 37o C, at
what time did the police surgeon estimate that the crime was committed? [ans: 4.54 am]

(b) A cup of coffee with cooling constant (constant of proportionality) k = −0.09 min−1 is placed
in a room at temperature 20o C. If the coffee is served at 90o C, how long will it take to reach an
optimal drinking temperature of 65o C? [ans: 4.91 min]

(c) If a body in air at 25o C cools from 100o C to 75o C in one minute. Find its temperature at the
end of three minutes. [ans: ]

2.7.4 Growth and decay


In many natural phenomena, quantities grow or decay at a rate that is directly proportional to their
size. If k is the constant of proportionality, then k > 0 represents growth while k < 0 represents decay.

Example(s):
(a) The population of Juja constituency in the year 1964 and 1970 was 12 thousand and 18 thousand,
1
respectively. Find the year when the population was 5 thousand, given that the rate of growth
3
of the population is directly proportional to the population.

Solution
dP dP
Let P be the population at time t. Then we have ∝ P ⇒ = kP, where k is a
dt dt
constant of proportionality. Separating the variables yields
dP
= kdt
P
Integrating over the given initial conditions, we get
∫18 ∫
1970
[ ]18 [ ]1970
dP 1
= kdt ⇒ ln P = kt ⇒ k= ln(1.5)
P 12 1964 6
12 1964

[ ]5 1 [ ]t 1 [ ]
3
Also, ln P =k t ⇒ ln(16/3) − ln(12) = ln(1.5) t − 1964
12 1964 6
ln(16/3) − ln(12) 6 ln(4/9)
⇒ t= + 1964 = + 1964 = 1952
1 ln(1.5)
ln(1.5)
6
1
Therefore, the population of Juja constituency was 5 thousand in the year 1952.
3

30
2.7 Applications of first order ODEs ⃝Francis
c Oketch

Exercise:

(a) The population of a certain community is known to increase at a rate proportional to the number
of people present at any time t. If the population has doubled in 10 years, how long will it take
for the population to triple. [ans: 15.85 years]

(b) The logistic growth rate of population of a certain community is modeled by the differential
dP
equation = (150P − 10P 2 ). When will the population be 12 thousand if initial population
dt
is 2 thousand? [ans: t = 0.0022]

(c) The JKUAT engineering students’ population N (t) at any time t is assumed to satisfy the logistic
dN 1 10000
growth law = N (10000 − N ). Prove that N (t) = , where C is an arbitrary
dt 500 1 + Ce−20t
constant.

(d) A company is using Newspaper advertising to introduce a new product to a community of 50,000
people. It was assumed that the rate at which people learn about the new product is proportional
to the product of the number of people who have heard about it and the number of people who
have not heard about it. If 100 individuals were aware of the product initially and 500 people
dN
were aware about it after 10 days of the campaign, [hint: ∝ N (50000 − N )]
dt
i) How many people will be aware of the product after 20 days? [6 mks]
ii) When will half of the community be aware of the product? [3 mks]

(e) A new company has zero sales initially, sales of Ksh 2 millions during the first year and sales of
Ksh 5 millions during the third year. If the sales is assumed to be growing at a rate proportional
to the difference between the sales and an unknown upper limit m. Determine the sales at any
dS
time t and the value of m to the nearest million. [hint: = k(m − S), ans:
[ ( )t ] dt
m−2
S =m 1− , m ≈ 12]
m

(f) A radioactive substance has an initial mass of 100mg. After 2 year the mass is 75mg. If the
rate of decay is directly proportional to the mass at any time t, determine the half-life of the
radioactive substance. [ans: 4.82 years]

2.7.5 Electrical RL circuits


Consider a series circuit containing an electromotive force (e.g., a battery or generator), resistors and
inductors. The emf produces a flow of current in a closed circuit and the current produces a voltage
drop across each resistor and inductor.

 [Faraday’s law] The voltage drop across the


dI
inductance is EL = L
dt
 [Ohm’s law] The voltage drop across the resistor
is ER = RI(t)

Here, I(t) denotes the current in the RLC circuit, Q(t) denotes the instantaneous charge on the
capacitor, and E(t) denotes the impressed voltage (or electric potential) at time t. From Kirchhoff’s
voltage law, “the sum of the voltage drops across resistors and inductors in an RL-series circuit is
equal to the total electromotive force in a closed circuit”, we have

dI . = E(t) ,
L + RI(t)
dt

31
2.7 Applications of first order ODEs ⃝Francis
c Oketch

where L, R and C are constants. This is the differential equation governing the current flowing in the
RL-series circuit.

Example(s):

(a) An electric series circuit has a constant electromotive force of 40V, a resistor of 10Ω and an
inductor of 0.2 henry (H). The basic differential equation governing the flow of current in the
dI
circuit is given by L + RI = E. If the initial current in the circuit is zero, find the current at
dt
time t.

Solution
The ODE governing this problem is
dI dI
0.2 + 10I = 40 ⇒ + 50I = 200 − − − (∗) (linear ODE in dependent variable I)
dt dt
The integrating factor is ∫
50dt
I.F = e = e50t
Multiplying equation (∗) through by e50t yields

dI d
e50t + 50e50t I = 200e50t ⇒ (Ie50t ) = 200e50t
dt dx
Integrating with respect to t, we obtain

Ie50t = 200 e50t dt + C ⇒ Ie50t = 4e50t + C

Making I the subject yields I(t) = 4 + Ce−50t . Imposing the initial condition I(0) = 0, we get
C = −4. Therefore, the current at time t
( )
I(t) = 4 1 − e−50t

Exercise:

1. A series circuit has an electromotive force given by E = 100 sin 40t V, a resistor of 10Ω and an
inductor of 0.5 H. If the initial current is 0, find the current at time t. [ans:
I(t) = 2(sin 40t − 2 cos 40t) + 4e −20t ]

32
⃝Francis
c Oketch

Lecture 6

3 Second order linear ODEs


Consider a linear ODE of order 2, with variable coefficients:

d2 y dy
a2 (x) 2
+ a1 (x) + a0 (x)y = R(x), (14)
dx dx
where a0 (x), a1 (x), a2 (x) are coefficients and a2 (x) ̸= 0. If R(x) = 0, then equation (14) is said to be
homogeneous; otherwise it is non-homogeneous. If the coefficients are constants, then equation
(14) is called linear ODE with constant coefficients, and is written as

d2 y dy
a2 2
+ a1 + a0 y = R(x), (15)
dx dx
where a0 , a1 , a2 are constants and a2 ̸= 0.

Definition 3.1 (Differential operator notation). Let y be an n-times differentiable function of the
independent variable x. The operation of differentiation with respect to x is denoted by the differential
operator D, i.e.,
d d2 d3
D= ⇒ D2 = 2 , D3 = 3 , etc
dx dx dx
dy d2 y 2
2 y, d y + 3 dy + 2y = (D 2 + 3D + 2)y,
Hence, the derivative is denoted by Dy. Likewise, = D
dx dx2 dx2 dx
etc. Thus, in terms of the D operator, equation (15) becomes:
[ ]
a2 D2 + a1 D + a0 y = R(x) (16)

→ Note: (Integral operator)

 D−n , where n is a positive integer, denotes the integral operator. For example,
 
∫x ∫x ∫x ∫x [ 2 ]
x2 x x3
D−1 x = xdx = and −2
D x =  xdx dx = dx =
2 2 6
0 0 0 0

Definition 3.2 (Exponential shift rule). Let y be a differentiable function of x. Then,

D(eαx y) = e.αx (D + α)y

That is, to shift eαx to the left-hand side of D, shift it but in place of D substitute (D + α).

Proof.
( )
αx d αx dy d
D(e y) = (e y) = eαx + αeαx y = eαx + α y = eαx (D + α)y
dx dx dx

Similarly,
. − α)eαx y
eαx Dy = (D

That is, to shift eαx to the right-hand side of D, shift it but in place of D substitute (D − α).

33
3.1 Solution of homogeneous linear ODEs with constant coefficients ⃝Francis
c Oketch

3.1 Solution of homogeneous linear ODEs with constant coefficients


Consider a homogeneous linear ODE of order 2, with constant coefficients:
d2 y dy
a2 + a1 + a0 y = 0, (17)
dx2 dx
d
where a2 ̸= 0. Let D = , then in terms of the D-operator equation (17) becomes:
dx
[ ]
a2 D2 + a1 D + a0 y = 0

For a non-trivial solution of y, we require that [a2 D2 + a1 D + a0 ] = 0 − − − (∗). Equation (∗) is called
the characteristic equation (or auxiliary/subsidiary equation) of the differential equation (17).
The non-trivial solution of y depends on the roots of the auxiliary equation (∗). The roots can be
classified into one of the three cases, depending on the sign of the discriminant (a21 − 4a2 a0 ), namely,
(i) Real and distinct roots
(ii) Real and equal roots
(iii) Complex conjugate roots
We consider these three cases separately.

Case 1: When the roots of the auxiliary equation are real and distinct
Let the roots be D1 = α and D2 = β, where α ̸= β. Then the general solution is given by

y = Aeαx. + Beβx ,
where A and B are arbitrary constants.

Proof. If the roots are α and β, then the auxiliary equation is (D − α)(D − β) = 0. Thus, the
differential equation is of the form
(D − α)(D − β)y = 0
We need to make y the subject. Thus, pre-multiplying by e−αx yields
e−αx (D − α)(D − β)y = 0
Shifting e−αx to the right of the operator (D − α) yields
(D − −α − α)[e−αx (D − β)y] = 0 ⇒ D[e−αx (D − β)y] = 0
Operating with the integral operator D−1 on both sides yields
D−1 D[e−αx (D − β)y] = D−1 (0) ⇒ e−αx (D − β)y = A1
Multiply though by eαx and simplify to get
(D − β)y = A1 eαx
Similarly, pre-multiplying by e−βx yields
e−βx (D − β)y = A1 e(α−β)x
Shifting e−βx to the right of the operator (D − β) yields
(D − −β − β)[e−βx y] = A1 e(α−β)x ⇒ D[e−βx y] = A1 e(α−β)x
Operating with D−1 on both sides yields
D−1 D[e−βx y] = D−1 (A1 e(α−β)x ) ⇒ e−βx y = A1 (α − β)−1 e(α−β)x + B
Multiplying through by eβx and letting A1 (α − β)−1 = A, we obtain
y = Aeαx + Beβx

34
3.1 Solution of homogeneous linear ODEs with constant coefficients ⃝Francis
c Oketch

Example(s):
Solve the following differential equations
d2 y dy
(a) −5 + 6y = 0.
dx2 dx

Solution
In terms of the D operator the given differential equation becomes (D2 − 5D + 6)y = 0. Thus,
the auxiliary equation is D2 − 5D + 6 = 0. Hence, the roots are α = 2 and β = 3. The general
solution is y = Ae2x + Be3x , where A and B are arbitrary constants.
d2 y dy
(b) 2 2
− − 10y = 0.
dx dx

Solution
In terms of the D operator the given differential equation becomes (2D2 − D − 10)y = 0. The
auxiliary equation is 2D2 − D − 10 = 0. Hence, the roots are α = −2 and β = 52 . The general
5
solution is y = Ae−2x + Be 2 x , where A and B are arbitrary constants.
d2 y dy
(c) 2
− = 0. [ans: y = Aex + B]
dx dx
 Generalization:

Consider a homogeneous linear ODE of order n, with constant coefficients:


[ ]
an Dn + an−1 Dn−1 + an−2 Dn−2 + · · · + a2 D2 + a1 D + a0 y = 0, (18)

where an ̸= 0. Let the roots of the auxiliary equation be α1 , α2 , · · · , αn , where α1 ̸= α2 ̸= · · · ̸= αn .


The general solution is given by

y = A1 eα1 x + A2 eα.2 x + · · · + An eαn x ,

where A1 , A2 , · · · , An are arbitrary constants.

Example(s):
Solve the following differential equation
d3 y d2 y dy
(a) 3
−2 2 − + 2y = 0.
dx dx dx

Solution
In terms of the D operator the given differential equation becomes (D3 − 2D2 − D + 2)y = 0.
The auxiliary equation is D3 − 2D2 − D + 2 = 0 ⇒ (D − 2)(D + 1)(D − 1) = 0. The roots
are α1 = 2, α2 = −1 and α3 = 1. Thus, the general solution is y = A1 e2x + A2 e−x + A3 ex , where
A1 , A2 and A3 are arbitrary constants.

Case 2: When the roots of the auxiliary equation are real and equal
Let the roots be D1 = D2 = α. The general solution is given by

y = (Ax .+ B)eαx ,

where A and B are arbitrary constants.

Proof. If the roots are D1 = D2 = α, then the auxiliary equation is (D−α)2 = 0. Thus, the differential
equation is of the form
(D − α)2 y = 0

35
3.1 Solution of homogeneous linear ODEs with constant coefficients ⃝Francis
c Oketch

Pre-multiplying by e−αx yields


e−αx (D − α)2 y = 0 ⇒ (D − −α − α)2 [e−αx y] = 0 ⇒ D2 [e−αx y] = 0
⇒ D−2 D2 [e−αx y] = D−2 (0) = D−1 (D−1 (0))
⇒ e−αx y = D−1 (A) = Ax + B
Multiplying through by eαx yields
y = (Ax + B)eαx

Example(s):
d2 y dy
(a) Find the general solution of −4 + 4y = 0.
dx2 dx

Solution
In terms of the D operator the equation becomes (D2 − 4D + 4)y = 0. The auxiliary equation
is D2 − 4D + 4 = 0. Hence, the roots are α1 = α2 = 2. The general solution is y = (Ax + B)e2x ,
where A and B are arbitrary constants.
d2 y dy
(b) Solve the initial value problem 2
+6 + 9y = 0; y(0) = −4, y ′ (0) = 14.
dx dx

Solution
In terms of the D operator the equation becomes (D2 + 6D + 9)y = 0. The auxiliary equation
is (D2 + 6D + 9) = 0. Hence, the roots are α1 = α2 = −3. The general solution is
y = (Ax + B)e−3x , (∗)
where A and B are arbitrary constants. Differentiating the general solution (∗) with respect to
x yields
y ′ = [(1 − 3x)A − 3B] e−3x (∗∗)
Applying the initial condition y(0) = −4 to (∗), we get B = −4. Applying the initial condition
y ′ (0) = 14 to (∗∗), we get A − 3B = 14 ⇒ A = 2. Substituting the values of A and B into
(∗), we obtain the particular solution as y = (2x − 4)e−3x .

Exercise:
d2 y dy
(a) Find the general solution of −2 + y = 0. [ans: y = (Ax + B)ex ]
dx2 dx
 Generalization:
Consider equation (18). Let the roots of the auxiliary equation be α1 , α2 , · · · , αn , where α1 = α2 =
· · · = αn = α. The general solution is given by
. · · · + An−1 x + An )eαx ,
y = (A1 xn−1 + A2 xn−2 +
where A1 , A2 , · · · , An are arbitrary constants.

Example(s):
Solve the following differential equation
d3 y d2 y dy
(a) 3
− 3 2
+3 − y = 0.
dx dx dx

Solution
In terms of the D operator the given differential equation becomes (D3 − 3D2 + 3D − 1)y = 0.
The auxiliary equation is D3 − 3D2 + 3D − 1 = 0 ⇒ (D − 1)(D − 1)(D − 1) = 0. Hence the
roots are D1 = D2 = D3 = 1. The general solution is y = (A1 x2 + A2 x + A3 )ex , where A1 , A2
and A3 are arbitrary constants.

36
3.1 Solution of homogeneous linear ODEs with constant coefficients ⃝Francis
c Oketch

Case 3: When the roots of the auxiliary equation are complex conjugate
Let the roots be D1,2 = (α ± iβ). The general solution is given by
. + B sin βx) ,
y = eαx (A cos βx

where A and B are arbitrary constants.

Proof. Let the roots be D1 = (α + iβ) and D2 = (α − iβ). Then from case 1, the general solution is
given by
y = c1 e(α+iβ)x + c2 e(α−iβ)x
= eαx [c1 eiβx + c2 e−iβx ]
= eαx [c1 (cos βx + i sin βx) + c2 (cos βx − i sin βx)]
= eαx [(c1 + c2 ) cos βx + i(c1 − c2 ) sin βx]
= eαx [A cos βx + B sin βx],
where A = (c1 + c2 ) and B = i(c1 − c2 ) are arbitrary constants.

Example(s):
d2 y dy
(a) Find the general solution of the differential equation +6 + 13y = 0.
dx2 dx

Solution
In terms of the D operator the given differential equation becomes (D2 + 6D + 13)y = 0. The
auxiliary equation is D2 + 6D + 13 = 0. Hence, the roots are D = −3 ± i2 (complex conjugate).
From which we obtain α = −3, β = 2. Thus, the general solution is y = e−3x (A cos 2x+B sin 2x),
where A and B are arbitrary constants.
d2 y
(b) Solve the initial value problem + 9y = 0; y(π) = −2, y ′ (π) = 3.
dx2

Solution
In terms of the D operator the given differential equation becomes (D2 + 9)y = 0. The auxiliary
equation is D2 + 9 = 0. Hence, the roots are D = ±i3 (complex conjugate). From which we
obtain α = 0, β = 3. Thus, the general solution is
y = A cos 3x + B sin 3x, (∗)
where A and B are arbitrary constants. Differentiating the general solution (∗) with respect to
x yields
y ′ = −3A sin 3x + 3B cos 3x (∗∗)
Applying the initial condition y(π) = −2 to (∗), we get A = 2. Applying the initial condition
y ′ (π) = 3 to (∗∗), we get B = −1. Substituting the values of A and B into (∗), we obtain the
particular solution as y = 2 cos 3x − sin 3x.

Exercise:
(a) Find the general solution of the following differential equations
d2 y dy
i) 2
−2 + 5y = 0. [ans: y = ex (A cos 2x + B sin 2x)]
dx dx
d3 y d2 y dy
ii) − 3 + 16 − 48y = 0. [ans: y = A cos 4x + B sin 4x + Ce3x ]
dx3 dx2 dx
d2 y dy
(b) Solve the initial value problem 2
−6 + 25y = 0; y(0) = −3, y ′ (0) = −1. [ans:
dx dx
y= e3x (2 sin 4x − 3 cos 4x)]

37
3.2 Solution of non-homogeneous linear ODEs with constant coefficients ⃝Francis
c Oketch

Lecture 7

3.2 Solution of non-homogeneous linear ODEs with constant coefficients


Consider equation (16) above, where R(x) ̸= 0. The solution comprises of two parts, i.e.,

i) Complementary function, yc (x) - it is obtained by solving the homogeneous part of equation


(16), i.e., [ ]
a2 D2 + a1 D + a0 yc (x) = 0

ii) Particular integral, yp (x) - it is obtained by using the following methods

(a) Inverse differential operators method


(b) Method of undetermined coefficients (UC)
(c) Method of variation of parameters

The general (complete) solution of equation (16) is given by the sum of the complementary function
and the particular integral, i.e.,
y = yc (x). + yp (x)

3.2.1 Inverse differential operators method


The particular integral of equation (16) is obtained by making y the subject, i.e.,
1 1
yp (x) = R(x) = R(x),
[a2 D2 + a1 D + a0 ] F (D)

where F (D) = a2 D2 + a1 D + a0 . We will consider 8 specific forms of the function R(x).

→ Note: In finding the particular integral, we don’t write constants of integration since these can be
absorbed with the arbitrary constants of the complementary function.

Case 1: When R(x) = eαx


In this case, we replace D by α provided that F (α) ̸= 0.

 Justification: this substitution is valid since

D(eαx ) = αeαx ⇒ D=α


2 αx
D (e ) = α e 2 αx
⇒ D=α
.. ..
. .
Dn (eαx ) = αn eαx ⇒ D=α

Example(s):

d2 y dy
(a) Find the particular integral of 2
−3 + 2y = e−3x .
dx dx

Solution
In terms of the D operator the given differential equation becomes (D2 − 3D + 2)y = e−3x . The
particular integral is obtained by making y the subject, i.e.,
1
yp (x) = e−3x . Replace D with α = −3
D2 − 3D + 2
1 1
= e−3x = e−3x
(−3) − 3(−3) + 2
2 20

38
3.2 Solution of non-homogeneous linear ODEs with constant coefficients ⃝Francis
c Oketch

d3 y d2 y dy
(b) Find the complete solution of 3
− 6 2
+ 12 − 8y = ex + e3x .
dx dx dx

Solution
In terms of the D operator the given differential equation becomes (D3 − 6D2 + 12D − 8)y =
ex + e3x .

i) The complementary function


The auxiliary equation is D3 − 6D2 + 12D − 8 = 0. Hence, the roots are
D1 = D2 = D3 = 2. Thus, the complementary function is yc (x) = (Ax2 + Bx + C)e2x ,
where A, B and C are arbitrary constants.

ii) The particular integral

1
yp (x) = (ex + e3x )

D3 + 12D − 8
6D2
1 1
= ex + 3 e3x
D3 − 6D2 + 12D − 8 D − 6D2 + 12D − 8
1 1
= ex + e3x
(1) − 6(1) + 12(1) − 8
3 2 (3) − 6(3) + 12(3) − 8
3 2

= −ex + e3x

Therefore, the complete solution is y = yc (x) + yp (x), i.e.,

y = (Ax2 + Bx + C)e2x − ex + e3x

Exercise:
d2 y dy d3 y
(a) Find the complete solution of 5 2 + 2 + e2x = 3 + 24y. [ans:
dx dx dx
−2x 3x 4x 1 2x
y = Ae + Be + Ce + e ]
8

Case 2: When R(x) = cos αx or R(x) = sin αx


In this case, we replace D2 by −(α2 ).

 Justification: this substitution is valid since

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


D2 (cos αx) = −α2 cos αx ⇒ D2 = −α2

Similarly,

D(sin αx) = α cos αx


D2 (sin αx) = −α2 sin αx ⇒ D2 = −α2

Example(s):

d2 y
(a) Find the particular integral of + 4y = cos 3x
dx2

Solution

39
3.2 Solution of non-homogeneous linear ODEs with constant coefficients ⃝Francis
c Oketch

In terms of the D operator the given differential equation becomes (D2 + 4)y = cos 3x. Thus,
the particular integral is given by
1
yp (x) = cos 3x. Replacing D2 with −(3)2 yields.
D2 +4
1 1
= cos 3x = − cos 3x
−(3) + 4
2 5

d2 y dy
(b) Find the general solution of +2 + y = sin 2x.
dx2 dx

Solution
In terms of the D operator the given differential equation becomes (D2 + 2D + 1)y = sin 2x.

i) The complementary function


The auxiliary equation is D2 + 2D + 1 = 0. Hence, the roots are D1 = D2 = −1. Thus, the
complementary function is yc (x) = (Ax + B)e−x , where A and B are arbitrary constants.
ii) The particular integral

1 1
yp (x) = sin 2x = sin 2x
D2 + 2D + 1 −(2) + 2D + 1
2

1
= sin 2x (Introduce D2 in the denominator -multiply by conjugate)
2D − 3
2D + 3 2D + 3 2D + 3
= sin 2x = sin 2x = sin 2x
(2D − 3)(2D + 3) 4D − 9
2 −4(2)2 − 9
2D + 3 1{ }
= − sin 2x = − 2D[sin 2x] + 3 sin 2x
25 25
1
= − (4 cos 2x + 3 sin 2x)
25
Therefore, the complete solution is y = yc (x) + yp (x).

Exercise:

1. Find the general solution of the following differential equations.


d2 y dy 1
(a) 2
− = sin 2x. [ans: y = A + Bex + (2 cos 2x − 4 sin 2x)]
dx dx 20
(b) (D3 + 4D)y = 3 sin x. [ans: y = A + B cos 2x + C sin 2x − cos x]

Case 3: When R(x) is a polynomial


A polynomial R(x) of degree n is an expression of the form

R(x) = bn xn + bn−1 xn−1 + · · · + b3 x3 + b2 x2 + b1 x + b0 ,

where b0 , b1 , · · · , bn are constants and n is a non-negative integer. In this case, we drop the terms of
D with higher powers than the degree of the polynomial.

 Justification: the dropping of terms is valid since

D2 (ax + b) = 0
D3 (ax2 + bx + c) = 0
⇒ Dk (Rn (x)) = 0 if k > n

→ Note: the dropping of terms is valid only if there exists at least one term in the denominator
which doesn’t contain the D-operator (i.e., if a0 ̸= 0). If, however, a0 = 0, we need to factor out D in

40
3.2 Solution of non-homogeneous linear ODEs with constant coefficients ⃝Francis
c Oketch

the denominator and operate with the integral operator, D−1 , first.

If, after dropping the terms, we still have D-operator in the denominator, we apply Maclaurin’s
series to expand the resulting inverse differential operator.

Recall: Maclaurin’s series expansion


1 1
= 1 + x + x2 + x3 + · · · and = 1 − x + x2 − x3 + · · ·
1−x 1+x
Hence,
1
= 1 + 2D + 4D2 + 8D3 + · · ·
1 − 2D
1 D D2 D3
{ } =1− + − + ···
D 2 4 8
1+
2
e.t.c.

Example(s):

d2 y dy
(a) Find the particular integral of 2
+2 + y = x + 1.
dx dx

Solution
In terms of the D operator the given equation becomes (D2 + 2D + 1)y = x + 1. The particular
integral is given by
1
yp (x) = (x + 1). Here, D is not common in every term of (D2 + 2D + 1).
D2 + 2D + 1
1
= (x + 1), (so we drop the term D2 since (x + 1) is of degree 1 and 2 > 1).
2D
[
+ 1 ] [ ]
= 1 − 2D + 4D2 + · · · (x + 1) = (x + 1) − 2D(x + 1) + 4D2 (x + 1) + 0
= [(x + 1) − 2(1) + 4(0)] = [x + 1 − 2] = x − 1

d2 y dy
(b) Find the general solution of 2
+2 = x − 2.
dx dx

Solution
In terms of the D operator the given equation becomes (D2 + 2D)y = x − 2.

i) The complementary function


The auxiliary equation is D2 + 2D = 0. Hence, the roots are D1 = 0, D2 = −2. Thus, the
complementary function is yc (x) = A + Be−2x , where A and B are arbitrary constants.
ii) The particular integral

1
yp (x) = (x − 2). We factor out D since it is common in every term of (D2 + 2D).
D2 + 2D
( 2 ) ( 2 )
1 1 1 x 1 x
= (x − 2) = D−1 (x − 2) = − 2x = { } − 2x
D(D + 2) D+2 D+2 2 D 2
2 +1
2
( 2 ) [ ]( 2 )
1 1 x 1 D D2 D3 x
= { } − 2x = 1− + − + ··· − 2x
2 D 2 2 2 4 8 2
1+
2
[( 2 ) ( 2 ) ( 2 ) ]
1 x 1 x 1 x
= − 2x − D − 2x + D2 − 2x + 0
2 2 2 2 4 2
[( 2 ) ] [ 2 ]
1 x 1 1 1 x 1 1 1( 2 )
= − 2x − (x − 2) + (1) = − 2x − x + 1 + = 2x − 10x + 5
2 2 2 4 2 2 2 4 8

41
3.2 Solution of non-homogeneous linear ODEs with constant coefficients ⃝Francis
c Oketch

Therefore, the complete solution is y = yc (x) + yp (x). That is,

1( 2 )
y = A + Be−2x + 2x − 10x + 5
8

Exercise:

1. Find the particular integral of the following equations


d2 y dy 1
(a) 2
+ = x2 + 2x + 4. [ans: yp = x3 + 4x − 4]
dx dx 3
d2 y dy 1
(b) +2 + 2y = x2 . [ans: yp = (x2 − 2x + 1)]
dx2 dx 2
1 3 7
(c) (D3 + 3D2 + 2D)y = x. [ans: yp = x2 − x + ]
4 4 8
1 3
(d) (D4 − 2D3 + D2 )y = x. [ans: yp = x + x2 + 3x + 4]
6
2. Find the general solution of the following differential equations.
d2 y dy 1( 2 )
(a) 2
−3 + 2y = x2 . [ans: y = Aex + Be2x + 2x + 6x + 7 ]
dx dx 4
d2 y dy 1 4 5
(b) −2 − 3y = 1 − x2 . [ans: y = Ae−x + Be3x + x2 − x + ]
dx2 dx 3 9 27

Case 4: When R(x) = eαx f (x) where f (x) = cos βx, f (x) = sin βx or f (x) is a polynomial
In this case, we use the exponential shift rule.

Example(s):

d2 y dy
(a) Find the particular integral of the differential equation +2 + y = ex (x + 1).
dx2 dx

Solution
In terms of the D operator the given equation becomes (D2 + 2D + 1)y = ex (x + 1). The
particular integral is
1
yp (x) = ex (x + 1). Shifting ex to the left yields.
D2 + 2D + 1
1 1
= ex 2
(x + 1) = ex 2 (x + 1), (Drop D2 since 2 > 1).
(D + 1) + 2(D + 1) + 1 D + 4D + 4
1 1 1 1 [ ]
= ex (x + 1) = ex (x + 1) = ex 1 − D + D2 + · · · (x + 1)
4D + 4 4 D+1 4
1 x[ ] 1 1
= e (x + 1) − D(x + 1) + D2 (x + 1) + 0 = ex [x + 1 − 1 + 0] = xex
4 4 4

d2 y dy
(b) Find the general solution of the differential equation 2
−2 − 3y = e−2x cos 3x.
dx dx

Solution
In terms of the D operator the given equation becomes (D2 − 2D − 3)y = e−2x cos 3x.

i) The complementary function


The auxiliary equation is D2 − 2D − 3 = 0. Hence, the roots are D1 = 3 and D2 = −1.
Thus, the complementary function is yc (x) = Ae3x + Be−x , where A and B are arbitrary
constants.

42
3.2 Solution of non-homogeneous linear ODEs with constant coefficients ⃝Francis
c Oketch

ii) The particular integral

1
yp (x) = e−2x cos 3x. Shifting e−2x to the left yields.
D2 − 2D − 3
1
= e−2x cos 3x
(D − 2) − 2(D − 2) − 3
2

1
= e−2x 2 cos 3x. Replace D2 with −(3)2
D − 6D + 5
1 1
= e−2x cos 3x = e−2x cos 3x
−(3) − 6D + 5
2 −(6D + 4)
(6D − 4) (6D − 4)
= −e−2x cos 3x = −e−2x cos 3x. Replace D2 with −(3)2
(6D + 4)(6D − 4) 36D2 − 16
(6D − 4) 1 −2x
= −e−2x cos 3x = e (6D − 4) cos 3x
36(−9) − 16 340
1 −2x { } 1 −2x { }
= e 6D[cos 3x] − 4 cos 3x = e − 18 sin 3x − 4 cos 3x
340 340
1 −2x { }
= − e 9 sin 3x + 2 cos 3x
170

Therefore, the general solution is y = yc (x) + yp (x). That is,

1 −2x { }
y = Ae3x + Be−x − e 9 sin 3x + 2 cos 3x
170

Exercise:

d2 y dy
1. Find the particular integral of the differential equation 2
+3 + 2y = e−2x (x + 1). [ans:
( ) dx dx
1 2
yp (x) = −e−2x x + 2x + 2 ]
2
2. Find the general solution of the following differential equations
d2 y dy 1
(a) 2
+3 − 4y = xe−4x . [ans: y = Ae−4x + Bex − xe−4x (5x + 2)]
dx dx 50
d3 y d2 y dy
(b) −3 2 +2 = 10 + 4xe2x . [ans: y = A + Bex + Ce2x + 5x + e2x (x2 − 3x)]
dx3 dx dx
( )
d2 y dy x + Be2x − 1 x3 + x2 + 2x ex ]
(c) − 3 + 2y = x2 ex . [ans: y = Ae
dx2 dx 3
3
d y 2
d y 1 ( )
(d) 3
+ 3 2 − 4y = xe−2x . [ans: y = Aex + (Bx + C)e−2x − e−2x x3 + x2 ]
dx dx 18
d2 y 1
(e) − y = cosh x cos x + 2x . [hint: cosh x = (ex + e−x ) and 2x = ex ln(2) , ans:
dx2 2
−x 2 1 1
y = Ae + Be + sinh x sin x − cosh x cos x +
x 2x ]
5 5 (ln 2)2 − 1
d3 y d2 y dy
3. Show that the solution of the equation 3
+3α 2
+3α2 +α3 y = 0 is y = (Ax2 +Bx+C)e−αx .
dx dx dx
d3 y d2 y dy
Hence, find the complete solution of − 6 2 + 12 − 8y = e2x (x + 1). [ans:
dx3 dx dx
1 ( )
y = (Ax2 + Bx + C)e−2x + e2x x4 + 4x3 ]
24

43
3.2 Solution of non-homogeneous linear ODEs with constant coefficients ⃝Francis
c Oketch

Lecture 8

Case 5: When R(x) = eαx and F (α) = 0


In this case, we use the exponential shift rule.

Example(s):
Find the complete solution of the following ODEs
d2 y dy
(a) 2
−2 + y = ex .
dx dx

Solution
In terms of the D operator the given equation becomes (D2 − 2D + 1)y = ex .
i) The complementary function
The auxiliary equation is D2 − 2D + 1 = 0 and so the roots are D1 = D2 = 1. Hence, the
complementary function is yc (x) = (Ax + B)ex , where A and B are arbitrary constants.
ii) The particular integral

1
yp (x) = ex . Shifting ex to the left yields.
− 2D + 1
D2
1 1 1
= ex = ex 2 (1) = ex D−2 1 = ex D−1 x = ex x2
(D + 1) − 2(D + 1) + 1
2 D 2
Therefore, the complete solution isy = yc (x) + yp (x). That is,
1
y = (Ax + B)ex + ex x2
2
d2 y dy
(b) 2
+3 − 4y = e−4x .
dx dx

Solution
In terms of the D operator the equation becomes (D2 + 3D − 4)y = e−4x .
i) The complementary function
The auxiliary equation is D2 + 3D − 4 = 0 ⇒ (D + 4)(D − 1) = 0. Hence, the roots
are D1 = 1, D2 = −4. Thus, the complementary function is yc (x) = Aex + Be−4x , where A
and B are arbitrary constants.
ii) The particular integral

1
yp (x) = e−4x . Shifting e−4x to the left yields.
+ 3D − 41
D2
1 1 1
= e−4x = e−4x 2 (1) = e−4x D−1 (1)
(D − 4) + 3(D − 4) − 4
2 D − 5D D−5
[ ]
1 1 1 1 −4x D 1
= e−4x x = − e−4x { } x = − e 1 + + · · · x = − e−4x (1 + 5x)
D−5 5 D 5 5 25
1−
5
Therefore, the general solution is y = yc (x) + yp (x). That is,
1 −4x
y = Aex + Be−4x − e (1 + 5x)
25

Exercise:
d2 y dy
(a) Find the complete solution of the differential equation 2
−6 + 9y = 6e3x + 7e−2x − log 2.
dx dx
7 1
[ans: y = (Ax + B)e3x + 3x2 e3x + e−2x − log 2]
25 9

44
3.2 Solution of non-homogeneous linear ODEs with constant coefficients ⃝Francis
c Oketch

Case 6: When R(x) = cos αx or R(x) = sin αx and F (−α2 ) = 0


In this case, we replace cos αx or sin αx by eiαx then use the exponential shift rule. If R(x) = sin αx,
we extract the imaginary part. If R(x) = cos αx, we extract the real part.

 Justification: extracting real or imaginary part is necessary since


∫ ∫ ∫ ∫
eix dx = (cos x + i sin x) dx = cos xdx + i sin xdx
= (sin x + c1 ) + i (− cos x + c2 )
∫ (∫ ) ∫ (∫ )
Therefore, cos xdx = sin x + c1 = Re eix dx and sin xdx = − cos x + c1 = Im eix dx ,
where c1 and c2 are constants of integration.

→ Note: The function eiθ = cos θ + i sin θ is called the Euler number.

Example(s):

d2 y
(a) Find the particular integral of the equation + 4y = sin 2x.
dx2

Solution
In terms of the D operator the equation becomes (D2 + 4)y = sin 2x. The particular integral is
given by ( )
1 1 i2x
yp (x) = 2 sin 2x = Im e
D +4 D2 + 4
1
Let I = 2 ei2x . Thus, we have
D +4
1
I = ei2x . Shifting ei2x to the left yields.
D2 +4
1 1 1 D − i4
= ei2x 2
(1) = ei2x 2 (1) = ei2x x = ei2x 2 x
(D + i2) + 4 D + i4D D + i4 D + 16
1 i2x 1 1
= e [D − i4]x = ei2x (1 − i4x) = (cos 2x + i sin 2x)(1 − i4x)
16 16 16
1
= [(cos 2x + 4x sin 2x) + i(sin 2x − 4x cos 2x)]
16
1
Extracting the imaginary part of I yields yp (x) = (sin 2x − 4x cos 2x).
16

Exercise:
d2 y 1
(a) Find the general solution of + 9y = cos 3x. [ans: y = A cos 3x + B sin 3x + x sin 3x]
dx2 6
d2 x
(b) Solve the IVP + 9x = 18 cos 3t; x(0) = 0, ẋ(0) = −6. [ans: y = (3t − 2) sin 3t]
dt2
(c) (D3 + D)y = 4 sin x. [ans: y = A + B cos x + C sin x − 2x sin x]

Case 7: When R(x) consists of products of sin αx or cos αx


In this case, we rewrite R(x) using the following trigonometric identities.

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


sin(A − B) = sin A cos B − cos A sin B

Adding yields
1
sin A cos B = [sin(A. + B) + sin(A − B)]
2

45
3.2 Solution of non-homogeneous linear ODEs with constant coefficients ⃝Francis
c Oketch

The restriction is that A is associated with sine and B is associated with cosine. Also,

cos(A + B) = cos A cos B − sin A sin B


cos(A − B) = cos A cos B + sin A sin B

Adding yields
1
cos A cos B = [cos(A. − B) + cos(A + B)]
2
Subtracting yields
1
sin A sin B = [cos(A. − B) − cos(A + B)]
2
. − sin A since sine is an odd function and cos(−A) =
Further, sin(−A) = . + cos A since cosine is an
even function.

Example(s):
Find the particular integral of the following differential equations.
d2 y
(a) + 4y = sin 2x cos 3x.
dx2

Solution
The right-hand side function can be rewritten as
1 1
sin 2x cos 3x = [sin(2x + 3x) + sin(2x − 3x)] = (sin 5x − sin x)
2 2
1
In terms of the D operator the given equation becomes (D2 + 4)y = (sin 5x − sin x). The
2
particular integral is given by
( )
1 1 1 1 1
yp (x) = 2
(sin 5x − sin x) = 2
sin 5x − 2 sin x
2D +4 2 D +4 D +4
( ) ( )
1 1 1 1 1 1
= sin 5x − sin x = − sin 5x + sin x
2 −(5)2 + 4 −(1)2 + 4 2 21 3

d2 y dy
(b) 2
+2 + y = cos2 x.
dx dx

Solution
The right-hand side function can be rewritten as
1
cos2 x = cos x cos x = (1 + cos 2x)
2
1
In terms of the D operator the given equation becomes (D2 + 2D + 1)y = (1 + cos 2x). The
2
particular integral is given by
( )
1 1 1 1 1
yp (x) = 2
(1 + cos 2x) = 2
(1) + 2 cos 2x
2 D + 2D + 1 2 D + 2D + 1 D + 2D + 1
( ) ( )
1 1 1 1
= 1+ cos 2x = 1+ cos 2x
2 −(2) + 2D + 1
2 2 2D − 3
( ) ( ) ( )
1 2D + 3 1 2D + 3 1 1
= 1+ cos 2x = 1 + cos 2x = 1 − (2D + 3) cos 2x
2 4D2 − 9 2 −4(2)2 − 9 2 25
( )
1 4 3
= 1+ sin 2x − cos 2x
2 25 25

Exercise:

46
3.2 Solution of non-homogeneous linear ODEs with constant coefficients ⃝Francis
c Oketch

1. Find the complete solution of the following differential equations.


d2 y dy 1 1
(a) +2 + y = sin x cos 2x. [ans: y = (Ax + B)e−x − (6 cos 3x + 8 sin 3x) + cos x]
dx2 dx 200 4
d2 y dy ( √ √ ) 1
(b) −2 + 4y = ex sin2 ( x2 ). [ans: y = ex A cos 3x + B sin 3x + ex (2 − 3 cos x)]
dx2 dx 12
d2 y dy
(c) +2 + y = sin x sin 2x.
dx2 dx
d2 y dy
(d) +2 + y = cos x cos 2x.
dx2 dx

Case 8: When R(x) is a product of sin αx or cos αx and a polynomial


In this case, we replace sin αx or cos αx by eiαx then use the exponential shift rule. In case R(x)
involves cos αx we extract the real part of the resulting solution and in case R(x) involves sin αx we
extract the imaginary part.

Example(s):
d2 y
(a) Find the particular integral of the equation + y = (x + 1) sin x.
dx2

Solution
In terms of the D operator the given equation becomes (D2 + 1)y = (x + 1) sin x. The particular
integral is given by
( )
1 1
yp (x) = 2 (x + 1) sin x = Im 2
(x + 1)eix
D +1 D +1
1
Let I = (x + 1)eix . Thus, we have
D2 +1
1
I = (x + 1)eix . Shifting eix to the left yields.
D2 +1 ( )
1 1 −1 x2
ix ix i2x D ix 1
= e (x + 1) = e (x + 1) = e (x + 1) = e +x
(D + i)2 + 1 D2 + i2D D + i2 D + i2 2
( ) [ ]( )
eix 1 x2 eix D D2 x2
= { } +x = 1− + + ··· +x
i2 D 2 i2 i2 −4 2
1+
( i2 )
e ix x2 x+1 1 eix ( 2 )
= +x+i − = 2x + 4x + i2x + i2 − 1
i2 2 2 4 i8
i ( )
= − (cos x + i sin x) 2x2 + 4x + i2x + i2 − 1
8
1 {[ ] [ ]}
= − −(2x + 2) cos x − (2x2 + 4x − 1) sin x + i (2x2 + 4x − 1) cos x − (2x + 2) sin x
8
1[ ]
Extracting the imaginary part of I yields yp (x) = − (2x2 + 4x − 1) cos x − (2x + 2) sin x .
8

Exercise:
1. Find the general solution of the following equations
d2 y dy
(a) 2
−2 + y = ex x sin x. [ans: y = (Ax + B)ex − ex (2 cos x + x sin x)]
dx dx
(b) (D2 − 4D + 4)y = 8x2 e2x sin 2x. [ans: y = (Ax + B)e2x + e2x [(3 − 2x2 ) sin 2x − 4x cos 2x]]
d2 y dy 1
(c) 2
+ = x cos x. [ans: y = A + Bex − (2 sin x − cos x)]
dx dx 2
2 2 x
(d) (D + 4)y = x sin x. [ans: y = A cos 2x + B sin 2x + (1 + 2 sin 2x)]
8

47
3.2 Solution of non-homogeneous linear ODEs with constant coefficients ⃝Francis
c Oketch

Lecture 9

3.2.2 Method of undetermined coefficients (UC)


This method is used to find the particular integral if the complementary function is known. The
method is applicable when R(x) is eαx , sin αx, cos αx, a polynomial or finite sum (or product) of
such functions.

Suppose that R(x) is one of the functions given above. Then, in this method we let yp (x) be the
general form of the function R(x), which involves unknown constant(s) to be determined. The choice
of yp (x) is given in the table below.

Table 1: How to choose the undetermined coefficients


Term in R(x) Choice of yp (x)
eαx Aeαx
xn An xn + An−1 xn−1 + An−2 xn−2 + · · · + A2 x2 + A1 x + A0
cos βx or sin βx A cos βx + B sin βx

→ Note: a constant term is a polynomial of degree zero.

 Rules:

1. If yp (x) contains a term that is obtainable from yc (x), then refine yp (x) by multiplying the
affected term by x (or by x2 if this solution is a double root). For example, if yc (x) = c1 ex +c2 e2x
and R(x) = e2x , the appropriate choice of yp (x) is yp (x) = Axe2x , where A is the undetermined
coefficient.

2. If R(x) is sum of functions listed in several lines of the above table in the first column, then the
choice of yp (x) will be the sum of the function in the corresponding lines in the second column.
For example,

• If R(x) = e2x + 3x2 , the appropriate choice of yp (x) is yp (x) = Ae2x + Bx2 + Cx + D, where
A, B, C and D are the undetermined coefficients.
• If R(x) = 3x cos(2x), the appropriate choice of yp (x) is

yp (x) = [A1 x + A2 ][A3 cos 2x + A4 sin 2x] = Ax cos 2x + Bx sin 2x + C cos 2x + D sin 2x,

where A, B, C and D are the undetermined coefficients.

Once an appropriate choice for yp (x) is found, follow these steps:

 Compute the respective derivatives of yp (x).

 Substitute yp (x) and its derivatives into the given differential equation and simplify the resulting
equation.

 Equate the coefficients of the corresponding functions on the left and right hand sides of the
resulting equation.

 Solve the resulting system of algebraic equations to obtain the values of the undetermined
coefficients.

Example(s):
Use the method of undetermined coefficients to find the complete solution of the following differential
equations.

48
3.2 Solution of non-homogeneous linear ODEs with constant coefficients ⃝Francis
c Oketch

d2 y dy
(a) 2
−2 + 2y = x sin x.
dx dx

Solution
In terms of the D operator the given differential equation becomes (D2 − 2D + 2)y = x sin x.
We first need to find the complementary function.

i) The complementary function


The auxiliary equation is D2 − 2D + 2 = 0. Hence, the roots are D = 1 ± i (complex
conjugate). The complementary function is given by

yc (x) = ex (A1 cos x + B1 sin x) = A1 ex cos x + B1 ex sin x

ii) The particular integral


By the method of undetermined coefficients, let yp (x) = (A2 x + B2 )(A3 sin x + B3 cos x).
Expanding yields

yp (x) = Ax sin x + Bx cos x + C cos x + D sin x (∗)

Clearly, none of the terms in yp (x) is contained in yc (x) so we cannot refine the yp (x).
Equation (∗) is a solution to the given differential equation and so it must satisfy it.
Computing the respective derivatives of equation (∗), we obtain

yp′ (x) = Ax cos x − Bx sin x + (A − C) sin x + (B + D) cos x (∗∗)

yp′′ (x) = −Ax sin x − Bx cos x + (2A − C) cos x − (2B + D) sin x (∗ ∗ ∗)


Substituting equations (∗), (∗∗) and (∗ ∗ ∗) into the given differential equation yields

yp′′ (x) − 2yp′ (x) + 2yp (x) = x sin x

That is,

−Ax sin x − Bx cos x + (2A − C) cos x − (2B + D) sin x − 2Ax cos x + 2Bx sin x
−2(A − C) sin x − 2(B + D) cos x + 2Ax sin x + 2Bx cos x + 2C cos x + 2D sin x
= x sin x

Collect the like terms to get

(−A + 2A + 2B)x sin x + (−2A − B + 2B)x cos x + (2A − C − 2B − 2D + 2C) cos x


+(−2B − D − 2A + 2C + 2D) sin x = x sin x

Simplify to get

(A + 2B)x sin x + (−2A + B)x cos x + (2A − 2B + C − 2D) cos x


+(−2A − 2B + 2C + D) sin x = x sin x

Equating the corresponding coefficients, we get:


 Coefficients of x sin x: A + 2B = 1 (i)
 Coefficients of x cos x: −2A + B = 0 (ii)
 Coefficients of cos x: 2A − 2B + C − 2D = 0 (iii)
 Coefficients of sin x: −2A − 2B + 2C + D = 0 (iv)
Solving equation (i) to (iv) simultaneously yields
1 2 14 2
A = ,B = ,C = ,D =
5 5 25 25
Substituting the values of A, B, C and D into equation (∗) yields:
1 2 14 2
yp (x) = x sin x + x cos x + cos x + sin x
5 5 25 25

49
3.2 Solution of non-homogeneous linear ODEs with constant coefficients ⃝Francis
c Oketch

Therefore, the complete (or general) solution is y = yc (x) + yp (x). That is,

1 2 14 2
y = ex (A1 cos x + B1 sin x) + x sin x + x cos x + cos x + sin x
5 5 25 25

d2 y dy
(b) 2
−2 − 3y = xe−x .
dx dx

Solution
In terms of the D operator the given equation becomes (D2 − 2D − 3)y = xe−x . We first need
to find the complementary function.

i) The complementary function


The auxiliary equation is D2 − 2D − 3 = 0. Hence, the roots are D1 = −1, D2 = 3. The
complementary function is given by yc (x) = A1 e−x + A2 e3x .
ii) The particular integral
By the method of undetermined coefficients, let yp (x) = (A1 + B1 x)(A2 e−x ). Expanding
yields yp (x) = Ae−x + Bxe−x . Since Ae−x is contained in yc (x), we refine this choice of
yp (x) by multiplying the term Ae−x by x2 . Hence, the particular integral becomes

yp (x) = Ax2 e−x + Bxe−x (∗)

This is a solution to the given differential equation and so it must satisfy the given
differential equation. Computing the respective derivatives, we obtain

yp′ (x) = −Ax2 e−x + (2A − B)xe−x + Be−x (∗∗)

yp′′ (x) = Ax2 e−x + (−4A + B)xe−x + (2A − 2B)e−x (∗ ∗ ∗)

Substituting equations (∗), (∗∗) and (∗ ∗ ∗) in the given differential equation yields

yp′′ (x) − 2yp′ (x) − 3yp (x) = xe−x

That is,

Ax2 e−x + (−4A + B)xe−x + (2A − 2B)e−x + 2Ax2 e−x + (−4A + 2B)xe−x
−2Be−x − 3Ax2 e−x − 3Bxe−x = xe−x

Collect the like terms to get

(A + 2A − 3A)x2 e−x + (−4A + B − 4A + 2B − 3B)xe−x + (2A − 2B − 2B)e−x = xe−x

Simplify to get

(−8A)xe−x + (2A − 4B)e−x = xe−x

Equating the corresponding coefficients, we get:


 Coefficients of xe−x : −8A = 1 (i)
 Coefficients of e−x : 2A − 4B = 0 (ii)
Solving equation (i) and (ii) simultaneously yields
1 1
A = − ,B = −
8 16

Substituting the values of A and B into equation (∗) yields:


1 1
yp (x) = − x2 e−x − xe−x
8 16

50
3.2 Solution of non-homogeneous linear ODEs with constant coefficients ⃝Francis
c Oketch

Therefore, the complete (or general) solution is y = yc (x) + yp (x). That is,
1 1
y = A1 e−x + A2 e3x − x2 e−x − xe−x
8 16

Exercise:
Solve the following differential equations by the method of undetermined coefficients.
d2 y dy
(a) 2
−3 + 2y = 2x2 + ex + 2xex + 4e3x .
dx dx

Solution
In terms of the D operator the given equation becomes (D2 − 3D + 2)y = 2x2 + ex + 2xex + 4e3x .
We first need to find the complementary function.
i) The complementary function
The auxiliary equation is D2 − 3D + 2 = 0. Hence, the roots are D1 = 1, D2 = 2. The
complementary function is given by yc (x) = A1 ex + A2 e2x .
ii) The particular integral
By the method of undetermined coefficients, let yp (x) = Ax2 +Bx+C +Dxex +Eex +F e3x .
Since ex is contained in yc (x), we refine this choice of yp (x) by multiplying the term Eex
by x2 . Hence, the particular integral becomes
yp (x) = Ax2 + Bx + C + Dxex + Ex2 ex + F e3x (∗)

This is a solution to the given differential equation and so it must satisfy the given
differential equation. Computing the respective derivatives, we obtain
yp′ (x) = 2Ax + B + Dxex + Dex + Ex2 ex + 2Exex + 3F e3x (∗∗)

yp′′ (x) = 2A + Dxex + 2Dex + Ex2 ex + 4Exex + 2Eex + 9F e3x (∗ ∗ ∗)


Substituting equations (∗), (∗∗) and (∗ ∗ ∗) into the given differential equation yields
yp′′ (x) − 3yp′ (x) + 2yp (x) = 2x2 + ex + 2xex + 4e3x
That is,
2A + Dxex + 2Dex + Ex2 ex + 4Exex + 2Eex + 9F e3x − 6Ax − 3B − 3Dxex − 3Dex
−3Ex2 ex − 6Exex − 9F e3x + 2Ax2 + 2Bx + 2C + 2Dxex + 2Ex2 ex + 2F e3x
= 2x2 + ex + 2xex + 4e3x
Collect the like terms to get
(2A)x2 + (2B − 6A)x + (2A − 3B + 2C) + (2D + 2E − 3D)ex
+(D + 4E − 3D − 6E + 2D)xex + (E − 3E + 2E)x2 ex
+(9F − 9F + 2F )e3x = 2x2 + ex + 2xex + 4e3x
Simplify to get
(2A)x2 + (2B − 6A)x + (2A − 3B + 2C) + (2E − D)ex + (−2E)xex + (2F )e3x
= 2x2 + ex + 2xex + 4e3x
Equating the corresponding coefficients, we get:
2A = 2, 2B − 6A = 0, 2A − 3B + 2C = 0, 2E − D = 1, −2E = 2, 2F = 4
Solving yields
7
A = 1, B = 3, C = , D = −3, E = −1, F = 2
2
Substituting the values of A, B, C, D, E and F into equation (∗) yields:
7
yp (x) = x2 + 3x + − 3xex − x2 ex + 2e3x
2

51
3.2 Solution of non-homogeneous linear ODEs with constant coefficients ⃝Francis
c Oketch

Therefore, the complete (general) solution is y = yc (x) + yp (x). That is,

7
y = A1 ex + A2 e2x + x2 + 3x + − 3xex − x2 ex + 2e3x
2

d2 y dy 1
(b) 2
−3 − 4y = 2 sin x. [ans: y = A1 e−x + A2 e4x + (3 cos x − 5 sin x)]
dx dx 17
d2 y dy
(c) −2 + y = 6xex . [hint: let yp (x) = Ax3 ex + Bx2 ex , ans: y = ex (A1 + A2 x + x3 )]
dx2 dx
d2 y dy 1
(d) 2
+3 + 2y = cos x. [ans: y = (3 sin x + cos x) + Ae−x + Be−2x ]
dx dx 10
d2 y dy
(e) +2 + y = x2 + 1. [ans: y = x2 − 4x + 7 + (Ax + B)e−x ]
dx2 dx
ex
(f) y ′′ − 3y ′ − 4y = −8ex cos 2x. [ans: y = Ae4x + Be−x + (10 cos 2x + 2 sin 2x)]
13
(g) y ′′ − 2y ′ + y = x2 ex . [ans: y =]
1
(h) y ′′ + y = sin x. [ans: y = A cos x + B sin x − x cos x]
2
(i) y ′′ − 6y ′ + 10y = x2 sin 2x + cos 2x. [hint:
yp = (A1 x2 + A2 x + A3 ) sin 2x + (B1 x2 + B2 x + B3 ) cos 2x]
( )
(j) y ′′ + 20y ′ = 8t3 + 7t + 6e2t . [hint: yp (t) = t At3 + Bt2 + Ct + D + Ee2t ]

(k) y ′′ + 4y ′ + 5y = 2e−2x ; y(0) = 1, y ′ (0) = −2. [ans: y = e−2x (2 − cos x)]


d3 y d2 y dy
(l) [Assignment] − 3 +2 = 10 + 4xe2x . [hint: let yp (x) = Ax + Bx2 e2x + Cxe2x ,
dx3 dx2 dx
ans: y = A1 + A2 ex + A3 e2x + 5x + e2x (x2 − 3x)]

3.2.3 Method of variation of parameters


This method is applicable for all forms of the function R(x). It is used to find the particular integral if
the complementary function (yc ) is known. The particular integral (yp ) is then obtained by replacing
the arbitrary constants in yc by unknown functions of the independent variable. Thus, the task
is to determine the arbitrary functions. Consider a second-order non-homogeneous linear ordinary
differential equation of the form

d2 y dy
+ P (x) + Q(x)y = R(x) (19)
dx2 dx
Suppose the complementary function is yc (x) = Ay1 (x) + By2 (x), where A and B are arbitrary
constants while y1 (x) and y2 (x) are independent solutions for the homogeneous part

d2 y dy
+ P (x) + Q(x)y = 0
dx2 dx
Then, by the method of variation of parameters, the particular integral is given by
∫ ∫
y2 (x)R(x). y1 (x)R(x)
yp (x) = −y1 (x) dx + y2 (x) dx ,
W (y1 , y2 ) W (y1 , y2 )

y y2

where W (y1 , y2 ) is the Wronskian of y1 (x) and y2 (x), defined by W (y1 , y2 ) = 1′ .
y1 y2′
d2 y
→ Note: The (leading) coefficient of in equation (19) must be unity. If it is not unity, then make
dx2
it unity by dividing the ODE by the leading coefficient.

52
3.2 Solution of non-homogeneous linear ODEs with constant coefficients ⃝Francis
c Oketch

Proof. If yc (x) = Ay1 (x) + By2 (x) is the complementary function for the homogeneous part

d2 y dy
+ P (x) + Q(x)y = 0,
dx2 dx
then each of the functions y1 (x) and y2 (x) must satisfy the above homogeneous ODE, i.e.,

y1′′ (x) + P (x)y1′ (x) + Q(x)y1 (x) = 0 (a)

and
y2′′ (x) + P (x)y2′ (x) + Q(x)y2 (x) = 0 (b)
To find the particular integral by the method of variation of parameters, we let the arbitrary constants
A and B to be functions of the independent variable x, i.e.,

yp (x) = A(x)y1 (x) + B(x)y2 (x) (∗)

We need to determine the arbitrary functions A(x) and B(x), as follows. Since equation (∗) is a
solution of the non-homogeneous ODE (19), it must satisfy it. Now, differentiating equation (∗) with
respect to x yields

yp′ (x) = −A(x)y1′ (x) + B(x)y2′ (x) + A′ (x)y1 (x) + B ′ (x)y2 (x)

To make calculations easier, we impose the condition that the sum containing the derivatives of the
arbitrary functions should be equal to zero, i.e.,

A′ (x)y1 (x) + B ′ (x)y2 (x) = 0 (i)

Hence, yp′ (x) reduces to the simpler form

yp′ (x) = A(x)y1′ (x) + B(x)y2′ (x) (∗∗)

Differentiating (∗∗) with respect to x yields

yp′′ (x) = A(x)y1′′ (x) + B(x)y2′′ (x) + A′ (x)y1′ (x) + B ′ (x)y2′ (x) (∗ ∗ ∗)

Substituting equations (∗), (∗∗) and (∗ ∗ ∗) into the non-homogeneous ODE (19) yields

yp′′ (x) + pyp′ (x) + qyp (x) = R(x)

That is,

{A(x)y1′′ (x) + B(x)y2′′ (x) + A′ (x)y1′ (x) + B ′ (x)y2′ (x)} + P (x){A(x)y1′ (x) + B(x)y2′ (x)}
+Q(x){A(x)y1 (x) + B(x)y2 (x)} = R(x)

Regrouping yields

A(x){y1′′ (x) + P (x)y1′ (x) + Q(x)y1 (x)} + B(x){y2′′ (x) + P (x)y2′ (x) + Q(x)y2 (x)}
+A′ (x)y1′ (x) + B ′ (x)y2′ (x) = R(x)

From equations (a) and (b), the first two brackets on the left-hand side of the above equation vanish.
Thus, the above equation reduces to the simpler form

A′ (x)y1′ (x) + B ′ (x)y2′ (x) = R(x) (ii)

In matrix form, equations (i) and (ii) become


( )[ ] ( )
y1 (x) y2 (x) A′ (x) 0
=
y1′ (x) y2′ (x) B ′ (x) R(x)

53
3.2 Solution of non-homogeneous linear ODEs with constant coefficients ⃝Francis
c Oketch

Using Cramer’s rule, we obtain



0 y2 (x)


R(x) y2′ (x) −y2 (x)R(x) y2 (x)R(x)

A (x) = = ⇒ A(x) = − dx
W (y1 , y2 ) W (y1 , y2 )
y1 (x) y2 (x)
′ ′
y1 (x) y2 (x)


y (x) y ′ (x)
1 1

0 R(x) y (x)R(x) y1 (x)R(x)

B (x) = = 1 ⇒ B(x) = dx
W (y1 , y2 ) W (y1 , y2 )
y1 (x) y2 (x)

y1 (x) y2′ (x)

Substituting the expressions for A(x) and B(x) into equation (∗) yields
∫ ∫
y2 (x)R(x) y1 (x)R(x)
yp (x) = −y1 (x) dx + y2 (x) dx
W (y1 , y2 ) W (y1 , y2 )

→ Note: we don’t write constant of integration in the expression of A(x) and B(x), since these can
be absorbed with the arbitrary constants of the complementary function.

→ Note: the above procedure can be easily extended to higher order non-homogeneous linear ODEs.

Example(s):
Use the method of variation of parameters to find the complete (or general) solution of the following
differential equations.

d2 y
(a) + y = sec x.
dx2

Solution
In terms of the D operator, the given differential equation becomes (D2 + 1)y = sec x. We first
need to find the complementary function.

i) The complementary function


The auxiliary equation is D2 + 1 = 0. Hence, the roots are D = ±i (complex conjugate).
Thus, the complementary function is given by

yc (x) = A cos x + B sin x,

where A and B are arbitrary constants. Thus, y1 (x) = cos x and y2 (x) = sin x.
ii) The particular integral
To find the particular integral by the method of variation of parameters, we let the arbitrary
constants A and B to be functions of the independent variable x, i.e.,

yp (x) = A(x) cos x + B(x) sin x (∗)

The arbitrary functions are given by


∫ ∫
y2 (x)R(x) y1 (x)R(x)
A(x) = − dx and B(x) = dx,
W (y1 , y2 ) W (y1 , y2 )

where R(x) = sec x. Now, the Wronskian of y1 (x) and y2 (x) is given by

y (x) y2 (x) cos x sin x

W (y1 , y2 ) = 1′ = = cos2 x + sin2 x = 1.
y1 (x) y2′ (x) − sin x cos x

54
3.2 Solution of non-homogeneous linear ODEs with constant coefficients ⃝Francis
c Oketch

Hence,
∫ ∫ ∫
y2 (x)R(x) sin x
A(x) = − dx = − sin x sec xdx = − dx = ln | cos x|
W (y1 , y2 ) cos x

and ∫ ∫ ∫
y1 (x)R(x)
B(x) = dx = cos x sec xdx = 1dx = x
W (y1 , y2 )
Substituting A(x) and B(x) into equation (∗) yields

yp (x) = cos x ln | cos x| + x sin x

Therefore, the general solution is given by y = yc (x) + yp (x). That is,

y = A cos x + B sin x + cos x ln | cos x| + x sin x

d2 y dy
(b) 2
−2 + y = ex ln(x), (x > 0).
dx dx

Solution
In terms of the D operator the given differential equation becomes [D2 − 2D + 1]y = ex ln(x).
We first need to find the complementary function.

i) The complementary function


The auxiliary equation is D2 − 2D + 1 = 0. Hence, the roots are D1 = D2 = 1. Thus, the
complementary function is given by

yc (x) = (Ax + B) ex ,

where A and B are arbitrary constants. Thus, y1 (x) = xex and y2 (x) = ex .
ii) The particular integral
To find the particular integral by the method of variation of parameters, we let the arbitrary
constants A and B to be functions of the independent variable x, i.e.,

yp (x) = A(x)xex + B(x)ex (∗)

The arbitrary functions are given by


∫ ∫
y2 (x)R(x) y1 (x)R(x)
A(x) = − dx and B(x) = dx,
W (y1 , y2 ) W (y1 , y2 )

where R(x) = ex ln(x). Now, the Wronskian of y1 (x) and y2 (x) is given by

y (x) y2 (x) xex ex

W (y1 , y2 ) = 1′ ′ = = −e2x
y1 (x) y2 (x) (x + 1)e ex
x

Hence, ∫ ∫ ∫
y2 (x)R(x) ex · ex ln(x)
A(x) = − dx = − dx = − ln(x)dx
W (y1 , y2 ) e2x
1
Using integration by parts: put u = ln x, dv = dx ⇒ du = dx, v = x.
x

⇒ A(x) = x ln x − dx = x[ln(x) − 1]

Similarly, ∫ ∫ ∫
y1 (x)R(x) xex · ex ln(x)
B(x) = dx = dx = x ln(x)dx
W (y1 , y2 ) e2x

55
3.2 Solution of non-homogeneous linear ODEs with constant coefficients ⃝Francis
c Oketch

1 x2
Using integration by parts: put u = ln x, dv = xdx ⇒ du = dx, v = .
x 2

x2 x x2
⇒ B(x) = − ln x + dx = [1 − 2 ln(x)]
2 2 4
Substituting A(x) and B(x) into equation (∗) yields
[ ]
x2 1
yp (x) = x (ln x − 1) +
2
(1 − 2 ln x) ex = x2 ex (2 ln x − 3)
4 4

Therefore, the general solution is given by y = yc (x) + yp (x). That is,


1
y = (Ax + B) ex + x2 ex (2 ln x − 3)
4

Exercise:

1. Find the general solution of the following differential equations.

d2 y
(a) + 4y = tan 2x.
dx2
Solution
In terms of the D operator the given equation becomes (D2 + 4)y = tan 2x. We first need
to find the complementary function.
i) The complementary function
The auxiliary equation is D2 + 4 = 0. Hence, the roots are D = ±i2 (complex
conjugate). Thus, the complementary function is

yc (x) = A cos 2x + B sin 2x,

where A and B are arbitrary constants. Thus, y1 (x) = cos 2x and y2 (x) = sin 2x.
ii) The particular integral
To find the particular integral by the method of variation of parameters, we let the
arbitrary constants A and B to be functions of the independent variable x, i.e.,

yp (x) = A(x) cos x + B(x) sin x (∗)

where ∫ ∫
y2 (x)R(x) y1 (x)R(x)
A(x) = − dx and B(x) = dx,
W (y1 , y2 ) W (y1 , y2 )
where R(x) = tan 2x. Now, the Wronskian of y1 (x) and y2 (x) is given by

y (x) y (x) cos 2x sin 2x
1 2
W (y1 , y2 ) = ′ = = 2[cos2 2x + sin2 2x] = 2
y1 (x) y2′ (x) −2 sin 2x 2 cos 2x

Hence,
∫ ∫ ∫
y2 (x)R(x) sin 2x tan 2x 1
A(x) = − dx = − dx = − sin 2x tan 2xdx
W (y1 , y2 ) 2 2
Using integration by parts: put
1
u = tan 2x, dv = sin 2xdx ⇒ du = 2 sec2 2xdx, v = − cos 2x
2
Thus,
[ ∫ ] [ ∫ ]
1 1 1 1 dx
A(x) = − − cos 2x tan 2x + cos 2x sec 2xdx = − − sin 2x +
2
2 2 2 2 cos 2x

56
3.2 Solution of non-homogeneous linear ODEs with constant coefficients ⃝Francis
c Oketch

By the t−substitution method, let


dt
t = tan x ⇒ dt = sec2 xdx = (1 + tan2 x)dx = (1 + t2 )dx ⇒ dx =
1 + t2
1 t
⇒ cos x = √ , sin x = √
1 + t2 1 + t2
Hence,
( )
1 − t2 dx dt 1 1 1
cos 2x = cos2 x − sin2 x = ⇒ = = + dt
1 + t2 cos 2x 1−t 2 2 1+t 1−t

[ ∫ ( ) ]
1 1 1 1 1 1 1
⇒ A(x) = − − sin 2x + + dt = sin 2x + ln (1 − t)
2 2 2 1+t 1−t 4 2
1 1
= sin 2x − [ln(1 + t) − ln(1 − t)]
4( 4 )
1 1 + t
= sin 2x − ln
4 1 − t
Back substitution yields
( )
1 1 + tan x
A(x) = sin 2x − ln = 1 (sin 2x − ln |sec 2x + tan 2x|)
4 1 − tan x 4
Similarly,
∫ ∫ ∫
y1 (x)R(x) cos 2x tan 2x 1
B(x) = dx = dx = sin 2xdx
W (y1 , y2 ) 2 2

1 x2
Using integration by parts: put u = ln x, dv = xdx ⇒ du = dx, v = .
x 2

x2 x x2 1
⇒ B(x) = − ln x + dx = [1 − 2 ln(x)] = − cos 2x
2 2 4 4
Substituting A(x) and B(x) into equation (∗) yields
1 1
yp (x) = (sin 2x − ln |sec 2x + tan 2x|) cos 2x − cos 2x sin 2x
4 4
1
= − cos 2x ln |sec 2x + tan 2x|
4
Therefore, the general solution is given by y = yc (x) + yp (x). That is,

1
y = A cos 2x + B sin 2x − cos 2x ln |sec 2x + tan 2x|
4

d2 y dy 1
(b) +3 + 2y = .
dx2 dx 1 + ex
Solution
1
In terms of the D operator the given equation becomes (D2 + 3D + 2)y = . We first
1 + ex
need to find the complementary function.
i) The complementary function
The auxiliary equation is D2 + 3D + 2 = 0. Hence, the roots are D1 = −1, D2 = −2.
The complementary function is given by

yc (x) = Ae−x + Be−2x ,

where A and B are arbitrary constants. Thus, y1 (x) = e−x and y2 (x) = e−2x .

57
3.3 Cauchy-Euler equations ⃝Francis
c Oketch

ii) The particular integral


To find the particular integral by the method of variation of parameters, we let the
arbitrary constants A and B to be functions of the independent variable x, i.e.,
yp (x) = A(x) cos x + B(x) sin x (∗)
where ∫ ∫
y2 (x)R(x) y1 (x)R(x)
A(x) = − dx and B(x) = dx,
W (y1 , y2 ) W (y1 , y2 )
1
where R(x) = . Now, the Wronskian of y1 (x) and y2 (x) is given by
1 + ex

y (x) y (x) e−x e−2x
1
= −e−3x
2
W (y1 , y2 ) = ′ =
y1 (x) y2′ (x) −e−x −2e−2x
Hence,
∫ ∫ ( ) ∫
y2 (x)R(x) e−2x 1 ex
A(x) = − dx = − · dx = dx = ln |1 + ex |
W (y1 , y2 ) 1 + ex −e−3x 1 + ex
Similarly,
∫ ∫ ( ) ∫
y1 (x)R(x) e−x 1 e2x
B(x) = dx = · dx = − dx
W (y1 , y2 ) 1 + ex −e−3x 1 + ex
∫ [ ]
ex
= − ex − dx = −ex + ln |1 + ex |
1 + ex
Substituting A(x) and B(x) into equation (∗) yields
yp (x) = e−x ln |1 + ex | − e−2x (ex − ln |1 + ex |)
Therefore, the general solution is given by y = yc (x) + yp (x). That is,
y = Ae−x + Be−2x + e−x ln |1 + ex | − e−2x (ex − ln |1 + ex |)

d2 y
(c) + y = tan x. [ans: y = A cos x + B sin x − cos x ln |sec x + tan x|]
dx2
d2 y dy ex
(d) − 2 + y = . [ans: y = (Ax + B) ex − (1 + ln x) ex ]
dx2 dx x2
d2 y
(e) i) + y = x − cot x. [ans: y =]
dx2
d2 y
ii) + y = x sin x. [ans: y =]
dx2
2
d y dy
iii) 2
+3 + 2y = e−3x sin x. [ans: y =]
dx dx
d2 y dy
(f) 2
+4 + 5y = e−2x sec x. [ans: y = e−2x (A cos x + B sin x + cos x ln | cos x| + x sin x)]
dx dx

Lecture 10

3.3 Cauchy-Euler equations


A general Cauchy-Euler equation of order n is a linear differential equation with variable coefficients
that takes the form
dn y n−1 d
n−1 y
n−2 d
n−2 y 2
2d y dy
an xn n
+ an−1 x n−1
+ a n−2 x n−2
+ · · · + a 2 x 2
+ a1 x + a0 y = R(x), (20)
dx dx dx dx dx
where a0 , a1 , · · · , an are constants. In equation (20), the derivative of the k th order is multiplied by xk
and by a constant. The transformation x =. et reduces equation (20) to a linear differential equation
with constant coefficients.

58
3.3 Cauchy-Euler equations ⃝Francis
c Oketch

Theorem 3.1. Let y be n-times differentiable function of x and let x = et . Then,


dy dy
(i) x =
dx dt
( )
d2 y d d d2 y dy
(ii) x2 2 = −1 y = 2 −
dx dt dt dt dt
( )( )
d3 y d d d d3 y d2 y dy
(iii) x3 3 = −1 −2 y = 3 −3 2 +2
dx dt dt dt dt dt dt
etc.

Proof. (i) From the chain rule, we have

dy dy dt 1 dy dt 1
= = , (since x = et ⇒ t = ln x ⇒ = )
dx dt dx x dt dx x
dy dy
∴ x =
dx dt

(ii) Differentiating the result in proof (i) above with respect to x yields
( ) ( ) ( )
d dy d dy d dy dt
x = = (by chain rule)
dx dx dx dt dt dt dx
d2 y dy 1 d2 y 2
2d y d2 y dy
⇒ x 2+ = 2
⇒ x 2
= 2
−x
dx dx x dt dx dt dx
d 2y d2 y dy
∴ x2 2 = −
dx dt2 dt

(iii) Differentiating the result in proof (ii) above with respect to x yields
( ) ( ) ( )
d d2 y d d2 y dy d d2 y dy dt
x2 2 = − = − (by chain rule)
dx dx dx dt2 dt dt dt2 dt dx
( )
3y d2 y d3 y d2 y d3 y d3 y d2 y 2
2d 1 2d y
⇒ x + 2x = − 2 ⇒ x3 = − − 2x
dx3 dx2 x dt3 dt dx3 dt3 dt2 dx2
( )
3y d3 y d2 y d2 y dy
3d
⇒ x = − − 2 −
dx3 dt3 dt2 dt2 dt
d3 y d3 y d2 y dy
∴ x3 = − 3 +2
dx3 dt 3 dt 2 dt

Alternatively, the theorem and proof are given in terms of the D-operators as:
d d
Theorem 3.2. Let y be n-times differentiable function of x and let x = et , Dx = and Dt = .
dx dt
Then,

(i) xDx = Dt

(ii) x2 Dx2 = Dt (Dt − 1)

(iii) x3 Dx3 = Dt (Dt − 1)(Dt − 2)

etc.
dy dy dt dt 1
Proof. (i) From the chain rule, we have = but x = et ⇒ t = ln x ⇒ = .
dx dt dx dx x
dy 1 dy dy dy
⇒ = ⇒ x = ⇒ xDx y = Dt y ⇒ xDx = Dt .
dx x dt dx dt
(ii) x2 Dx2 = x(xDx )Dx = xDt Dx = et Dt Dx = (Dt − 1)et Dx = (Dt − 1)xDx = (Dt − 1)Dt .

59
3.3 Cauchy-Euler equations ⃝Francis
c Oketch

(iii) x3 Dx3 = x(x2 Dx2 )Dx = x(Dt − 1)Dt Dx = et (Dt − 1)Dt Dx = (Dt − 2)(Dt − 1)et Dx = (Dt −
2)(Dt − 1)xDx = (Dt − 2)(Dt − 1)Dt .

Example(s):

1. Solve the following differential equations


d2 y dy
(a) x2 2
− 5x + 8y = 2 ln x.
dx dx
Solution
We first need to transform the given differential equation to a linear equation with constant
dy dy d2 y d2 y dy
coefficients, as follows. Let x = et . Then, ln x = t, x = and x2 2 = 2 − .
dx dt dx dt dt
Substituting into the given differential equation yields

d2 y dy dy d2 y dy
2
− − 5 + 8y = 2t ⇒ 2
− 6 + 8y = 2t (∗)
dt dt dt dt dt
d
Let D = . Then in terms of the D operator, equation (∗) becomes
dt
[D2 − 6D + 8]y = 2t

i) The complementary function


The auxiliary equation is D2 − 6D + 8 = 0. Thus, the roots are D1 = 4, D2 = 2. Hence,
the complementary function is

yc (t) = Ae4t + Be2t ,

where A and B are arbitrary constants.


ii) The particular integral
1
yp (t) = (2t). Drop the term is D2 since 2 > 1.
D2 − 6D + 8 [ ]
1 1 1 1 3D 9D2
= (2t) = { } (t) = 1+ + + · · · (t)
−6D + 8 4 3D 4 4 16
1−
4
[ ]
1 3 t 3
= t+ = +
4 4 4 16
t 3
Therefore, the general solution is y = yc (x) + yp (x). That is, y = Ae4t + Be2t + + .
4 16
Back substitution yields
ln x 3
y = Ax4 + Bx2 + +
4 16
d2 y dy 2 B x ln x
(b) x 2
+2 − y = ln x. [ans: y = Ax + 2
+ [3 ln x − 2]]
dx dx x x 18
Solution
d2 y dy
The equation can be written as x2 2 + 2x − 2y = x ln x, which is of the Cauchy-Euler
dx dx
type. We first need to transform the above differential equation to a linear equation with
dy dy d2 y
constant coefficients, as follows. Let x = et . Then, ln x = t, x = and x2 2 =
dx dt dx
d2 y dy
− . Substituting into the above differential equation yields
dt2 dt
d2 y dy dy d2 y dy
2
− + 2 − 2y = et t ⇒ + − 2y = et t (∗)
dt dt dt dt2 dt

60
⃝Francis
c Oketch

d
Let D = . Then in terms of the D operator, equation (∗) becomes
dt
[D2 + D − 2]y = et t

i) The complementary function


The auxiliary equation is D2 + D − 2 = 0. Thus, the roots are D1 = 1, D2 = −2.
Hence, the complementary function is

yc (t) = Aet + Be−2t ,

where A and B are arbitrary constants.


ii) The particular integral
1
yp (t) = (et t). Shifting et to the left yields.
D2+D−2
1 1
= et (t) = et 2 (t)
(D + 1) + (D + 1) − 2
2 D + 2D + 1 + D + 1 − 2
( ) ( )
1 1 1 1 t2 1 t2
= et 2 (t) = et D−1 (t) = et = et { }
D + 3D D+3 D+3 3 2 D 2
1+
3
[ ]( ) [ ]
1 t D D 2 D 3 t 2 1 t 2 t 1
= e 1− + − + ··· = et − +
3 3 9 27 2 3 2 3 9
tet 1
= [3t − 2] + et
18 27
Therefore, the general solution is y = yc (x) + yp (x). That is,

tet 1 tet
y = Aet + Be−2t + [3t − 2] + et = A1 et + Be−2t + [3t − 2]
18 27 18
Back substitution yields
B x ln x
y = A1 x + + [3 ln(x) − 2]
x2 18

Exercise:

1. Find the general solution of the following differential equations.


d2 y dy ln x A ln x
(a) x2 2
−x − 3y = , (x > 0). [ans: y = + Bx3 − (2 ln x + 1)]
dx dx x x 16x
d2 y dy 2y { }
(b) x 2 − + = (ln x)2 . [ans: y = x A cos(ln x) + B sin(ln x) + (ln x)2 − 2 ]
dx dx x
2
d y 3 dy 3
(c) − + y = 2x − 1, (x ̸= 0). [ans: y = Ax3 + Bx + x3 ln x + x2 ]
dx2 x dx x2
ln x
(d) xy ′′ − 2y ′ = x2 ; (x ̸= 0). [ans: y = A + x3 (B + )]
3
1
(e) x2 y ′′ + 6xy ′ + 6y = 2 ; (x ̸= 0). [ans: y = Ax−2 + Bx−3 + x−2 ln |x|]
x

4 Systems of linear ODEs


A system of two linear differential equations of first-order in two dependent variables x and y takes
the general form
dx dy
a0 (t) + a1 (t) + a2 (t)x + a3 (t)y = f1 (t)
dt dt
dx dy
b0 (t) + b1 (t) + b2 (t)x + b3 (t)y = f2 (t)
dt dt

61
⃝Francis
c Oketch

A pair of functions x = f (t) and y = g(t) is said to be a solution of the above system if the two
functions satisfy each of the equations in the system simultaneously. If all the coefficients in the
system are constants, then the system is said to be a system of two equations with constant
coefficients.

To solve a system of linear ODEs, we write the system in terms of the D operator then solve it using
elimination method, as illustrated in the following examples.

Example(s):
1 1
(a) Solve the following system subject to the initial conditions x(0) = and y(0) = .
2 5
dy
+ x = e3t (i)
dt
dx
−y = 0 (ii)
dt

Solution
d
Let D = . In terms of the D operator the given system becomes
dt
x + Dy = e3t
Dx − y = 0

Eliminating x, we have
( )
Dx + D2 y = D e3t
−Dx + y = 0
( ) ( ) ( )
Adding yields D2 + 1 y = D e3t ⇒ D2 + 1 y = 3e3t .

i) The complementary function


The auxiliary equation is D2 + 1 = 0. Hence, the roots are D1,2 = ±i. The complementary
function is

yc (t) = A cos t + B sin t,

where A and B are arbitrary constants.


ii) The particular integral
1 ( ) 1 ( 3t ) 3
3t
yp (t) = 2
3e = 2
3e = e3t
D +1 3 +1 10

Therefore, y = yc (t) + yp (t). That is,


3 3t
y = A cos t + B sin t + e
10
dy
From equation (i), we have x = e3t − . Hence,
dt
( )
d 3 1
x = e3t − A cos t + B sin t + e3t = A sin t − B cos t + e3t
dt 10 10
1 1 1 2
Using the initial conditions, x(0) = and y(0) = , we obtain A = − and B = − .
2 5 10 5
Therefore,
1 ( ) 1 ( )
x= 4 cos t − sin t + e3t and y= −4 sin t − cos t + 3e3t
10 10

62
⃝Francis
c Oketch

(b) Solve the following system of equations.


dx dy
2 − 2 − 3x = t (i)
dt dt
dx dy
2 + 2 + 3x + 8y = 2 (ii)
dt dt

Solution
d
Let D = . In terms of the D operator the given system becomes
dt
(2D − 3)x − 2Dy = t
(2D + 3)x + (2D + 8)y = 2
Eliminating x, we have
−(2D + 3)(2D − 3)x + 2D(2D + 3)y = −(2D + 3)t
(2D − 3)(2D + 3)x + (2D − 3)(2D + 8)y = (2D − 3)2
Adding yields:
2D(2D + 3)y + (2D − 3)(2D + 8)y = −(2D + 3)t + (2D − 3)2
⇒ (4D2 + 6D)y + (4D2 + 16D − 6D − 24)y = − (2 + 3t) + (0 − 6)
⇒ (8D2 + 16D − 24)y = −3t − 8

i) The complementary function


The auxiliary equation is 8D2 + 16D − 24 = 0. Hence, the roots are D1 = 1, D2 = −3. The
complementary function is
yc (t) = Aet + Be−3t ,
where A and B are arbitrary constants.
ii) The particular integral
1 1 1
yp (t) = (−3t − 8) = (−3t − 8) = { } (−3t − 8)
8D2 + 16D − 24 16D − 24 2D
−24 1 −
3
{ } { }
1 2D 1 2 1
= − 1+ + ··· (−3t − 8) = (3t + 8) + D (3t + 8) = {3t + 10}
24 3 24 3 24
1 5
= t+
8 12
Therefore, y = yc (t) + yp (t). That is,
1 5
y = Aet + Be−3t + t +
8 12
dx
To find x, we need to eliminate between equations (i) and (ii). Thus, we have
dt
dx dy
−2 + 2 + 3x = −t
dt dt
dx dy
2 + 2 + 3x + 8y = 2
dt dt
dy
Adding yields 4 + 8y + 6x = 2 − t. Make x the subject
dt
{ }
1 dy
x = 2 − t − 4 − 8y
6 dt
{ ( ) ( )}
1 d −3t 1 5 −3t 1 5
= 2−t−4 t
Ae + Be + t+ − 8 Ae + Be
t
+ t+
6 dt 8 12 8 12
{ ( ) ( )}
1 1 1 5
= 2 − t − 4 Aet − 3Be−3t + − 8 Aet + Be−3t + t +
6 8 8 12

63
⃝Francis
c Oketch

Therefore,
2 1 11
x = −2Aet + Be−3t − t −
3 3 36

Exercise:

1. Solve each of the following systems.

(a) [ans: x = Aet + Be−t and y = −Aet + Be−t + cos t]

dx
+ y = cos t
dt
dy
+ x = − sin t
dt

(b) [ans: y = A + Be2t + 2et and x = A − Be2t − et ]

dy dx
2−y+x+ = 0
dt dt
dy dx
3 +x−y+2 = et
dt dt
1 2 1
(c) [ans: y = Aet + Be−t − tet − 4t + 1 and x = − Be−t − et + t − 1]
2 5 2
dx dy
2 + − 3x − y = t
dt dt
dx dy
+ − 4x − y = et
dt dt

(d) [ans: ]

dx dy
2 + − 2x − 2y = 5et
dt dt
dx dy
+ + 4x + 2y = 5e−t
dt dt

(e) [ans: ]

dx dy
+ − x = −2t
dt dt
dx dy
+ − 3x − y = t2
dt dt

(f) [ans: ]

dx dy
+ − 2x − 4y = et
dt dt
dx dy
+ − y = e4t
dt dt
1 4 2 1 10
(g) [ans: y = Aet + Be3t − t − , x = − Be3t + t − ]
3 9 5 3 9
dx dy
+ + 2x − y = t
dt dt
dx dy
2 + −x−y = 1
dt dt

64
⃝Francis
c Oketch

1 −t 1 2 1
(h) [ans: y = Aet + Be−3t + e (t + 2) + , x = −2Aet + Be−3t − e−t (3t + 1)]
32 4 3 16
dx dy
2 − 2 − 3x = te−t
dt dt
dx dy
2 + 2 + 3x + 8y = 2
dt dt

2. (a) Solve the system below subject to x(0) = 1 and y(0) = 0. [ans: x = cos t and y = − sin t]

dx
= y
dt
dy
= −x
dt

(b) Solve the following system subject to the initial conditions x(0) = −1 and y(0) = 3. [ans:
x = 4e3t − 5e2t and y = 8e3t − 5e2t ]

dx
= x+y
dt
dy
= −2x + 4y
dt

65
⃝Francis
c Oketch

Lecture 11

5 Laplace transforms
Suppose a function f (t) is defined for t ≥ 0. Also, let L denote the Laplace transform operator, then
the Laplace transform of f (t) is a function defined by
∫∞
L [f (t)] = e−st f (t)dt = F (s),
0

where e−st
is the kernel of the transformation; s being the Laplace transform parameter (or dummy
variable) which we think of as a parameter chosen such that the improper integral above converges.

5.1 Properties of Laplace transform


The Laplace transform of some important elementary functions are given in the following examples.

Example(s):
(a) Let f (t) = 1 for t ≥ 0. Then,
 b 
∫∞ ∫ [ ]b [ ]
1 1
L [1] = e−st · 1dt = lim  e−st dt = lim − e−st = − lim e−sb − 1
b→∞ b→∞ s 0 s b→∞
0 0
[ ]
1 1 1 1
= − lim sb − 1 = − [0 − 1] = , s>0
s b→∞ e s s

(b) Let f (t) = eat for t ≥ 0, where a is a constant. Then,


 b 
[ ] ∫∞ ∫ [ ]b
−st −(s−a)t  1
L e at
= e · e dt = lim
at  e dt = lim − e−(s−a)t
b→∞ b→∞ (s − a) 0
0 0
[ ] [ ]
1 1 1 1
= − lim e−(s−a)b − 1 = − lim (s−a)b − 1 = − [0 − 1]
(s − a) b→∞ (s − a) b→∞ e (s − a)
1
= , s>a
(s − a)

(c) Let f (t) = t for t ≥ 0. Then,


 b 
∫∞ ∫
1
L [t] = e−st tdt = lim  e−st tdt . Put u = t, dv = e−st dt. Thus, du = dt, v = − e−st
b→∞ s
0 0
 
   
[ ]b ∫b [ 1
 ]b
1
∫b  1 [ b ] ∫b 
= lim uv − vdu = lim − e−st t + e−st dt = lim − sb + e−st dt
b→∞  0  b→∞  s 0 s  s b→∞  e 
0 0 0
 
∫∞ { }
1  1 1 1 1
= 0 + e−st dt = {0 + L[1]} = 0+ = , s>0
s  s s s s2
0

(d) Let f (t) = t2 for t ≥ 0. Then,


 b 
[ ] ∫∞ ∫
1
L t2 = e−st t2 dt = lim  e−st t2 dt . Put u = t2 , dv = e−st dt. Thus, du = 2tdt, v = − e−st
b→∞ s
0 0
  [ ] 
[ 1 ]b
2
∫b  1  b2 ∫b 
= lim − e−st t2 + e−st tdt = lim − sb + 2 e−st tdt
b→∞  s 0 s  s b→∞  e 
0 0
 
 ∫∞  { }
1 1 1 1 2
= 0+2 e−st tdt = {0 + 2L[t]} = 0+2· 2 = , s>0
s  s s s s3
0

66
5.1 Properties of Laplace transform ⃝Francis
c Oketch

In general,
n! .
L [tn ] = , for n ≥ 0
sn+1

(e) Let f (t) = cos(bt) for t ≥ 0, where b is a real constant. Then,


 
∫∞ ∫c
−st −st
L [cos bt] = e cos(bt)dt = lim  e cos(bt)dt .
c→∞
0 0
1
Put u = cos(bt), dv = e−st dt. Thus, du = −b sin(bt)dt and v = − e−st
   s 
[ ]c ∫c[ 1  ]c
b
∫c 
−st
= lim uv − vdu = lim − e cos(bt) − e−st sin(bt)dt
c→∞  0  c→∞  s 0 s 
0 0
   
[ ] ∫c  ∫c
1 cos(bc) 1 b
= lim 1− − b e−st sin(bt)dt = − lim  e−st sin(bt)dt
s c→∞  esc  s s c→∞
0 0
1
Again, put u = sin(bt), dv = e−st dt. Thus, du = b cos(bt)dt and v = − e−st
  s
 1 [ ]c ∫c 
1 b b
= − lim − e−st sin(bt) + e−st cos(bt)dt
s s c→∞  s 0 s 
0
   
1 b sin(bc) [ ] ∫c
1 
b 
∫∞ 
= − 2 lim − sc +b −st
e cos(bt)dt = − 2 0 + b e−st cos(bt)dt
s s c→∞  e  s s  
0 0
1 b2
= − L[cos(bt)]
s s2
b2 1
Therefore, L[cos(bt)] + 2
L[cos(bt)] = . Making L[cos(bt)] the subject yields
s s
s
L[cos(bt)] = . , s>0
s2 + b2

Similarly,

b s . b
L[sin(bt)] = , L[cosh(bt)] = , and L[sinh(bt)] = , s>0
s2 + b2 s2 − b2 s2 − b2

 Linearity property of Laplace transform


Suppose that f (t) and g(t) are two functions whose Laplace transforms exist. Then,

L [c1 f (t) + c2 g(t)] = c. 1 L [f (t)] + c2 L [g(t)] ,

where c1 and c2 are constants. This equation states that the Laplace transform is a linear operator,
and the property can be readily extended to an arbitrary number of terms. For example, find the
Laplace transform of f (t) = 5e−2t − 3 sin 4t for t ≥ 0.
[ ] [ ] [ ]
L [f (t)] = L 5e−2t − 3 sin 4t = L 5e−2t − L [3 sin 4t] = 5L e−2t − 3L [sin 4t]
1 4 5 12
= 5 −3 2 = − , s > 0.
s+2 s + 16 s + 2 s2 + 16
Theorem 5.1 (First shifting property). The first shifting property of Laplace transform states that if
L [f (t)] = F (s), then [ ]
L eat f (t) = F (s − a),
where ‘a’ is a constant.

67
5.1 Properties of Laplace transform ⃝Francis
c Oketch

Proof. From the definition of Laplace transform of a function f (t) we have


∫∞
L [f (t)] = e−st f (t)dt
0

Then, it follows that

[ ] ∫∞ ∫∞
−st
at
L e f (t) = e · e f (t)dt =
at
e−(s−a)t f (t)dt. Put s − a = u
0 0
∫∞
= e−ut f (t)dt = F (u) = F (s − a)
0

2
For example, we know that L[t2 ] = . Then from the first shifting property, we have
s3
2
L[e4t t2 ] =
(s − 4)3

Similarly,
s s+1
L[cos 2t] = ⇒ L[e−t cos 2t] =
s2 + 4 (s + 1)2 + 4

Example(s):

(a) Find the Laplace transform of f (t) = e−3t (2 cos 5t − 3 sin 3t).

Solution
[ ] [ ]
L [f (t)] = L e−3t (2 cos 5t − 3 sin 3t) = L 2e−3t cos 5t − 3e−3t sin 3t
[ ] [ ] [ ] [ ]
= L 2e−3t cos 5t − L 3e−3t sin 3t = 2L e−3t cos 5t − 3L e−3t sin 3t
s+3 3
= 2 2
−3
(s + 3) + 25 (s + 3)2 + 9

Exercise:

1. Verify the following properties of Laplace transform.


1 [ ] 1
L[1] = L eat =
s s−a
n! [ at n ] n!
L [t ] = n+1 , n ≥ 0 L e t =
n
s (s − a)n+1
s [ at ] s−a
L [cos bt] = 2 L e cos bt =
s +b 2 (s − a)2 + b2
b [ at ] b
L [sin bt] = 2 L e sin bt =
s +b 2 (s − a)2 + b2
s [ at ] s−a
L [cosh bt] = 2 L e cosh bt =
s −b 2 (s − a)2 − b2
b [ at ] b
L [sinh bt] = 2 L e sinh bt =
s −b 2 (s − a)2 − b2
s −b
2 2 [ at ] (s − a)2 − b2
L [t cos bt] = 2 L e t cos bt =
(s + b2 )2 [(s − a)2 + b2 ]2
2bs [ ] 2b(s − a)
L [t sin bt] = 2 L eat t sin bt =
(s + b ) 2 2
[(s − a)2 + b2 ]2
2. Find the Laplace transform of the following functions.

(a) f (t) = teat + 3 sinh at, where a is a real constant.

68
5.1 Properties of Laplace transform ⃝Francis
c Oketch

1
(b) f (t) = cos2 3t − 4et sin 3t. [hint: cos2 3t =(1 + cos 6t)]
2
3 1
(c) f (t) = sin3 t. [hint: sin3 t = sin t − sin 3t]
4 4
3. Find the Laplace transform of the following functions:


 if 0 ≤ t < 1
1,
(a) f (t) = k, if t = 1 , where k is a constant. In engineering contexts f (t) often


0 if t > 1
represents a unit pulse, perhaps of force or voltage.

Solution
∫∞ ∫1 ∫1 ∫∞
−st −st −st 1 − e−s
L [f (t)] = e f (t)dt = e · 1dt + e · kdt + e−st · 0dt = +0+0
s
0 0 1 1
1 − e−s
= , s>0
s
 ( )

cos t − 3 π , if t > 3 π
2 2
(b) f (t) =

0, if t < 32 π
Solution
3
∫∞ ∫2 π ∫∞ ( ) ∫∞ ( )
−st −st −st 3 3
L [f (t)] = e f (t)dt = e · 0dt + e cos t − π dt = e−st cos t − π dt
2 2
0 0 3
π 3
π
2 2

3 3
Put t − π = u ⇒ dt = du. Changing limits of integration: when t = π ⇒ u=0
2 2
and when t = ∞ ⇒ u = ∞. Therefore,
∫∞ ∫∞
−s(u+ 32 π) − 32 πs
e−su cos (u) du = e− 2 πs L [cos (u)]
3
L [f (t)] = e cos (u) du = e
u=0 u=0
( )
− 23 πs s
= e
s2 + 1
{
(t + 1), if 0 ≤ t ≤ 2
(c) h(t) = .
3, if t > 2
Solution

∫∞ ∫2 ∫∞
−st −st
L [h(t)] = e h(t)dt = e (t + 1)dt + e−st 3dt
0 0 2
1
Put u = t + 1 and dv = e−st dt ⇒ du = dt, v = − e−st . Integration by parts yields
s
[ ]2 ∫2 ( ) ∫∞
1 1
L [h(t)] = −(t + 1) e−st − − e−st dt + 3 e−st dt
s t=0 s
0 2
∫2 ∫∞
3 1 1
= − e−2s + + e−st dt + 3 e−st dt
s s s
0 2
[ ]2 [ ]∞
3 1 1 1 1
= − e−2s + + − e−st + 3 − e−st
s s s s t=0 s t=2
3 −2s 1 1 −2s 1 3 −2s
= − e + − 2e + 2+ e
s s s s s
1 1 ( )
−2s
= + 1−e
s s2

69
5.2 Inverse Laplace transform ⃝Francis
c Oketch

5.2 Inverse Laplace transform


Let L−1 be the inverse Laplace transform operator. If L [f (t)] = F (s) then f (t) = L−1 [F (s)] is called
the inverse Laplace transform. For example,
[ ] [ ] [ ]
1 1 n!
L−1 = 1, L−1 2 = t, L−1 n+1 = tn
s s s
[ ] [ ] [ ]
1 1 n!
L−1 = eat , L−1 = e at
t, L −1
= eat tn
s−a (s − a)2 (s − a)n+1
[ ] [ ]
s a
L−1 2 = cos at, L −1
= sin at
s + a2 s2 + a2
[ ] [ ]
s a
L−1 2 = cosh at, L −1
= sinh at
s − a2 s2 − a2

Example(s):

1. Find the inverse Laplace transform of the following functions


1 2 6
(a) F (s) = + + .
s − 2 s + 5 s4
Solution
[ ] [ ] [ ] [ ]
1 2 6 1 1 3!
L−1 [F (s)] = L−1 + + 4 = L−1 + 2L−1 + L−1 3+1
s−2 s+5 s s−2 s − (−5) s
2t −5t 3
= e + 2e +t
s−2 s+4 1
(b) F (s) = + + .
(s − 2) + 25 (s + 4) + 81 (s + 2)2 + 9
2 2

Solution
[ ]
−1 −1 s−2 s+4 1
L [F (s)] = L + +
(s − 2) + 25 (s + 4) + 81 (s + 2)2 + 9
2 2
[ ] [ ] [ ]
s−2 s − (−4) 1 −1 3
= L−1 + L−1
+ L
(s − 2)2 + 52 (s − (−4))2 + 92 3 (s − (−2))2 + 32
1
= e2t cos 5t + e−4t cos 9t + e−2t sin 3t
3
[ ]
5s + 3
2. Evaluate L−1 .
(s − 1)(s2 + 2s + 5)

Solution
Since the denominator consists of products of functions of s, we decompose the given function
5s + 3 A Bs + C
into its partial fractions. Let = + 2 .
(s − 1)(s + 2s + 5)
2 s − 1 s + 2s + 5

⇒ A(s2 + 2s + 5) + (Bs + C)(s − 1) = 5s + 3

This equation holds for all values of s. In particular,

Put s = 1 ⇒ A(1 + 2 + 5) = 5 + 3 ⇒ A = 1
Put s = 0 ⇒ 5A − C = 3 ⇒ 5 − C = 3 ⇒ C = 2
Put
s = −1 ⇒ A(1 − 2 + 5) − 2(C − B) = −5 + 3 ⇒ 4 − 2(2 − B) = −2 ⇒ B = −1.

Substituting these values for A, B and C, we have


5s + 3 1 −s + 2
= +
(s − 1)(s2 + 2s + 5) s − 1 s2 + 2s + 5

70
5.3 Laplace transform of ordinary derivatives ⃝Francis
c Oketch

Hence,
[ ] [ ]
−1 5s + 3 −1 1 −s + 2
∴L = L +
(s − 1)(s2 + 2s + 5) s − 1 s2 + 2s + 5
[ ] [ ]
−1 1 −1 s−2
= L −L
s−1 s2 + 2s + 5
[ ] [ ]
−1 1 −1 s−2
= L −L , (completing the square)
s−1 (s + 1)2 + 22
[ ] [ ]
−1 1 −1 s+1 3 2
= L −L −
s−1 (s + 1)2 + 22 2 (s + 1)2 + 22
3
= et − e−t cos 2t + e−t sin 2t
2

Exercise:

1. Find the inverse Laplace transform of the given functions.


s+2 5 3
(a) F (s) = . [ans: f (t) = e3t − et ]
− 4s + 3
s2 2 2
8s2 − 4s + 12
(b) F (s) = .
s(s2 + 4)
4 3
(c) F (s) = + 2 .
(s − 1) 3 s +4

5.3 Laplace transform of ordinary derivatives


[ ]
L f ′ (t) = sL[f (t)] − f (0)
[ ]
L f ′′ (t) = s2 L[f (t)] − sf (0) − f ′ (0)
..
. [ ]
L f (n) (t) = sn L[f (t)] − sn−1 f (0) − sn−2 f ′ (0) − sn−3 f ′′ (0) − · · · − sf (n−2) (0) − f (n−1) (0)

Proof. From the definition of Laplace transform, we have


∫∞
L [f (t)] = e−st f (t)dt
0

It follows that
∫∞
[ ]
L f ′ (t) = e−st f ′ (t)dt
0

Using integration by parts, put u = e−st and dv = f ′ (t)dt ⇒ du = −se−st dt, v = f (t). Thus,
integration by parts yields

[ ]∞ ∫∞ [ ]∞ ∫∞
[ ′ ] −st
L f (t) = uv − vdu = e f (t) − f (t)(−se−st dt)
0 0
0 0
∫∞
= −f (0) + s e−st f (t)dt
0
= sL[f (t)] − f (0)

Similarly,
∫∞
[ ′′ ]
L f (t) = e−st f ′′ (t)dt
0

71
5.4 Applications of Laplace transform in ordinary differential equations ⃝Francis
c Oketch

Using integration by parts, put u = e−st and dv = f ′′ (t)dt ⇒ du = −se−st dt, v = f ′ (t). Thus,
integration by parts yields
[ ]∞ ∫∞ [ ]∞ ∫∞
[ ′′ ] −st ′
L f (t) = uv − vdu = e f (t) − f ′ (t)(−se−st dt)
0 0
0 0
∫∞
= −f ′ (0) + s e−st f ′ (t)dt = sL[f ′ (t)] − f ′ (0) = s {sL[f (t)] − f (0)} − f ′ (0)
0
= s L[f (t)] − sf (0) − f ′ (0)
2

By induction, we have
[ ]
. f ′ (0) − sn−3 f ′′ (0) − · · · − f (n−1) (0)
L f (n) (t) = sn L[f (t)] − sn−1 f (0) − sn−2

Example(s):
1. Find L [y ′′′ (t)] given that y(t) = sin 2t.

Solution
[ ]
L y ′′′ (t) = s3 L[y(t)] − s2 y(0) − sy ′ (0) − y ′′ (0)

Now,

y(t) = sin 2t, y ′ (t) = 2 cos 2t, y ′′ (t) = −4 sin 2t ⇒ y(0) = 0, y ′ (0) = 2, y ′′ (0) = 0

Therefore,
( )
[ ] 0 ′  2 * 0 2s

3
*− y ′′
′′′ 2 *−
 8s
L y (t) = s 3
2
− s2
y(0) s
y (0)  (0) = 2
− 2s = − 2
s +4 s +4 s +4

5.4 Applications of Laplace transform in ordinary differential equations


Since the solutions of linear ordinary differential equations with constant coefficients are based on
the exponential function, the Laplace transform is particularly useful to solve such equations. The
most important elementary applications of the Laplace transform are in the study of mechanical
vibrations and in the analysis of electric circuits.

Consider the second order linear ordinary differential equation with constant coefficients of the form.

d2 y dy
a2 + a1 + a0 y = f (t) or a2 y ′′ + a1 y ′ + a0 y = f (t). (21)
dt2 dt
where a0 , a1 and a2 are constants. Operating with Laplace transform operator (L) on both sides of
equation (21) and using the linearity property of L, we get
[ ] [ ]
a2 L y ′′ (t) + a1 L y ′ (t) + a0 L [y(t)] = L [f (t)]

or
{ }
a2 s2 L [y(t)] − sy(0) − y ′ (0) + a1 {sL [y(t)] − y(0)} + a0 L [y(t)] = F (s) (22)

If we are given the initial conditions y(0) and y ′ (0), equation (22) can be solved for L [y(t)]. We then
operate with the inverse Laplace transform operator (L−1 ) on both sides of the resulting equation to
get the particular solution y(t).

Example(s):

72
5.4 Applications of Laplace transform in ordinary differential equations ⃝Francis
c Oketch

1. Solve the following initial value problems using the Laplace transform method.

(a) y ′′ − 6y ′ + 9y = t2 e3t ; y(0) = 2, y ′ (0) = 6.

Solution
Operating with the Laplace transform operator (L) on both sides of the given equation, we
obtain
[ ] [ ] [ ]
L y ′′ (t) − 6L y ′ (t) + 9L [y(t)] = L e3t t2
{ } 2
⇒ s2 L [y(t)] − sy(0) − y ′ (0) − 6 {sL [y(t)] − y(0)} + 9L [y(t)] =
(s − 3)3

Applying the initial conditions, we get


{ } 2
s2 L [y(t)] − 2s − 6 − 6 {sL [y(t)] − 2} + 9L [y(t)] =
(s − 3)3
[ ]
2 2 1
⇒ (s − 3) L [y(t)] − 2s + 6 =
2
⇒ L [y(t)] = + 2s − 6
(s − 3)3 (s − 3)3 (s − 3)2
2 2
⇒ L [y(t)] = +
(s − 3) 5 s−3

Operating with the inverse Laplace transform operator (L−1 ) on both sides, we have
[ ] [ ] [ ] [ ]
−1 −1 2 2 2 4! 1
L L [y(t)] = L + L−1 = L−1 + 2L−1
(s − 3)5 s−3 4! (s − 3)4+1 (s − 3)
1 3t 4
∴ y(t) = e t + 2e3t
12

d2 y dy
(b) − 10 + 9y = 5t; y(0) = −1, y ′ (0) = 2.
dt2 dt
Solution
Operating with L on both sides of the given equation, we have
[ ] [ ]
L y ′′ (t) − 10L y ′ (t) + 9L [y(t)] = L [5t]
{ } 5
⇒ s2 L [y(t)] − sy(0) − y ′ (0) − 10 {sL [y(t)] − y(0)} + 9L [y(t)] =
s2
Applying the initial conditions, we get
{ } 2
s2 L [y(t)] + s − 2 − 10 {sL [y(t)] + 1} + 9L [y(t)] =
s2 [ ]
5 5 1
⇒ (s2 − 10s + 9)L [y(t)] + s − 12 = ⇒ L [y(t)] = 2 − (s − 12)
s2 s (s − 9)(s − 1)
( )
5 + 12s2 − s3 1 50 45 31 162
⇒ L [y(t)] = 2 = + 2 + −
s (s − 9)(s − 1) 81 s s s−9 s−1

Operating with L−1 on both sides, we have


[ ( )]
50 45
1 31 162
L−1 L [y(t)] = L−1 + 2 + −
81
s s s−9 s−1
{ [ ] [ ] [ ] [ ]}
1 1 1 1 1
= 50L−1 + 45L−1 2 + 31L−1 − 162L−1
81 s s s−9 s−1
1 { }
∴ y(t) = 50 + 45t + 31e9t − 162et
81

Exercise:
Use Laplace transform method to solve the following initial value problems.

73
5.4 Applications of Laplace transform in ordinary differential equations ⃝Francis
c Oketch

d2 y 1 1 2
(a) + y = e−t ; y(0) = 0, y ′ (0) = 0. [ans: y(t) = e−2t − cos t + sin t]
dt2 5 5 5
(b) y ′′ + y = t; y(0) = 0, y ′ (0) = 2. [ans: y(t) = t + sin t]
dy 4 1
(c) + 2y = 4e3t ; y(0) = 1. [ans: y(t) = e3t + e−2t ]
dt 5 5
(d) y ′′ − 3y ′ + 2y = 2e3t ; y(0) = 5, y ′ (0) = 7. [ans: y(t) = 4et + e3t ]
( )
d2 y dy 1
(e) 2
+2 + y = 3xe−x ; y(0) = 4, y ′ (0) = 2. [ans: y(x) = e−x 4 + 6x + x3 ]
dx dx 2
20 −0.5x 11 −2x 1 −2x
(f) 2y ′′ + 5y ′ + 2y = e−2x ; y(0) = 1, y ′ (0) = 1. [ans: y(x) = e − e − xe ]
9 9 3
(g) y ′′ + y = sin 2t; y(0) = 2, y ′ (0) = 1. [ans: y(t) = 2 cos t + 35 sin t − 31 sin 2t]

d4 y 1
(h) − y = 0; y(0) = 0, y ′ (0) = 1, y ′′ (0) = 0, y ′′′ (0) = 0. [ans: y(t) = (sin t + sinh t)]
dx4 2

74
⃝Francis
c Oketch

Lecture 12

6 Power series solutions of linear ODEs


6.1 Basic concepts
A series in powers of (x − x0 ) is an expression of the form

a0 + a1 (x − x0 ) + a2 (x − x0 )2 + a3 (x − x0 )3 + · · ·

If a function f (x) can be written as a series in powers of (x − x0 ), we say that the function has been
expanded about x0 . A power series solution of a differential equation is an approximate solution of
the equation which is valid in the neighbourhood of a given value of x (i.e., the dependent variable).
Definition 6.1 (Analytic function). A function f (x) is said to be analytic (or defined) at a point
x = x0 if f (x) can be expanded in a power series about the point x0 , which has a positive radius of
convergence.
Thus, f (x) is analytic at x = x0 if f (x) has the representation


f (x) = an (x − x0 )n (23)
n=0

The coefficients, an ’s, are constants and the series (23) converges in the interval |x − x0 | < R, where
R > 0. The radius of convergence, R, can be found using either ratio test or root test.

p(x)
→ Note: a rational function f (x) = is analytic everywhere in the real number line except at
q(x)
those values of x at which q(x) = 0.

6.2 Ordinary and singular points


Consider a linear second-order homogeneous ODE of the form
d2 y dy
a2 (x) 2
+ a1 (x) + a0 (x)y = 0 (24)
dx dx
We can write equation (24) into the equivalent normalized form as
d2 y dy
+ P1 (x) + P2 (x)y = 0, (25)
dx2 dx
a1 (x) a0 (x)
where P1 (x) = and P2 (x) = are continuous functions in their simplest form and a2 (x) ̸= 0.
a2 (x) a2 (x)
Definition 6.2 (Ordinary point). A point x0 is called an ordinary point of equation (24) if both the
functions P1 (x) and P2 (x) are analytic at x = x0 , i.e., if both the functions are continuous at point
x0 .
Definition 6.3 (Singular point). A point x0 is called a singular point of equation (24) if at least one
of the functions P1 (x) and P2 (x) is not analytic at the point x = x0 .
→ Note: to find the singular point(s), equate the denominator of the functions P1 (x) and P2 (x) to
zero and solve for x.
Definition 6.4 (Regular singular point). If x0 is a singular point of the differential equation (24) and
both the products (x − x0 )P1 (x) and (x − x0 )2 P2 (x) are analytic at x = x0 , i.e., if both

lim (x − x0 )P1 (x) is finite (or exists)


x→x0

and
lim (x − x0 )2 P2 (x) is finite (or exists),
x→x0

then the point x0 is called a regular singular point.

75
6.2 Ordinary and singular points ⃝Francis
c Oketch

Definition 6.5 (Irregular singular point). If x0 is a singular point of the differential equation (24)
and at least one of the products (x − x0 )P1 (x) and (x − x0 )2 P2 (x) is not analytic at x = x0 , then the
point x0 is said to be an irregular singular point.

→ Note: the point x0 is an irregular singular point if at least one of the above limits does not exist.

Example(s):
d2 y dy 1
(a) Find all the singular points of the equation (x − 1) 2
+x + y = 0.
dx dx x

Solution

i) Equivalent normalized form of the given equation:

d2 y x dy 1 x 1
+ + y = 0. Here, P1 (x) = , P2 (x) =
dx2 x − 1 dx x(x − 1) x−1 x(x − 1)

ii) Singular points:


• For P1 (x), we have x − 1 = 0 ⇒ x = 1. Thus, P1 (x) is not analytic at the point
x = 1.
• For P2 (x), we have x(x − 1) = 0 ⇒ x = 0 or x = 1. Thus, P2 (x) is not analytic at
the points x = 0 and x = 1.
Therefore, the points x = 0 and x = 1 are the only singular points of the given differential
equation. All the other points in the real number line are ordinary points.
d2 y dy
(b) Find the singular point(s) of the differential equation 2x2 −x + (x − 5)y = 0 and hence
dx2 dx
classify the point(s) into regular or irregular.

Solution

i) Normal form:

d2 y 1 dy x − 5 1 x−5
2
− + y = 0. Here, P1 (x) = − , P2 (x) =
dx 2x dx 2x2 2x 2x2

ii) Singular points:


• For P1 (x), we have 2x = 0 ⇒ x = 0. Thus, P1 (x) is not analytic at the point
x = 0.
• For P2 (x), we have 2x2 = 0 ⇒ x = 0. Thus, P2 (x) is not analytic at the point
x = 0.
Therefore, the point x = 0 is the only singular point of the given differential equation. All
the other points in the real number line are ordinary points.
iii) Classification:
• Let x0 = 0. Now,
( ) ( )
1 1 1
lim (x − x0 )P1 (x) = lim x − = lim − =− (i.e., finite)
x→x0 x→0 2x x→0 2 2
Also,

(x − 5) (x − 5) 5
lim (x − x0 )2 P2 (x) = lim x2 2
= lim = − (i.e., finite)
x→x0 x→0 2x x→0 2 2
Since both the limits exist, therefore, the point x = 0 is a regular singular point of the
given differential equation.

76
6.2 Ordinary and singular points ⃝Francis
c Oketch

(c) Find the singular points of the following differential equation and determine whether they are
regular or irregular points:
d2 y dy
x2 (1 − x) 2
+ (1 − x) +y =0
dx dx

Solution
i) Normal form:
d2 y 1 dy 1 1 1
+ + y = 0. Here, P1 (x) = , P2 (x) =
dx2 x2 dx x2 (1 − x) x2 x2 (1 − x)

ii) Singular points:


• For P1 (x), we have x2 = 0 ⇒ x = 0. Thus, P1 (x) is not analytic at the point
x = 0.
• For P2 (x), we have x2 (1 − x) = 0 ⇒ x = 0 or x = 1. Thus, P2 (x) is not analytic
at the points x = 0 and x = 1.
Therefore, the points x = 0 and x = 1 are the only singular points of the given differential
equation. All the other points in the real number line are ordinary points.
iii) Classification:
• Let x0 = 0. Now,
( ) ( )
1 1 D.S
lim (x − x0 )P1 (x) = lim x = lim = ∞ (infinite)
x→x0 x→0 x2 x→0 x
Since the limit does not exist, therefore, the point x = 0 is an irregular singular point
of the given differential equation.
• Let x0 = 1. Now,
( ) ( )
1 x−1 D.S
lim (x − x0 )P1 (x) = lim (x − 1) = lim = 0 (finite)
x→x0 x→1 x2 x→1 x2
Also,
[ ] [ ]
1 (x − 1) D.S
lim (x − x0 )2 P2 (x) = lim (x − 1)2 = lim = 0 (finite)
x→x0 x→1 x2 (1 − x) x→1 −x2
Since both the limits exist, therefore, the point x = 1 is a regular singular point of the
given differential equation.

Exercise:
(a) Identify all the regular singular points of the following differential equation
d2 y dy
(x3 − 3x2 + 2x) + x(x − 2) + 4x2 y = 0
dx2 dx

d2 y dy
(b) Determine the singular points of the Legendre equation (1 − x2 ) 2
− 2x + p(p + 1)y = 0 and
dx dx
determine whether they are regular or irregular. [ans: −1 and 1 are regular singular points]
(c) Determine the singular points of the following differential equation and classify them as regular
or irregular.
d2 y dy
i) 2x(x − 2)2 2
+ 3x + (x − 2)y = 0. [ans: 0 is regular, 2 is irregular]
dx dx
( ) 2 d2 y dy
ii) x − π2 2
+ (cos x) + (sin x)y = 0. [ans: π/2 is a regular singular point]
dx dx
d2 y 1 dy
iii) (ln x) 2 + + y = 0. [ans: 1 is a regular singular point]
dx 2 dx

77
6.3 Power series solution about an ordinary point ⃝Francis
c Oketch

6.3 Power series solution about an ordinary point


6.3.1 Taylor series expansion method
This method is applicable in finding the power series solution of an initial value problem (IVP) if the
initial conditions given are specified at an ordinary point.

Example(s):
(a) Use Taylor series expansion to find the third degree power series solution of the initial value
problem y ′′ − 2xy ′ + 3y = 0; y(0) = 2, y ′ (0) = −4.

Solution
Let y(x) be the solution of the given differential equation. The Taylor’s series expansion of y(x)
about the point x0 is given by

∑ y (n) (x0 )
y(x) = (x − x0 )n
n=0
n!
Putting x0 = 0 and n = 3 yields
y ′′ (0) 2 y ′′′ (0) 3
y(x) = y(0) + y ′ (0)x + x + x + ··· (∗)
2! 3!
Now,

y(0) = 2
y ′ (0) = −4
y ′′ (x) = 2xy ′ (x) − 3y(x) ⇒ y ′′ (0) = 2(0)y ′ (0) − 3y(0) = −6
y ′′′ (x) = 2xy ′′ (x) + 2y ′ (x) − 3y ′ (x) = 2xy ′′ (x) − y ′ (x) ⇒ y ′′′ (0) = 2(0)y ′′ (0) − y ′ (0) = 4

Replacing these values in the series (∗) yields


2
y(x) = 2 − 4x − 3x2 + x3 + · · ·
3
This solution is valid in the interval |x − x0 | < R, i.e., |x| < R, where R > 0 is the radius of
convergence of the series.

Exercise:
(a) Use Taylor’s theorem to find the third degree series solution of the following initial value
problems.

(i) y ′′ + (x2 + 2x + 1)y ′ + 3xy = 0; y(0) = 1, y ′ (0) = −2. [ans: y = 1 − 2x + x2 − 61 x3 + · · · ]


1 2
(ii) y ′ = y 2 − x; y(0) = 1. [ans: y = 1 + x + x2 + x3 + · · · ]
2 3
(iii) y ′′ + y ′ + x2 y = 0; y(0) = 1, y ′ (0) = 2. [ans: y = 1 + 2x − x2 + 31 x3 − 61 x4 + · · · ]
(iv) xy ′′ + (x − 1)y ′ + xy = 0; y(1) = 0, y ′ (1) = 5.
(v) (x − 1)y ′′ + 2y ′ − 4y = 0; y(0) = 2, y ′ (0) = 6.
d2 y dy 11x3 x4
(vi) (x2 − 1) 2 + 3x + xy = 0; y(0) = 4, y ′ (0) = 6. [ans: y = 4 + 6x + + + ···]
dx dx 3 2
d2 y dy
(vii) (2x2 − 3) 2 − 2x + y = 0; y(0) = 1, y ′ (0) = 7.
dx dx
d2 y dy
(ix) (x2 + 1) 2 + x + 2xy = 0; y(0) = 2, y ′ (0) = 4.
dx dx

(b) Consider the initial value problem y ′ = 1 − y 2 ; y(0) = 0. Look for a solution of the initial
value problem in the form of a power series about x = 0. Find the coefficients up to the term in
x3
x3 in this series. [ans: y = x − + · · · = sin x]
3!

78
6.3 Power series solution about an ordinary point ⃝Francis
c Oketch

6.3.2 General method of power series solution about an ordinary point


d2 y dy
Theorem 6.1. If x0 is an ordinary point of the differential equation a2 (x) 2 +a1 (x) +a0 (x)y = 0,
dx dx
then there exists at least two linearly independent power series solutions of the form



y(x) = a. n (x − x0 )n ,
n=0

valid in the interval |x − x0 | < R for some real number R > 0, where an ’s (for n = 0, 1, 2, · · · ) are
constants to be determined and a0 ̸= 0.

→ Note: this method is applicable when the initial conditions are not given and x0 is an ordinary
point.

Example(s):
Find the power series solution in powers of x for each of the following differential equations.

d2 y dy
(a) (1 − x2 ) − 2x + 2y = 0.
dx2 dx

Solution
Here, x0 = 0 is an ordinary point of the given differential equation. Thus, the power series
solution of the given differential equation is given by


y(x) = an xn , (a0 ̸= 0)
n=0

Differentiating with respect to x yields



∑ ∞

dy d2 y
= nan xn−1 and = n(n − 1)an xn−2
dx n=1 dx2 n=2

Substituting into the given differential equation, we get



∑ ∞
∑ ∞

(1 − x )2
n(n − 1)an x n−2
− 2x nan x n−1
+2 an xn = 0
n=2 n=0 n=0


∑ ∞
∑ ∞
∑ ∞

⇒ n(n − 1)an xn−2 − n(n − 1)an xn − 2nan xn + 2an xn = 0
n=2 n=2 n=0 n=0
Grouping the terms with the same power of x together, we obtain

∑ ∞

n(n − 1)an xn−2 + [2 − n(n − 1) − 2n] an xn = 0 (∗)
n=2 n=0

To combine the two series, we need to rewrite at least one of them so that both series display
the same generic term. Thus, in the second sum, we shift the index of summation so that the
series has the general term xn−2 . Replacing n with n − 2 in the second summation of equation
(∗) and starting the sum at 2 rather than 0, we obtain

∑ ∞

n(n − 1)an xn−2 + [2 − (n − 2)(n − 3) − 2(n − 2)] an−2 xn−2 = 0
n=2 n=2



⇒ [n(n − 1)an − ((n − 2)(n − 3) + 2n − 6)) an−2 ] xn−2 = 0
n=2


⇒ [n(n − 1)an − n(n − 3)an−2 ] xn−2 = 0
n=2

79
6.3 Power series solution about an ordinary point ⃝Francis
c Oketch

For this equation to be satisfied for all x, the coefficient of each power of x must be zero. Hence,
equating the coefficient of xn−2 to zero yields

(n − 3) .
n(n − 1)an − n(n − 3)an−2 = 0 ⇒ an = an−2 , n≥2
(n − 1)

The above recurrence relation is used to calculate an for n ≥ 2 in terms of a0 and a1 , which
are left arbitrary. Thus, we have
Even subscripts Odd subscripts
−1
a2 = a0 a3 = 0
1
1 2
a4 = a2 a5 = a3
3 4
3 4
a6 = a4 a7 = a5
5 6
.. ..
. .
(2k − 3) (2k − 2)
a2k = a2k−2 a2k+1 = a2k−1 , k ≥ 1
(2k − 1) 2k
Multiplying the corresponding members of each column we get:

−1 1 3 −
(2k
 3) −1
2 ·
a 4 ·
a 6 · · · a2k =
a a0 · 2·
a 
a · · · 
a2k−2 ⇒ a2k = a0
 3  5  (2k − 1)
4
1 (2k − 1)

Similarly,

2 4 (2k − 2)
3 ·
a 5 ·
a 7 · · · a2k+1 = 0 · 
a 3· 
a 5···
a 
a2k−1 ⇒ a2k+1 = 0
 4 6 2k 
Substituting these coefficients into the assumed solution, we have

∑ ∞
∑ ∞
∑ ∞
∑ x2k
y(x) = n
an x ⇒ y = a2k x2k
+ a2k+1 x 2k+1
= −a0 ,
n=0 k=0 k=0 k=0
(2k − 1)

where a0 is an arbitrary constant.


d2 y dy
(b) 2
+x + (x2 + 2)y = 0.
dx dx

Solution
Here, x0 = 0 is an ordinary point of the given differential equation. Thus, the power series
solution of the given differential equation is given by


y(x) = an xn , (a0 ̸= 0)
n=0

Differentiating with respect to x yields



∑ ∞

dy d2 y
= nan xn−1 and = n(n − 1)an xn−2
dx n=1 dx2 n=2

Substituting into the given differential equation, we get



∑ ∞
∑ ∞
∑ ∞

n(n − 1)an xn−2 + nan xn + nan xn+2 + 2an xn = 0
n=2 n=1 n=0 n=0

Grouping the terms with the same power of x together, we obtain



∑ ∞
∑ ∞

n(n − 1)an xn−2 + (n + 2)an xn + an xn+2 = 0 (∗)
n=2 n=0 n=0

80
6.3 Power series solution about an ordinary point ⃝Francis
c Oketch

Next, we shift the index of summation so that the series has the general term xn−2 . Putting
n = n − 2 in the second summation and n = n − 4 in the third summation of equation (∗), we
obtain

∑ ∞
∑ ∞

n(n − 1)an xn−2 + nan−2 xn−2 + an−4 xn−2 = 0
n=2 n=2 n=4


∑ ∞
∑ ∞

⇒ 2a2 + 6a2 x + n(n − 1)an x n−2
+ 2a0 + 3a1 x + nan−2 xn−2
+ an−4 xn−2 = 0
n=4 n=4 n=4


⇒ (2a2 + 2a0 ) + (6a3 + 3a1 )x + [n(n − 1)an + nan−2 + an−4 ] xn−2 = 0
n=2
Again, for this equation to be satisfied for all x in some interval, the coefficients of like powers
of x must be equal. Hence, equating the constant terms (coefficient of x0 ) to zero yields

2a2 + 2a0 = 0 ⇒ a2 = −a0

Equating the coefficient of x to zero yields


1
6a3 + 3a1 = 0 ⇒ a3 = − a1
2
Equating the coefficient of xn−2 to zero yields

1 1
n(n − 1)an + nan−2 + an−4 = 0 ⇒ an = − an−2 −. an−4 , n ≥ 4
(n − 1) n(n − 1)

The above recurrence relation is used to calculate an for n ≥ 4 in terms of a0 and a1 , which
are left arbitrary. Solving for the first few coefficients an in terms of a0 and a1 , we have
Even subscripts Odd subscripts
1
a2 = −a0 a3 = − a1
2
1 1 1 1 1 3
a4 = − a2 − a0 = a0 a5 = − a3 − a1 = a1
3 12 4 4 20 40
.. ..
. .
Substituting these coefficients into the assumed solution, we have


y = an xn = a0 + a1 x + a2 x2 + a3 x3 + a4 x4 + a5 x5 + · · ·
n=0
1 1 3
= a0 + a1 x − a0 x2 − a1 x3 + a0 x4 + a1 x5 + · · ·
2 4 40
1 1 3
= a0 (1 − x2 + x4 + · · · ) + a1 (x − x3 + x5 + · · · ),
4 2 40
where a0 and a1 are arbitrary constants.

Exercise:

1. Find the power series solution in powers of x for each of the following differential equations.
d2 y
(a) + 4y = 0.
dx2
Solution
Here, x = 0 is an ordinary point of the given differential equation. The power series solution
of the given differential equation is given by


y(x) = an xn , (a0 ̸= 0)
n=0

81
6.3 Power series solution about an ordinary point ⃝Francis
c Oketch

Differentiating with respect to x yields



∑ ∞

dy d2 y
= nan xn−1 and = n(n − 1)an xn−2
dx n=1 dx2 n=2

Substituting into the given differential equation, we get



∑ ∞

n(n − 1)an x n−2
+4 an xn = 0 · · · (∗)
n=2 n=0

We shift the index of summation so that the series has the general term xn−2 . Putting
n = n − 2 in the second summation of equation (∗) yields

∑ ∞
∑ ∞

n(n − 1)an xn−2 + 4 an−2 xn−2 = 0 ⇒ [n(n − 1)an + 4an−2 ] xn−2 = 0
n=2 n=2 n=2

Equating the coefficients to zero yields

−4 .
n(n − 1)an + 4an−2 = 0 ⇒ an = an−2 , n ≥ 2
n(n − 1)

The above recurrence relation is used to calculate an for n ≥ 2 in terms of a0 and a1 ,


which are left arbitrary. Thus, we have
Even subscripts Odd subscripts
−4 −4
a2 = a0 a3 = a1
2(1) 3(2)
−4 −4
a4 = a2 a5 = a3
4(3) 5(4)
.. ..
. .
−4 −4
a2k = a2k−2 a2k+1 = a2k−1 , k ≥ 1
2k(2k − 1) (2k + 1)(2k)
Multiplying the corresponding members of each column we get:

−4 −4 −4 (−4)k
2 ·
a 4 · · · a2k =
a a0 · 2···
a 
a2k−2 ⇒ a2k = a0
 2(1) 4(3) 2k(2k − 1) (2k)!
Similarly,

−4 −4 −4 (−4)k
3 ·
a 5 · · · a2k+1 =
a a1 · 3···
a 
a2k−1 ⇒ a2k+1 = a1
 3(2) 5(4)  (2k + 1)(2k) (2k + 1)!
Therefore, the solution becomes

∑ ∞
∑ ∞

y = an x n = a2k x2k + a2k+1 x2k+1
n=0 k=0 k=0
∑∞ ∞

(−4)k (−4)k
= a0 x2k + a1 x2k+1
k=0
(2k)! k=0
(2k + 1)!

∑ ∞

(−1)k · 22k (−1)k · 22k+1 · 2−1
= a0 x2k + a1 x2k+1
k=0
(2k)! k=0
(2k + 1)!
∑∞ ∑∞
·(−1)k (2x)2k
a1 (−1)k · (2x)2k+1
= a0 +
k=0
(2k)! 2 k=0
(2k + 1)!
a1
∴ y = a0 cos 2x + sin 2x
2

d2 y dy
(b) (1 − x2 ) − 6x − 4y = 0.
dx2 dx
Solution

82
6.3 Power series solution about an ordinary point ⃝Francis
c Oketch

Here, x0 = 0 is an ordinary point of the given differential equation. The power series
solution of the given differential equation is given by


y(x) = an xn , (a0 ̸= 0)
n=0

Differentiating with respect to x yields



∑ ∞

dy d2 y
= nan xn−1 and = n(n − 1)an xn−2
dx n=1 dx2 n=2

Substituting into the given differential equation, we get



∑ ∞
∑ ∞

(1 − x2 ) n(n − 1)an xn−2 − 6x nan xn−1 − 4 an x n = 0
n=2 n=1 n=0

∑ ∞
∑ ∑∞ ∞

⇒ n(n − 1)an xn−2 − n(n − 1)an xn − 6nan xn − 4an xn = 0
n=2 n=2 n=1 n=0

∑ ∞

⇒ n(n − 1)an xn−2 − [n(n − 1) + 6n + 4]an xn = 0
n=2 n=0

∑ ∞

⇒ n(n − 1)an xn−2 − (n + 1)(n + 4)an xn = 0 · · · (∗)
n=2 n=0

We shift the index of summation so that the series has the general term xn−2 . So we put
n = n − 2 in the second summation of equation (∗) and get

∑ ∞

n(n − 1)an xn−2 − (n − 1)(n + 2)an−2 xn−2 = 0
n=2 n=2


⇒ [n(n − 1)an − (n − 1)(n + 2)an−2 ] xn−2 = 0
n=2

Equating the coefficients to zero yields

(n + 2).
n(n − 1)an − (n − 1)(n + 2)an−2 = 0 ⇒ an = an−2 , n ≥ 2
n

The above recurrence relation is used to calculate an for n ≥ 2 in terms of a0 and a1 ,


which are left arbitrary. Thus, we have
Even subscripts Odd subscripts
4 5
a2 = a0 a3 = a1
2 3
6 7
a4 = a2 a5 = a3
4 5
8 9
a6 = a4 a7 = a5
6 7
.. ..
. .
(2k + 2) (2k + 3)
a2k = a2k−2 a2k+1 = a2k−1 , k ≥ 1
2k (2k + 1)
Multiplying the corresponding members of each column we get:

4 6 8 (2k + 2)
2 ·
a 4 ·
a 6 · · · a2k = a0 · 
a 2· 
a 4···
a a  ⇒ a2k = (k + 1)a0
 2 4 6  2k−2

2k
Similarly,

5 7 9 (2k + 3) 2k + 3
3 ·
a 5 ·
a 7 · · · a2k+1 = a1 ·
a 3·
a 5···
a  
a2k−1 ⇒ a2k+1 = a1
 3 5  7  +
(2k
 1) 3

83
6.3 Power series solution about an ordinary point ⃝Francis
c Oketch

Therefore, the solution becomes



∑ ∞
∑ ∞

y = an x n = a2k x2k + a2k+1 x2k+1
n=0 k=0 k=0
∑∞ ∞
∑ 2k + 3
= (k + 1)a0 x2k + a1 x2k+1
k=0 k=0
3

∑ ∞
a1 ∑
= a0 (k + 1)x2k + (2k + 3)x2k+1
k=0
3 k=0

2. Find the power series solution in powers of x for each of the following differential equations.
dy ∞ (2x)k

(a) = 2y. [ans: y = a0 = a0 e2x ]
dx k=0 k!
d2 y dy ∞
∑ 1
(b) (1 + x2 ) + 2x − 2y = 0. [ans: y(x) = (−1)k−1 x2k ]
dx2 dx k=0 2k − 1
( ) ( )
(c) y ′′ + xy ′ + y = 0. [ans: y = a0 1 − 1 2
2x + 1 4
8x + · · · + a1 x − 31 x3 + 1 5
15 x + ··· ]
d2 y dy
(d) (x − 1) 2
− (3x − 2) + 2xy = 0.
dx dx
d2 y dy
(e) +x + (x2 − 4)y = 0.
dx2 dx
d2 y dy
(f) (x2 − 1) 2 + x2 + xy = 0.
dx dx
d2 y dy
(g) (x2 + 1) 2 + x − xy = 0. [ans:
( dx dx ) ( )
y = a0 1 + 61 x3 − 40 x + · · · + a1 x − 16 x3 +
3 5 1 4
12 x + 3 5
40 x − ··· ]
d2 y dy ( ) ( )
(h) + x + x2 y = 0. [ans: y = a
0 1− 1 4
12 x + 1 6
90 x − · · · + a1 x − 61 x3 − 1 5
40 x − ··· ]
dx2 dx
3. Given the Airy’s equation y ′′ − xy = 0, −∞ < x < ∞.

(a) Find a (series solution of the Airy’s


) equation
( in powers of x . ) [ans:
y = a0 1 + 6 x + 180 x + · · · + a1 x + 12 x + 504
1 3 1 6 1 4
x + ··· ]
1 7

(b) Find a series solution of the [Airy’s equation in powers of (x − 1). [hint: put
]
x = 1 + (x − 1), ans: y = a0 1 + 21 (x − 1)2 + 16 (x − 1)3 + 24
1
(x − 1)4 + 1
30 (x − 1)5 + · · · +
[ ]
a1 (x − 1) + 61 (x − 1)3 + 1
12 (x − 1)4 + 1
120 (x − 1)5 + · · · ]

4. (a) By making the change of variable x − 1 = t and assuming that y has a Taylor series in
powers of t, find two series solutions of the equation y ′′ + (x − 1)2 y ′ + (x2 − 1)y = 0 in
powers of (x − 1).
(b) Show that you obtain the same result by assuming that y has a Taylor series in powers of
(x − 1) and also expressing the coefficient (x2 − 1) in powers of (x − 1). [hint: put
x = 1 + (x − 1) ⇒ (x2 − 1) = 2(x − 1) + (x − 1)2 ]

5. The amount A in a fixed savings account at any time t is known to satisfy the differential
d2 A dA
equation 2
+t + (t2 − 4)A = 0. Express A as a series in powers of t. [ans:
(dt dt ) ( )
A(t) = c0 1 + 2t2 + 14 t4 − 15 t + · · · + c1 t + 12 t3 − 40
1 6
t − 1680
1 5 19 7
t + ··· ]

6.3.3 Legendre’s equation and polynomials


The differential equation

d2 y dy
(1 − x2 ) 2
− 2x + p(p + 1)y = 0 (26)
dx dx

84
6.3 Power series solution about an ordinary point ⃝Francis
c Oketch

where −1 < x < 1, for any non-negative integer p, is called Legendre’s differential equation of
order p. The equation arises in many problems in physics and engineering, especially in boundary
value problems in spheres. The equivalent normalized form of equation (26) is
d2 y 2x dy p(p + 1) 2x p(p + 1)
− + y=0 ⇒ P1 (x) = − , P2 (x) =
dx2 1 − x2 dx 1 − x2 1 − x2 1 − x2
Clearly, the points x = −1 and x = 1 are the only singular points of equation (26). All other points
are ordinary. Thus, we study the general solution of equation (26) about the ordinary point x = 0.
Let the trial solution be of the form


y(x) = an x n , (a0 ̸= 0)
n=0

Differentiating with respect to x yields



∑ ∞

y′ = nan xn−1 , y ′′ = n(n − 1)an xn−2
n=1 n=2

Substituting the values of y, y ′ , y ′′ into equation (26), we get



∑ ∞
∑ ∞

(1 − x )2
n(n − 1)an x n−2
− 2x nan x n−1
+ p(p + 1) an xn = 0
n=2 n=1 n=0

∑ ∞
∑ ∑∞ ∞

⇒ n(n − 1)an xn−2 − n(n − 1)an xn − 2nan xn − p(p + 1)an xn = 0
n=2 n=2 n=1 n=0

∑ ∞

⇒ n(n − 1)an xn−2 − [n(n − 1) + 2n − p(p + 1)]an xn = 0
n=2 n=0

∑ ∞

⇒ n(n − 1)an xn−2 − [n(n + 1) − p(p + 1)]an xn = 0
n=2 n=0

We shift the index of summation so that the series has the general term xn−2 . Putting n = n − 2 in
the second summation, we obtain

∑ ∞

n(n − 1)an xn−2 − [(n − 2)(n − 1) − p(p + 1)]an−2 xn−2 = 0
n=2 n=2


⇒ [n(n − 1)an − [(n − 2)(n − 1) − p(p + 1)]an−2 ] xn−2 = 0
n=2


⇒ [n(n − 1)an + (p − n + 2)(p + n − 1)an−2 ] xn−2 = 0
n=2

Equating the coefficients to zero yields

−(p − n + 2)(p .+ n − 1)
n(n − 1)an + (p − n + 2)(p + n − 1)an−2 = 0 ⇒ an = an−2 , n ≥ 2
n(n − 1)

The above recurrence relation is used to calculate an for n ≥ 2 in terms of a0 and a1 , which are
left arbitrary. Thus, we have
Even subscripts Odd subscripts
−p(p + 1) −(p − 1)(p + 2)
a2 = a0 a3 = a1
2(1) 3(2)
−(p − 2)(p + 3) −(p − 3)(p + 4)
a4 = a2 a5 = a3
4(3) 5(4)
−(p − 4)(p + 5) −(p − 5)(p + 6)
a6 = a4 a7 = a5
6(5) 7(6)
.. ..
. .
−(p − 2k + 2)(p + 2k − 1) −(p − 2k + 1)(p + 2k)
a2k = a2k−2 a2k+1 = a2k−1 , k ≥ 1
2k(2k − 1) (2k + 1)(2k)

85
6.4 Power series solution about a regular singular point (Frobenius method) ⃝Francis
c Oketch

Multiplying the corresponding members of each column we get:


−p(p + 1) −(p − 2)(p + 3) −(p − 4)(p + 5) −(p − 2k + 2)(p + 2k − 1)
2 ·
a 4 ·
a 6 · · · a2k
a = a0 · 2·
a
 4 ···
a
  
a2k−2
2(1) 4(3) 6(5) 2k(2k − 1)
(−1)k p(p + 1)(p − 2)(p + 3)(p − 4)(p + 5) · · · (p − 2k + 2)(p + 2k − 1)
= a0
(2k)!


k
(−1)k (p − 2j +.2)(p + 2j − 1)
⇒ j=1
a2k = a0 , k ≥ 1
(2k)!
Similarly,
−(p − 1)(p + 2) −(p − 3)(p + 4) −(p − 5)(p + 6) −(p − 2k + 1)(p + 2k)
3 ·
a 5 ·
a 7 · · · a2k+1
a = a1 · a
3  5 ···
a  
a2k−1
3(2) 5(4) 7(6) (2k + 1)(2k)
(−1)k (p − 1)(p + 2)(p − 3)(p + 4)(p − 5)(p + 6) · · · (p − 2k + 1)(p + 2k)
= a1
(2k + 1)!


k
(−1)k (p − 2j. + 1)(p + 2j)
⇒ j=1
a2k+1 = a1 , k ≥ 1
(2k + 1)!
Therefore, the solution becomes

∑ ∞
∑ ∞

y = an xn = a2k x2k + a2k+1 x2k+1
n=0 k=0 k=0
∏k
∞ (−1)k (p − 2j + 2)(p + 2j − 1)
∑ j=1
= a0 x2k
k=0
(2k)!

k
∞ (−1)k (p − 2j + 1)(p + 2j)
∑ j=1
+a1 x2k+1
k=0
(2k + 1)!
[ ]
p(p + 1) 2 p(p + 1)(p − 2)(p + 3) 4
= a0 1 − x + x − ···
2! 4!
[ ]
(p − 1)(p + 2) 3 (p − 1)(p + 2)(p − 3)(p + 4) 5
+a1 x − x + x − ···
3! 5!
= a0 y0 (x) + a1 y1 (x)

which is the general solution of the Legendre’s equation. The functions y0 (x) and y1 (x) are called the
Legendre’s polynomials.

6.4 Power series solution about a regular singular point (Frobenius method)
If x0 is a regular singular point of equation (24), then the equation has at least one solution of the
form


y(x) = an. (x − x0 )n+r , (27)
n=0

where r and an ’s (for n = 0, 1, 2, · · · ) are constants to be determined and a0 ̸= 0. The solution (27) is
valid in the interval |x − x0 | < R for some positive real number R.

Example(s):

1. Find the power series solution in powers of x for the following differential equations.

86
6.4 Power series solution about a regular singular point (Frobenius method) ⃝Francis
c Oketch

d2 y dy
(a) 2x2 2
−x + (x − 5)y = 0.
dx dx
Solution
Clearly, the point x = 0 is a regular singular point of the given differential equation. We


assume a power series solution of the form y(x) = an (x − x0 )n+r , a0 ̸= 0. Putting
n=0
x0 = 0 yields


y(x) = an xn+r
n=0
Differentiating with respect to x yields

∑ ∞

dy d2 y
= (n + r)an xn+r−1 and = (n + r)(n + r − 1)an xn+r−2
dx n=0 dx2 n=0

Substituting into the given differential equation yields



∑ ∞
∑ ∞

2x 2
(n + r)(n + r − 1)an x n+r−2
−x (n + r)an x n+r−1
+ (x − 5) an xn+r = 0
n=0 n=0 n=0

∑ ∞
∑ ∞
∑ ∞

⇒ 2(n + r)(n + r − 1)an xn+r − (n + r)an xn+r + an xn+r+1 − 5an xn+r = 0
n=0 n=0 n=0 n=0

∑ ∞

⇒ [2(n + r)(n + r − 1) − (n + r) − 5] an xn+r + (n + r)an xn+r+1 = 0
n=0 n=0

∑ ∞

⇒ [(n + r)(2n + 2r − 3) − 5] an xn+r + an xn+r+1 = 0
n=0 n=0

We shift the index of summation so that the series has the general term xn+r . Putting
n = n − 1 in the second summation, we obtain

∑ ∞

[(n + r)(2n + 2r − 3) − 5] an xn+r + an−1 xn+r = 0
n=0 n=1

This can be written as



∑ ∞

[r(2r − 3) − 5] a0 xr + [(n + r)(2n + 2r − 3) − 5] an xn+r + an−1 xn+r = 0
n=1 n=1



⇒ [(r + 1)(2r − 5)] a0 xr + {[(n + r)(2n + 2r − 3) − 5] an + an−1 } xn+r = 0 (∗)
n=1

If equation (∗) is to be satisfied for all x, the coefficient of each power of x must be zero.
Thus, equating the coefficients of xr and xn+r to zero, we get

1. [(r + 1)(2r − 5)] a0 = 0 (This is called indicial equation). But a0 ̸= 0


5
⇒ (r + 1)(2r − 5) = 0 ⇒ r = −1 or r =
2

2. [(n + r)(2n + 2r − 3) − 5] an + an−1 = 0


−1 .
⇒ an = an−1 , n ≥ 1 (recurrence relation)
(n + r)(2n + 2r − 3) − 5

The above recurrence relation is used to calculate an for n ≥ 1 in terms of a0 which is


left arbitrary. We consider two cases of r.

Case 1: when r = −1
−1
The above recurrence relation becomes an = an−1 , n ≥ 1. Thus, we
(n − 1)(2n − 5) − 5

87
6.4 Power series solution about a regular singular point (Frobenius method) ⃝Francis
c Oketch

have.

( ) ( )
1 1 1 1 1 1 1 1 1
a1 = a0 , a2 = a1 = a0 = a0 , a3 = a2 = a0 = a0 , ···
5 6 6 5 30 3 3 30 90

Therefore, the solution corresponding to r = −1 is



∑ ( )
y = x−1 an xn = x−1 a0 + a1 x + a2 x2 + a3 x3 + · · ·
n=0
( )
−1 1 1 1
= a0 x 1 + x + x2 + x3 + · · ·
5 30 90
Setting a0 = 1 yields the first solution as
( )
−1 1 1 1
y1 = x 1 + x + x2 + x3 + · · ·
5 30 90
5
Case 2: when r =
2
−1
The above recurrence relation becomes an = an−1 , n ≥ 1. Thus, we
(2n + 5)(n + 1) − 5
have.

( )
1 1 1 1 1 1 1
a1 = − a0 , a2 = − a1 = − − a0 = a0 , a3 = − a2 = − a0 , ···
9 22 22 9 198 39 7722

Therefore, the solution corresponding to r = 5/2 is



∑ ( )
y = x5/2 an xn = x5/2 a0 + a1 x + a2 x2 + a3 x3 + · · ·
n=0
( )
1 1 2 1 3
= a0 x 5/2
1− x+ x − x + ···
9 198 7722
Setting a0 = 1 yields the second solution as
( )
1 1 2 1 3
y2 = x 5/2
1− x+ x − x + ···
9 198 7722
The general solution of the given differential equation is y = c1 y1 + c2 y2 , i.e.,
( ) ( )
−1 1 1 1 1 1 2 1 3
y = c1 x 1 + x + x2 + x3 + · · · + c2 x 5/2
1− x+ x − x + ··· ,
5 30 90 9 198 7722
where c1 and c2 are arbitrary constants.

→ Note: a more general equation with a regular singular point may not have two solutions
of the form (27). In particular, if the roots r1 and r2 of the indicial equation are equal or
differ by an integer, then the second solution normally has a more complicated structure.
In all cases, though, it is possible to find at least one solution (i.e., y1 (x)) of the form (27);
if r1 and r2 differ by an integer, this solution corresponds to the larger value of r. If there
is only one such solution, then the second solution involves a logarithmic term, given by
the following theorem.
Theorem 6.2. Let r1 and r2 be the real roots of the indicial equation with r1 ≥ r2 . Let
y1 (x) be the solution corresponding to r = r1 , which converges at least for |x| < R. If r1
and r2 are equal or differ by an integer, then the second solution is determined by:
 Case 1: if the roots are equal (r1 = r2 ), then there exists a second independent solution
of the form


y2 (x) = y1 (x) ln |x| + bn xn+r2 .
n=1

88
6.4 Power series solution about a regular singular point (Frobenius method) ⃝Francis
c Oketch

 Case 2: if r1 − r2 = N , a positive integer, then there exists a second independent


solution of the form


y2 (x) = dy1 (x) ln |x| + bn xn+r2 ,
n=0

where d is a constant.

We then find the derivatives of y2 (x), substitute them into the given differential equation
and find a recurrence relation for bn . Obtain, for example, the first three terms, say
b1 , b2 , b3 . We then fix b0 = 1 and substitute them into the second solution y2 (x).

Alternatively, we can use the method of reduction of order to find y2 (x) once y1 (x) is
known, i.e., we let y2 (x) = y1 (x)v(x); where v(x) is an arbitrary function to be
determined. Therefore, the general solution is given by y = c1 y1 (x) + c2 y2 (x). This is
illustrated in the following example.

d2 y dy
(b) x2 + (x2 − 3x) + 3y = 0.
dx2 dx
Solution
Clearly, the point x = 0 is a regular singular point of the given differential equation. We


assume a power series solution of the form y(x) = an (x − x0 )n+r , a0 ̸= 0. Putting
n=0
x0 = 0, we obtain


y(x) = an xn+r
n=0

Differentiating with respect to x yields



∑ ∞

dy d2 y
= (n + r)an xn+r−1 and = (n + r)(n + r − 1)an xn+r−2
dx n=0 dx2 n=0

Substituting into the given differential equation yields



∑ ∞
∑ ∞

x2 (n + r)(n + r − 1)an xn+r−2 + (x2 − 3x) (n + r)an xn+r−1 + 3 an xn+r = 0
n=0 n=0 n=0

Simplifying yields

∑ ∞
∑ ∞
∑ ∞

(n + r)(n + r − 1)an xn+r + (n + r)an xn+r+1 − 3(n + r)an xn+r + 3an xn+r = 0
n=0 n=0 n=0 n=0

∑ ∞

⇒ [(n + r)(n + r − 1) − 3(n + r) + 3] an xn+r + (n + r)an xn+r+1 = 0
n=0 n=0

Shifting the index in the second summation, i.e., putting n = n − 1 we get



∑ ∞

[(n + r)(n + r − 1) − 3(n + r) + 3] an xn+r + (n + r − 1)an−1 xn+r = 0
n=0 n=1

This can be written as



∑ ∞

[r(r − 1) − 3r + 3] a0 xr + [(n + r)(n + r − 1) − 3(n + r) + 3] an xn+r + (n+r−1)an−1 xn+r = 0
n=1 n=1



⇒ [(r − 3)(r − 1)] a0 xr + {[(n + r)(n + r − 4) + 3] an + (n + r − 1)an−1 } xn+r = 0
n=1

89
6.4 Power series solution about a regular singular point (Frobenius method) ⃝Francis
c Oketch

Equating the coefficients of xr and xn+r to zero, we get

1. [(r − 3)(r − 1)] a0 = 0 (This is called indicial equation). But a0 ̸= 0


⇒ (r − 3)(r − 1) = 0 ⇒ r1 = 3 and r2 = 1

2. [(n + r)(n + r − 4) + 3] an + (n + r − 1)an−1 = 0


−(n + r −. 1)
⇒ an = an−1 , n ≥ 1 (recurrence relation)
(n + r)(n + r − 4) + 3

The above recurrence relation is used to calculate an for n ≥ 1 in terms of a0 which is


left arbitrary. We consider two cases of r.

Case 1: when r = r1 = 3
−(n + 2) −1
The above recurrence relation becomes an = an−1 = an−1 , n ≥ 1.
(n + 3)(n − 1) + 3 n
Thus, we have.

1 1 1 1 −1
a1 = − a0 a2 = − a1 a3 = − a2 a4 = − a3 ··· ak = ak−1
1 2 3 4 k

Multiplying yields
1 1 1 1 1
1 ·
a
 2 ·
a 3 ·
a 4 · · · ak = − a0 · − 
a 1·− 
a 2·− 
a 3··· − 
a 

ak−1
1 2 3 4 k
Thus, we obtain
(−1)k
ak =
a0
k!
Therefore, the solution corresponding to r = 3 is

∑ ∞
∑ ( )
(−1)k 1 1
y(x) = ak x k+3
= a0 xk+3
= a0 x − x + x5 − x6 + · · ·
3 4

k=0 k=0
k! 2 6

Setting a0 = 1 yields the first solution as


1 1
y1 (x) = x3 − x4 + x5 − x6 + · · ·
2 6
Case 2: when r = r2 = 1
−n −1
The above recurrence relation becomes an = an−1 = an−1 , n ≥ 1.
(n + 1)(n − 3) + 3 n−2
Thus, we have.

1 1
a1 = − a0 = a0 a2 = − a1 = −∞
1− 0

Therefore, no power series corresponds to r = 1. The second solution, y2 (x), can be


obtained by invoking theorem (6.2). Hence, the general solution is

y = c1 y1 (x) + c2 y2 (x),

where c1 and c2 are arbitrary constants.

→ Task: the student should apply theorem (6.2) to obtain y2 (x).

Exercise:

90
6.4 Power series solution about a regular singular point (Frobenius method) ⃝Francis
c Oketch

1. Find a series solution near x = 0 of the following differential equations.

(a) 2x2 y ′′ − xy (
′ + (1 + x)y = 0.
) ( )
[ans:
∞ (−1)n 2n
∑ ∞ (−1)n 2n

y(x) = c1 x 1 + xn + c2 x1/2 1 + xn , x > 0]
n=1 (2n + 1)! n=1 (2n)!
(b) 2x(1 + x)y ′′ + (3 + x)y ′ − xy = 0. [hint: r1 = 0, r2 = −1/2, ans: ]
d2 y dy
(c) 4x 2
+2 + y = 0. [hint: r1 = 0, r2 = 1/2, ans:
dx (dx ) ( )
x x2 x3 x x2 x3
y(x) = c1 1 − + − + · · · + c2 x1/2 1− + − + ··· ]
2! 4! 6! 3! 5! 7!
( )
1 sin x cos x
(d) x2 y ′′ + xy ′ + x2 − y = 0. [hint: r1 = 1/2, r2 = −1/2, ans: y(x) = c1 √ + c2 √ ]
4 x x
2. Find the power series solution in powers of x for the following differential equations.
d2 y dy
(a) 4x2 − 4x2 + (1 − 2x)y = 0. [ans:
dx2 ( dx )
x2 x3 x4
y1 = a0 x 1/2 1+x+ + + + · · · = a0 x1/2 ex ]
2! 3! 4!
√ √
(b) 2xy ′′ + y ′ + y = 0. [hint: set a0 = 1, ans: y = c1 cos 2x + c2 sin 2x for x > 0]
x2
(c) xy ′′ + (1 − x)y ′ + 2y = 0, x > 0. [hint: set a0 = 1, ans: y1 = 1 − 2x + ]
2
(d) x(x − 1)y ′′ + 3xy ′ + y = 0. [ans: y1 = a0 x(1 + 2x + 3x2 + 4x3 + · · · )]
d2 y dy
(e) 2x2 2
−x + (1 − x)y = 0. [ans:
dx ( dx ) ( )
x x2 x3 √ x2 x3
y = c1 x 1 + + + + · · · + c2 x 1 + x + + + ··· ]
3 30 630 6 90
d2 y dy
(f) 2x2 2
+x + (x2 − 3)y = 0. [hint: a1 = 0, set a0 = 1, ans: y =
dx ( dx ) ( )
1 2 1 4 1 −1 1 2 1 4 1 6
c1 x3/2 1− x + x − x + · · · + c2 x
6 1+ x − x + x + ··· ]
18 936 95472 2 24 1008
(g) x(x − 1)y ′′ + 6x2 y ′ + 3y = 0.
(h) xy ′′ + 2xy ′ + 6ex y = 0.
d2 y dy
(i) 9x(1 − x) 2
− 12 + 4y = 0.
dx dx
d2 y dy
(j) 2x2 2 + (x + 2) + y = 0.
dx dx
d2 y dy
(k) x2 2 + (x2 − 3x) + 3y = 0.
dx dx
d2 y dy
(l) 9x(1 − x) 2 − 12 + 4y = 0.
dx dx

6.4.1 Bessel’s equation and functions


The differential equation

d2 y dy
x2 +x + (x2 − p2 )y = 0 (28)
dx2 dx
is called Bessel’s equation of order p, where p is a constant. The fundamental set of solutions of
equation (28) are known as Bessel functions. The equivalent normalized form of equation (28) is
( )
d2 y 1 dy p2 1 p2
+ + 1 − y=0 ⇒ P1 (x) = , P2 (x) = 1 − 2
dx2 x dx x2 x x

91
6.4 Power series solution about a regular singular point (Frobenius method) ⃝Francis
c Oketch

Clearly, the point x = 0 is a regular singular point of equation (28). To solve equation (28), we assume
that it has a power series solution of the form


y(x) = an xn+r , (a0 ̸= 0) (29)
n=0

where x0 is the regular singular point of equation (28) about which we are finding the solution,
a0 , a1 , · · · are constants. From (29) it implies that

∑ ∞

dy d2 y
= (n + r)an xn+r−1 and = (n + r)(n + r − 1)an xn+r−2
dx n=0 dx2 n=0
Substituting into equation (28) yields

∑ ∞
∑ ∞

x2
(n + r)(n + r − 1)an x n+r−2
+x (n + r)an x n+r−1
+ (x − p )
2 2
an xn+r = 0
n=0 n=0 n=0

∑ ∞
∑ ∞
∑ ∞

⇒ (n + r)(n + r − 1)an xn+r + (n + r)an xn+r + an xn+r+2 − p2 an xn+r = 0
n=0 n=0 n=0 n=0

∑ ∑∞
⇒ [(n + r)(n + r − 1) + (n + r) − p2 ]an xn+r + an xn+r+2 = 0
n=0 n=0

∑ ∑∞
⇒ [(n + r)2 − p2 ]an xn+r + an xn+r+2 = 0
n=0 n=0

Shifting the index in the second summation, i.e., putting n = n − 2 we get



∑ ∞

[(n + r)2 − p2 ]an xn+r + an−2 xn+r = 0
n=0 n=2

∑ ∞

⇒ a0 (r − p )x + a1 [(r + 1) − p ]x
2 2 r 2 2 r+1
+ [(n + r) − p ]an x
2 2 n+r
+ an−2 xn+r = 0
n=2 n=2

Equating the coefficients of xr , xr+1 and xn+r to zero, we get


1. a0 (r2 − p2 ) = 0 (This is called indicial equation). But a0 ̸= 0
⇒ (r2 − p2 ) = 0 ⇒ r = ±p

2. a1 [(r + 1)2 − p2 ] = 0. But [(r + 1)2 − p2 ] ̸= 0 ⇒ a1 = 0

[ ] −1 .
3. (n + r)2 − p2 an + an−2 = 0 ⇒ an = an−2 , n ≥ 2 (recurrence relation)
(n + r)2 − p2

The above recurrence relation is used to calculate an for n ≥ 2 in terms of a0 and a1 which are left
arbitrary. We consider two cases of r.
 Case 1: when r = p
−1
The above recurrence relation becomes an = an−2 , n ≥ 2. Thus, we have (note
(p + n)2 − p2
a1 = 0).

Even subscripts Odd subscripts


−1 −1 −1
a2 = a0 = a0 a3 = a1 = 0
(p + 2) − p
2 2 4(p + 1) (p + 3)2 − p2
−1 −1 −1
a4 = a2 = a2 a5 = a3 = 0
(p + 4) − p
2 2 8(p + 2) (p + 5)2 − p2
−1 −1 −1
a6 = a4 = a4 a7 = a5 = 0
(p + 6) − p
2 2 12(p + 3) (p + 7)2 − p2
.. ..
. .
−1 −1 −1
a2k = a2k−2 = a2k−2 a2k+1 = a2k−1 = 0, k ≥ 1
(p + 2k) − p
2 2 4k(p + k) (p + 2k + 1)2 − p2

92
6.4 Power series solution about a regular singular point (Frobenius method) ⃝Francis
c Oketch

Multiplying the corresponding members of each column we get:


For the even subscripts,
−a0 −a2 −a2k−2
a2 · a4 · · · a2k = · ···
4(p + 1) 8(p + 2) 4k(p + k)
(−1) k
= a0 · a2 · · · a2k−2
22k k!(p + 1)(p + 2) · · · (p + k)
(−1)k 1
⇒ a2k = a0 . We choose a0 = p and get,
2 k!(p + 1)(p + 2) · · · (p + k)
2k 2 p!
(−1)k 1 (−1)k (−1)k
a2k = = =
22k k!(p + 1)(p + 2) · · · (p + k) 2p p! 2p+2k k!(p + k)! 2p+2k k!Γ(p + k + 1)

Similarly, for the odd subscripts,

a3 · a5 · · · a2k+1 = 0 ⇒ a2k+1 = 0

Therefore,

∑ ∞
∑ ∞

y(x) = an x n+r
⇒ y1 (x) = p+2k
a2k x + a2k+1 xp+2k+1
n=0 k=0 k=0
∑∞
(−1)k · xp+2k
= +0
k=0
2p+2k k!Γ(p + k + 1)
= Jp (x) (30)

The function Jp (x) is called Bessel function of the first kind of order p.

 Case 2: when r = −p
Similarly, the Bessel function corresponding to r = −p is [we replace p by −p in equation (30)]

∑ (−1)k · x−p+2k
y2 (x) = = J−p (x)
k=0
2−p+2k k!Γ(−p + k + 1)

The function J−p (x) is called Bessel function of the second kind of order p.

Therefore, the general solution of equation (28) is y = c1 Jp (x)+c2 J−p (x), where c1 and c2 are arbitrary
constants.

93
⃝Francis
c Oketch

Lecture 13

7 Applications of second order linear ODEs


7.1 Electrical RLC-series circuits
Consider a series circuit containing an electromotive force (e.g., a battery or generator), resistors,
inductors, and capacitors. The emf produces a flow of current in a closed circuit and the current
produces a voltage drop across each resistor, inductor and capacitor.

 [Faraday’s law] The voltage drop across the inductor


dI
is EL = L
dt
 [Ohm’s law] The voltage drop across the resistor is
ER = RI(t)
1
 The voltage drop across the capacitor is EC = Q(t)
C

Here, I(t) denotes the current in the RLC-series circuit, Q(t) denotes the instantaneous charge on the
capacitor, and E(t) denotes the impressed voltage (or electric potential) at time t. From Kirchhoff’s
voltage law, “the sum of the voltage drops across resistors, inductors, and capacitors is equal to the
total electromotive force in a closed circuit”, we have
dI 1
L + RI(t) + Q(t) = E(t), (∗)
dt C
where L, R and C are constants while I and Q are the dependent variables. But

dQ
I(t) =. ,
dt

Thus, equation (∗) becomes


d2 Q dQ . 1
L 2
+R + Q = E(t)
dt dt C
This is the differential equation governing the charge on the capacitor in an RLC series circuit.

→ Note:
dI
 If the circuit contains no capacitor, then Kirchhoff’s voltage law becomes L + RI(t) = E(t).
dt
dQ 1
 If the circuit contains no inductor, then Kirchhoff’s voltage law becomes R + Q = E(t).
dt C

Example(s):

1. A series circuit has an inductor of 0.2 henrys (H), a resistor of 300 ohms and a capacitor of 10−5
farads (F). The initial charge on the capacitor is 10−6 coulombs and the initial current is 0. Find
the charge on the capacitor and the current at any time t.

Solution
d2 Q dQ 1
The IVP to be solved is L 2
+R + Q = 0; Q(0) = 10−6 , I(0) = Q′ (0) = 0. Given
dt dt C
L = 0.2, R = 300, C = 10−5 , E(t) = 0, we have

d2 Q dQ 1 d2 Q dQ
0.2 2
+ 300 + −5 Q = 0 ⇒ 2
+ 1500 + 500000Q = 0 (∗)
dt dt 10 dt dt

94
7.1 Electrical RLC-series circuits ⃝Francis
c Oketch

d
Let D = . In terms of D operator, equation (∗) becomes [D2 + 1500D + 500000]Q = 0. The
dt
auxiliary equation is D2 + 1500D + 500000 = 0. The roots are D1 = −1000 and D2 = −500.
Therefore, the general solution is

Q(t) = Ae−1000t + Be−500t ,

where A and B are arbitrary constants. Differentiating the general solution, we get

Q′ (t) = −1000Ae−1000t − 500Be−500t

Applying the initial condition Q(0) = 10−6 , we have 10−6 = A+B. Applying the initial condition
Q′ (0) = 0, we have 0 = −1000A − 500B. Solving for A and B, we obtain A = −10−6 , B =
2 × 10−6 . Therefore, the particular solution is
( )
Q(t) = 10−6 2e−500t − e−1000t

dQ
The current at any time t is given by I(t) = , i.e.,
dt
( )
I(t) = 10−3 e−1000t − e−500t

2. Suppose that the circuit of example 1 above is attached to an alternating current power supply
with the impressed voltage E(t) = 110 sin(12t) volts. Find the steady-state charge on the
capacitor and the steady-state current. Identify the amplitude and phase shift of the steady-
state charge.

Solution
d2 Q dQ 1
The IVP to be solved is L 2
+R + Q = E(t); Q(0) = 10−6 , Q′ (0) = 0. Given L =
dt dt C
0.2, R = 300, C = 10−5 , E(t) = 110 sin(12t), we have

d2 Q dQ 1 d2 Q dQ
0.2 2
+ 300 + −5 Q = 0 ⇒ 2
+ 1500 + 500000Q = 550 sin(12t) (∗)
dt dt 10 dt dt
d
Let D = . In terms of D operator, equation (∗) becomes [D2 +1500D+500000]Q = 550 sin 12t.
dt
i) The complementary function
The auxiliary equation is D2 + 1500D + 500000 = 0. The roots are D1 = −1000 and
D2 = −500. Therefore, the general solution is

Qc (t) = Ae−1000t + Be−500t ,

where A and B are arbitrary constants.


[ ]
lim [Qc (t)] = lim Ae−1000t + Be−500t = 0 → not steady-state
t→∞ t→∞

ii) The particular integral

1 1
Qp (t) = (550 sin 12t) = (550 sin 12t)
D2 + 1500D + 500000 −(122 ) + 1500D + 500000
1 (1500D − 499856)
= (550 sin 12t) = (550 sin 12t)
1500D + 499856 (1500D + 499856)(1500D − 499856)
(1500D − 499856) 550
= (550 sin 12t) = (1500D − 499856)(sin 12t)
[2250000D2 − (499856)2 ] [2250000(−144) − (499856)2 ]
( ) ( )
= (−2.19842 × 10−9 )(18000 cos 12t − 499856 sin 12t) ≈ 1.1 × 10−3 sin(12t) − 4 × 10−5 cos(12t)

95
7.2 Simple pendulum ⃝Francis
c Oketch

The steady-state charge is


( ) ( )
Qp (t) = 1.1 × 10−3 sin(12t) − 4 × 10−5 cos(12t)

and steady-state current I(t) = Q′p (t), i.e.,


( ) ( )
I(t) = 1.32 × 10−2 cos(12t) + 4.8 × 10−4 sin(12t)

To identify the amplitude and phase shift of the steady-state charge, we first need to express
Qp (t) in the “phase-angle” form Qp (t) = A sin(12t + α); where A and α are constants to be
determined.
( ) ( )
1.1 × 10−3 sin(12t) − 4 × 10−5 cos(12t) = A sin(12t + α)
= A sin(12t) cos α + A cos(12t) sin α

Equating the corresponding coefficients, we have

A cos α = 1.1 × 10−3 − −(i) and A sin α = −4 × 10−5 − −(ii)


( )2 ( )2
and (ii) then adding, we get (A cos α)2 + (A sin α)2 = 1.1 × 10−3
Squaring (i)√ + −4 × 10−5 .
Thus, A = (1.1 × 10−3 )2 + (−4 × 10−5 )2 ≈ 1.2 × 10−3 . Dividing equation (ii) by (i), we get
( )
−4×10−5
α = tan−1 1.1×10−3
≈ −0.0364 radians. Therefore,
( )
Qp (t) = 1.2 × 10−3 sin(12t − 0.0364) = 0.0012 sin 12(t − 0.00303)

Amplitude = 0.0012, period = 2π/12 = π/6, and phase shift = 0.00303 to the right.

Exercise:

1. A series circuit has an inductor of 0.2 henry, no resistance and a capacitor of 10−5 farads. The
initial charge on the capacitor is 10−6 coulombs and there is no initial current. Find the charge
on the capacitor and the current at any time t. Find the amplitude and phase shift of the charge
function. [hint: solve Q′′ + 500000Q = 0]

2. A series circuit has an inductor of 0.5 henry, a resistor of 2 ohms and a capacitor of 0.05 farads.
The initial charge on the capacitor is zero and the initial current is 1 Amperes. A voltage source
of E(t) = 3 cos 2t volts is analogous to an external force. Find the charge on the capacitor and
the current at any time t. [hint: solve Q′′ + 4Q′ + 40Q = 6 cos 2t; Q(0) = 0, Q′ (0) = 1]

3. A series circuit has an inductor of 1 henry, a resistor of 10 ohms and a capacitor of 0.5 farads,
and an electromotive force given by E(t) = 0.1 cos 2t volts. Find the steady-state solution and
identify its amplitude, period and phase shift. [hint: solve Q′′ + 10Q′ + 2Q = 0.1 cos 2t, ans:
amplitude 0.00497, period π, phase shift 0.05 to the right]

7.2 Simple pendulum

The restoring force F = mg sin θ acts on the opposite direction of


the motion, g = 9.8ms−2 is the gravitational acceleration. Linear
dS
displacement S = Lθ, linear velocity v = = Lθ′ (t), and linear
dt
dv
acceleration a = = Lθ′′ (t).
dt

96
7.2 Simple pendulum ⃝Francis
c Oketch

 Undamped pendulum: from Newton’s second law of linear motion (F = ma), we have
g
mLθ′′ = −mg sin(θ). Rearranging, we get θ′′ + sin θ = 0. For small θ, we can approximate
L
sin θ ≈ θ. Therefore, the governing equation for the motion of an undamped pendulum is
g
θ′′ (t) + . θ(t) = 0 ,
L

where θ(t) is the angular displacement and θ′′ (t) is the angular acceleration of the bob at time
t. This equation shows that the motion of the bob continues indefinitely (no other forces are
involved). However, this doesn’t happen in the real world.

 Damped pendulum: In the real world, there is always some air resistance in the system,
which causes the oscillations to die off slowly -an effect called damping. The damping force is
assumed to be proportional to the velocity of the bob and acts in the opposite direction. So
the damping force is given by −aLθ′ (t), where a (> 0) is the damping constant (kg/s). Again
applying Newton’s second law, the differential equation for the motion of a damped pendulum
becomes
a g
θ′′ (t) + θ′ (t). + θ(t) = 0 ,
m L
d
where θ′ (t) is the angular velocity of the bob at time t. Let D = . Then, the associated
dt
a g
characteristic equation is D2 + D + = 0. Applying the quadratic formula, we have
m L

4m2 g
−a ± a2 −
L
D=
2m
If a ̸= 0, the behavior of the system depends on whether the characteristic equation has distinct
real roots, a repeated real root, or complex conjugate roots.
4m2 g
i) If a2 − > 0, the system is overdamped and does not exhibit oscillatory behavior.
L
4m2 g
ii) If a2 − = 0, the system is critically damped. It does not exhibit oscillatory behavior,
L
but any slight reduction in the damping would result in oscillatory behavior.
4m2 g
iii) If a2 − < 0, the system is underdamped. It exhibits oscillatory behavior, but the
L
amplitude of the oscillations decreases over time.

 Damped forced pendulum: If the bob experiences an external force (e.g., if the support
P is set in motion) of magnitude F (t), then the equation of motion for a damped pendulum is
given by
a g 1
θ′′ (t) + θ′ (t) + . θ(t) = F (t) .
m L mL
If F (t) ̸= 0, the equation has both the complementary function (θc (t)) and particular integral
(θp (t)). If the system is damped, lim [θc (t)] = 0. Since the terms in θc (t) do not affect the
t→∞
long-term behavior of the system, we call this part of the solution the transient solution. The
long-term behavior of the system is determined by θp (t), so we call this part of the solution the
steady-state solution.

Example(s):
1. For a pendulum of length 5 cm, the bob is released from rest from a starting angle θ = 0.2
radians. Find an equation for the position at any time t and find the amplitude and period of
the motion.

Solution

97
7.2 Simple pendulum ⃝Francis
c Oketch

g
The IVP to be solved is that of undamped pendulum, i.e., θ′′ (t) + θ(t) = 0; θ(0) = 0.2, θ′ (0) =
L
0. Given L = 0.05, g = 9.8, k = 0, F (t) = 0, we have

θ′′ (t) + 196θ(t) = 0 (∗)

d
Let D = . In terms of D operator, equation (∗) becomes [D2 + 196]θ = 0. The auxiliary
dt
equation is D2 + 196 = 0. The roots are D1,2 = ±14i. Therefore, the general solution is

θ(t) = A cos 14t + B sin 14t,

where A and B are arbitrary constants. Differentiating the general solution, we get

θ′ (t) = −14A sin 14t + 14B cos 14t

Applying the initial condition θ(0) = 0.2, we have 0.2 = A. Applying the initial condition
θ′ (0) = 0, we have 0 = B. Therefore, the particular solution is

θ(t) = 0.2 cos 14t

The amplitude of the motion is A = 0.2 while period of the motion is T = 2π/14 = π/7.

2. For a pendulum of mass 62.5 g, length 245/16 cm, damping constant a = 0.1 kg/s and forcing
function F (t) = 0.5 sin 4t N, find the amplitude and period of the steady-state motion.

Solution
The equation to be solved is that of damped forced pendulum, i.e.,
a ′ g 1
θ′′ (t) + θ (t) + θ(t) = F (t)
m L mL
Given m = 0.0625, L = 2.45/16, g = 9.8, d = 0.1, F (t) = 0.5 sin 4t, we have
2560
θ′′ (t) + 1.6θ′ (t) + 64θ(t) = sin 4t (∗)
49
d 2560
Let D = . In terms of D operator, equation (∗) becomes [D2 + 1.6D + 64]θ = sin 4t.
dt 49
i) The complementary function
The auxiliary equation is D2 + 1.6D + 64 = 0. Hence, the roots are D1,2 ≈ −0.8 ± 7.96i.
Thus, the complementary function is θc (t) = e−0.8t (A cos 7.96t + B sin 7.96t), where A and
B are arbitrary constants.
[ ]
lim [θc (t)] = lim e−0.8t (A cos 7.96t + B sin 7.96t) = 0 → not steady-state
t→∞ t→∞

ii) The particular integral


2560 1 2560 1 2560 1
θp (t) = (sin 4t) = (sin 4t) = (sin 4t)
2
49 D + 1.6D + 64 49 −(4 ) + 1.6D + 64
2 49 1.6D + 48
2560 1.6D − 48 2560 1.6D − 48
= (sin 4t) = (sin 4t)
49 (1.6D + 48)(1.6D − 48) 49 (2.56D2 − 2304)
2560 1.6D − 48 2560 1
= (sin 4t) = − (1.6D − 48)(sin 4t)
49 (2.56(−16) − 2304) 49 2344.96
= −0.02228(6.4 cos 4t − 48 sin 4t) = 1.069 sin 4t − 0.143 cos 4t

Therefore, the steady-state solution is

θp (t) = 1.069 sin 4t − 0.143 cos 4t

98
7.3 Spring-mass systems ⃝Francis
c Oketch

To identify the amplitude and phase shift of the steady-state solution, we first need to express
θp (t) in the form θp (t) = A sin(4t + α); where A and α are constants to be determined.

1.069 sin 4t − 0.143 cos 4t = A sin(4t + α) = A sin(4t) cos α + A cos(4t) sin α


= (A cos α) sin(4t) + (A sin α) cos(4t)

Equating the corresponding coefficients, we have

A cos α = 1.069 − −(i) and A sin α = −0.143 − −(ii)


2 2 2 2
Squaring
√ (i) and (ii) then adding, we get (A cos α) + (A sin α) = (1.069) + (−0.143) . Thus,
( )
−0.143
A = (1.069)2 + (−0.143)2 ≈ 1.079. Dividing equation (ii) by (i), we get α = tan−1 1.069 ≈
−0.1330 radians. Therefore,

θp (t) = 1.079 sin(4t − 0.1330) = 1.079 sin 4(t − 0.0332)

Amplitude = 1.079, period = 2π/4 = π/2, and phase shift = 0.0332 to the right.

Exercise:
1. A pendulum of length 10 cm. The bob is released from a starting angle θ = 0.2 radians. Find
an equation for the position at any time and find the amplitude and period of the motion.

2. A pendulum of length 10 cm and mass 200g, has a damping constant a = 6. The bob is released
from a starting angle θ = 0 and forcing function F (t) = 0.5 sin(2πt). with an initial angular
velocity of θ′ = 0.1. Find the steady-state equation for the position at any time t and find the
amplitude and period of the motion.

7.3 Spring-mass systems

Let the spring have natural (or unstretched) length l, as shown in figure (a). In figure (b), the mass
m is attached to its lower end and comes to rest in its equilibrium position O, thereby stretching the
spring by an amount e so that its stretched length is l + e. In the equilibrium position O, the mass m
in acted upon by two forces: (i) weight mg acting vertically downwards (ii) the tension on the spring
given by Hooke’s law as ke acting vertically upwards; k (> 0) being the spring constant. Thus, we
have
mg = ke (∗)
We choose the axis along the line of the spring, with the origin at equilibrium position O and the
positive direction downward. Let P be the position of the mass at any time t such that OP = x, as
shown in figure (c). Then x is positive, zero, or negative according to whether the mass is below, at,
or above its equilibrium position O. When the mass is situated at P, it is acted upon by the following
forces.
i) The weight given by F1 = mg, acting in the vertically downward direction.

99
7.3 Spring-mass systems ⃝Francis
c Oketch

ii) The tension on the spring (or restoring force of the spring) given by F2 = −k(x + e), acting in
the upward direction and so it is negative. Using equation (∗), we have
F2 = −kx − ke = −kx − mg

iii) The dumping force (or resisting force of the medium), which is proportional to the magnitude
of the velocity, given by F3 = −a(dx/dt), acting in the upward direction and so it is negative.
The constant of proportionality a (> 0) is called the damping constant.
iv) External impressed force F4 = F (t) acting in downward direction.
d2 x
By Newton’s second law of linear motion F = ma, where F = F1 + F2 + F3 + F4 and a = 2 . Thus,
dt
we obtain
dx d2 x
mg − kx − mg − a + F (t) = m 2
dt dt
or
d2 x dx .
+a + kx = F (t)
dt2 dt
This is the differential equation governing the motion of the mass on the spring.

→ Note:
 If a = 0 the motion is called undamped otherwise it is called damped. If there are no external
impressed forces, F (t) = 0 for all t and the motion is called free; otherwise it is called forced.
a k
The associated characteristic equation is D2 + D + = 0. Applying the quadratic formula,
m m
we have √
−a ± a2 − 4mk
D=
2m
If a ̸= 0, the behavior of the system depends on whether the characteristic equation has distinct
real roots, a repeated real root, or complex conjugate roots.
i) If a2 − 4mk > 0, the system is overdamped and does not exhibit oscillatory motion.
ii) If a2 − 4mk = 0, the system is critically damped. It does not exhibit oscillatory motion,
but any slight reduction in the damping force would result in oscillatory motion.
iii) If a2 − 4mk < 0, the system is underdamped. It exhibits oscillatory motion, but the
amplitude of the oscillations decreases over time.
 Undamped motion of the mass is a simple harmonic motion.

Example(s):
1. A 0.5kg weight is attached to the lower end of a spring suspended from the ceiling, the spring
constant of the spring being 10 kg/ft. The weight comes to rest in its equilibrium position.
Beginning at t = 0 an external force given by F (t) = 5 cos 2t is applied to the system. If the
damping constant is 2, determine the resulting motion.

Solution
The equation to be solved is that of damped forced system, i.e.,
mx′′ (t) + ax′ (t) + kx(t) = F (t)
Given m = 0.5, a = 2, k = 10, F (t) = 5 cos 2t, we have
0.5x′′ (t) + 2x′ (t) + 10x(t) = 5 cos 2t
or
x′′ (t) + 4x′ (t) + 20x(t) = 10 cos 2t(∗)
d
subject to the initial conditions x(0) = 0 and x′ (0) = 0. Let D = . In terms of D operator,
dt
equation (∗) becomes [D2 + 4D + 20]x = 10 cos 2t.

100
7.3 Spring-mass systems ⃝Francis
c Oketch

i) The complementary function


The auxiliary equation is D2 + 4D + 20 = 0. Hence, the roots are D1,2 = −2 ± i4. Thus, the
complementary function is xc (t) = e−2t (A cos 4t + B sin 4t), where A and B are arbitrary
constants.
[ ]
lim [xc (t)] = lim e−2t (A cos 4t + B sin 4t) = 0 → not steady-state
t→∞ t→∞

Thus, the transient term is xc (t), representing a damped oscillatory motion.


ii) The particular integral
1 1 1
θp (t) = 10 (cos 2t) = 10 (cos 2t) = 10 (cos 2t)
D2 + 4D + 20 −(22 ) + 4D + 20 4D + 16
4D − 16 4D − 16
= 10 (cos 2t) = 10 (cos 2t)
(4D + 16)(4D − 16) (16D2 − 256)
4D − 16 10
= 10 (cos 2t) = − (4D − 16)(cos 2t)
(16(−4) − 256) 320
1 1 1
= − (−8 sin 2t − 16 cos 2t) = sin 2t + cos 2t
32 4 2
Therefore, the steady-state solution is
1 1
xp (t) = sin 2t + cos 2t ≈ 0.56 cos(2t − 0.46)
4 2
representing a simple harmonic motion of amplitude 0.56 and period π. Therefore, the general
solution is
1 1
x(t) = e−2t (A cos 4t + B sin 4t) + sin 2t + cos 2t
4 2

Applying the initial conditions x(0) = 0, x (0) = 0, we obtain the particular solution as
1 1
x(t) = − e−2t (4 cos 4t + 3 sin 4t) + (sin 2t + 2 cos 2t)
8 4

Exercise:

1. A 15 grams mass stretches a spring by 10 cm. The damping constant is a = 0.4. The spring is
set in motion from the equilibrium position with an upward velocity of 2 m/s. Find an equation
for the position of the mass at any time t. [hint: solve
′′ ′ ′
x + (0.4/0.015)x + (9.8/0.1)x = 0; x(0) = 0, x (0) = 2]

101
⃝Francis
c Oketch

8 Elementary set theory


A set is any well-defined collection, group, aggregate, class or conglomerate of objects. These objects
(which may be cities, countries, years, numbers, letters, or anything else) are called elements of the
set, and are often said to be members of the set. Each element occurs once in the set.

8.1 Notation and terminology


Usually capital letters of the alphabet are used to represent sets while small letters of the alphabet
are used to represent elements of a set. The elements of a set are listed inside a pair of curly brackets.
For example, the set whose elements are the first six letters of the alphabet is written as

A = {a, b, c, d, e, f }

We can also specify a set by giving a description of its elements (without actually listing the elements).
For example, the set B = {2, 4, 6, 8, 10} can also be written

B = {all even integers between 1 and 11}

Symbol Meaning
∈ Belongs to (or is a member of). For example, x ∈ A means element x belongs to the set A.

/ Is not a member of. For example, x ∈/ A means element x is not a member of A.
∀ For all
∃ There exists
| or : such that

8.2 Finite and infinite sets


A set is said to be finite if its members can be enumerated and it’s infinite otherwise. For example,
the set A = {1, 2, 3, 4, 6, 12} is finite while the set B = {2, 4, 6, · · · } is infinite.

8.3 Empty set


An empty set is a set with no elements. An empty set is usually denoted by ∅ or {}. It is a set that
arises in a variety of guises. For example, let B = {People taller than the Times Tower in Kenya}. It
is clear that the set B is empty.

8.4 Subsets
Let A and B be two sets. If every element of A is an element of B, we say that A is a subset of
B, and we write A ⊆ B. We also say that A is contained in B. For example, let A = {2, 5, 7} and
B = {1, 2, 3, 4, 5, 6, 7, 8}. Then, it is clear that A is contained in B, i.e., A ⊂ B.

8.5 Cardinality of a Set


The number of elements in a set A is called the cardinality of A, and is denoted n(A) or |A|. A set
with one element is called a singleton set. Thus, a set A is said to be finite if n(A) < ∞. A set A is
said to be infinite if n(A) = ∞. Note that n(∅) = 0.

8.6 Fundamental operations on Sets


8.6.1 Union
Let A and B be sets. The union of A and B, denoted by A ∪ B is

A ∪ B = {x : x ∈ A or x ∈ B or both}

Thus, the union of sets is the set of all objects which belong to at least one of them. For example, if
A = {Nairobi, Lagos, Kigali} and B = {Kamau, Onyango, Wanyama}, then

A ∪ B = {Nairobi, Lagos, Kigali, Kamau, Onyango, Wanyama}

102
8.7 Universal set ⃝Francis
c Oketch

Similarly, let A = {x, y, t, s}, B = {1, 4, 9, 16} and C = {0, 1, 3, 4, 5, 6, 7, 8, 20}. Then,

A ∪ B ∪ C = {x, y, t, s, 1, 4, 9, 16, 0, 3, 5, 6, 7, 8, 20}

8.6.2 Intersection
Let A and B be sets. The intersection of A and B, denoted by A ∩ B is

A ∩ B = {x : x ∈ A and x ∈ B}

Thus, the intersection of sets is the set of all objects which belong to all of them. For example, let
A = {1, 4, 9, 16} and B = {0, 1, 3, 4, 5, 6}. Then,

A ∩ B = {1, 4}

Definition 8.1 (Disjoint sets). Two sets A and B are said to be disjoint if they do not have a
member in common. That is, A ∩ B = ∅. If this is the case, we say that A and B do not intersect. If
A ∩ B ̸= ∅, we say that A and B intersect.

8.6.3 Set difference


Let A and B be sets. The set difference of A and B, denoted by A − B is defined as

A − B = {x : x ∈ A and x ∈ B}

For example, if A = {1, 2, 3, 5, 6, 7} and B = {3, 5, 9}, then

A − B = {1, 2, 6, 7} and B − A = {9}

Similarly, if A = {New York, Cairo, Mumbai, Seoul,Beijing, Moscow, London} and


B = {Nairobi, Kigali, Pretoria, Beijing, Harare, Paris, London}; then

A − B = {New York, Cairo, Mumbai, Seoul, Moscow}

and
B − A = {Nairobi, Kigali, Pretoria, Harare, Paris}

8.6.4 Symmetric difference of two sets


Let A and B be sets. The symmetric difference of A and B B, denoted by A∆B is defined as

A∆B = {x : x ∈ A or x ∈ B, but not both} = (A − B) ∪ (B − A) = (A ∪ B) − (A ∩ B)

For example, if A = {2, 1, 3, 5} and B = {x, t, 7, 1}, then A ∪ B = {1, 2, 3, 5, x, t, 7} and A ∩ B = {1}.
Therefore,
A∆B = {2, 3, 5, x, t, 7}

8.7 Universal set


A universal set U is a set which contains all elements under consideration. For example, suppose
A = {a, b, c, d}, B = {b, d, e, f }, and C = {d, e, f, g, h}. Then the universal set is probably U =
{a, b, c, d, e, f, g, h, p, q, t}. Similarly,

(a) If one considers the set of men and women, then a universal set is probably the set of human
beings.

(b) If one considers sets such as pigs, cows, chickens, or horses, the universal set is probably the set
of animals.

103
8.8 Complement of a set ⃝Francis
c Oketch

8.8 Complement of a set


Let U be the universal set and let A be any set. Then, the complement of A is the set of elements of
U that do not belong to A. It is denoted by Ac = U − A. Thus for the above sets, we have

Ac = {e, f, g, h, p, q, t}, B c = {a, c, g, h, p, q, t}, and C c = {a, b, c, p, q, t}

Similarly, let the universal set be U = {0, 1, 2, 3, 5, 6} and D = {3, 5}. Clearly, Dc = {0, 1, 2, 6}.

→ Note: the complement is always with respect to a particular universal set. Thus, when discussing
complements, it is essential to define the universal set.

8.9 Venn diagrams


It is often useful a diagram called a Venn diagram to visualize and prove some of the various properties
of set operations. In a Venn diagram, the universal set U is represented/depicted by the interior of
a large rectangular area/region. Subsets within this universe are represented by interiors of circular
areas/regions and wanted regions are to be shaded. For a set A, the region/area outside the circle for
A represents Ac . Examples of set operations using Venn diagram:

(a) A ⊂ B (b) Ac (c) A − B

(d) A ∪ B (e) A ∩ B (f) A∆B

8.10 Applications of Venn diagrams in counting


We can use Venn diagrams to solve counting problems.

Example(s):

1. Safaricom (Kenya Ltd) surveyed 400 of its customers to determine the way they learned about
the new Kochokocho promotion. The survey shows that 180 learned about the promotion from
radio, 190 from television, 190 from newspapers, 80 from radio and television, 90 from radio and
newspapers, 50 from television and newspapers, and 30 from all three forms of media. Draw a
Venn diagram to represent this information. Hence, determine the number of customers who:

(a) learned of the promotion from at least two of the three media.
(b) learned of the promotion from exactly one of the three media.
(c) did not learn of the promotion from any of the three media.

104
8.10 Applications of Venn diagrams in counting ⃝Francis
c Oketch

Solution
Let the universal set be
U = {400 Safaricom customers}
R = {customers who learned about the promotion from Radio}
T = {customers who learned about the promotion from Television}
N = {customers who learned about the promotion from Newspapers}
We are given that
|U | = 400, |R| = 180, |T | = 190, |N | = 190
and
|R ∩ T | = 80, |R ∩ N | = 90, |T ∩ N | = 50, |R ∩ T ∩ N | = 30

(a) At least two of the media means we add : 50,60, 20 and 30 to get 160. Thus exactly 160
customers learned of the promotion from at least two of the three media.
(b) Exactly one of the media means Radio only or Television only or Newspapers only. From
the Venn diagram we have: 40 + 90 + 80 = 210.
(c) |U | − |R ∪ T ∪ N | = 400 − (40 + 50 + 60 + 30 + 90 + 20 + 80) = 30.
2. Each of the 100 students in the first year of Open Universitys Computer Science Department
studies at least one of the subsidiary subjects: mathematics, electronics and accounting. Given
that 65 study mathematics, 45 study electronics, 42 study accounting, 20 study mathematics
and electronics, 25 study mathematics and accounting, and 15 study electronics and accounting,
find the number who study:
(a) all three subsidiary subjects; [ans: x = 8]
(b) mathematics and electronics but not accounting; [ans: 20 − x = 12]
(c) only electronics as a subsidiary subject. [ans: 10 + x = 18]

Solution [hint: |U | = |M ∪ E ∪ A|]

Exercise:

105
8.10 Applications of Venn diagrams in counting ⃝Francis
c Oketch

1. A group of 150 tourists planned to visit East Africa. Among them, 3 fall ill and did not
come, of the rest 6 visited all the three countries, 8 visited Uganda and Tanzania, 26 visited
Kenya and Tanzania, 17 visited Kenya and Uganda, 27 visited Kenya only, and 45 visited
Uganda only.
(a) How many visited Tanzania only? [ans: = 36]
(b) How many visitors did each country have? [ans: |K| = 64, |Uganda| = 64, |T | = 64]
2. In a survey involving 60 people, 25 take milk, 26 take tea and 26 take coffee, 9 take both
milk and tea, 11 take both milk and coffee, 8 like both coffee and tea and 8 take none of
the three drinks.
(a) Find the number of people who take any of the three drinks. [ans: ]
(b) Find the number of people who take coffee, tea, milk alone. [ans: ]

106

You might also like