You are on page 1of 71

PAUL WACHIRA GITHAIGA

EMAIL: wachipaul@gmail.com
SMA 2271: ORDINARY DIFFERENTIAL EQUATIONS
CONTACT: +254 702909635

⃝Francis
c O. Ochieng
francokech@gmail.com

Department of Pure and Applied Mathematics


PURE AND APPLIED MATHEMATICS

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

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

• Systems of linear differential equations.

• Laplace transform: methods of solution.

• Power series solutions including Bessel and Legendre 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] Calculus With Analytic Geometry (5th edition) by Larson Roland E., Hostetler Robert P., and
Bruce H. Edwards

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

[3] Swift R. J., & Wirkus S. (2014). A Course in Ordinary Differential Equations, 2nd Edition, 807 p,
Published by Chapman and Hall/C, ISBN-13: 978-1466509085.

[4] Noonburg, V. W. (2014). Ordinary Differential Equations: From Calculus to Dynamical Systems,
334 p, Published by Mathematical Association of America, ISBN-13: 978-1939512048.

[5] Journal of Differential Equations, ISSN: 0022-0396.

[6] Journal of Dynamics and Differential Equations, ISSN: 1040-7294

Lecture 1

1
1 Definitions and basic concepts
Definition 1.1 (Dependent and independent variable). Suppose y = y(x), then y is the dependent
variable while x is the independent variable. Also, suppose z = z(x, y), then z is the dependent variable
while x and y are the independent variables.
Definition 1.2 (Differential equation (DE)). A differential equation is an equation that involves
derivatives of a function which depends on either one or more than one independent variable(s). For
example,
dy 2
= 2xex (1)
dx

∂z ∂z
+ = 2(x + y) (2)
∂x ∂y
There are two types of differential equations: ODE and PDE.
Definition 1.3 (Ordinary differential equation (ODE)). An ODE is a differential equation which
contains derivative(s) of a function which depends on only one independent variable. For example,
equation (1) is an ODE since it contains ordinary derivatives.
Definition 1.4 (Partial differential equation (PDE)). A PDE is a differential equation which
contains derivative(s) of a function which depends on more than one independent variable. 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
= c (1D wave equation)
∂t2 ∂x2

∂2 u ∂2u ∂2 u
+ 2 + = 0 (Laplace equation)
∂x2 ∂y ∂z 2

1.1 Order and degree of a differential equation


Definition 1.5 (Order of a differential equation). The order of a differential equation is the order
of the highest-ordered derivative which 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 ordered derivative which occurs in the equation (3).
dx2
Definition 1.6 (Degree of a differential equation). The degree of a differential equation is the greatest
power of the highest-ordered derivative which occurs in the differential equation. For example, equation
d2 y
(3) is of degree 1 since is the highest-ordered derivative and its power is 1.
dx2
More examples,
dy
+ y 2 = cos x, (order 1, degree 1)
dx
( )2
dy
+ y = sin x, (order 1, degree 2)
dx
( )3
d2 y dy
2
+ + y = ex , (order 2, degree 1)
dx dx

Exercise:
Determine the order and degree of the following differential equations.

2
d4 y d2 y
(a) − − 6y = 0.
dx4 dx2
( )4 ( )5
d2 y dy
(b) − + 3y = ex .
dx2 dx

1.2 Classification of ODEs


Ordinary differential equations are classified into two groups: linear and nonlinear.

Definition 1.7 (Linear ordinary differential equation). 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) + a n−1 (x) + a n−2 (x) + · · · + a2 (x) + a1 (x) + a0 (x)y = F̃ (x), (4)
dxn dxn−1 dxn−2 dx2 dx
where an (x) ̸= 0 and which is such that

(i) Dependent variable y and its derivatives are of power 1 only.

(ii) No product of the dependent variable, y, and/or its derivatives are present.

(iii) No transcendental functions of the dependent variable, y, and its derivatives occur. For example,
cos(y), ln y or ey is absent.

Examples of linear differential equations are:

d2 y dy
2
−7 − 3y = 0 (linear equation with constant coefficient)
dx dx
d4 y 3
2d y
2
3d y
x − x + x − e−x y = cos(x) (linear equation with variable coefficient)
dx4 dx3 dx2

→ Note: trigonometric, exponential, and logarithmic functions are called transcendental functions.

A differential equation that does not satisfy all the three conditions above is called nonlinear
d2 y dy
differential equation. For example, the equation 2
+ xy + y 2 = ex is nonlinear because of the
dx dx
dy d2 y
terms xy and y 2 . Similarly, the equation + cos(y) = 0 is nonlinear because cos(y) is a
dx dx2
transcendental function of 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) −5 + 6y 2 = 9.
dx3 dx
( )2
d2 y dy
(c) x 2
+ x −y − 3y 2 = 0.
dx dx

1.3 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.

3
1.3.1 Geometric problem

Example(s):
A curve is defined by the condition that at each point the slope is 2 times 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.3.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.

1.3.3 Elimination of essential arbitrary constants from primitives


Definition 1.8 (Arbitrary constant). An arbitrary constant refers to an undefined constant 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.9 (Essential arbitrary constant). Arbitrary constants are said to be essential if they
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) with 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.10 (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, we differentiate the given primitive a
number of times equal to the number of essential arbitrary constants then manipulate algebraically
the derivatives to eliminate the essential arbitrary constants.

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

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

4
(a) y = Ax2 + Bx.

Solution
Since we have two essential arbitrary constants, we differentiate the given primitive 2 times.
Thus,
y = Ax2 + a2 x ⇒ y ′ = 2Ax + B and y ′′ = 2A
1
⇒ A = y ′′ and B = y ′ − 2Ax = y ′ − xy ′′
2
Substituting in the given primitive yields

x2 ′′ ( ) d2 y dy
y= y + x y ′ − xy ′′ ⇒ x2 y ′′ − 2xy ′ + 2y = 0 or x2 − 2x + 2y = 0
2 dx2 dx

(b) y = A cos 2x + B sin 2x.

Solution
Since we have two essential arbitrary constants, we differentiate the given primitive 2 times.

y = A cos 2x + B sin 2x ⇒ y ′ = −2A sin 2x + 2B cos 2x and y ′′ = −4 (A cos 2x + B sin 2x)

d2 y
⇒ y ′′ = −4y or + 4y = 0
dx2
(c) y = Ae2x + Be−3x .

Solution
Since we have 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)

Eliminating A between equations (i)and (ii), we obtain y ′ − 2y = −5Be−3x · · · (∗).


Eliminating A between equations (ii)and (iii), we obtain y ′′ − 2y ′ = 15Be−3x · · · (∗∗).
Eliminating B between equations (∗)and (∗∗), we obtain

y ′′ + y ′ − 6y = 0

Alternatively, equations (i), (ii) and (iii) can be written in matrix form as
    
e2x e−3x −y A 0
 2x    
2e −3e−3x −y ′  B  = 0
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
2e 2x −3e −3x −y ′ = 0
4e 2x 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

Exercise:

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

Solution
Since we have 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
Differentiating implicitly, using product rule on the left hand side, yields

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

Differentiating again yields

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

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

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

(c) y = A sin(4x + B) + Ce3x . [ans: y ′′′ − 3y ′′ + 16y ′ − 48y = 0]

(d) y = Ae2x + Bex + Ce−x . [ans: y ′′′ − 2y ′′ − y ′ + 2y = 0]

(e) y = Ax3 + Bx2 + C. [ans: x2 y ′′′ − 2xy ′′ + 2y ′ = 0]

(f) y = e4x (A cos 3x + B sin 3x). [ans: y ′′ − 8y ′ + 25y = 0]

(g) y = x2 + Ae2x + Be3x . [ans: y ′′ − 5y ′ + 6y = 6x2 − 10x + 2]

1.4 Solution of differential equations


A solution of a differential equation is any function that satisfies the given differential equation. There
are two types of solutions: general solution and particular solution.

Definition 1.11 (General solution). A general solution of an ODE is the primitive associated with
the given differential equation. The number of essential arbitrary constants in the solution should be
equal to the order of the given differential equation. For example, the primitive y = mx + c is a general
solution of the equation y ′′ = 0, where m and c are essential arbitrary constants (parameters). The
function y = mx + c is a family of straight lines on the xy-plane.

Definition 1.12 (Particular solution). A particular solution of an ODE 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.

Example(s):

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

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

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

6
dy d2 y
Similarly, y = e−3x −−−(ii) ⇒ = −3e2x and 2 = 9e2x . Substituting these derivatives
dx dx
in the given differential equation yields
( )
9e2x − 3e2x − 6 e−3x = 0

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

→ Note: if y1 , y2 , · · · , yn are each solution to a DE, then their linear combination is also a solution
to the differential equation. That is, y = a1 y1 + a2 y2 + · · · + an yn , where ai , i = 1, 2, 3, · · · , n are
arbitrary constants. For instance, y = a1 e2x + a2 e−3x is also a solution to the given differential
equation (∗).
2. Verify that the given function is a solution of the corresponding differential equation.
d2 y
(a) + y = 0; y = cos x
dx2
d2 y dy
(b) +4 + 13y = 0; y = e−2x (cos 3x + sin 3x)
dx2 dx

Lecture 2

2 First order ODEs


A first order ordinary differential equation 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 of 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
(a) sin x cos ydx + cos x sin ydy = 0.

Solution
Dividing the equation through by cos x cos y and then integrating we get
∫ ∫ ∫
sin x sin y
dx + dy = 0 ⇒ − ln | cos x| − ln | cos y| = − ln |C| ⇒ cos x cos y = C
cos x cos y

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

Solution

