Sei sulla pagina 1di 33

SMA 2304: Ordinary Differential Equations 1

Francis Oketch Ochieng

November 9, 2017

Contents
1 DEFINITION OF TERMS 2
1.1 Differential Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Ordinary Differential Equation (ODE) . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Partial Differential Equation (PDE) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4 Order and Degree of a Differential Equation . . . . . . . . . . . . . . . . . . . . . . . . 2
1.5 Solution of a Differential Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2 ORIGIN/FORMATION OF ODEs 4
2.1 Geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2 From real life situations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.3 Elimination of essential arbitrary constants from primitives . . . . . . . . . . . . . . . 4

3 ODEs OF FIRST ORDER AND FIRST DEGREE 6


3.1 Equations with separable variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.2 Homogeneous equations of first order . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.3 Exact Differential Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.4 Linear Differential Equations of first order . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.5 Bernoulli’s Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

4 APPLICATIONS OF ODEs 15
4.1 In Geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.2 In Real life situations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

5 HIGHER ORDER LINEAR ODEs 16


5.1 Solution of HOMOGENEOUS Linear Differential Equation (15) . . . . . . . . . . . . . 17
5.2 Solution of NON-HOMOGENEOUS Linear Differential Equation (14) . . . . . . . . . 20
5.3 Linear Differential Equations of Cauchy Type . . . . . . . . . . . . . . . . . . . . . . . 31

6 SYSTEMS OF LINEAR ODEs 32

7 POWER SERIES SOLUTIONS OF LINEAR ODEs 33

1
Course Outline
First order equations and their applications.

Second order linear equations: homogeneous with constant and variable coefficients and their
applications.

Systems of linear differential equations and their applications.

Power series solution of first and second order differential equations. Linear

1 DEFINITION OF TERMS

1.1 Differential Equation

This is an equation that involves the derivative of a dependent variable with respect to one or
more independent variables. For instance,
2
Let y = ex . Here y is dependent variable and x is independent variable.
Then,
dy 2
= 2xex (1)
dx
The right hand side of equation is called the derivative but equation (1) is a differential equation.
Also, let u = x2 + y 2 . Then, ∂u ∂u
∂x = 2x, and ∂y = 2y

∂u ∂u
+ = 2x + 2y (2)
∂x ∂y

Equation (2) is a differential equation.

1.2 Ordinary Differential Equation (ODE)

This is a differential equation that involves the derivative(s) of a dependent variable with respect
to only one independent variable. For instance, equation (1)

1.3 Partial Differential Equation (PDE)

This is a differential equation that involves the derivative(s) of a dependent variable with respect
to more than one independent variables. For instance, equation (2). Other examples are

∂u ∂2u
= α 2 (Heat Equation)
∂t ∂y

∂2 u ∂2u
= k − c (Wave Equation)
∂t2 ∂y 2

∂2 u ∂2u ∂2 u
+ 2 + = 0 (Poisson Equation)
∂x2 ∂y ∂z 2

1.4 Order and Degree of a Differential Equation

Order of a Differential Equation


This is the highest order of the derivatives involved in the differential equation.

2
Degree of a Differential Equation
This is the power of the highest derivative involved in the differential equation.

For instance,

d2 y dy
2
−3 + 2y = ex (Order=2, Degree=1)
dx dx
2
dy

+ y = sin x (Order=1, Degree=2)
dx
3
d2 y dy

+ + y = ex (Order=2, Degree=1)
dx2 dx
dy
+ y 2 = cos x (Order=1, Degree=1)
dx

1.5 Solution of a Differential Equation

This is a function that satisfies the differential equation.

Examples:

1. Show that y1 = e2x and y2 = e−3x are both solutions of the differential equation defined
d2 y dy
by dx 2 + dx − 6y = 0

Solution
d2 y1
y1 = e2x implies dy 1
dx = 2e
2x and
dx2
= 4e2x . Substituting these derivatives in the
given differential equation yields
4e2x + 2e2x − 6e2x = 0
∴ y1 is a solution.

Similarly,
d2 y2
y2 = e−3x implies dydx = −3e
2 −3x and
dx2
= 9e−3x . Substituting yields
9e−3x − 3e−3x − 6e−3x = 0
∴ y2 is a solution.

Note that if y1 , y2 , ..., yn are each solution to a differential equation then their linear com-
bination is also a solution to the differential equation.
i.e., y = α1 y1 + α2 y2 + ... + αn yn where αi , i = 1, 2, 3, ..., n are constants.
For instance, y = α1 e2x + α2 e−3x is also a solution to the above differential equation.

2. Show that the functions beside the ODEs ore their solutions
d2 y
(a) dx2
+ y = 0; y = cos x

d2 y dy
(b) dx2
+ 4 dx + 13y = 0; y = e−2x (cos 3x + sin 3x)

[hint : ye2x = (cos 3x + sin 3x)


e2x (2y + y 0 ) = −3 sin 3x + 3 cos 3x
e2x (4y + 4y 0 + y 00 ) = −9ye2x ]

3
2 ORIGIN/FORMATION OF ODEs

2.1 Geometry

Example: 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
4y dy
slope = lim =
4x→0 4x dx
dy
⇒ dx = 2 (x + y)

2.2 From real life situations

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

Solution
Let z kg be converted at time t
Unconverted milk = (30 − z)
rate = dz dz
dt ∝ (30 − z) ⇒ dt = k(30 − z)

2.3 Elimination of essential arbitrary constants from primitives

Definition: Arbitrary constant


This is undefined constant in a function.
For instance, consider the equation

y = α1 x2 + α2 x2 + α3 x + 4 (3)

Then 3 and 4 in equation (3) are defined constants while α1 , α2 and α3 are undefined constants
- they are arbitrary constants.

Definition: Essential arbitrary constants


These are arbitrary constants which cannot be reduced to a lower number of the
constants. For instance, equation (3) can be written as

y = (α1 + α2 )x2 + α3 x + 4 ⇒ y = α4 x2 + α3 x + 4 (i)


The number of arbitrary constants in equation (3) are 3 hence they are not essential since they
can be reduced to 2 arbitrary constants as in equation (i)

Definition: Primitive
This is a function with essential arbitrary constants. eg equation (3).

Note that to obtain a differential equation from a primitive, we differentiate the primitive a num-
ber of times equal to the number of essential arbitrary constants then manipulate algebraically
the derivatives to eliminate the constants.

4
A primitive involving n essential arbitrary constants gives rise to a differential equation of order
n, free of arbitrary constants.

Examples: Form a differential equation from the primitives defined by


(a) y = c1 x2 + c2 x

Solution:
Since we have two essential arbitrary constants, we differentiate the equation 2 times.
dy d2 y
y = c1 x2 + c2 x ⇒ = 2c1 x + c2 and = 2c1
dx dx2
1 d2 y dy dy d2 y
⇒ c1 = and c2 = − 2c1 x ⇒ c2 = − x
2 dx2 dx dx dx2
Substituting in the primitive yields
!
x2 d2 y dy d2 y d2 y dy
y= + x − x ⇒ x2 − 2x + 2y = 0
2 dx2 dx dx2 dx 2 dx

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

Solution:
Since we have two essential arbitrary constants, we differentiate the equation 2 times.
y = A cos 2x + B sin 2x ⇒ y 0 = −2A sin 2x + 2B cos 2x and y 00 = −4 (A cos 2x + B sin 2x)
d2 y
⇒ y 00 = −4y ⇒ + 4y = 0
dx2

