UNIVERSITY OF BOTSWANA
Department of Mathematics
MAT 292 Engineering Mathematics II
LECTURE NOTES BY MR MOETELE
DIFFERENTIAL EQUATION
Denition: A dierential equation is an equation that involves indepen-
dent variable x, dependent variable y and one or more derivatives with
respect to x.
Denition: The order of a dierential equation is given by the high-
est derivative involved in the equation.
Examples
(i) x
dy
dx
+ y = ex [1st order Dierential Equation]
order Dierential Equation]
2
2d y dy
(ii) x − xy = 3x3 [2nd
dx2 dx
(iii)
d3y
3x 3 + 3y = ex
dx
dy
dx
[3rd order Dierential Equation]
SOLVING FIRST ORDER DIFFERENTIAL EQUATION
Method 1: DIRECT INTEGRATION
If the equation can be arranged in the form
dy
= f (x),
dx
1
then the equation can be solved by direct or simple integration.
Example Solve the following dierential equation.
dy
(a) = 3x2 − 6x + 5
dx
Answer: Z
y= (3x2 − 6x + 5)dx
i.e.,
y = x3 − 3x2 + 5x + C
dy
(b) ex = 4, y(0) = 3
dx
Answer: dy
= 4e−x
i.e,
dx
Z
y=4 e−x = −4e−x + C
so that
3 = −4 + C =⇒ C = 7
∴ y = −4e−x + 7
dy
(c) x = 5x3 + 4
dx
Answer: dy 4
= 5x2 +
i.e,
dx x
Z Z
1
y = 5 x2dx + 4 dx
x
so that 5
y = x3 + 4 ln x + C
3
2
Methaod 2: SEPARATION OF VARIABLES
If the dierential equation is of the form
dy
= f (x, y)
dx
and f (x, y) is separable i.e,
f (x, y) = g(x)h(y) . Then
Z Z
dy 1
= g(x)h(y) =⇒ dy = g(x)dx.
dx h(y)
Example Solve the following dierential equation
dy 2x 1
(a) = = (2x)
dx y + 1 y+1
Z Z
=⇒ (y + 1)dy = 2 xdx
i.e., 1 2
y + y = x2 + C.
2
dy
(b) = (1 + x)(1 + y)
dx
i.e., Z
1
Z
dy = (1 + x)dx
1+y
so that, 1
ln(1 + y) = x + x2 + C
2
3
dy y 2 + xy 2 y 2(1 + x)
(c) = =
dx x2y − x2 x2(y − 1)
i.e., Z
y−1
Z
1+x
dy = dx
y2 x2
so that Z
1
Z
1
− y −2 dy = x−2 + dx
y x
i.e., 1 1
ln y + = − + ln x + C
y x
dy x2 + 1
(d) xy =
dx y+1
so that Z Z 2
x +1
y(y + 1)dy = dx
x
and Z Z
1
(y 2 + y)dy = x+ dx
x
i.e., 1 3 1 2 1 2
y + y = x + ln x + C
3 2 2
4
dy
(e) y tan x = (4 + y 2) sec2 x
dx
so that
sec2 x
Z Z
1 2y
dy = dx
2 4 + y2 tan x
and
1
ln(4 + y 2) = ln(tan x) + ln A = ln(A tan x)
2
i.e.,
p
ln( 4 + y 2) = ln(A tan x)
giving us
p
4 + y 2 = A tan x
Method 3: HOMOGENEOUS EQUATIONS
Sometimes we can make the inseparable dierential equation separable
by using substitutions such as y = vx or y = or y = x + v e.t.c.
v
x
Example: Find the solution of the dierential equation
, let y = vx
dy x + 3y
=
dx 2x
Answer: Start by dierentiating the given substitution
dy dv
y = vx =⇒ =v+x
dx dx
Next substitute the result in the dierential equation.
5
dy x + 3y dv x + 3vx
= ⇐⇒ v + x =
dx 2x dx 2x
dv 1 + 3v 1 3v
=⇒ v + x = = +
dx 2 2 2
dv 1 3v 1 1
=⇒ x = + −v = + v
dx 2 2 2 2
=⇒ x
dv 1 + v
dx
=
2
(separable)
Z Z
2 1
=⇒ dv = dx
1+v x
=⇒ 2 ln(1 + v) = ln x + ln A = ln(Ax)
=⇒ (1 + v)2 = Ax
y
=⇒ (1 + )2 = Ax
x
Example: Solve
dy x2 + y 2
= .
dx xy
Answer: dierentiate the given substitution
dy dv
y = vx =⇒ =v+x
dx dx
Now substitute in the equation
dv x2 + v 2x2 x2 + v 2x2 x2(1 + v 2) 1 + v 2
v+x = = = =
dx vx2 vx2 vx2 v
6
dv 1
=⇒ v + x = +v
dx v
dv 1
=⇒ x = separable
Then
dx v
Z Z
1
vdv = dx
x
1 2 y
=⇒ v = ln x + C, y = vx =⇒ v =
2 x
1 y2
=⇒ = ln x + C
2 x2
So that 1 2
y = x2 ln x + Cx2
Use the substitution to solve
2
Example: y = xv
dy y
+ = xy 2, y(2) = 2.
dx x
Answer: Dierentiate the given substitution
y=
v
x
=⇒
dy
dx
v
=− 2+
x
1 dv
x dx
quotient rule
Substitute in the equation
v 1 dv v xv 2
− 2+ + = 2
x x dx x2 x
1 dv v 2
=⇒ =
x dx x
=⇒
dv
= v2 separable
Then
dx
Z Z
1
dv = dx
v2
1 v
=⇒ − = x + C, y = =⇒ v = xy
v x
7
so that 1
− =x+C
xy
=⇒ −1 = x2y + Cxy
The given conditions gives −1 = 8 + 4C =⇒ C = − 49 .
Hence 9
−1 = x2y − xy =⇒ 9xy − 4x2y = 4.
4
Example: Use the substitution
x+y = v to solve the homogeneous
dierential equation
dy
(3x + 3y − 4) = −(x + y)
dx
Answer: Dierentiate the given substitution
dy dv
x + y = v =⇒ y = v − x =⇒ = −1
dx dx
Substitute
dv
(3v − 4) −1 = −v
dx
dv v
=⇒ −1=−
dx 3v − 4
dv v −v + 3v − 4 2v − 4
=⇒ =− +1= =
dx 3v − 4 3v − 4 3v − 4
=⇒
dv 2v − 4
=
dx 3v − 4
separable
Then
long division
Z
3v − 4
Z Z
3 2
dv = dx =⇒ − dv = x + C
2v − 4 2 2v − 4
8
Z
3 2
=⇒ v − dv = x + C
2 2v − 4
=⇒
3
v − ln(2v − 4) = x + C but v =x+y
Hence
2
3
(x + y) = ln(2x + 2y − 4) = x + C
2
Method 4: INTEGRATING FACTOR METHOD
If a dierential equation can be expressed in the form
+ p(x)y = f (x), linear form
dy
dx
then we can apply integrating factor method as follows
Example: Solve
dy
−y =x
Answer:
dx
Z Z
p(x) = −1 =⇒ p(x)dx = −1dx = −x
The integrating factor is R
e p(x)dx
= e−x.
Then, multiply by the integrating factor both sides of linear dierential
equation
dy
e−x − y = xe−x
dx
d
=⇒ (ye−x) = xe−x
So that
dx
ye−x = −xe−x − e−x + C, integration by parts
9
Hence
y = Cex − x − 1.
Example: Solve
dy
+ 3y = sin x
Answer: Here
dx
Z Z
p(x) = 3 =⇒ p(x)dx = 3dx = 3x
And the integrating factor is R
3xdx
e = e3x
Multiply by integrating factor
both sides
dy
e3x + 3y = e3x sin x
dx
d
=⇒ (ye3x) = e3x sin x
So that
dx
Z
ye3x = e3x sin xdx
And
ye3x =
1 3x
10
e (3 sin x − cos x) + C integration by parts
1
∴ y = (3 sin x − cos x) + Ce−3x
Solve
10
Example:
dy
x + y = x3
Answer: Make the equation linear
dx
dy 1
+ y = x2
dx x
Here 1
Z Z
1
p(x) = =⇒ p(x)dx = dx = ln(x)
x x
10
The integrating factor is
eln x = x
Multiply by integrating factor both sides
dy 1
x + y = x3
dx x
So that d
(xy) = x3
dx
And Z
1
xy = x3dx = x4 + C
4
Hence the solution is 1 C
y = x3 +
4 x
Example: Solve
dy
(x + 1) + y = (x + 1)2
dx
Answer: Make the equation linear
dy 1
+ y =x+1
dx x + 1
Here 1
Z Z
1
p(x) = =⇒ p(x)dx = = ln(x + 1)
x+1 x+1
And the integrating factor is
eln(x+1) = x + 1
Multiply both sides of theequation by integrating
factor to get
dy 1
(x + 1) + y = (x + 1)2
dx x + 1
so that Z
d
(y(x + 1)) = (x + 1)2 =⇒ y(x + 1) = (x + 1)2dx
dx
11
And
1
y(x + 1) = (x + 1)3 + C
3
integration by substitution
Hence 1 C
y = (x + 1)2 +
3 x+1
Example: Solve
dy
(1 − x2) − 2xy = 1
Answer: make the equation linear
dx
dy 2x 1
− y =
dx 1 − x2 1 − x2
Here
−2x −2x
Z Z
p(x) = =⇒ p(x)dx = dx = ln(1 − x2)
1 − x2 1−x 2
And the integrating factor is
2
eln(1−x ) = 1 − x2
Multiply both sides of the linear
equation by integrating
factor
dy 2x
(1 − x2) − y =1
dx 1 − x2
So that Z
d
(y(1 − x2)) = 1 =⇒ y(1 − x2) = 1dx = x + C
dx
Hence x C
y= +
1 − x2 1 − x2
Example: Solve
dy
x − 5y = x7
Answer: Make the equation linear
dx
dy 5
− y = x6
dx x
12
Here
−5 −5
Z Z
1
p(x) = =⇒ p(x)dx = dx = −5 ln(x) = ln(x−5) = ln
x x x5
The integrating factor is
1
ln 15
e x =
x5
Multiply both sides
of the equation by integrating
factor
1 dy 5 1 d 1
− y = x6 . =⇒ y. =x
x5 dx x x5 dy x5
And 1
Z
1
y. 5 = xdx = x2 + C
x 2
Hence 1
y = x7 + Cx5
Solve
2
Example:
dy
(1 − x2) − xy = 1
Answer: Make the equation linear
dx
dy x 1
− y =
dx 1 − x2 1 − x2
Here
−x −2x
Z Z
1 1 2
p
p(x) = =⇒ p(x)dx = dx = ln(1−x ) = ln( 1 − x2
1 − x2 2 1−x 2 2
The integrating factor is √ p
ln( 1−x2 )
e = 1 − x2
Multiply both sides by integrating
factor ro
√
get
p dy x 1 − x2
1 − x2 − y =
dx 1 − x2 1 − x2
So that d p 1
(y 1 − x2) = √
dx 1 − x2
13
And p Z
dx
y 1 − x2 = √ = sin−1 x + C
1 − x2
Hence 1 C
y=√ sin−1 x + √
1 − x2 1 − x2
Method 5: BERNOULLI'S EQUATION
If a 1 order dierential equation is non- linear and of the form below, it
st
is called Bernoulli's equation
dy
+ p(x)y = f (x)y n n ̸= 0, 1
dx
Procedure for solving Bernoulli's equations
Step 1: multiply by y −n
dy
y −n + p(x)y 1−n = f (x)
dx
Step 2: multiply by 1 − n
dy
(1 − n)y −n + (1 − n)p(x)y 1−n = (1 − n)f (x)
dx
Step 3: Let
dz dy
z = y 1−n =⇒ = (1 − n)y −n
Then in step 2, we have
dx dx
dz
+ (1 − n)p(x)z = (1 − n)f (x)
dx
This is now linear dierential equation and can be solved using integrat-
ing factor method.
Example: Solve
dy 1
+ y = xy 2
dx x
Step 1: Multiply by y −2
dy 1 −1
y −2 + y =x
dx x
14
Step 2: Multiply by 1 − 2 = −1
dy 1 −1
−1y −2 − y = −x
dx x
Step 3: Let
dz dy
z = y −1 =⇒ = −1y −2
dx dx
Substitute dz 1
− z = −x
dx x
Linear form
Apply integrating factor method. Here
Z Z
1 1 1
p(x) = − =⇒ p(x)dx = − dx = − ln x = ln x−1 = ln
x x x
The integrating factor is
1 1
eln( x ) =
x
Multiply both sides
by integrating
factor
1 dz 1 1 d 1
− z = −x. =⇒ z. = −1
x dx x x dx x
so that 1
Z
z. = −1dx = −x + C
x
And
z = −x2 + Cx
we now have 1
= y −1 = z = −x2 + Cx
y
Hence the solution is 1
y=
Cx − x2
Example: Solve
dy
x2 y − x3 = y 4 cos x
dx
15
Answer: Re-write dy
−x3 + x2y = y 4 cos x
dx
dy 1 y 4 cos x
=⇒ − y=
dx x x3
Step 1: Multiply by y −4
dy 1 −3 cos x
y −4− y = 3
dx x x
Step 2: multiply by 1 − 4 = −3 to get
dy 3 −3 −3 cos x
−3y −4 + y =
dx x x3
Step 3: Let
dz dy
z = y −3 =⇒ = −3y −4
dx dx
substitute dz 3
+ z=
dx x
−3 cos x
x3
linear form
Here 3
Z Z
3
p(x) = =⇒ p(x)dx = dx = 3 ln x = ln(x3)
x x
The integrating factor is 3
eln(x ) = x3
Multiply by integrating factor
dz 3 −3 cos x
x3 + z = x3
dx x x3
d
=⇒ (zx3) = −3 cos x
dxZ
=⇒ zx3 = −3 cos xdx = −3 sin x + C
so that −3 sin x C
y −3 = z = + 3
x3 x
16
Hence − 31
−3 sin x C
y= + 3
x3 x
Example: Solve
dy
y − 2x = x(x + 1)y 3
Answer: Re-write as
dx
dy
−2x + y = x(x + 1)y 3
dx
dy 1 1
=⇒ − y = − (x + 1)y 3
dx 2x 2
Step 1: multiply by y −3
dy 1 1
y −3 − y −2 = − (x + 1)
Step 2: multiply by
dx 2x 2
1 − 3 = −2
dy 1
−2y −3 + y −2 = x + 1
dx x
Step 3: Let
dz dy
z = y −2 =⇒ = −2y −3
substitute
dx dx
dz 1
+ z = x + 1, linear form
Here
dx x
Z Z
1 1
p(x) = =⇒ p(x)dx = dx = ln x
x x
The integrating factor is
eln x = x
multiply by integrating
factor
dz 1
x + z = x(x + 1) = x2 + x
dx x
d
(zx) = x2 + x
dx
17
Z
1 1
=⇒ zx = (x2 + x)dx = x3 + x2 + C
3 2
1 1 C
=⇒ z = x2 + x +
And
3 2 x
−2 2x3 + 3x2 + 6C
y =z=
Hence
6x
3 2
− 21
2x + 3x + 6C
y=
6x
which can be written as
21
6x
y=
2x3 + 3x2 + A
SECOND ORDER DIFFERENTIAL EQUATIONS
Many practical problems in engineering give rise to second order ordi-
nary dierential equations of the form
d2y dy
a 2 + b + cy = f (x)
dx dx
If f (x) = 0, then it is called homogeneous ordinary dierential equation.
If f (x) ̸= 0, then it is called non-homogeneous ordinary dierential equa-
tions.
Solving Homogeneous second order ordinary dierential equations
Given dy 2
dy
a +b + cy = 0
dx2
Step 1: Form an auxillary equation
dx
am2 + bm + c = 0
Step 2: Investigate the roots
18
(i) If the roots are distinct and real, i.e., m =α and m = β. Then, the
solution is
1 2
y = Aeαx + Beβx
(ii) If the roots are equal and real, i.e., m = α. Then, the solution is
y = Aeαx + Bxeαx
(iii) If the roots are complex numbers, i.e., m = α±iβ. Then, the solution
is
y = eαx(A sin βx + B cos βx)
Example: Solve
d2y dy
+ 5 + 6y = 0
dx2
Answer: Step 1: Form an auxillary equation
dx
m2 + 5m + 6 = 0 =⇒ m1 = −3, m2 = −2
i.e., the roots are real and distinct. Then, the solution is
y = Ae−3x + Be−2x
Example: Solve
d2y dy
2 2 + 5 + 6y = 0
Answer: The auxillary equation is
dx dx
√ √
−5 23 −5 23
2m2 + 5m + 6 = =⇒ m = ± =⇒ α = ,β =
4 4 4 4
i.e., the roots are complex numbers. Then, the solution is
√ √
−5 x A cos 23 23
4 4 x+B sin 4 x
y=e
Example: Solve
d2y dy
+ 6 + 9y = 0
dx2
Answer: The auxillary equation is
dx
m2 + 6m + 9 = 0 =⇒ m = −3
19
i.e., the roots are real numbers and equal. Then, the solution is
y = Ae−3x + Bxe−3x
Example: Solve
d2y
+ 16y = 0
Answer: The auxillary equation is
dx2
m2 + 16 =⇒ m = ±4i =⇒ α = 0, β = 4
i.e., the roots are complex numbers. Then the solution is
y = e0x(A cos 4x + B sin 4x) = A cos 4x + B sin 4x
Example: Solve ′′ ′
y − 2y + 10y = 0
Answer: The auxillary equation is
m2 − 2m + 10 = 0 =⇒ m = 1 ± 3i, =⇒ α = 1, β = 3
i.e., the roots are complex numbers. Then, the solution is
y = ex(A cos 3x + B sin 3x)
Example: Solve
d2 y
− 25y = 0
Answer: The auxillary equation is
dx2
m2 − 25 = 0 =⇒ m = 5, m = −5
i.e., the roots are real and distinct. Then, the solution is
y = Ae5x + Be−5x
Example: Solve ′′ ′
y + 2y = 0
Answer: The auxillary equation is
m2 + 2m = 0 =⇒ m = 0, m = −2
i.e., the roots are real and distinct. Then, the solution is
y = Ae0x + Be−2x = A + Be−2x
20