(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

Exercise:
y
(a) Solve xy ′ = y + y 2 . [ans: = C]
x(1 + y)

[ans: x2 + ln(xy) = C or xy = a1 e−x ]


2
(b) Solve (2x2 y + y)dx + xdy = 0.
dy y2 − 1 y−1
(c) Solve = . [ans: = Cx2 ]
dx x y+1
dy
(d) Solve the initial value problem: (x2 + 9) + xy = 0; y(0) = 2. [ans: y 2 (x2 + 9) = 36]
dx
dy
[ans: y 2 + 2y = 1 + Ce−x ]
2
(e) Solve (y + 1) + x(y 2 + 2y) = x.
dx
(f) Determine the family of curves such that at each point the slope is given by 2xy 2 . [ans:
1
x2 + = C]
y
(g) Show that the solution of the differential equation (1 + y 2 )dx + (1 + x2 )dy = 0; y(0) = −1 is
xy − x − y − 1 = 0.

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.

Example(s):
Solve the following differential equations

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

Solution

8
1
Let u = x + 2y ⇒ du = dx + 2dy ⇒ dy = (du − dx). Substituting in 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
dy
From = (x + y)2 ⇒ dy − (x + y)2 dx = 0. Let u = x + y ⇒ du = dx + dy ⇒ dy =
dx
du − dx. Substituting in the given DE 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θ
 = dx ⇒ dθ = dx ⇒ θ = x + C,
1+
 2 θ
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
dy
From = sin(x + y) ⇒ sin(x + y)dx − dy = 0. Let u = x + y ⇒ du = dx + dy ⇒
dx
dy = du − dx. Substituting in the given DE yields sin udx − (du − dx) = 0 ⇒ (1 + sin u)dx −
du = 0. Rearranging and integrating we get
∫ ∫ ∫
du
dx − = 0 − − − −(∗)
1 + sin u
Here, we use t substitution by letting t = tan( u2 ).
( )
1 u 2dt 2dt 2dt
⇒ dt = sec2 du ⇒ du = 2 u = 2
(u) =
2 2 sec ( 2 ) 1 + tan 2 1 + t2
Consider the following diagram


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

9
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

Exercise:
Solve the following differential equations
dy ( )
x+y
(a) = sin(x + y) + cos(x + y). [hint: put u = x + y, ans: 1 + tan 2 = 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+1 2 1
(c) = . [hint: put u = x + y, ans: (x + y) + ln |3x + 3y + 4| = x + C]
dx 2y + 3 + 2x 3 9

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 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 that if the sum of the powers of each term in equation (7) is the same, then
equation (7) is said to be homogeneous. If equation (7) is homogeneous, then the substitution

y = ux

reduces equation (7) to an equation with variables separable as follows. Let y = ux ⇒ dy =


udx + xdu. 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

10
(a) (x − 2y)dx + xdy = 0.

Solution
First, we need to test for homogeneity as follows: M (x, y) = x − 2y ⇒ M (λx, λy) =
λx − 2(λy) = λ(x − 2y) = λM (x, y), which is homogeneous of degree 1.
Similarly, N (x, y) = x ⇒ N (λx, λy) = (λx) = λ(x) = λN (x, y) which is homogeneous of degree
1.
Therefore, the given DE is homogeneous of degree 1. Next, let

y = ux ⇒ dy = udx + xdu

Substituting in the given DE yields

(x − 2ux)dx + x (udx + xdu) = 0 ⇒


(1 − 2u)dx + udx + xdu = 0
∫ ∫ ∫
dx du
⇒ (1 − u)dx + xdu = 0 ⇒ − = 0
x u−1 ( )
y
⇒ ln |x| − ln |u − 1| = ln |C| ⇒ x = C(u − 1) ⇒ x = C −1
x
⇒ x2 = C (y − x)
(√ )
(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 in the given DE 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
( )
y −1 y
⇒ ln |x| + sin−1 u = − ln |C| ⇒ − sin−1 = ln |Cx| ⇒ Cx = e− sin ( x )
x

dy
(c) xy = y 2 + 2x2 .
dx

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

y = ux ⇒ dy = udx + xdu

Substituting in 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

Exercise:
Solve the following equations

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

Solution
Put v = y − 2 ⇒ dv = dy. Substituting in the given DE yields
dv x+v
= ⇒ (x − v)dv − (x + v)dx = 0 − − − (∗)
dx x−v
Clearly, this equation is homogeneous of degree 1. Next, let

v = ux ⇒ dv = udx + xdu

Substituting in equation (∗) yields

(x − ux)(udx + xdu) − (x + ux)dx = 0 ⇒


(1 − u)(udx + xdu) − (1 + u)dx = 0
∫ ∫ ∫
dx u−1
(u + 1)dx + x(u − 1)du = 0 ⇒
2
+ du = 0
∫ ∫
x u2 +

1
u 1 1
⇒ ln |x| + 2
du − 2
du = ln |C|, [hint: put u = tan θ in 2
du]
u +1 u +1 u +1
1 1
⇒ ln |x| + ln |u2 + 1| − tan−1 u = − ln |C|
2 [ ( )] 2
⇒ ln Cx u + 1 = 2 tan−1 (u)
2 2

Back substitution yields


[ ( )] ( )
v2 v −1
⇒ ln Cx 2
+1 = 2 tan
x2 x
[ { }] ( )
−1 y − 2
⇒ ln C (y − 2) + x
2 2
= 2 tan
x

dy y2 x
(b) x =y+ [ans: − = ln x + C]
dx x y
dy
(c) x = x cos(y/x) + y [ans: sec(y/x) + tan(y/x) = Cx]
dx

(d) xdy − ydx = x2 + y 2 dx [ans: sinh−1 (y/x) = ln x + C]
dy √ 1√ 2
(e) xy = y 2 + x x2 + y 2 [ans: x + y 2 = ln x + C]
dx x

2.3 Exact differential equations


Equation (7) is said to be exact differential if a function (solution) ϕ(x, y) (read as “phi”) can be found
such that
dϕ = M (x, y)dx + N (x, y)dy − − − (∗)
∂ϕ ∂ϕ
But from differential calculus, dϕ = dx + ∂y dy. So equation (∗) can be written as
∂x
∂ϕ ∂ϕ
dx + dy = M (x, y)dx + N (x, y)dy
∂x ∂y
Comparing the coefficients of the 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

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

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

Equation (8) is the necessary 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)dx + 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)dx + g ′ (y)
∂y ∂y


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

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

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

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

M = 2xy + cos y and N = x2 − x sin y


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

Thus,
ϕ(x, y) = x2 y + x cos y + g(y), − − −(∗)
where g is an arbitrary function of integration. Equation (∗) is the solution provided g(y) is
determined. Differentiating equation (∗) partially wrt y yields
∂ϕ
= x2 − x sin y + g ′ (y)
∂y

13
Comparing with equation (ii), we have

′ ′
x − x sin y + g (y) = x − x sin y
2 2
⇒ g (y) = 0 ⇒ g (y) = 0dy = C

Therefore, the solution (∗) to the given DE is

ϕ(x, y) = x2 y + x cos y + C

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

Solution
First, we need to test whether the given DE 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 DE is exact. Now, let the solution to the given
∂y ∂x
DE 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
Comparing coefficients of the differentials, we have

∂ϕ
= x3 + x tan y − − − (i) ⇒ ϕ(x, y) = (x3 + x tan y)dx + g(y) − − − (ii)
∂x
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 tan y + g(y), − − −(∗)
ϕ(x, y) =
4 2
where g is an arbitrary function of integration. Equation (∗) is the solution provided g(y) is
determined. Differentiating equation (∗) partially wrt 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 (∗) to the given DE is
( )
1 1 1 1
ϕ(x, y) = x4 + x2 tan y + y 2 ln y − +C
4 2 2 2

Exercise:

14
1. Find the general solution of the following equations
(a) (2x + sin x tan y)dx − cos x sec2 ydy = 0. [ans ϕ(x, y) = x2 − cos x tan y + C]
(b) (3x2 + 4xy)dx + (2x2 + 2y)dy = 0. [ans ϕ(x, y) = x3 + 2x2 y + y 2 + C]
2. Show that the following DEs are exact and find their general solution.
3 1 2
(a) (3xy 4 + x)dx + (6x2 y 3 − 2y 2 + 7)dy = 0. [ans: ϕ(x, y) = x2 y 4 + x2 − y 3 + 7y + C]
( ) ( ) 2 2 3
2 2 2
(b) y 2 exy + 4x3 dx + 2xyexy − 3y dy = 0.
2 [ans: ϕ(x, y) = e + x4 − y 3 + C]
xy

3. 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 = − 21 , ϕ(x, y) = 2x1/2 y 3 + 32 x3/2 + C]
( ) ( )
3−y y 2 − 2x
4. Show that the equation dx + dy = 0 is exact. Hence, find ϕ(x, y) given that
x2 xy 2
y−3 2
ϕ(−1, 2) = 0. [ans: ϕ(x, y) = + − 2]
x y

Lecture 3

2.4 Linear differential equations of first order


Suppose equation (7) can be re-written to take the form
dy
+ P (x)y = Q(x), (9)
dx
then equation (9) is said to be linear in the dependent variable y. To solve equation (9), we first
multiply it by the integrating factor µ(x), which makes it an exact differential equation. Hence,
equation (9) becomes
dy
µ(x) + µ(x)P (x)y = µ(x)Q(x) ⇒ [µ(x)P (x)y − µ(x)Q(x)] dx + µ(x)dy = 0 (∗)
dx
Comparing equation (∗) with equation (7), we have

M (x, y) = µ(x)P (x)y − µ(x)Q(x) and N (x, y) = µ(x)


∂M ∂N
Since equation (∗) is exact, we require that = . Now,
∂y ∂x
∂M ∂N dµ
= µ(x)P (x) and =
∂y ∂x dx
dµ dµ
Equating yields = µ(x)P (x). Separating the variables, we get = P (x)dx. Integrating yields
dx µ
∫ ∫ ∫ ∫

= P (x)dx ⇒ ln(µ) = P (x)dx ⇒ µ=e P (x)dx
µ
Therefore, the integrating factor is defined by

µ = e . P (x)dx

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

Example(s):
Solve the following differential equations

15
(a) xdy + (2xy − x)dx = 0.

Solution
The given DE can be rewritten as
dy
+ 2y = 1 · · · (∗) (linear ODE in dependent variable y)
dx
∫ ∫
Here, P (x) = 2 ⇒ P (x)dx = 2dx = 2x. Therefore, the integrating factor is

P (x)dx
µ=e = e2x

Multiplying equation (∗) by e2x yields

dy d ( 2x )
e2x + 2e2x y = e2x ⇒ ye = e2x
dx dx
Integrating with respect to x yields

1 1
ye 2x
= e2x dx ⇒ ye2x = e2x + C ⇒ y= + Ce−2x
2 2
which is the solution.

(b) y 2 dx + (2xy − 4y 3 )dy = 0.

Solution
The given DE can be rewritten as
dx 2
+ x = 4y · · · (∗) (linear ODE in dependent variable x)
dy y
∫ ∫
2 2
Here, P (y) = ⇒ P (y)dy = dy = 2 ln y = ln(y 2 ). Therefore, the integrating factor
y y
is ∫ 2
µ=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

2
xy = 4y 3 dx ⇒ xy 2 = y 4 + C,

which is the solution.

(c) (y + x3 )dx − xdy = 0.

Solution
The given DE 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
µ=e = eln(1/x) =
x

16
1
Multiplying equation (∗) by yields
x
( )
1 dy 1 d y
− 2y = x ⇒ =x
x dx x dx x
Integrating with respect to x yields

y y 1
= xdx ⇒ = x2 + C,
x x 2
which is the solution.