(c) y = Ae2x + Be−3x

Solution:
Since we have two essential arbitrary constants, we differentiate the equation 2 times.
y = Ae2x + Be−3x ⇒ y 0 = 2Ae2x − 3Be−3x and y 00 = 4Ae2x + 9Be−3x

Ae2x + Be−3x − y = 0
2Ae2x − 3Be−3x − y 0 = 0
4Ae2x + 9Be−3x − y 00 = 0
The above equations is a homogeneous system of equations in A and B and to obtain a
non-trivial solution (ie for A 6= 0 and B 6= 0), the determinant of the coefficient matrix
should be equal to zero. That is,

e2x
e−3x −y
2x
−3e −3x −y 0 = 0
2e

9e−3x −y 00
2x
4e

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

⇒ y 00 + y 0 − 6y = 0

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

Solution:
Since we have two essential arbitrary constants, we differentiate the equation 2 times.

ye−2x = A cos x + B sin x ⇒ e−2x [y 0 − 2y] = −A sin x + B cos x


and e−2x [y 00 − 2y 0 − 2y 0 + 4y] = −(A cos x + B sin x)
⇒ e−2x [y 00 − 4y 0 + 4y] = −ye−2x
⇒ y 00 − 4y 0 + 5y = 0

(e) y = Ae2x + Bex + C, answer: y 000 − 3y 00 + 2y 0 = 0

(f) y = A sin(4x + B) + Ce3x , answer: y 000 − 3y 00 + 16y 0 − 48y = 0

3 ODEs OF FIRST ORDER AND FIRST DEGREE


A differential equation of first order, first degree takes the form of

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

Equation (4) can be categorized into 5 groups as follows

1. Equation with separable variables


2. Homogeneous equation of first order
3. Exact differential equation
4. Linear differential equation of first order
5. Bernoulli’s Equation

3.1 Equations with separable variables

If equation (4) can be rearranged to take the form of A(x)dx + B(y)dy = 0, then equation (4)
is said to be with separable variables and the solution is obtained by integrating directly ie
Z Z
A(x)dx + B(y)dy = C

where C is a constant of integration.

Examples: 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
Z Z Z
dx + dy = 0 ⇒ − ln | cos x| − ln | cos y| = − ln |C| ⇒ cos x cos y = C
cos x cos y

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


R x2 +1 y
Dividing through by (x + 1)(y 2 + 1) and integrating we get
R R
x+1 dx + y 2 +1
dy = 0
x2 +1 2
But x+1 = (x − 1) + x+1 so we have

2 y
Z Z Z Z
(x − 1)dx + dx + 2
dy = 0
x+1 y +1

x2 1
⇒ − x + 2 ln |x + 1| + ln |y 2 + 1| = C
2 2

Equations reducible to equations with separable variables


Consider equation (4) such that the functions of x and y in both M and N are scalar multiples
of each other, then equation (4) can be reduced to an equation with separable variables.

Examples: Solve the following differential equations

(a) (x + 2y + 1)dx + [3(x + 2y) + 5]dy = 0

Solution:
Let u = x + 2y ⇒ du = dx + 2dy ⇒ dy = 12 (du − dx)
Substituting yields (u + 1)dx + 3u+5
2 R (du −Rdx) = 0 ⇒ (−u − 3)dx + (3u + 5)du = 0
Rearranging and integrating we get dx − 3u+5
R
u+3 du = 0
3u+5 4
But u+3 = 3 − u+3 so we have

4
Z Z Z Z
dx − 3du + du = 0
u+3

⇒ x − 3u + 4 ln |u + 3| = C1

⇒ x − 3(x + 2y) + 4 ln |x + 2y + 3| = C1

⇒ x + 3y − 2 ln |x + 2y + 3| = C

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

Solution:
dy
dx = sin(x + y) ⇒ sin(x + y)dx − dy = 0
Let u = x + y ⇒ du = dx + dy ⇒ dy = du − dx
Substituting yields sin udx − (du − dx) = 0 R ⇒ 1 + sinRudx − du = 0
R du
Rearranging and integrating we get dx − 1+sin u = 0
Here we use t substitution by letting t = tan( 2 ) ⇒ dt = 12 sec2 ( u2 )du
u

7
Consider the following diagram


1 + t2
t
u
2
u u u u 2t
     
1 sin u = sin + = 2 sin cos =
2 2 2 2 1 + t2
2dt 2dt 2dt
du = u = u =
1 + tan2
 
2
sec 2 1 + t2
2
2dt
du 1+t2 2dt 2dt
2t = 2t = t2 + 2t + 1 =
(t + 1)2
1 + 1+t2 1 + 1+t2
du 2dt
Z Z Z Z Z Z
∴ dx − = 0 ⇒ dx − = 0
1 + sin u (t + 1)2
2
[hint:put w = t + 1] ⇒ x + = C
t+1
2
Back substitution yields x + u
 = C
tan 2 +1
2
⇒x+   = C
x+y
tan 2 +1

dy
(c) dx = sin(x + y) + cos(x + y), answer:putting u = x + y yields y = 2 tan−1 (Cex − 1) − x

3.2 Homogeneous equations of first order

A function f (x, y) is said to be homogeneous of nth degree iff for any λ ∈ R

f (λx, λy) = λn f (x, y)

eg

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 i.e. degree of homogeneity is 3.


Note that if the sum of the powers of each term is the same then the function is said to be
homogeneous.

Equation (4) is said to be homogeneous iff both M and N are homogeneous and of the same
degree. If equation (4) is homogeneous then the substitution

y = ux ⇒ dy = udx + xdu

8
reduces equation (4) to an equation with separable variables as follows
Putting y = ux and dy = udx + xdu in equation (4) yields

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

⇒ xn M (u)dx + xn N (u)[udx + xdu] = 0, x 6= 0

⇒ [M (u) + uN (u)]dx + xN (u)du = 0

dx N (u)du
⇒ + = 0
x M (u) + uN (u)
dx N (u)du
Z Z Z
⇒ + = 0
x M (u) + uN (u)
N (u)du
Z
⇒ ln x + = C
M (u) + uN (u)

Examples: Solve the following differential equations

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

Solution:
First,test for homogeneity
M (x, y) = x − 2y ⇒ M (λx, λy) = λx − 2(λy) = λ(x − 2y) = λM (x, y) which is homoge-
neous of degree 1
Similarly, N (x, y) = x ⇒ N (λx, λy) = (λx) = λ(x) = λN (x, y) which is homogeneous of
degree 1
∴ degree of homogeneity is 1

Next,
Let y = ux ⇒ dy = udx + xdu. Substituting in the given equation we get

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

dx du
Z Z Z
⇒ (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)