Exercise:
1. Find the general solution of the following differential equation
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
dy y
(c) x − 2y = x4 ex . [ans: = (x − 1)ex + C]
dx x2
df (y) dy
2. Show that the transformation u = f (y) reduces the equation · + P (x)f (y) = Q(x) to
dy dx
dy
[ans: y 2 + 2y = 1 + Ce−x ]
2
a linear DE. Hence, solve (y + 1) + x(y 2 + 2y) = x.
dx
dy
3. Solve the differential equation defined by x − 2y = x6 sin x. [ans:
dx
y
= (6x − x3 ) cos x + (3x2 − 6) sin x + C]
x2
dC 2 12
4. Solve the initial value problem m2 + 2mC = 2; C(2) = 4. [ans: C = + 2]
dm m m

2.5 Bernoulli’s equation


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

z = y. 1−n ,

as follows: dividing equation (10) by y n yields


dy
y −n + P (x)y 1−n = Q(x) (11)
dx
Let z = y 1−n . By chain rule, differentiating both sides with respect to the independent variable
dz dy dy 1 dz
x, we have = (1 − n)y −n ⇒ y −n = . Substituting in equation (11), we get
dx dx dx 1 − n dx
1 dz
+ P (x)z = Q(x). Multiplying through by (1 − n) yields
1 − n dx
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.

Example(s):
Solve the following differential equations

17
dy
(a) + y = xy 4 .
dx

Solution
dy dy
+ y = xy 4 ⇒ y −4
+ y −3 = x
dx dx
dy 1 dz
Let z = y −3 ⇒ dz = −3y −4 dy ⇒ y −4 =− . So,
dx 3 dx
−1 dz dz
+z =x ⇒ − 3z = −3x − − − (∗) (linear ODE in dependent variable z)
3 dx dx
The integrating factor is ∫
−3dx
µ=e = e−3x
Multiplying equation (∗) through by e−3x yields

−3x dz −3x −3x d
e − 3e z = −3xe ⇒ (ze−3x ) = −3xe−3x ⇒ ze −3x
= −3 xe−3x dx + C
dx dx
Integrating by parts and rearranging we get [hint: put u = x, dv = e−3x dx]
3z = 3x + 1 + Ce3x ⇒ 3y −3 = 3x + 1 + Ce3x

dy
(b) + 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 ∫
µ=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
∫ [∫ ∫ ]
−x −x −x −x
⇒ ze =− e (sin x + cos x)dx = − e sin xdx + e 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,
[ ]
−x e−x e−x
ze =− − (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

18
Exercise:
dy y x2
(a) Solve − = y3. [ans: 3 + 2x3 = C]
dx x y2
( )
dy 1 1 3 x
(b) Solve − 1+ y = y3. [ans: = Ce−x − 6]
dx 2 x x y2
y
(c) Solve x(6x2 − y − 1)dy + 2ydx = 0. [ans: = 6 + Ce−y ]
x2
dy
(d) Prove that the transformation z = y 1−n reduces the equation + P (x)y = Q(x)y n to a linear
dx
dy x
equation in z and x. Hence, solve the initial value problem + xy = 3 ; y(0) = 2. [ans:
dx y
y 4 = 1 + 15e−2x ]
2

2.6 Applications of first order ODEs


2.6.1 Geometry

Example(s):

(a) A curve is defined by the condition that at each point the gradient is equal to twice the sum of
the coordinates. Find the equation of the curve.

Solution
dy dy 1
= 2(x + y) ⇒ − 2y = 2x which is linear in y. Solving it yields y = −x − + Ce2x .
dx dx 2

2.6.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.

Suppose the ODE corresponding to the first


family F (x, y) = c is given by M dx + N dy = 0
then the ODE for the orthogonal family (i.e.,
second family) is given by

M dy − N dx = 0, (∗)

since the product of their gradients is −1.


The general solution of (∗) gives the required
orthogonal trajectories.

→ Note 1: 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.

dy −1
→ Note 2: the differential equation for the other family is obtained by replacing by .
dx dy/dx
Example(s):

19
1. Find the orthogonal trajectories of the curves whose equations are.

(a) x + y = c.

Solution
Here, F (x, y) ≡ x + y = c ⇒ dF ≡ dx + dy = 0, which is the DE for the family F (x, y).
dy dx
The DE for the orthogonal trajectories is obtained by replacing by − . Hence, the
dx dy
DE for the orthogonal trajectories is dy − dx = 0. Integrating yields y − x = k, which is
the required orthogonal trajectories.
x
(b) y = .
c+x
Solution
x ydx − xdy
Here, F (x, y) ≡ − x = c ⇒ dF ≡ − dx = 0 ⇒ (y 2 − y)dx + xdy = 0,
y y2
which is the DE for the family F (x, y). The DE for the orthogonal trajectories is obtained by
dy dx
replacing by − . Hence, the DE for the orthogonal trajectories is (y 2 −y)dy −xdx = 0.
dx dy
Integrating yields 2y 3 − 3y 2 − 3x2 = k, which is the required orthogonal trajectories.
(c) x2 + y 2 = c. [ans: orthogonal trajectories are y = kx]

2. (a) Find the orthogonal trajectories of all parabolas having their vertices at the origin and foci
on the x-axis.

Solution
The equation of parabolas having their vertices at the origin and foci on the x-axis is given by
y2 2xydy − y 2 dy
y 2 = cx. Here, F (x, y) ≡ = c ⇒ dF ≡ = 0 ⇒ 2xdy − ydx = 0,
x x2
which is the DE for the family F (x, y). The DE for the orthogonal trajectories is obtained
dy dx
by replacing by − . Hence, the DE for the orthogonal trajectories is 2xdx + ydy = 0.
dx dy
Integrating yields 2x2 + y 2 = k, which is the required orthogonal trajectories.
(b) 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 = mx, answer: orthogonal
trajectories are x2 + y 2 = k]

2.6.3 Real life situations

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
We apply Newton’s law of cooling which states that “the rate at which a substance cools is
directly proportional to the excess temperature above the room temperature.”
Let the temperature of the substance at time t be 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

20
Integrating and applying the given 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.
(b) The population of Juja constituency in 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
3
growth of the population is directly proportional to the population.

Solution
dP dP
Let P be the population at time t. Then we have = kP ⇒ = kdt. Integrating and
dt P
applying the given conditions, we get
∫18 ∫
1970
dP 1
= kdt ⇒ k= ln(1.5)
P 6
12 1964

Also,
1
∫5 3 ∫t [ ]5 1 [ ]t [ ]
dP 3 1
= kdt ⇒ ln(P ) =k t ⇒ ln(16/3) − ln(12) = ln(1.5) t − 1964
P 12 1964 6
12 1964

⇒ t = 1952

Exercise:
(a) An electric circuit has a constant electromotive force E = 40v, a resistor of R = 10Ω and an
inductance L = 0.2 henry (H), with initial current I = 0 at t = 0 and basic differential equation
dI ( )
is: L + RI = E. Determine the current at any time t. [ans: I = 4 1 − e−50t ]
dt
(b) 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.
(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.
(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]

Lecture 4

21
3 Second order linear ODEs
Consider the linear ODE of order 2, with variable coefficients:
d2 y dy
a2 (x)
2
+ a1 (x) + a0 (x)y = F̃ (x), (12)
dx dx
where a2 (x) ̸= 0. If F̃ (x) = 0, then equation (12) is said to be homogeneous. Otherwise, it is
non-homogeneous. If the coefficients are constants, then equation (12) is called linear ODE with
constant coefficients, and is written as
d2 y dy
a2 2
+ a1 + a0 y = F̃ (x), (13)
dx dx
where a0 , a1 , a2 are constants and a2 ̸= 0.

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 =
D 3
= , etc
dx dx2 dx3
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 (13) is written as
[ ]
a2 D2 + a1 D + a0 y = F̃ (x) (14)
Definition 3.1 (Shift operator). Let y be differentiable function of x. Then,
D(eαx y) = eαx (D + α)y
That is, to shift eαx to the LHS 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 Dy = (D − α)eαx y
That is, to shift eαx to the RHS of D, shift it but in place of D substitute (D − α).

3.2 Solution of homogeneous linear ODEs with constant coefficients


Consider a homogeneous linear ODE of order 2, with constant coefficients:
d2 y dy
a2 2
+ a1 + a0 y = 0, (15)
dx dx
d
where a2 ̸= 0. Let D = , then in terms of the D-operator equation (15) becomes:
dx
[ ]
a2 D2 + a1 D + a0 y = 0
For 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 (15).
The non-trivial solution of y is dependent on the roots of the characteristic equation (∗). The roots
can be classified into one of the three cases:
(i) Real and distinct roots
(ii) Real and equal roots
(iii) Complex conjugate roots
We shall consider the three cases above.

22
Case 1: When the roots of the auxiliary equation are real and distinct
Let the roots be α and β. 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 DE is of the form

(D − α)(D − β)y = 0

Pre-multiplying by e−αx yields

e−αx (D − α)(D − β)y = 0 ⇒ (D − α − −α)[e−αx (D − β)y] = 0 ⇒ D[e−αx (D − β)y] = 0

⇒ D−1 D[e−αx (D − β)y] = D−1 (0), (D−1 is the Integral Operator)


⇒ e−αx (D − β)y = A1 ⇒ (D − β)y = A1 eαx
Pre-multiplying by e−βx yields

e−βx (D − β)y = A1 e(α−β)x ⇒ (D − β − −β)[e−βx y] = A1 e(α−β)x ⇒ D[e−βx y] = A1 e(α−β)x


⇒ D−1 D[e−βx y] = D−1 (A1 e(α−β)x )
⇒ e−βx y = A1 (α − β)−1 e(α−β)x + B

Multiplying by eβx and letting A1 (α − β)−1 = A yields

y = Aeαx + Beβx

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

Solution
In terms of the D operator the given DE 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 to the
given DE is y = Ae2x + Be3x .
d2 y dy
(b) 2 − − 10y = 0.
dx2 dx

Solution
In terms of the D operator the given DE becomes (2D2 − D − 10)y = 0. The auxiliary equation
is 2D2 − D − 10 = 0. Hence, the roots are α = −2 and β = 52 . The general solution is
5
y = Ae−2x + Be 2 x .
d2 y dy
(c) − = 0. [ans: y = Aex + B]
dx2 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, (16)

23
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

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 DE 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 .

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 DE is of the form

(D − α)2 y = 0

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 by eαx yields
y = (Ax + B)eαx

Example(s):
Solve the following differential equations
d2 y dy
(a) 2
−4 + 4y = 0.
dx 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 .
d2 y dy
(b) 2
+ 10 + 25y = 0.
dx dx

Solution
In terms of the D operator the equation becomes (D2 + 10D + 25)y = 0. The auxiliary equation
is (D2 + 10D + 25) = 0. Hence, the roots are α1 = α2 = −5. The general solution is y =
(Ax + B)e−5x .

24
Exercise:

d2 y dy
(a) Find the general solution of −2 + y = 0. [ans: y = (Ax + B)ex ]
dx2 dx
d2 y dy
(b) Solve the initial value problem 2
+6 + 9y = 0; y(0) = −4 and y ′ (0) = 14. [ans:
dx dx
y = (2x − 4)e−3x ]

Generalization:
Consider equation (16). 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 +

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 DE 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 .

Case 3: When the roots of the auxiliary equation are complex conjugate
Let the roots be D = (α ± iβ). The general solution is given by

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

where A and B are arbitrary constants.

Proof. Let the roots be D1 = (α + iβ) and D2 = (α − iβ). The general solution is given by

y = A1 e(α+iβ)x + B1 e(α−iβ)x
= eαx [A1 eiβx + B1 e−iβx ]
= eαx [A1 (cos βx + i sin βx) + B1 (cos βx − i sin βx)]
= eαx [(A1 + B1 ) cos βx + i(A1 − B1 ) sin βx]
= eαx [A cos βx + B sin βx],

where A = A1 + B1 and B = i(A1 − B1 ).

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

Solution
In terms of the D operator the given DE 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).