p 
(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 yields

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

dy x+y−2
(c) dx = x−y+2

Solution:
dv x+v
Put v = y − 2 ⇒ dv = dy. Substituting yields dx = x−v ⇒ (x − v)dv − (x + v)dx = 0
Clearly, this equation is homogeneous of degree 1
Next,
Let v = ux ⇒ dv = udx + xdu. Substituting yields

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


dx u−1
Z Z Z
2
(u + 1)dx + x(u − 1)du = 0 ⇒ + du = 0
x u2 + 1
u 1 1
Z Z Z
⇒ ln |x| + 2
du − 2
du = ln |C|, [hint:put u = tan θ in 2
du]
u +1 u +1 u +1
1
⇒ ln |x| + ln |u2 + 1| − tan−1 u = − ln |C|
2
 s 
v2 v
⇒ ln Cx 2
+ 1 = tan−1
x x

y−2
 q 
⇒ ln C (y − 2)2 + x2 = tan−1
x
y−2 q  
⇒ = tan ln C (y − 2)2 + x2
x

3.3 Exact Differential Equations

Consider equation (4) above. Then if a function

φ(x, y) = C

10
may be found such that the total differential equation of φ is equal to the LHS of equation (4)
i.e.

dφ = M (x, y)dx + N (x, y)dy

∂φ ∂φ
But from differential Calculus, dφ = dx + dy
∂x ∂y
∂φ ∂φ
so we have, dx + dy = M (x, y)dx + N (x, y)dy
∂x ∂y
∂φ ∂φ
⇒ M (x, y) = , and N (x, y) =
∂x ∂y

∂M ∂2φ ∂N ∂2φ
⇒ = , and =
∂y ∂y∂x ∂x ∂x∂y

∂2φ ∂2φ
also from differential Calculus we have, =
∂y∂x ∂x∂y
∂M ∂N
∴ = (5)
∂y ∂x

Equation (5) is the condition for exactness of a differential equation.

∂φ
Z Z
From, = M (x, y) ⇒ ∂φ = M (x, y)∂x
∂x

⇒ φ(x, y) =
R
M (x, y)dx + g(y)
(6)

Equation (6) is the solution of (4) so long as g(y) is determined as follows

∂φ ∂
Z
= M (x, y)dx + g 0 (y)
∂y ∂y
∂φ
but, = N (x, y)
∂y

Z
⇒ M (x, y)dx + g 0 (y) = N (x, y)
∂y

Examples: Solve the following differential equations

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

Solution:
First,test for exactness
M (x, y) = x3 + x tan y ⇒ ∂M 2
∂y = x sec y
N (x, y) = y ln y + 12 x2 sec2 y ⇒ ∂N 2
∂x = x sec y
∂M ∂N
⇒ ∂y = ∂x ∴ the differential equation is exact

Next,

11
There exists a function φ(x, y) such that dφ = M dx + N dy

∂φ ∂φ 1
i.e. dx + dy = (x3 + x tan y)dx + (y ln y + x2 sec2 y)dy (7)
∂x ∂y 2
∂φ
Z
⇒ = x3 + x tan y ⇒ φ(x, y) = (x3 + x tan y)dx + g(y)
∂x

x4
⇒ φ(x, y) = 4 + 21 x2 tan y + g(y)

∂φ 1
Differentiating partially wrt y yields = x2 sec2 y + g 0 (y)
∂y 2
∂φ 1
but from (7) we have = y ln y + x2 sec2 y
∂y 2
1 1
⇒ x2 sec2 y + g 0 (y) = y ln y + x2 sec2 y
2 2
Z
⇒ g 0 (y) = y ln y ⇒ g (y) = y ln ydy + C, [hint:put u = ln y, dv = ydy]

1 1
 
integration by parts yields g(y) = y 2 ln y − +C
2 2
1 1 1 1
 
∴ the solution to the given eqn is φ(x, y) = x4 + x2 tan y + y 2 ln y − +C
4 2 2 2

(b) (2xy + cos y)dx + (x2 − x sin y)dy = 0, answer: φ(x, y) = x2 y + x cos y + C

3.4 Linear Differential Equations of first order

Consider equation (4) above. Suppose equation (4) can be re-written to take the form of

dy
+ P 0 (x)y = Q(x) (8)
dx
Then equation (8) is said to be linear in y.

Let y be a differentiable function of x then

d[eP (x) y] P (x) dy


 
0 P (x)
= + P (x)e y (9)
dx dx
R
P 0 (x)dx
Multiplying equation (8) by the Integrating Factor, given by I.F = e = eP (x) , we
have
P (x) dy
 
+ P 0 (x)eP (x) y = eP (x) Q(x) (10)
dx
From equations (9) and (10) we have

d[eP (x) y]
= eP (x) Q(x) ⇒ d[eP (x) y] = eP (x) Q(x)dx
dx

12
Integrating both sides we have
Z
eP (x) y = eP (x) Q(x)dx + C

⇒ y = e−P (x) eP (x) Q(x)dx + Ce−P (x)


R

which is the general solution of a linear differential equation.

Examples: Solve the following differential equation(s)

(a) (y + x3 )dx − xdy = 0

Solution:

dy 1
(y + x3 )dx − xdy = 0 ⇒ − y = x2 (∗)
dx x
1 1 1
Z
⇒ P 0 (x) = − ⇒ P (x) = − dx = ln
x x x
1 1
∴ I.F = eP (x) = eln x =
x
1 1 dy 1
Multiplying equation (∗) by we get − 2y = x
x x dx x
y
d y 1
Z
⇒ x
=x ⇒ = xdx = (x2 + C)
dx x 2

⇒ 2y = x3 + Cx which is the solution

3.5 Bernoulli’s Equation

This equation takes the form of


dy
+ P 0 (x)y = Q(x)y n
dx
where n is a constant. Dividing through by y n we get
dy
y −n + P 0 (x)y 1−n = Q(x) (11)
dx
dy 1 dz
let z = y 1−n ⇒ dz = (1 − n)y −n dy ⇒ y −n =
dx 1 − n dx
1 dz
substituting in eqn (11) we get + P 0 (x)z = Q(x)
1 − n dx
dz
⇒ + (1 − n)P 0 (x)u = (1 − n)Q(x), which is linear in z
dx

Examples: Solve the following differential equations


dy
(a) dx + y = xy 4

13
Solution:

dy dy
+ y = xy 4 ⇒ y −4 + y −3 = x
dx dx
dy 1 dz
let z = y −3 ⇒ dz = (−3)y −4 dy ⇒ y −4 =−
dx 3 dx
−1 dz dz
so +z =x ⇒ − 3z = −3x, which is linear in z
3 dx dx
R
−3dx
The Integrating factor is e = e−3x . Multiplying through by e−3x we get

dz d(ze−3x )
e−3x − 3e−3x z = −3xe−3x ⇒ = −3xe−3x
dx dx
Z
⇒ ze−3x = −3 xe−3x dx, [hint: put u = x, dv = e−3x dx]

Integrating by parts and rearranging we get 3z = 3x + 1 + Ce3x

⇒ 3y −3 = 3x + 1 + Ce3x

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

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 =−
dx dx
dz dz
so − + z = sin x + cos x ⇒ − z = −(sin x + cos x), which is linear in z
dx dx
R
The integrating factor is e− dx
= e−x . Multiplying through by e−x we get

dz d(ze−x )
e−x − e−x z = −e−x (sin x + cos x) ⇒ = −e−x (sin x + cos x)
dx dx
Z Z Z 
⇒ ze−x = − e−x (sin x + cos x)dx = − e−x sin xdx + e−x cos xdx

Z Z Z Z
−x −x −x
But i e sin xdx + e cos xdx = e (cos x + i sin x)dx = e(i−1)x dx = I

−1 (i−1)x e−x e−x


⇒I= e +C =− (1 + i)eix + C = − (1 + i)(cos x + i sin x) + C
1−i 2 2
e−x e−x
⇒ I = −i (cos x + sin x) − (cos x − sin x) + C
2 2
e−x e−x
Z Z
⇒ e−x sin xdx = − (cos x + sin x) + C1 and e−x cos xdx = − (cos x − sin x) + C2
2 2

14
" #
−x e−x e−x
⇒ ze =− − (cos x + sin x) + C1 − (cos x − sin x) + C2 = e−x cos x + C
2 2
⇒ z = − cos x + Cex ⇒ y −1 = cos x + Cex

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

4 APPLICATIONS OF ODEs

4.1 In Geometry

Example: 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
dx = 2(x + y) ⇒ dx − 2y = 2x which is linear in y. Solving it yields y = −x − 2 + Ce2x

Orthogonal Trajectories
Let F (x, y) = C be a family of curves. Then if ∃ another family of curves G(x, y) = K such that
they intersect with F (x, y) at 90o then G(x, y) are called orthogonal trajectories.
F (x, y) and G(x, y) are said to be orthogonal trajectories of each other. The product of their
gradients is −1
Suppose the ODE of F (x, y) = C is given by M dx + N dy = 0 then the equation for for the
orthogonal trajectories of F (x, y) will be given by M dy − N dx = 0

Examples:

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

(a) x + y = C

Solution:
x + y = C ⇒ dx + dy = 0 which is the equation for the family of curves. The equation
for the orthogonal trajectories is dy − dx = 0. Integrating yields y − x = K

x
(b) y = C+x

Solution:
x
y = C+x ⇒ xy (1 − y) = C ⇒ (y 2 − y)dx + xdy = 0 which is the equation for the family
of curves. The equation for the orthogonal trajectories is (y 2 − y)dy − xdx = 0. Integrating
yields 2y 3 − 3y 2 − 3x2 = K

(c) x2 + y 2 = C

Solution:
x2 + y 2 = C ⇒ 2xdx + 2ydy = 0 ⇒ xdx + ydy = 0 which is the equation for the family
of curves. The equation for the orthogonal trajectories is xdy − ydx = 0. Integrating yields
ln y − ln x = ln K ⇒ xy = K

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

Solution:
2
The family of curves is y 2 = 4Cx ⇒ yx = 4C. Differentiating we get the equation for
the family of curves as ydx − 2xdy = 0. The equation for the orthogonal trajectories is
ydy + 2xdx = 0. Integrating yields y 2 + 2x2 = K

4.2 In Real life situations

Examples:

1. 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 and the room temperature be To
Then Newton’s law of cooling becomes
dT dT
∝ (T − To ) ⇒ = k(T − To )
dt dt
dT
where k is a constant of proportionality. Thus we have T −To = kdt. Applying the given
R60 dT R10
conditions we have T −20 = kdt ⇒ [ln(T − 20)]60 10
100 = [kt]0 ⇒ k = 0.1 ln(0.5)
100 0
Also [ln(T − 20)]T100 = [kt]40
0 ⇒ ln(T − 20) − ln(80) = 4 ln(0.5) ⇒ T = 25o C when
t = 40 seconds.

2. The population of Kasipul Kabondo constituency in 1964 and 1970 was 12000 and 18000
respectively. Find the year when the population was 5 13 thousands given that the rate of
growth of the population is directly proportional to the population.

Solution:
dP dP
Let P be the population at time t. Then we have dt = kP ⇒ P = kdt. Applying the
R18 dP 1970
R 1
given conditions we have P = kdt ⇒k= 6 ln(1.5)
12 1964
5 31
R dP Rt
Also P = kdt ⇒ t = 1952
12 1964

5 HIGHER ORDER LINEAR ODEs

A linear ODE of nth order takes the form of


dn y dn−1 y dn−2 y d2 y dy
An (x) n
+A n−1 (x) n−1
+An−2 (x) n−2
+· · ·+A 2 (x) 2
+A1 (x) +A0 (x)y = F̃ (x) (12)
dx dx dx dx dx

If F̃ (x) = 0 then equation (12) is said to be homogeneous

16
0
If Ai (x) s are constants ∀i = 0, 1, ..., n then equation (12) is said to be an nth order linear
differential equation with constant coefficients, and it will take the form of

dn y dn−1 y dn−2 y d2 y dy
An n
+ An−1 n−1 + An−2 n−2 + · · · + A2 2 + A1 + A0 y = F̃ (x) (13)
dx dx dx dx dx

d
To solve equation (13) , we define the differential operator D = dx so Dx3 = 3x2 .
Then in terms of the D operator, equation (13) takes the form of
h i
An Dn + An−1 Dn−1 + An−2 Dn−2 + · · · + A2 D2 + A1 D + A0 y = F̃ (x)

⇒ F (D)y = F̃ (x) (14)

The homogeneous equation thus becomes

F (D)y = 0 (15)

5.1 Solution of HOMOGENEOUS Linear Differential Equation (15)

Shift Operator
Let y and eαx be differentiable functions of x.
Then D(eαx y) = eαx (D + α)y i.e. to shift eαx to the LHS of D, shift it but in place of D
substitute (D + α)

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

Also eαx Dy = (D − α)eαx y ie eαx is shifted to the RHS of D. In this case we substitute (D − α)
in place of D

Consider equation (15) then either y = 0 (trivial solution) or

F (D) = 0 (16)

Equation (16) is known as the characteristic equation or the auxiliary equation of the
differential equation.
The solution of y is dependent on the roots of equation (16) and we shall consider a linear
differential equation of order 2. The roots can be

(i) Real and distinct


(ii) Real and equal
(iii) Complex conjugate

We shall consider the 3 cases

CASE 1: When the roots of the auxiliary equation are real and distinct
Let the roots be α and β. Then the solution will take the form of

y = Aeαx + Beβx

17
Proof
If the roots are α and β then the differential equation will take the form of
(D − α)(D − β)y = 0. Pre-multiplying by e−αx we have

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 we have

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 though by eβx and letting A1 (α − β)−1 = A we get

y = Aeαx + Beβx

Examples: Solve the following differential equations


d2 y dy
(a) dx2
− 5 dx + 6y = 0

Solution:
In terms of the D operator the equation becomes (D2 − 5D + 6)y = 0
The auxiliary equation is D2 − 5D + 6 = 0 and so the roots are α = 2 and β = 3
Thus, the solution is y = Ae2x + Be3x

d y 2 dy
(b) 2 dx2 − dx − 10y = 0

Solution:
In terms of the D operator the equation becomes (2D2 − D − 10)y = 0
5
The auxiliary equation is 2D2 − D − 10 = 0 and so the roots are α = −2 and β = 2
5
Thus, the solution is y = Ae−2x + Be 2 x

Generalization
Consider equation (15), the linear differential equation of nth order, such that the roots of the
auxiliary equation F (D) = 0 are real and distinct ie the roots are D1 = α1 , D2 = α2 , · · · , Dn =
αn , αi 6= αj for j 6= i
Then the solution will take the form of

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

Example: Solve the following differential equation


d3 y 2
d y dy
(a) dx3
− 2 dx 2 − dx + 2y = 0

18
Solution:
In terms of the D operator the equation becomes (D3 − 2D2 − D + 2)y = 0
The auxiliary equation is D3 − 2D2 − D + 2 = 0 ⇒ (D − 2)(D + 1)(D − 1) = 0 and so
the roots are α1 = 2, α2 = −1 and α3 = 1
Thus, the 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 = α. Then the solution will take the form of

y = (Ax + B)eαx

Proof
Since the roots are real and equal i.e. D1 = D2 = α, then the differential equation will take
the form of
(D − α)2 y = 0. Pre-multiplying by e−αx we have

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)), (D−1 is the Integral Operator)
⇒ e−αx y = D−1 (A) = Ax + B