25
d2 y dy
(b) 2
−8 + 25y = 0.
dx dx

Solution
In terms of the D operator the given DE becomes (D2 − 8D + 25)y = 0. The auxiliary equation
is D2 − 8D + 25 = 0. Hence, the roots are D = 4 ± i3 (complex conjugate). From which we
obtain α = 4, β = 3. Thus, the general solution is y = e4x (A cos 3x + B sin 3x).

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

Lecture 5

3.3 Solution of non-homogeneous linear ODEs with constant coefficients


Consider equation (14) above, then the solution comprises of 2 parts i.e.,
1. Complementary solution, yc (x)

2. Particular integral, yp (x)


[ ]
The complementary solution is obtained from the auxiliary equation a2 D2 + a1 D + a0 = 0.

The particular integral of equation (14) is given by


1
yp (x) = F̃ (x),
[a2 D2 + a1 D + a0 ]

which makes use of inverse differential operator. We will consider 9 cases of F̃ (x).

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

Case 1: When F̃ (x) = eαx


In this case, we substitute D with α.

 Justification: this substitution is valid since

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

Example(s):

26
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 DE becomes
1
(D2 − 3D + 2)y = e−3x ⇒ yp (x) = e−3x
D2 − 3D + 2
Substituting D with −3 yields
1 1
yp (x) = e−3x = e−3x
(−3)2 − 3(−3) + 2 20

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

Solution
In terms of the D operator the given DE becomes (D3 − 6D2 + 12D − 8)y = ex + e3x .
i) The complementary solution
The auxiliary equation is D3 − 6D2 + 12D − 8 = 0. Hence, the roots are
D1 = D2 = D3 = 2. Thus, the complementary solution is yc (x) = (Ax2 + Bx + C)e2x

ii) The particular integral

1
yp (x) = (ex + e3x )

D3 + 12D − 8
6D2
1 1
= ex + 3 e3x
D − 6D + 12D − 8
3 2 D − 6D + 12D − 8
2
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 F̃ (x) = cos αx or F̃ (x) = sin αx


In this case, we substitute D2 with −α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):

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

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

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

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

i) The complementary solution


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

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

1
= sin 2x (Introduce a 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).

Case 3: When F̃ (x) is a polynomial


In this case, we drop terms of D with higher powers than the degree of the polynomial.

 Justification: the dropping of terms is valid since

D2 x = 0
D3 x2 = 0
⇒ Dk xn = 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 operator D (i.e., if a0 ̸= 0). If, however, a0 = 0, we need to factor out D in
the denominator and operate with the integral operator, D−1 , first.

We then apply the Maclaurin’s series expansion of the resulting inverse differential operator. Recall
from Maclaurin’s series expansion that:
1 1
= 1 + x + x2 + x3 + · · · and = 1 − x + x2 − x3 + · · ·
1−x 1+x

28
Hence,
1
= 1 + 2D + 4D2 + 8D3 + · · ·
1 − 2D
1 D D2 D3
{ } =1− + − + ···
D 2 4 8
1+
2
e.t.c.

Example(s):
Find the particular integral of the following ODEs
d2 y dy
(a) 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), (we drop 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) 2
+2 = x − 2.
dx dx

Solution
In terms of the D operator the given equation becomes (D2 + 2D)y = x − 2. The particular
integral is given by
1
yp (x) = (x − 2). We first factor out D since it is common in every term of (D2 + 2D).
D2 + 2D ( ) ( )
1 D−1 1 x2 1 x2
= (x − 2) = (x − 2) = − 2x = { } − 2x
D(D + 2) D+2 D+2 2 D 2
2 +1
2
( ) [ ]( )
1 1 x2 1 D D2 D3 x2
= { } − 2x = 1− + − + ··· − 2x
2 D 2 2 2 4 8 2
1+
2
[( ) ( ) ( ) ]
1 x 2 1 x2 1 2 x2
= − 2x − D − 2x + D − 2x + 0
2 2 2 2 4 2
[( ) ] [ ]
1 x2 1 1 1 x2 1 1 1( 2 )
= − 2x − (x − 2) + (1) = − 2x − x + 1 + = 2x − 10x + 5
2 2 2 4 2 2 2 4 8

Case 4: When F̃ (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 shift operator.

Example(s):

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

Solution

29
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 solution


The auxiliary equation is D2 − 3D − 3 = 0. Hence, the roots are D1 = 3 and D2 = −1.
Thus, the complementary solution is yc (x) = Ae3x + Be−x .
ii) The particular integral

1
yp (x) = e−2x cos 3x. Shifting e−2x to the left yields.
D2 − 2D − 3
1
= e−2x (x + 1)
(D − 2)2 − 2(D − 2) − 3
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) (6D − 4) 1 −2x
= −e−2x cos 3x = −e−2x cos 3x = e (6D − 4) cos 3x
36(−9) − 16 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
(a) 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
d2 y dy
(b) Find the complete solution of the differential equation 2
+3 − 4y = xe−4x . [ans:
dx dx
1
y = Ae−4x + Bex − xe−4x (5x + 2)]
50

30
d3 y d2 y dy
(c) Find the complete (general) solution of the differential equation 3
− 3 2
+2 = 10 + 4xe2x .
dx dx dx
[ans: y = A + Bex + Ce2x + 5x + e2x (x2 − 3x)]
d3 y d2 y dy
(d) [Assignment 1 ] Show that the solution of the equation + 3α + 3α2 + α3 y = 0 is
dx3 dx2 dx
d3 y d2 y dy
y = (Ax2 +Bx+C)e−αx . Hence, find the complete solution of 3 −6 2 +12 −8y = e2x (x+1).
dx dx dx
1 ( )
[ans: y = (Ax2 + Bx + C)e−2x + e2x x4 + 4x3 ]
24

Lecture 6

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


In this case, we use the shift operator.

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 solution
The auxiliary equation is D2 − 2D + 1 = 0 and so the roots are D1 = D2 = 1. Hence, the
complementary solution is yc (x) = (Ax + B)ex .
ii) The particular integral

1
yp (x) = ex . Shifting ex to the left yields.
D2 − 2D + 1
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) +3 − 4y = e−4x .
dx2 dx

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

1
yp (x) = e−4x . Shifting e−4x to the left yields.
D2+ 3D − 41
1 1 1 1
= e−4x = e−4x 2 (1) = e−4x D−1 (1) = e−4x x
(D − 4) + 3(D − 4) − 4
2 D − 5D D−5 D−5
[ ]
1 1 1 −4x D 1
= − e−4x { } x = − e 1 + + · · · x = − e−4x (1 + 5x)
5 D 5 5 25
1−
5

31
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
(c) 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

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


In this case, we substitute cos αx or sin αx with eiαx then use the shift operator. For F̃ (x) = sin αx
we extract the imaginary part while for F̃ (x) = cos αx we extract the real part.

Example(s):
Find the particular integral of the following ODEs
d2 y
(a) + 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
yp (x) = sin 2x = 2 ei2x . Shifting ei2x to the left yields.
D2 +4 D +4
1 1 1 D − i4 1
= ei2x 2
(1) = ei2x 2 (1) = ei2x x = ei2x 2 x = ei2x (1 − i4x)
(D + i2) + 4 D + i4D D + i4 D + 16 16
1
= (1 − i4x)(cos 2x + i sin 2x)
16
1
Extracting the imaginary part we get yp (x) = (sin 2x − 4x cos 2x).
16
d2 y 1
(b) + 9y = cos 3x. [ans: yp (x) = (6x sin 3x + cos 3x)]
dx2 36

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


In this case, we use 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
Thus,
1
sin A cos B = [sin(A. + B) + sin(A − B)]
2
Also,
cos(A + B) = cos A cos B − sin A sin B
cos(A − B) = cos A cos B + sin A sin B
Let A = B = θ. Substituting yields cos 2θ = cos2 θ − sin2 θ and 1 = cos2 θ + sin2 θ. Thus, we have
1 . 1.
sin2 θ = (1 − cos 2θ) and cos2 θ = (1 + cos 2θ)
2 2

Example(s):
Find the particular integral of the following equations.

32
d2 y
(a) + 4y = sin 2x cos 3x.
dx2

Solution
1 1
sin 2x cos 3x = (sin(2x + 3x) + sin(2x − 3x)) = (sin 5x − sin x). In terms of the D operator
2 2
1
the given equation becomes (D + 4)y = (sin 5x − sin x). The particular integral is given by
2
2
( )
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
1
cos2 x = (1 + cos 2x). In terms of the D operator the given equation becomes
2
1
(D2 + 2D + 1)y = (1 + cos 2x). The particular integral is given by
2
( )
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:
d2 y dy
(a) Find the complete solution of 2
+2 + y = sin x cos 2x. [ans:
dx dx
1 1
y = (Ax + B)e−x − (6 cos 3x + 8 sin 3x) + cos x]
200 4
d2 y dy
(b) Solve the differential equation 2
−4 + 2y = ex sin2 ( x2 ). [ans: ]
dx dx
d2 y dy
(c) Solve the differential equation 2
−2 + 4y = ex sin2 ( x2 ). [ans:
( dx dx
√ √ ) 1
y = ex A cos 3x + B sin 3x + ex (2 − 3 cos x)]
12

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


In this case, we substitute sin αx or cos αx with eiαx then use the shift operator. In case of cos αx we
extract the real part and in case of sin αx we extract the imaginary part.