Multiplying though by eαx we get

y = (Ax + B)eαx

Examples: Solve the following differential equations


d2 y dy
(a) dx2
− 4 dx + 4y = 0

Solution:
In terms of the D operator the equation becomes (D2 − 4D + 4)y = 0
The auxiliary equation is D2 − 4D + 4 = 0 and so the roots are D1 = D2 = 2
Thus, the solution is y = (Ax + B)e2x

d2 y dy
(b) dx2
+ 10 dx + 25y = 0

Solution:
In terms of the D operator the equation becomes (D2 + 10D + 25)y = 0
The auxiliary equation is (D2 + 10D + 25) = 0 and so the roots are D1 = D2 = −5
Thus, the solution is y = (Ax + B)e−5x

Generalization
Consider equation (15), the linear differential equation of nth order, such that the roots of the
auxiliary equation F (D) = 0 are real and equal ie the roots are D1 = D2 = · · · = Dn = α
Then the solution will take the form of

y = (A1 xn−1 + A2 xn−2 + · · · + An−1 x + An )eαx

Example: Solve the following differential equation

19
d3 y 2
d y dy
(a) dx3
− 3 dx 2 + 3 dx − y = 0

Solution:
In terms of the D operator the equation becomes (D3 − 3D2 + 3D − 1)y = 0
The auxiliary equation is D3 − 3D2 + 3D − 1 = 0 ⇒ (D − 1)(D − 1)(D − 1) = 0 and so
the roots are D1 = D2 = D3 = 1
Thus, the 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 D1 = (α + iβ) and D2 = (α − iβ). Then the solution will take the form of