Example(s):Find the particular integral of the following differential equations.


d2 y
(a) + y = (x + 1) sin x.
dx2

SolutionIn terms of the D operator the given equation becomes (D2 + 1)y = (x + 1) sin x. The

33
particular integral is given by
1 1
yp (x) = (x + 1) sin x = 2 (x + 1)eix . Shifting eix to the left yields.
D2 +1 D +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 x 2 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[ 2 ]
Extracting the imaginary part we get yp (x) = − (2x + 4x − 1) cos x − (2x + 2) sin x .
8

Lecture 7

Case 9: When F̃ (x) is any other function


In this case, we use two methods to find the particular integral.

1. Method of undetermined coefficients (UC)

2. Method of variation of parameters

3.3.1 Method of undetermined coefficients (UC)


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

We let yp (x) be the general form of the function, F̃ (x), on the RHS of the given differential equation.
The choice of yp (x) is given in the table below.

How to choose the undetermined coefficient


Term in F̃ (x) Choice of yp (x)
e αx Aeαx
x n 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
eαx cos βx or eαx sin βx eαx [A cos βx + B sin βx]

Rules:

1. If F̃ (x) is one of the function in the first column of the above table, choose corresponding function
in second column.

2. 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) = a1 ex +a2 e2x
and F̃ (x) = e2x , then the appropriate choice for yp (x) will be yp (x) = Axe2x , where A is the
undetermined coefficient.

3. If F̃ (x) is sum of functions listed in several lines of the above table in the first column, then the
choice for yp (x) will be the sum of the function in the corresponding lines in the second column.

34
→ Note: once an appropriate choice for yp (x) is found, we then compute the respective derivatives of
yp (x). Substitute yp (x) and its derivatives in the given differential equation, and determine the
values of the constants by equating the coefficients and then 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 solutions of the following differential
equations.
d2 y dy
(a) 2
−2 + 2y = x sin x.
dx dx

Solution
In terms of the D operator the given DE becomes (D2 − 2D + 2)y = x sin x. We first need to
find the complementary solution.
i) The complementary solution
The auxiliary equation is D2 − 2D + 2 = 0. Hence, the roots are D = 1 ± i (complex
conjugate). The complementary solution 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 DE 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 (∗ ∗ ∗) in the given DE 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

⇒ (−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

⇒ (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 coefficients we get: A + 2B = 1, −2A + B = 0, 2A − 2B + C − 2D = 0, and
−2A − 2B + 2C + D = 0. Solving yields
1 2 14 2
A = ,B = ,C = ,D =
5 5 25 25
Substituting the values of A, B, C and D in equation (∗) yields:
1 2 14 2
yp (x) = x sin x + x cos x + cos x + sin x
5 5 25 25

35
Therefore, the complete (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 solution.

i) The complementary solution


The auxiliary equation is D2 − 2D − 3 = 0. Hence, the roots are D1 = −1, D2 = 3. The
complementary solution 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 yp (x) by
multiplying the term Ae−x (on the RHS) 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 DE 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

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

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

Equating the coefficients we get: −8A = 1 and 2A − 4B = 0. Solving yields


1 1
A = − ,B = −
8 16

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


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

Therefore, the complete (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:

36
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 solution.

i) The complementary solution


The auxiliary equation is D2 − 3D + 2 = 0. Hence, the roots are D1 = 1, D2 = 2. The
complementary solution 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 our yp (x) by multiplying the term Eex (on the RHS)
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 (∗ ∗ ∗) in the given DE 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

⇒ (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

⇒ (2A)x2 + (2B − 6A)x + (2A − 3B + 2C) + (2E − D)ex + (−2E)xex + (2F )e3x
= 2x2 + ex + 2xex + 4e3x

Equating the 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 in equation (∗) yields:
7
yp (x) = x2 + 3x + − 3xex − x2 ex + 2e3x
2
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

37
d2 y dy
(b) 2
−3 − 4y = 2 sin x. [hint: let yp (x) = A cos x + B sin x, ans:
dx dx
1
y = A1 e−x + A2 e4x + (3 cos x − 5 sin x)]
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
d3 y d2 y dy
(g) [Assignment] 3
− 3 2
+2 = 10 + 4xe2x . [hint: let yp (x) = Ax + Bx2 e2x + Cxe2x ,
dx dx dx
ans: y = A1 + A2 ex + A3 e2x + 5x + e2x (x2 − 3x)]

3.3.2 Method of variation of parameters


This method is used to find the particular integral if the complementary solution is known. This
method has much more applicability than the method of undetermined coefficients. It can be best
explained by using an example.

Example(s):
Use the method of variation of parameters to find the complete solution of the following differential
equations.
d2 y
(a) + y = sec x.
dx2

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

i) The complementary solution


The auxiliary equation is D2 + 1 = 0. Hence, the roots are D = ±i (complex conjugate).
Thus, the complementary solution is given by yc (x) = A cos x + B sin x, where A and B are
arbitrary constants.
ii) The particular integral
To find the particular integral, we let the constants A and B to be arbitrary functions of
x, which we need to determine. Thus, the particular integral to the given DE is given by

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

Equation (∗) is a solution to the given differential equation and so in must satisfy it. Now,

yp′ (x) = −A(x) sin x + B(x) cos x + A′ (x) cos x + B ′ (x) sin 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) cos x + B ′ (x) sin x = 0 (i)

Hence,
yp′ (x) = −A(x) sin x + B(x) cos x
yp′′ (x) = −A(x) cos x − B(x) sin x − A′ (x) sin x + B ′ (x) cos x (∗∗)

38
Substituting equations (∗) and (∗∗) in the given differential equation yields
yp′′ (x) + yp (x) = sec x i.e,

−A(x) cos x − B(x) sin x − A′ (x) sin x + B ′ (x) cos x + A(x) cos x + B(x) sin x = sec x

⇒ −A′ (x) sin x + B ′ (x) cos x = sec x (ii)


In matrix form, equations (i) and (ii) yield
( )[ ] ( )
cos x sin x A′ (x) 0
=
− sin x cos x B ′ (x) sec x

Using Cramer’s rule, we obtain

0 sin x
sec x cos x ∫
A′ (x) = = − tan x ⇒ A(x) = − tan xdx = ln | cos x|
cos x sin x
− sin x cos x

cos x 0
− sin x sec x ∫
B ′ (x) = =1 ⇒ B(x) = 1dx = x
cos x sin x
− sin x cos x

Substituting A(x) and B(x) in 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 1
(b) 2
−2 + y = ex ln(x), x > 0. [ans: y = (Ax + B)ex + x2 ex (2 ln x − 3)]
dx dx 4

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

i) The complementary solution


The auxiliary equation is D2 − 2D + 1 = 0. Hence, the roots are D1 = D2 = 1. Thus,
the complementary solution is given by yc (x) = (Ax + B) ex , where A and B are arbitrary
constants.
ii) The particular integral
To find the particular integral, we let the constants A and B to be arbitrary functions of
x, which we need to determine. Thus, the particular integral is given by

yp (x) = [xA(x) + B(x)] ex (∗)

Equation (∗) is a solution to the given differential equation and so in must satisfy it. Now,
[ ]
yp′ (x) = ex (x + 1)A(x) + B(x) + xA′ (x) + B ′ (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.,

xA′ (x) + B ′ (x) = 0 (i)

39
Hence,
yp′ (x) = ex [(x + 1)A(x) + B(x)] (∗∗)
x[ ]
yp′′ (x) = e (x + 2)A(x) + B(x) + (x + 1)A′ (x) + B ′ (x) (∗ ∗ ∗)
Substituting equations (∗), (∗∗) and (∗∗) in the given differential equation yields
yp′′ (x) − 2yp′ + yp (x) = ex ln(x) i.e,
[ ]
ex (x + 2)A(x) + B(x) + (x + 1)A′ (x) + B ′ (x) − 2ex [(x + 1)A(x) + B(x)]
+ex [xA(x) + B(x)] = ex ln(x)

⇒ (x + 1)A′ (x) + B ′ (x) = ln x (ii)


In matrix form, equations (i) and (ii) yield
( )[ ] ( )
x 1 A′ (x) 0
=
(x + 1) 1 B ′ (x) ln x

Using Cramer’s rule, we obtain

0 1
ln x 1
A′ (x) = = ln x
x 1
(x + 1) 1

x 0
(x + 1) ln x
B ′ (x) = = −x ln x
x 1
(x + 1) 1

Solving for A(x) and B(x), we get



A(x) = ln xdx

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, ∫
B(x) = − x ln xdx

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) in 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

40
Exercise:
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 solution.

i) The complementary solution


The auxiliary equation is D2 + 4 = 0. Hence, the roots are D = ±i2 (complex conjugate).
Thus, the complementary solution is yc (x) = A cos 2x + B sin 2x.
ii) The particular integral
To find the particular integral, we let the constants A and B be arbitrary functions of x,
which we need to determine. Thus, the particular integral to the given DE is given by

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

Equation (∗) is a solution to the given differential equation and so it must satisfy it. Now,

yp′ (x) = −2A(x) sin 2x + 2B(x) cos 2x + A′ (x) cos 2x + B ′ (x) sin 2x

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) cos 2x + B ′ (x) sin 2x = 0 (i)

Hence,
yp′ (x) = −2A(x) sin 2x + 2B(x) cos 2x (∗∗)
yp′′ (x) = −4A(x) cos 2x − 4B(x) sin 2x − 2A′ (x) sin 2x + 2B ′ (x) cos 2x (∗ ∗ ∗)
Substituting equations (∗) and (∗ ∗ ∗) in the given differential equation yields yp′′ (x) +
4yp (x) = tan 2x i.e,

−4A(x) cos 2x−4B(x) sin 2x−2A′ (x) sin 2x+2B ′ (x) cos 2x+4A(x) cos 2x+4B(x) sin 2x = tan 2x
sin 2x
⇒ −2A′ (x) sin 2x + 2B ′ (x) cos 2x = tan 2x = (ii)
cos 2x
In matrix form, equations (i) and (ii) yield
( )[ ] ( )
cos 2x sin 2x A′ (x) 0
=
−2 sin 2x 2 cos 2x B ′ (x) tan 2x

Using Cramer’s rule, we obtain

0 sin 2x
tan 2x 2 cos 2x − sin 2x tan 2x 1
A′ (x) = = = − sin 2x tan 2x
cos 2x sin 2x 2 2
−2 sin 2x 2 cos 2x

cos 2x 0
−2 sin 2x tan 2x cos 2x tan 2x 1
B ′ (x) = = = sin 2x
cos 2x sin 2x 2 2
−2 sin 2x 2 cos 2x

Solving for A(x) and B(x), we get