y = (A1 + iA2 )e(α+iβ)x + (B1 + iB2 )e(α−iβ)x

Expanding yields y = eαx [(A1 + iA2 )eiβx + (B1 + iB2 )e−iβx ]


⇒ y = eαx [(A1 + iA2 )(cos βx + i sin βx) + (B1 + iB2 )(cos βx − i sin βx)]

Extracting the real part yields y = eαx [(A1 + B1 ) cos βx + (B2 − A2 ) sin βx]

Letting A1 + B1 = A and B2 − A2 = B then the solution becomes

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

Examples: Solve the following differential equations


d2 y dy
(a) dx2
+ 6 dx + 13y = 0

Solution:
In terms of the D operator the equation becomes (D2 + 6D + 13)y = 0
The auxiliary equation is D2 + 6D + 13 = 0 and so the roots are D1 = −3 + i2 and
D2 = −3 − i2. This implies that α = −3, β = 2
Thus, the solution is y = e−3x (A cos 2x + B sin 2x)

d y 2 dy
(b) 2 dx2 − 8 dx + 25y = 0

Solution:
In terms of the D operator the equation becomes (D2 − 8D + 25)y = 0
The auxiliary equation is D2 −8D +25 = 0 and so the roots are D1 = 4+i3 and D1 = 4−i3.
This implies that α = 4, β = 3
Thus, the solution is y = e4x (A cos 3x + B sin 3x)

5.2 Solution of NON-HOMOGENEOUS Linear Differential Equation (14)

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

1. Complementary Function, yc (x)


2. Particular Integral, yp (x)

The complementary function is obtained from the auxiliary equation F (D) = 0.

20
THE PARTICULAR INTEGRAL (PI)

The particular integral of equation (14) will be given by


1
yp (x) = F̃ (x)
F (D)

We shall consider 9 cases of F̃ (x)

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


In this case, we substitute D with α. Since recall that:

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

Therefore, the particular integral becomes


1 1 αx
yp (x) = eαx = e
F (D) F (α)

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

Solution:
In terms of the D operator the equation becomes (D2 − 3D + 2)y = e−3x
1
⇒ yp (x) = D2 −3D+2 e−3x .
1
Substituting D with −3 yields yp (x) = (−3)2 −3(−3)+2 e−3x
1 −3x
∴ yp (x) = − 20 e

d3 y 2
d y dy x 3x
(b) Find the complete (general) solution of dx3
− 6 dx2 + 12 dx − 8y = e + e

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

The complementary function


The auxiliary equation is D3 − 6D2 + 12D − 8 = 0 and so the roots are D1 = D2 = D3 = 2.
⇒ yc (x) = (Ax2 + Bx + C)e2x

The particular integral


⇒ yp (x) = D3 −6D21+12D−8 (ex + e3x ) = 1
D3 −6D2 +12D−8
ex + 1
D3 −6D2 +12D−8
e3x .

1 1
⇒ yp (x) = (1)3 −6(1)2 +12(1)−8
ex + (3)3 −6(3)2 +12(3)−8
e3x = −ex + e3x .

Therefore, the general solution will be y = yc (x) + yp (x)

CASE 2: When F̃ (x) = cos αx or F̃ (x) = sin αx


In this case, we substitute D2 with −α2 . Since recall that:

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


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

21
Also,

D(sin αx) = α cos αx


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

Therefore, the particular integral becomes


1 1
yp (x) = cos αx = cos αx
F (D) F (−α2 )
or

1 1
yp (x) = sin αx = sin αx
F (D) F (−α2 )
Examples:
d2 y
(a) Find the particular integral of dx2
+ 4y = cos 3x

Solution:
In terms of the D operator the equation becomes (D2 + 4)y = cos 3x
⇒ yp (x) = D21+4 cos 3x.
Substituting D2 with −(3)2 yields yp (x) = −(3)12 +4 cos 3x
∴ yp (x) = − 51 cos 3x

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

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

The complementary function


The auxiliary equation is D2 + 2D + 1 = 0 and so the roots are D1 = D2 = −1.
⇒ yc (x) = (Ax + B)e−x

The particular integral


1
⇒ yp (x) = D2 +2D+1 sin 2x.

1 1
⇒ yp (x) = −(2)2 +2D+1
sin 2x = 2D−3 sin 2x.

We need to introduce a D2 in the denominator. So we multiply by the conjugate.

2D+3 2D+3 2D+3


⇒ yp (x) = (2D−3)(2D+3) sin 2x = 4D2 −9
sin 2x = −4(2)2 −9
sin 2x.

⇒ yp (x) = − 2D+3 1
25 sin 2x = − 25 (4 cos 2x + 3 sin 2x)

Therefore, the complete solution will be 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. Since
recall that:

D2 x = 0
D 3 x2 = 0
⇒ Dk xn = 0 if k > n

22
Furthermore, recall that
1
= 1 + D + D2 + D3 + · · ·
1−D
1
= 1 − D + D2 − D3 + · · ·
1+D
Examples: Find the particular integral of the following ODEs
d2 y dy
(a) dx2
+ 2 dx =x−2

Solution:
In terms of the D operator the equation becomes (D2 + 2D)y = x − 2
1
⇒ yp (x) = D2 +2D (x − 2).