1
A(x) = − sin 2x tan 2xdx
2

41
Using integration by parts: put u = tan 2x, dv = sin 2xdx ⇒ du = 2 sec2 2xdx, v =
1
− cos 2x.
2
[ ∫ ] [ ∫ ]
1 1 1 1 dx
⇒ A(x) = − − cos 2x tan 2x + cos 2x sec 2xdx = − − sin 2x +
2
2 2 2 2 cos 2x
By t substitution we have, 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+t 2 1 + t2
Hence,
( )
1 − t2 dx dt 1 1 1
cos 2x = cos x − sin x =
2 2
⇒ = = + 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
By back substitution we have
( )
1 1 + tan x 1
A(x) = sin 2x − ln = (sin 2x − ln |sec 2x + tan 2x|)
4 1 − tan x 4
Similarly, ∫
1 1
B(x) = sin 2xdx = − cos 2x
2 4
Substituting A(x) and B(x) in 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) 2
+3 + 2y = .
dx dx 1 + ex

Solution
1
In terms of the D operator the given equation becomes (D2 + 3D + 2)y = . We first need
1 + ex
to find the complementary solution.

i) The complementary solution


The auxiliary equation is D2 + 3D + 2 = 0. Hence, the roots are D1 = −1, D2 = −2. The
complementary solution is given by yc (x) = Ae−x + Be−2x .

42
ii) The particular integral
To find the particular integral, we let the constants A and B to be arbitrary functions of
x, which we need to determine. Thus, the particular integral to the given DE is given by

yp (x) = A(x)e−x + B(x)e−2x (∗)

Equation (∗) is a solution to the given differential equation and so in must satisfy it. Now,

yp′ (x) = −A(x)e−x − 2B(x)e−2x + A′ (x)e−x + B ′ (x)e−2x

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)e−x + B ′ (x)e−2x = 0 (i)

Hence,
yp′ (x) = −A(x)e−x − 2B(x)e−2x (∗∗)
yp′′ (x) = A(x)e−x + 4B(x)e−2x − A′ (x)e−x − 2B ′ (x)e−2x (∗ ∗ ∗)
Substituting equations (∗) and (∗ ∗ ∗) in the given differential equation yields yp′′ (x) +
1
3yp′ (x) + 2yp (x) = i.e,
1 + ex
1
A(x)e−x +4B(x)e−2x −A′ (x)e−x −2B ′ (x)e−2x +−3A(x)e−x −6B(x)e−2x +2A(x)e−x +2B(x)e−2x =
1 + ex

1
⇒ −A′ (x)e−x − 2B ′ (x)e−2x = (ii)
1 + ex
In matrix form, equations (i) and (ii) yield
( )[ ]  
e−x e−2x A′ (x) 0
= 1 
−e−x −2e−2x ′
B (x)
1 + ex
Using Cramer’s rule, we obtain

0 e−2x
1
x
−2e−2x −e−2x 1 −ex

A (x) = 1 + e = · =
e−x e−2x 1 + ex e−3x 1 + ex
−e −x −2e −2x

e−x 0
1
−e−x −x e2x ex
B ′ (x) = 1 + ex = e ·
1
= = e x

e−x e−2x 1 + ex e−3x 1 + ex 1 + ex
−e−x −2e −2x

Solving for A(x) and B(x), we get



−ex
A(x) = dx = − ln |1 + ex |
1 + ex
Similarly, ∫ ( )
ex
B(x) = ex − dx = ex − ln |1 + ex |
1 + ex
Substituting A(x) and B(x) in equation (∗) yields

yp (x) = −e−x ln |1 + ex | + e−2x (ex − ln |1 + ex |)

43
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
−2 + y = 2. [ans: y = (Ax + B) ex − (1 + ln x) ex ]
dx dx x
d2 y
(e) i) + y = x − cot x. [ans: y =]
dx2
d2 y
ii) + y = x sin x. [ans: y =]
dx2

Lecture 8

3.4 Linear differential equations of Euler-Cauchy type


This is an equation with variable coefficients that takes the general form

dn y n−1 d
n−1 y
n−2 d
n−2 y 2
2d y dy
an xn + a n−1 x + a n−2 x + · · · + a 2 x + a1 x + a0 y = F̃ (x), (17)
dxn dxn−1 dxn−2 dx2 dx
where a0 , a1 , · · · , an are constants. The transformation x = et reduces equation (17) to a linear
differential equation with constant coefficients.

Theorem 3.1. Let y be n-times differentiable function of x. 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

44
(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

Example(s):
Solve the following differential equations
d2 y dy
(a) x2 2
− 5x + 8y = 2 ln x.
dx dx

Solution
dy dy d2 y d2 y dy
Let x = et . Then, x = and x2 2 = 2 − . Substituting in the given equation, we
dx dt dx dt dt
get
d2 y dy dy d2 y dy
− − 5 + 8y = 2t ⇒ − 6 + 8y = 2t (∗)
dt2 dt dt dt2 dt
d
Let D = . Then in terms of the D operator, equation (∗) becomes
dt
[D2 − 6D + 8]y = 2t

i) The complementary solution


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

yc (t) = Ae4t + Be2t

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 + + . Back
4 16
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

45
d2 y dy
The equation can be written as x2 2
+ 2x − 2y = x ln x, which is of the Euler-Cauchy
dx dx
dy dy d2 y d2 y dy
equation. Let x = et . Then, x = and x2 2 = − . Substituting in the given
dx dt dx dt2 dt
equation, we get
d2 y dy dy d2 y dy
− + 2 − 2y = et t ⇒ + − 2y = et t (∗)
dt2 dt dt dt2 dt
d
Let D = . Then in terms of the D operator, equation (∗) becomes
dt
[D2 + D − 2]y = et t

i) The complementary solution


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

yc (t) = Aet + Be−2t

ii) The particular integral


1
yp (t) = (et t). Shifting et to the left yields.
D2 + D − 2
1 1 1
= et (t) = et 2 (t) = et 2 (t)
(D + 1) + (D + 1) − 2
2 D + 2D + 1 + D + 1 − 2 D + 3D
( ) ( )
1 1 1t2 1 t2
= e t
D−1 (t) = et = et { } . Maclaurin’s expansion yields.
D+3 D+3 32 D 2
1+
3
[ ]( ) [ ]
1 t D D 2 D 3 t 2 1 t2 t 1 tet 1
= e 1− + − + ··· = et − + = [3t − 2] + et
3 3 9 27 2 3 2 3 9 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:
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

4 Systems of linear ODEs


To solve a system of ODEs, we write the system in terms of the D operator then solve it using
elimination method and/or substitution method.

Example(s):
(a) Solve the system defined by
dy
+ x = e3t
dt
dx
−y = 0
dt

46
1 1
subject to the initial conditions x(0) = and y(0) = .
2 5

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

Operating with D on equation (ii) and adding the result to equation (i), we get (D2 + 1)x = e3t .

i) The complementary solution


The auxiliary equation is D2 + 1 = 0. Hence, the roots are D1 = −i, D2 = i. The
complementary solution is

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

ii) The particular integral


1 1 1
xp (t) = e3t = 2 e3t = e3t
D2 +1 3 +1 10
Therefore, x = xc (x) + xp (x). That is,
1 3t
x = A cos t + B sin t + e
10
From equation (ii), y = Dx. Hence,
3 3t
y = −A sin t + B cos t + e
10
1 1 2 1
Using the initial conditions, x(0) = and y(0) = , we obtain A = and B = − . Therefore,
2 5 5 10
1 ( ) 1 ( )
x= 4 cos t − sin t + e3t and y= −4 sin t − cos t + 3e3t
10 10

(b) Solve the system of ODEs defined by


dy dx
2 −y+x+ = 0 (i)
dt dt
dy dx
3 +x−y+2 = et (ii)
dt dt

Solution
d
Let D = . In terms of the D operator the system becomes
dt
(2D − 1)y + (D + 1)x = 0
(3D − 1)y + (2D + 1)x = et

Eliminating x between the above equations, we get

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


−(D + 1)(3D − 1)y − (2D + 1)(D + 1)x = −(D + 1)et

Adding yields:
(2D + 1)(2D − 1)y − (D + 1)(3D − 1)y = −(D + 1)et
( )
⇒ (4D2 − 2D + 2D − 1)y − (3D2 − D + 3D − 1)y = − et + et

⇒ (D2 − 2D)y = −2et

47
i) The complementary solution
The auxiliary equation is D2 − 2D = 0. Hence, the roots are D1 = 0, D2 = 2. The
complementary solution is
yc (t) = A + Be2t
ii) The particular integral
1 ( ) −2
yp (t) = −2e t
= et = 2et
D − 2D
2 (1) − 2(1)
2

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


y = A + Be2t + 2et
dx
To find x, we need to eliminate between equations (i) and (ii). Thus, we have
dt
dy dx
−4 + 2y − 2x − 2 = 0
dt dt
dy dx
3 +x−y+2 = et
dt dt
Adding yields:
dy dy
− + y − x = et ⇒ x=− + y − et
dt dt
d ( )
⇒ x=− A + Be2t + 2et + A + Be2t + 2et − et = −2Be2t − 2et + A + Be2t + 2et − et
dt
Therefore,
x = A − Be2t − et

Exercise:
(a) Solve the system of ODEs defined by. [ans: x = Aet + Be−t and y = −Aet + Be−t + cos t]
dx
+ y = cos t
dt
dy
+ x = − sin t
dt
(b) Solve the following system. [ans: x = 4e3t − 5e2t and y = 8e3t − 5e2t ]
dx
= x+y
dt
dy
= −2x + 4y
dt
subject to the initial conditions x(0) = −1 and y(0) = 3.
1 5
(c) Solve the following system of equations. [ans: y = Aet + Be−3t + t + and
8 12
2 1 11
x = −2Aet + Be−3t − t − ]
3 3 36
dx dy
2 − 2 − 3x = t
dt dt
dx dy
2 + 2 + 3x + 8y = 2
dt dt
(d) Solve the following system of equations. [ans: ]
dx dy
2 + − 2x − 2y = 5et
dt dt
dx dy
+ + 4x + 2y = 5e−t
dt dt

Lecture 9

48
5 Laplace transform
Suppose a function f (t) is defined for t ≥ 0. Also, let L be the Laplace transform operator, then the
Laplace transform, with respect to t, of f (t) is a function defined by
∫∞
L [f (t)] = e−st f (t)dt = F (s), Re(s) > 0, where s is a dummy variable.
0

5.1 Properties of the Laplace transform

Example(s):
Find the Laplace transform of the following functions:

(a) f (t) = 1

(b) f (t) = eat , where a is a constant.

(c) f (t) = t2