First we have to factor out D.


 
1 D−1 1 x2
⇒ yp (x) = D(D+2) (x − 2) ⇒ yp (x) = D+2 (x − 2) = D+2 2 − 2x .
      
1 1 x2 1 D D2 x2 1 x2 x 1
⇒ yp (x) = 2 1+ D 2 − 2x = 2 1− 2 + 4 + ··· 2 − 2x = 2 2 − 2x − 2 +1+ 4 .
2

1
2x2 − 10x + 5

⇒ yp (x) = 8

d2 y dy
(b) dx2
+ 2 dx +y =x+1

Solution:
In terms of the D operator the equation becomes (D2 + 2D + 1)y = x + 1
1
⇒ yp (x) = D2 +2D+1 (x + 1).

Since we cannot factor out D, so we drop D2 since the degree of the polynomial is 1 and
2 > 1.

1
⇒ yp (x) = 2D+1 (x + 1) = (1 − 2D + · · · ) (x + 1) = x + 1 − 2 = x − 1.

CASE 4: When F̃ (x) = eαx f (x) where f (x) = cos βx, f (x) = sin βx or f (x) is a polyno-
mial
In this case, we use the shift operator
Examples: Find the particular integral of the following ODEs
d2 y dy
(a) dx2
+ 2 dx + y = ex (x + 1)

Solution:
In terms of the D operator the equation becomes (D2 + 2D + 1)y = ex (x + 1)
1
⇒ yp (x) = D2 +2D+1 ex (x + 1).

Shifting ex to the left yields.

1 1
⇒ yp (x) = ex (D+1)2 +2(D+1)+1 (x + 1) = ex D2 +4D+4 (x + 1).

Since we cannot factor out D, so we drop D2 since the degree of the polynomial is 1 and
2 > 1.

23
ex 1 ex ex
⇒ yp (x) = 4 D+1 (x + 1) = 4 [1 − D + · · · ](x + 1) = 4 [x + 1 − 1] = 41 xex .

d2 y dy
(b) dx2
− 2 dx − 3y = ex cos 3x

Solution:
In terms of the D operator the equation becomes (D2 − 2D − 3)y = ex cos 3x
1
⇒ yp (x) = D2 −2D−3 ex cos 3x.

Shifting ex to the left yields.

1
⇒ yp (x) = ex (D+1)2 −2(D+1)−3 (x + 1) = ex D21−4 cos 3x.

We replace D2 with −(3)2 .

⇒ yp (x) = ex −(3)12 −4 cos 3x = − 13


1 x
e cos 3x.

d2 y
 
dy
(c) dx2
+ 3 dx + 2y = e−2x (x + 1), answer: yp (x) = e−2x 1 2
2x + 2x + 2

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


In this case, we use the shift operator
Examples: Find the complete solution of the following ODEs
d2 y dy
(a) dx2
− 2 dx + y = ex

Solution:
In terms of the D operator the equation becomes (D2 − 2D + 1)y = ex

The complementary function


The auxiliary equation is D2 − 2D + 1 = 0 and so the roots are D1 = D2 = 1.
⇒ yc (x) = (Ax + B)ex

The particular integral


1
⇒ yp (x) = D2 −2D+1 ex .

Shifting ex to the left yields.

1
yp (x) = ex (D+1)2 −2(D+1)+1 = ex D12 (1) = ex D−2 1 = ex D−1 x = 12 ex x2 .

Therefore, the complete solution will be y = yc (x) + yp (x)

d2 y dy
(b) dx2
+ 3 dx − 4y = e−4x

Solution:
In terms of the D operator the equation becomes (D2 + 3D − 4)y = e−4x

The complementary function


The auxiliary equation is D2 + 3D − 4 = 0 ⇒ (D + 4)(D − 1) = 0 and so the roots are
D1 = 1, D2 = −4.
⇒ yc (x) = Aex + Be−4x

24
The particular integral
1
⇒ yp (x) = D2 +3D−41 e−4x .

Shifting ex to the left yields.

yp (x) = e−4x (D−4)2 +3(D−4)−4


1
= e−4x D2 −5D
1
(1) = e−4x D−5
1
D−1 (1) = e−4x D−5
1
x.

yp (x) = −e−4x 51 1−1D x = − 51 e−4x [1 + D


5
1 −4x
+ · · · ]x = − 25 e (1 + 5x).
5

Therefore, the general solution will be y = yc (x) + yp (x)

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 which leads us to CASE 1 above.
In case of sin αx we extract the imaginary part and in case of cos αx we extract the real part.
Examples: Find the particular integral of the following ODEs
d2 y
(a) dx2
+ 4y = sin 2x

Solution:
In terms of the D operator the equation becomes (D2 + 4)y = sin 2x
⇒ yp (x) = D21+4 sin 2x = D21+4 ei2x .

Shifting ei2x to the left yields.

1
⇒ yp (x) = ei2x (D+i2)2 +4 (1) = e
i2x 1
D2 +i4D
1
(1) = ei2x D+i4 x = ei2x DD−i4
2 +16 x =
1 i2x
16 e (1 − i4x).

1
⇒ yp (x) = 16 (1 − i4x)(cos 2x + i sin 2x).

1
Extracting the imaginary part we get yp (x) = 16 (sin 2x − 4x cos 2x).

d2 y 1
(b) dx2
+ 9y = cos 3x answer: yp (x) = 36 (6x sin 3x + cos 3x)

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


In this case, we use the following trigonometric identities

1
sin(A ± B) = sin A cos B ± cos A sin B ⇒ sin A cos B = 2 [sin(A + B) + sin(A − B)]
cos(A ± B) = cos A cos B ∓ sin A sin B
sin2 A = 21 (1 − cos 2A)
cos2 A = 12 (1 + cos 2A)

Examples: Find the particular integral of the following ODEs


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

Solution:
1 1
Recall: sin 2x cos 3x = 2 (sin(2x + 3x) + sin(2x − 3x)) = 2 (sin 5x − sin x)

1
In terms of the D operator the equation becomes (D2 + 4)y = 2 (sin 5x − sin x)
 
1 1 1 1 1
⇒ yp (x) = 2 D2 +4 (sin 5x − sin x) = 2 D2 +4
sin 5x − D2 +4
sin x .

25
   
1 1 1
⇒ yp (x) = 2 −(5)2 +4
sin 5x − −(1)2 +4
sin x = − 12 1
21 sin 5x + 13 sin x .

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

Solution:
1
Recall: cos2 x = 2 (1 + cos 2x)

1
In terms of the D operator the equation becomes (D2 + 2D + 1)y = 2 (1 + cos 2x)
 
1 1 1 1 1
⇒ yp (x) = 2 D2 +2D+1 (1 + cos 2x) = 2 D2 +2D+1
(1) + D2 +2D+1
cos 2x
   
1 1 1 1
⇒ yp (x) = 2 1+ −(2)2 +2D+1
cos 2x = 2 1+ 2D−3 cos 2x
     
1 2D+3 1 2D+3 1 1
⇒ yp (x) = 2 1+ 4D2 −9
cos 2x = 2 1+ −4(2)2 −9
cos 2x = 2 1− 25 (2D + 3) cos 2x
 
1 4 3
⇒ yp (x) = 2 1+ 25 sin 2x − 25 cos 2x

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.

Examples: Find the particular integral of the following ODEs


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