(d) f (t) = cos bt, where b is a constant. [hint: put u = cos bt and dv = e−st dt]

(e) f (t) = teat , where a is a constant.


1
(f) f (t) = cos2 3t. [hint: cos2 θ = (1 + cos 2θ)]
2
3 1
(g) f (t) = sin3 t. [hint: sin3 t = sin t − sin 3t]
4 4
Theorem 5.1 (First shifting property). The first shifting property of Laplace transforms states that
if L [f (t)] = F (s) then [ ]
L eat f (t) = F (s − a)

Proof. From the definition of Laplace transform, with respect to t, 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[et cos 2t] =
s2 +4 (s − 1)2 + 4

Exercise:

49
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 [ ] b
L [sinh bt] = 2 L eat sinh bt =
s − b2 (s − a)2 − b2
2. Find the Laplace transform of the following functions:
 ( )

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

 0, if t < 32 π
Solution
3
∫∞ ∫2 π ∫∞ ∫∞ ( )
−st −st −st 3
L [f (t)] = e f (t)dt = e f (t)dt + e f (t)dt = 0 + e−st cos t − π dt
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 2
s +1
{
(t + 1), if 0 ≤ t ≤ 2
(b) 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
3. Find the Laplace transform of f (t) = e−3t (2 cos 5t − 3 sin 3t). [ans:
s+3 3
2 2
−3 ]
(s + 3) + 25 (s + 3)2 + 9

50
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 1 n!
L = 1, L−1 2 = t, L−1 n+1 = tn
s s s
[ ] [ ] [ ]
−1 1 at −1 1 at −1 n!
L =e , L = e t, L = eat tn
s−a (s − a)2 (s − a)n+1
[ ] [ ]
−1 s −1 a
L = cos at, L = sin at
s2 + a2 s2 + a2
[ ] [ ]
s a
L−1 2 = cosh at, L−1 2 = sinh at
s −a 2 s − a2

Example(s):

1. Find the inverse Laplace transform of the following functions


1 2 6
(a) F (s) = + + 4.
s−2 s+5 s
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)2 + 25 (s + 4)2 + 81 (s + 2)2 + 9
Solution
[ ]
s−2 s+4 1
L−1 [F (s)] = L−1 + +
(s − 2)2 + 25 (s + 4)2 + 81 (s + 2)2 + 9
[ ] [ ] [ ]
−1 s−2 −1 s − (−4) 1 −1 3
= L +L + 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

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.
Therefore,
5s + 3 1 −s + 2
= +
(s − 1)(s2 + 2s + 5) s − 1 s2 + 2s + 5

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

Exercise:
s+2 5 3
(a) Find the inverse Laplace transform, with respect to t, of . [ans: f (t) = e3t − et ]
s2 − 4s + 3 2 2

5.3 Laplace transform of 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) − · · · − 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).
Integration by parts yields
[ ]∞ ∫∞
[ ′ ] −st
L f (t) = e f (t) − f (t)(−se−st dt)
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
Using integration by parts, put u = e−st and dv = f ′′ (t)dt ⇒ du = −se−st dt, v = f ′ (t).
Integration by parts yields
[ ]∞ ∫∞
[ ′′ ] −st ′
L f (t) = e f (t) − f ′ (t)(−se−st dt)
0
0
∫∞
= −f ′ (0) + s e−st f ′ (t)dt = sL[f ′ (t)] − f ′ (0) = s {sL[f (t)] − f (0)} − f ′ (0)
0
= s2 L[f (t)] − sf (0) − f ′ (0)

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

5.4 Applications of Laplace transform in differential equations


Consider the second order differential equation

d2 y dy
a + b + cy = f (t) or ay ′′ + by ′ + cy = f (t) (18)
dt2 dt
where a, b, c are constants. Taking the Laplace transform on both sides of equation (18), we get
[ ] [ ]
aL y ′′ + bL y ′ + cL [y] = L [f (t)]
{ }
⇒ a s2 L [y] − sy(0) − y ′ (0) + b {sL [y] − y(0)} + cL [y] = L [f (t)] (19)

Given the initial conditions, equation (19) can be solved for Y (s). We then take the inverse Laplace
transform on both sides to get the solution, y(t).

Example(s):
Solve the following differential equations using the Laplace transform method

(a) y ′′ − 6y ′ + 9y = t2 e3t subject to the initial conditions y(0) = 2 and y ′ (0) = 6.

Solution
Taking the Laplace transform on both sides we have
[ ] [ ] [ ]
L y ′′ − 6L y ′ + 9L [y] = L e3t t2
{ } 2
⇒ s2 L [y] − sy(0) − y ′ (0) − 6 {sL [y] − y(0)} + 9L [y] =
(s − 3)3

On applying the initial conditions we get


{ } 2
s2 L [y] − 2s − 6 − 6 {sL [y] − 2} + 9L [y] =
(s − 3)3
[ ]
2 2 1
⇒ (s − 3)2 L [y] − 2s + 6 = ⇒ L [y] = + 2s − 6
(s − 3)3 (s − 3)3 (s − 3)2
2 2
⇒ L [y] = +
(s − 3)5 s − 3
Now taking the inverse Laplace transform on both sides, we have
[ ] [ ] [ ] [ ]
−1 −1 2 2 2 4! 1
L L [y] = L + L−1 = L−1 + 2L−1
(s − 3) 5 s−3 4! (s − 3)4+1 (s − 3)
1 3t 4
∴ y = e t + 2e3t
12

(b) y ′′ − 10y ′ + 9y = 5t subject to the initial conditions y(0) = −1 and y ′ (0) = 2.

Solution
Taking the Laplace transform on both sides we have
[ ] [ ]
L y ′′ − 10L y ′ + 9L [y] = L [5t]
{ } 5
⇒ s2 L [y] − sy(0) − y ′ (0) − 10 {sL [y] − y(0)} + 9L [y] =
s2

53
On applying the initial conditions we get
{ } 2
s2 L [y] + s − 2 − 10 {sL [y] + 1} + 9L [y] =
s2 [ ]
5 5 1
⇒ (s2 − 10s + 9)L [y] + s − 12 = ⇒ L [y] = 2 − (s − 12)
s2 s (s − 9)(s − 1)
( )
5 + 12s2 − s3 1 50 45 31 162
⇒ L [y] = 2 = + 2 + −
s (s − 9)(s − 1) 81 s s s−9 s−1

Now taking the inverse Laplace transform on both sides, we have


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

Exercise:
Use Laplace transform method to solve the following initial value problems
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 subject to the initial conditions y(0) = 0, y ′ (0) = 2. [ans: y(t) = t + sin t]
dy 4 1
(c) + 2y = 4e3t subject to the initial condition y(0) = 1. [ans: y(t) = e3t + e−2t ]
dt 5 5
(d) y ′′ − 3y ′ + 2y = 2e3t ; y(0) = 5 and y ′ (0) = 7. [ans: y(t) = 4et + e3t ]
( )
1
(e) y ′′ + 2y ′ + y = 3te−t ; y(0) = 4 and y ′ (0) = 2. [ans: y(t) = e−t 4 + 6t + t3 ]
2
20 −0.5x 11 −2x 1 −2x
(f) 2y ′′ + 5y ′ + 2y = e−2x ; y(0) = 1 and y ′ (0) = 1. [ans: y(x) = e − e − xe ]
9 9 3

Lecture 10

6 Power series solutions of linear ODEs


Power series representations are used to find solution of second order linear differential equations with
variable coefficients. The solutions are normally defined in a neighbourhood at a point where the
solution series is centered at.

Definition 6.1 (Analytic function). A function f (x) is said to be analytic (defined) at a point x = x0
if f (x) can be expanded in a power series about 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 (20)
n=0

Here, an ’s are constants and (20) converges for |x − x0 | < r, where r > 0. The radius of convergence,
r, can be found from ratio test/root test. Hence, the function f (x) is single valued and possesses
derivatives of all orders in the interval |x − x0 | < r.

p(x)
→ Note: a rational function is analytic everywhere except at those values of x at which q(x) = 0.
q(x)

54
6.1 Ordinary and singular points
Consider a linear 2nd order homogeneous ODE of the form

d2 y dy
a2 (x) + a1 (x) + a0 (x)y = 0 (21)
dx2 dx
We can write equation (21) into the equivalent normalized form as

d2 y dy
2
+ P1 (x) + P2 (x)y = 0, (22)
dx dx
a1 (x) a0 (x)
where P1 (x) = , P2 (x) = , a2 (x) ̸= 0.
a2 (x) a2 (x)
Definition 6.2 (Ordinary point). A point x = x0 is called an ordinary point of equation (22) if both
P1 (x) and P2 (x) are analytic at x = x0 .

Definition 6.3 (Singular point). If at least P1 (x) and P2 (x) in equation (22) is not analytic at the
point x = x0 , then we say that the point x0 is a singular point of the differential equation (21).

Definition 6.4 (Regular singular point). If x0 is a singular point of the differential equation (21) but
both the products, (x − x0 )P1 (x) and (x − x0 )2 P2 (x) in their simplest form, are analytic at the point
x = x0 , then the point x = x0 is called a regular singular point of the differential equation (21).

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

Example(s):
d2 y dy 1
(a) Determine the singular point(s) 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) =
dx 2 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 are ordinary.
d2 y dy
(b) Find the singular point(s) of the differential equation 2x2 2
−x + (x − 5)y = 0 and hence
dx 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:

55
• 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 are ordinary.
iii) Classification:
• Let x0 = 0. Now,
( )
1 1
(x−x0 )P1 (x) =x − =− (finite ⇒ (x − x0 )P1 (x) is analytic at x = 0)
x=x0 2x x=0 2
Also,
(x − 5) 5
(x−x0 )2 P2 (x) = x2 · =− (finite ⇒ (x − x0 )2 P2 (x) is analytic at x = 0)
x=x0 2x2 x=0 2
Since (x − x0 )P1 (x) and (x − x0 )2 P2 (x) are both analytic at x = 0, therefore, the point
x = 0 is a regular singular point of the given DE.

(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) + (1 − x) +y =0
dx2 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 are ordinary.
iii) Classification:
• Let x0 = 0. Now,
1
(x−x0 )P1 (x) =
x· = ∞ (infinite ⇒ (x − x0 )P1 (x) is not analytic at x = 0)
x=x0 x2 x=0

Since (x − x0 )P1 (x) is not analytic at x = 0, therefore, the point x = 0 is an irregular


singular point of the given DE.
• Let x0 = 1. Now,
1
(x − x0 )P1 (x) = (x − 1) · = 0 (finite ⇒ (x − x0 )P1 (x) is analytic at x = 1)
x=x0 x2 x=1