Solution:
In terms of the D operator the equation becomes (D2 + 1)y = (x + 1) sin x
⇒ yp (x) = D21+1 (x + 1) sin x = D21+1 (x + 1)eix .

Shifting eix to the left yields.

D −1 2
1
⇒ yp (x) = eix (D+i)2 +1 (x + 1) = e
ix 1
D2 +i2D
(x + 1) = ei2x D+i2 1
(x + 1) = eix D+i2 ( x2 + x)
 
eix 1 x2 eix D D2 2
⇒ yp (x) = i2 1+ D ( 2 + x) = i2 1− i2 + −4 + · · · ( x2 + x).
i2
 
eix x2 eix
+ x + i x+1 1
2x2 + 4x + i2x + i2 − 1

⇒ yp (x) = i2 2 2 − 4 = i8

⇒ yp (x) = − 8i (cos x + i sin x) 2x2 + 4x + i2x + i2 − 1




Extracting the imaginary part we get yp (x) = − 81 (2x2 + 4x − 1) cos x − (2x + 2) sin x .
 

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


In this case, we use two methods to find the particular solution.
1. Method of Variation of parameters
2. Method of Undetermined Coefficients (UC)

1. Method of Variation of parameters


This method is used to find the particular integrals if the complimentary function is known.

Examples: Use variation of parameters to find the particular solution of the following
differential equations

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

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

The complementary function


The auxiliary equation is D2 + 1 = 0 and so the roots are D1 = −i, D2 = i ⇒α=
0, β = 1.
⇒ yc (x) = A cos x + B sin x

The particular integral


By variation of parameters, the constants A and B become variables of x

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


This is a solution to the given differential equation and so in must satisfy the given
differential equation.

⇒ yp0 (x) = −A(x) sin x + B(x) cos x + A0 (x) cos x + B 0 (x) sin x. We then impose the
condition that the sum containing the derivatives should be equal to zero. i.e.

A0 (x) cos x + B 0 (x) sin x = 0 (i)

⇒ yp0 (x) = −A(x) sin x + B(x) cos x

⇒ yp00 (x) = −A(x) cos x − B(x) sin x − A0 (x) sin x + B 0 (x) cos x (∗∗)

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

−A(x) cos x − B(x) sin x − A0 (x) sin x + B 0 (x) cos x + A(x) cos x + B(x) sin x = sec x

⇒ −A0 (x) sin x + B 0 (x) cos x = sec x (ii)

Solving for A0 (x) and B 0 (x) using equations (i) and (ii) we have (by Crammer’s rule)
!" # !
cos x sin x A0 (x) 0
=
− sin x cos x B 0 (x) sec x


0
sin x
sec x cos x
Z
⇒ A0 (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
Z
0
⇒ 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

27
d2 y
(b) dx2
+ 4y = tan 2x

Solution:
In terms of the D operator the equation becomes (D2 + 4)y = tan 2x. We first need to
find the complementary function.

The complementary function


The auxiliary equation is D2 + 4 = 0 and so the roots are D1 = −i2, D2 = i2 ⇒α=
0, β = 2.
⇒ yc (x) = A cos 2x + B sin 2x

The particular integral


By variation of parameters, the constants A and B become variables of x

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


This is a solution to the given differential equation and so in must satisfy the given
differential equation.

⇒ yp0 (x) = −2A(x) sin 2x + 2B(x) cos 2x + A0 (x) cos 2x + B 0 (x) sin 2x. We then impose
the condition that the sum containing the derivatives should be equal to zero. i.e.

A0 (x) cos 2x + B 0 (x) sin 2x = 0 (i)

⇒ yp0 (x) = −2A(x) sin 2x + 2B(x) cos 2x (∗∗)

⇒ yp00 (x) = −4A(x) cos 2x − 4B(x) sin 2x − 2A0 (x) sin 2x + 2B 0 (x) cos 2x (∗ ∗ ∗)

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


yp00 (x) + 4yp (x) = tan 2x i.e

−4A(x) cos 2x−4B(x) sin 2x−2A0 (x) sin 2x+2B 0 (x) cos 2x+4A(x) cos 2x+4B(x) sin 2x =
tan 2x

⇒ −2A0 (x) sin 2x + 2B 0 (x) cos 2x = tan 2x = sin 2x


cos 2x (ii)

Solving for A0 (x) and B 0 (x) using equations (i) and (ii) we have from (i)

A0 (x) = −B 0 (x) cos


sin 2x
2x . Substituting in (ii) yields

2 sin 2x
2B 0 (x) sin 2x 0
cos 2x + 2B (x) cos 2x =
sin 2x
cos 2x ⇒ B 0 (x) = 1
2 2
sin 2x
cos 2x
= 1
2 sin 2x
cos 2x
+cos 2x

1
sin 2xdx = − 41 cos 2x
R
⇒ B(x) = 2

Also, A0 (x) = − 12 sin 2x cos


sin 2x 1
2x = − 2 sin 2x tan 2x

⇒ A(x) = − 12 sin 2x tan 2xdx. Using integration by parts we have,


R

Put u = tan 2x, dv = sin 2xdx ⇒ du = 2 sec2 2xdx, v = − 21 cos 2x


h i h i
dx
⇒ A(x) = − 21 − 12 cos 2x tan 2x + cos 2x sec2 2xdx = − 21 − 12 sin 2x +
R R
cos 2x .

By t substitution we have, put t = tan x ⇒ dt = sec2 xdx = (1+tan2 x)dx = (1+t2 )dx
1−t
and cos 2x = cos2 x − sin2 x = 1+t2

28
h R dt i
⇒ A(x) = − 12 − 21 sin 2x + 1 1
1−t = 4 sin 2x + 2 ln (1 − t). By back substitution we
have

1
A(x) = 4 sin 2x + 21 ln (1 − tan x).

Substituting A(x) and B(x) in equation (∗) yields

1
yp (x) = 2 cos 2x ln (1 − tan x)

d2 y dy 1
(c) dx2
+ 3 dx + 2y = 1+ex

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

The complementary function


The auxiliary equation is D2 + 3D + 2 = 0 and so the roots are D1 = −1, D2 = −2.
⇒ yc (x) = Ae−x + Be−2x

The particular integral


By variation of parameters, the constants A and B become variables of x

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


This is a solution to the given differential equation and so in must satisfy the given
differential equation.

⇒ yp0 (x) = −A(x)e−x − 2B(x)e−2x + A0 (x)e−x + B 0 (x)e−2x . We then impose the


condition that the sum containing the derivatives should be equal to zero. i.e.

A0 (x)e−x + B 0 (x)e−2x = 0 (i)

⇒ yp0 (x) = −A(x)e−x − 2B(x)e−2x (∗∗)

⇒ yp00 (x) = A(x)e−x + 4B(x)e−2x − A0 (x)e−x − 2B 0 (x)e−2x (∗ ∗ ∗)

Substituting equations (∗), (∗∗) and (∗ ∗ ∗) in the given differential equation yields
yp00 (x) + 3yp0 (x) + 2yp (x) = 1+e
1
x i.e

A(x)e−x + 4B(x)e−2x − A0 (x)e−x − 2B 0 (x)e−2x + −3A(x)e−x − 6B(x)e−2x + 2A(x)e−x +


2B(x)e−2x = 1+e
1
x

⇒ −A0 (x)e−x − 2B 0 (x)e−2x = 1


1+ex (ii)

Solving for A0 (x) and B 0 (x) using equations (i) and (ii) we have from (i)

A0 (x) = −B 0 (x)e−x . Substituting in equation (ii) yields


2x ex
B 0 (x)e−2x − 2B 0 (x)e−2x = 1
1+ex ⇒ B 0 (x) = − 1+e
e
x = 1+ex − ex
R  ex 
x dx = ln |1 + ex | − ex
⇒ B(x) = 1+e x − e
x ex ex
Also, A0 (x) = −( 1+e
e x −x = = ln |1 + ex |
R
x − e )e 1+ex ⇒ A(x) = 1+ex dx

29
Substituting A(x) and B(x) in equation (∗) yields

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

2. Method of Undetermined Coefficients (UC)


This method is used to find the particular integrals. We assume yp (x) to be the general
form of the function on the RHS of the given differential equation and determine the values
of the constants by substitution in the whole equation and equating coefficients.
If yp (x) contains a term that is obtainable from the yc (x), then refine the yp (x) by multiply
that term by x (or by x2 if necessary).

Examples: Use the method of UC to solve the following differential equations

d2 y dy
(a) dx2
− 3 dx + 2y = 2x2 + ex + 2xex + 4e3x

Solution:
In terms of the D operator the equation becomes (D2 − 3D + 2)y = 2x2 + ex + 2xex + 4e3x .
We first need to find the complementary function.

The complementary function


The auxiliary equation is D2 − 3D + 2 = 0 and so the roots are D1 = 1, D2 = 2.
⇒ yc (x) = A1 ex + A2 e2x

The particular integral


By UC method, let yp (x) = Ax2 + Bx + C + Eex + Dxex + F e3x . Since ex is contained in
the yc (x), we refine our yp (x) by multiplying ex by x2

⇒ yp (x) = Ax2 + Bx + C + Dxex + Ex2 ex + F e3x (∗).

This is a solution to the given differential equation and so in must satisfy the given differ-
ential equation.

⇒ yp0 (x) = 2Ax + B + Dxex + Dex + Ex2 ex + 2Exex + 3F e3x (∗∗)

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

Substituting equations (∗), (∗∗) and (∗ ∗ ∗) in the given differential equation yields
yp00 (x) − 3yp0 (x) + 2yp (x) = 2x2 + ex + 2xex + 4e3x i.e

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 =

30
1, −2E = 2, 2F = 4

⇒ A = 1, B = 3, C = 72 , D = −3, E = −1, F = 2

Substituting in equation (∗) yields

7
yp (x) = x2 + 3x + 2 − 3xex − x2 ex + 2e3x

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

d2 y dy
(b) dx2
+ 3 dx + 2y = cos x [answer: y = 1
10 (3 sin x + cos x) + Ae−x + Be−2x ]

d2 y dy
(c) dx2
+ 2 dx + y = x2 + 1 [answer: y = x2 − 4x + 7 + (Ax + B)e−x ]

5.3 Linear Differential Equations of Cauchy Type

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


dn y dn−1 y dn−2 y
An (ax + b)n n
+ An−1 (ax + b)n−1 n−1 + An−2 (ax + b)n−2 n−2 + · · ·
dx dx dx
d2y dy
+A2 (ax + b)2 2 + A1 (ax + b) + A0 y = F̃ (x) (17)
dx dx
where Ai ’s are constants ∀i ∈ Z+

d d
To solve equation (17), we make the substitution x = et , Dx = dx , Dt = dt

Theorem
d d
Let x = et , Dx = dx , Dt = dt then,

(i) xDx = Dt
(ii) x2 Dx2 = Dt (Dt − 1)
(iii) x3 Dx3 = Dt (Dt − 1)(Dt − 2)

Proof

dy dy dt dt 1
(i) From the chain rule we have dx = dt dx but x = et ⇒ t = ln x ⇒ dx = x

dy 1 dy dy dy
⇒ dx = x dt ⇒ x dx = dt ⇒ xDx y = Dt y ⇒ xDx = Dt

(ii) x2 Dx2 = x(xDx )Dx = xDt Dx = et Dt Dx = (Dt − 1)et Dx = (Dt − 1)xDx = (Dt − 1)Dt

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

d y dy 2
2
Example: Solve x dx 2 + 2 dx − x y = ln x

Solution:
d2 y dy
The equation can be written as x2 dx 2 + 2x dx − 2y = x ln x which is of the Cauchy type.

31
d
Let Dx = dx then in terms of the D operator the equation becomes (x2 Dx2 + 2xDx − 2)y = x ln x

d d
Let x = et ⇒ t = ln x, xDx = Dt , x2 Dx2 = Dt (Dt − 1) where Dx = dx , Dt = dt

⇒ (x2 Dx2 + 2xDx − 2)y = x ln x ⇒ (Dt (Dt − 1) + 2Dt − 2)y = tet ⇒ (Dt2 + Dt − 2)y = tet

The complementary function


The auxiliary equation is Dt2 + Dt − 2 = 0 and so the roots are Dt1 = 1, Dt2 = −2.

⇒ yc (t) = Aet + Be−2t ⇒ yc (x) = Aeln x + Be−2 ln x = Ax + Bx−2

The particular integral

1 1 1 D−1 et 1
yp (t) = Dt2 +Dt −2
et t = et (Dt +1)2 +(D t +1)−2
t = et D2 +3D t = et Dtt+3 t = 2 Dt +3 t
2
t t

et 1 et Dt Dt2 et 2 2t
yp (t) = 6 1+ Dt t
2 = 6 (1 − 3 + 9 · · · )t2 = 6 (t − 3 + 29 )
3
h i
eln x 2ln x x
yp (x) = 6 ((ln x)
2 − 3 + 29 ) = 6 (ln x)2 − 32 ln x + 2
9

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

6 SYSTEMS OF LINEAR ODEs

Examples:

(a) Solve the simultaneous equations defined by

dy
+ x = e3t
dt
dx
−y = 0
dt
Solution:
In terms of the Dt operator the system becomes

Dt y + x = e3t (i)
Dt x − y = 0 (ii)

We then need to solve for x and y simultaneously as follows. From equation (ii) we have
y = Dt x.

Substituting in equation (i) we get (Dt2 + 1)x = e3t

The complementary function


The auxiliary equation is Dt2 + 1 = 0 and so the roots are Dt1 = −i, Dt2 = i ⇒α=
0, β = 1.

⇒ xc (t) = A cos t + B sin t ⇒ yc (x) = Dt xc (t) = −A sin t + B cos t

32
The particular integral
xp (t) = D21+1 e3t = 321+1 e3t = 1 3t
10 e ⇒ yp (x) = Dt xp (t) = 3 3t
10 e
t

Therefore, the general solution is x = xc (x) + xp (x) and y = yc (x) + yp (x) ie

1 3t 3 3t
x = A cos t + B sin t + 10 e and y = −A sin t + B cos t + 10 e

(b) Solve the following system of equations [answer: x = Aet + Be−3t − 13 t − 11


36 and y =
Aet + Be−3t + 18 t + 12
5
]

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

7 POWER SERIES SOLUTIONS OF LINEAR ODEs

References
[1] Richard Bronson (Fairleigh Dickinson University), Differential Equations, third edition, Schaum’s
Outline Series.

1
Mathematics is fun and beauty

33

Potrebbero piacerti anche