Also,
1
(x−x0 )2 P2 (x) = (x−1)2 ·  x=1 = 0 (finite ⇒ (x − x0 )P1 (x) is analytic at x = 1)
x=x0 −x2 −1)
(x

Since (x − x0 )P1 (x) and (x − x0 )2 P2 (x) are both analytic at x = 1, therefore, the point
x = 1 is a regular singular point of the given DE.

56
(d) Identify all 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
(e) Show that x = 0 is an ordinary point for the equation (x2 − 1) 2
+ 3x + xy = 0.
dx dx

6.2 Solution about an ordinary point


The power series of a function y : R → R centered at x0 ∈ R is


y= an (x − x0 )n
n=0

Example(s):
Use the power series method to solve the following differential equations about the given ordinary
points
d2 y dy
(a) (1 − x2 ) 2
− 2x + 2y = 0 about the ordinary point x0 = 0.
dx dx

Solution
The solution of the given DE is given by


y= an xn
n=0

Differentiating yields

∑ ∞

y′ = nan xn−1 , y ′′ = n(n − 1)an xn−2
n=1 n=2

Substituting in the given differential equation we get



∑ ∞
∑ ∞

(1 − x2 ) n(n − 1)an xn−2 − 2x nan xn−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

∑ ∞

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

We can now change the indexing so that the series has the general term xn−2 . Plugging in
n = n − 2 in the second summation of equation (∗) yields

∑ ∞

n(n − 1)an x n−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
Equating the coefficients yields

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

57
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   (2k − 1)
4
1 5 (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 
Therefore, the solution becomes

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

d2 y
(b) + 4y = 0 about the ordinary point x0 = 0.
dx2

Solution
Let the solution of the given DE be


y= an xn
n=0
Differentiating yields

∑ ∞

y′ = nan xn−1 , y ′′ = n(n − 1)an xn−2
n=1 n=2

Substituting in the given differential equation we get



∑ ∞

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

We can now change the indexing 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 x n−2
+4 an−2 x n−2
=0 ⇒ [n(n − 1)an + 4an−2 ] xn−2 = 0
n=2 n=2 n=2

Equating the coefficients 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

58
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 2k (−1)k · 22k+1 · 2−1 2k+1
= a0 x + a1 x
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

→ Note: if the initial conditions are known, we apply Taylor series expansion to obtain the
power series solution of the given IVP.

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

Solution
The Taylor series expansion of y(x) about the point x0 is given by

∑ y (n) (x0 )
y= (x − x0 )n
n=0
n!

Thus, the 3rd degree Taylor series solution of the given IVP is obtained by putting n = 3 and
x0 = 0. Thus, we have

y ′′ (0) 2 y ′′′ (0) 3


y = y(0) + y ′ (0)x + x + x + ··· (∗)
2! 3!
Now,

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

59
Replacing these values in the series (∗) yields
2
y = 2 − 4x − 3x2 + x3 + · · ·
3

Exercise:
d2 y dy
(a) Use power series method to solve (1 − x2 ) − 6x − 4y = 0 about the ordinary point x0 = 0.
dx2 dx

Solution
Let the solution to the given DE be

∑ ∞

y= an (x − x0 )n = an x n
n=0 n=0

Differentiating yields

∑ ∞

y′ = nan xn−1 , y ′′ = n(n − 1)an xn−2
n=1 n=2

Substituting in 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 can now change the indexing 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 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)

60
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
Therefore, the solution becomes

∑ ∞
∑ ∞

n 2k
y = an x = a2k x + 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

(b) Find power series solution of the following differential equations about the ordinary point x0 = 0.

dy ∞ 5k

(i) = 5y. [ans: y = a0 xk ]
dx k=0 k!

∑ (2x)k
(ii) y ′ − 2y = 0. [ans: y = a0 = a0 e2x ]
k=0 k!
d2 y dy ∞
∑ 1
(iii) (1 + x2 ) + 2x − 2y = 0. [ans: y = (−1)k−1 x2k ]
dx2 dx k=0 2k − 1
( ) ( )
(iv) y ′′ + xy ′ + y = 0. [ans: y = a0 1 − 1 2
2x + 1 4
8x + · · · + a1 x − 31 x3 + 1 5
15 x + ··· ]
(v) y ′′ + xy ′ + (x2 + 2)y = 0. [ans: y = a0 (1 − x2 + 41 x4 + · · · ) + a1 (x − 21 x3 + 3 5
40 x + · · · )]

(c) Use Taylor’s theorem to find the third degree series solution to the following IVPs.

(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
(vi) (x2 − 1) 2
+ 3x + xy = 0; y(0) = 4, y ′ (0) = 6.
dx dx
d2 y dy
(vii) (2x2 − 3) 2 − 2x + y = 0; y(0) = 1, y ′ (0) = 7.
dx dx

6.2.1 Legendre’s equation and polynomials


The equation

d2 y dy
(1 − x2 ) − 2x + p(p + 1)y = 0 (23)
dx2 dx
where p is a positive integer is called Legendre’s differential equation. This equation arises in
many problems in physics, especially in boundary value problems in spheres.

The equivalent normalized form of equation (23) 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

61
Therefore, the poinst x = −1 and x = 1 are the only singular points of equation (23). All other
points are ordinary. Thus, we study the general solution to equation (23) in the interval −1 < x < 1.

To solve equation (23) about the ordinary point x0 = 0, we assume that it has a power series solution
of the form


y= an x n
n=0

Differentiating yields

∑ ∞

y′ = nan xn−1 , y ′′ = n(n − 1)an xn−2
n=1 n=2

Substituting the values of y, y′, y ′′ in equation (23) we get



∑ ∞
∑ ∞

(1 − x2 ) n(n − 1)an xn−2 − 2x nan xn−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 can now change the indexing so that the series has the general term xn−2 . So we put n = n − 2
in the second summation and get

∑ ∞

n(n − 1)an x n−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 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)
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)!

62

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.3 Solution about a regular singular point (Frobenius method)


Let x0 be a regular singular point of equation (21). We assume a power series solution, about the
point x = x0 , of the form


y= an (x − x0 )n+r , a0 ̸= 0
n=0

Example(s):
d2 y dy
(a) Determine the power series solution of x2 2
+ (x2 − 3x) + 3y = 0 about the point x0 = 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= an (x − x0 )n+r , a0 ̸= 0
n=0

63
Differentiating yields

∑ ∞

′ ′′
y = (n + r)an x n+r−1
, y = (n + r)(n + r − 1)an xn+r−2
n=0 n=0

Substituting into the given differential equation yields



∑ ∞
∑ ∞

x2
(n + r)(n + r − 1)an x n+r−2
+ (x − 3x)
2
(n + r)an x n+r−1
+3 an xn+r = 0
n=0 n=0 n=0

∑ ∞
∑ ∑∞ ∞

⇒ (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 x n+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 x + r
{[(n + r)(n + r − 4) + 3] an + (n + r − 1)an−1 } xn+r = 0
n=1

Equating the coefficients we get

1. [(r − 3)(r − 1)] a0 = 0 (This is called indicial equation). But a0 ̸= 0


⇒ (r − 3)(r − 1) = 0 ⇒ r = 3 or r = 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 = 3
−(n + 2) −1
The above recurrence relation becomes an = an−1 = an−1 , n ≥ 1. Thus,
(n + 3)(n − 1) + 3 n
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!

64
Therefore, the solution corresponding to r = 3 is

∑ ∞
∑ ( )
(−1)k 1 1
y= ak x k+3
= a0 x k+3
= a0 x − x + x5 − x6 + · · ·
3 4

k=0 k=0
k! 2 6

Case 2: when r = 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 correspond to r = 1.

Exercise:
Determine the power series solution of the following differential equations about the regular singular
point x = 0.
d2 y dy
(a) 2x2 2
−x + (x − 5)y = 0.
dx dx
d2 y dy
(b) 2x2 + (x + 2) + y = 0.
dx2 dx
d2 y dy
(c) 2x2 2
+x + (x2 − 2)y = 0.
dx dx
d2 y dy
(d) 9x(1 − x) − 12 + 4y = 0.
dx2 dx

6.3.1 Bessel’s equation and functions


The equation

d2 y dy
x2 2
+x + (x2 − p2 )y = 0 (24)
dx dx
is called Bessel’s equation of order p. The solutions of equation (24) are known as Bessel functions.
The equivalent normalized form of equation (24) is
( )
d2 y 1 dy p2 1 n2
+ + 1 − y=0 ⇒ P1 (x) = , P2 (x) = 1 − 2
dx2 x dx x2 x x

Therefore, the point x = 0 is a regular singular point of equation (24)


To solve equation (24), we assume that it has a power series solution of the form


y= an xn+r , a0 ̸= 0 (25)
n=0

where x0 is the regular singular point of equation (24) about which we are finding the solution,
a0 , a1 , · · · are constants

From (25) it implies that



∑ ∞

y′ = (n + r)an xn+r−1 , y ′′ = (n + r)(n + r − 1)an xn+r−2
n=0 n=0

65
Substituting in equation (24) yields

∑ ∞
∑ ∞

x2 (n + r)(n + r − 1)an xn+r−2 + x (n + r)an xn+r−1 + (x2 − p2 ) 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 (r2 − p2 )xr + a1 [(r + 1)2 − p2 ]xr+1 + [(n + r)2 − p2 ]an xn+r + an−2 xn+r = 0
n=2 n=2

Equating the coefficients 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 a1 = 0).
(p + n)2 − p2
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
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)

66
Similarly, for the odd subscripts,

a3 · a5 · · · a2k+1 = 0 ⇒ a2k+1 = 0

Therefore,

∑ ∞
∑ ∞

y= an xn+r ⇒ y1 = a2k xp+2k + a2k+1 xp+2k+1
n=0 k=0 k=0
∑∞
(−1)k· xp+2k
= p+2k k!Γ(p + k + 1)
+0
k=0
2
= Jp (x) (26)

Equation (26) is called Bessel function and Jp (x) stands for the Bessel function of order p

Case 2: when r = −p
Similarly, the Bessel function for r = −p is [we replace p by −p in equation (26)]

∑ (−1)n · x−p+2n
y2 = = J−p (x)
n=0
n!2−p+2n Γ(−p + n + 1)

Therefore, the general solution of equation (24) is y = AJp (x) + BJ−p (x).

Lecture 11

7 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.

7.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

7.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.

67
7.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.

7.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.

7.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.

7.6 Fundamental operations on Sets


7.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}
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}

7.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 7.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.

7.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}

68
7.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}

7.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.

7.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.

7.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:

69
(a) A ⊂ B (b) Ac (c) A − B

(d) A ∪ B (e) A ∩ B (f) A∆B

7.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.

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

70
(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|]

3. 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]

71

You might also like