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

DIFFERENTIAL EQUATIONS 1 (MATH 350) NOTES

Dr Chisara Peace Ogbogbo

Contents
First Order D.E. 2

Separable Equations 2

The Rate of Cooling of a Chemical Reaction 5

Solving Linear Equations Using Integrating Factor (I.F) 8

Bernoulli Equations 12

1
First Order D.E.
The method of obtaining the solution of a D.E. depends on the type of D.E. We proceed by considering a first
order D.E. The standard form of a first order D.E. is given as:
dy
= f (x, y)
dx

First order D.E.’s can be classified as follows:


a. Separable Variable equations
b. Linear equations
c. Exact equations
d. Homogeneous equations

Separable Equations
A first order D.E. which can be written in the form
dy
= f (x)g(y) (1)
dx
where f (x) and g(y) are given functions is called a separable equation. i.e. a separable equation is a first order
dy
DE in which the expression for dx can be factored as a function of x times a function of y; f (x)g(y)
The following equations are examples of separable equations:

dy
1. = 2xy 2
dx
dy
2. y −1 = (x + 1)−1
dx
dy
3. (3y 2 + ey ) = cosx
dx
From equation 1, we have, for separable equation,
1 dy
= f (x)
g(y) dx

Integrating on both sides w.r.t x, we have


Z Z
1 dy
dx = f (x)dx
g(y) dx
Z Z
dy
Thus = f (x)dx
g(y)

Examples

1. Solve the D.E.


dy 1+y
=
dx 2+x

Solution
rhs can be written in separable form.
Comparing with equation 1,

2 Chisara P. Ogbogbo
1
f (x) = 2+x and g(y) = 1 + y
Separating the variables, we have
1 dy 1
=
1 + y dx 2+x
Integrating, we have
Z Z
dy dx
=
1+y 2+x
Hence, ln (1 + y) = ln (2 + x) + C
= ln (2 + x) + ln A where C = ln A is a constant
ln (1 + y) = ln A(2 + x)
1 + y = A(2 + x)
y = A(2 + x) − 1, where A is an arbitrary constant

2. Solve the D.E.


dy
= 2xy 2
dx
Solution
The equation is separable with f (x) = 2x and g(y) = y 2
Separating the variables and integrating, we have
dy
y −2 = 2x
Z dx Z
and y −2 dy = 2xdx
−1
= x2 + c
y
1
−x2 − c =
y
1
y=− 2
x +c
Generally, if a D.E. can be arranged in the form g(y)dy = h(x)dx, the equation is called a separable variable equation
and it is solved by integrating directly.
A first order D.E. y ′ = f (x, y) is called a separable equation if the function f (x, y) can be factored into the
product of the two functions of x and y. f (x, y) = h(x)g(y). h(x) and g(y) are continuous functions,i.e.
dy
= h(x)g(y)
dx
dy
⇒ = h(x)dx
g(y)

We make sure that g(y) ̸= 0


1
If ∃ a number x0 such that g(x0 ) = 0, then this number will also be a solution of the D.E. If we denote g(y)
by q(y), we can write the equation in the form

q(y)dy = h(x)dx

We can now integrate the equation


Z Z
q(y)dy = h(x)dx + c

Q(y) = H(x) + c

3 Chisara P. Ogbogbo
Example N1

Solve the D.E.


dy
= y(y + 2)
dx
Solution

Now, h(x) = 1, g(y) = y(y + 2)


Divide the D.E. by g(y) and move d(x) to rhs and multiply both sides by dx

dy
= dx
y(y + 2)
dy
There are values of y for which g(y) = 0: y = 0 and y = −2. These are also solutions. For y = 0, dx =0
dy
Also, for y = −2, dx =0
Now,
Z Z
dy
= dx + c
y(y + 2)

We integrate by partial fractions (fractional decomposition)


1 A B
= +
y(y + 2) y y+2
1 A(y + 2) + By
=
y(y + 2) y(y + 2)
1 ≡ Ay + 2A + By
1 ≡ (A + B)y + 2A
A+B =0
2A = 1
1 1
A= and B = −
2 2
Hence,
 
1 1 1 1
= −
y(y + 2) 2 y y+2

So,
Z   Z
1 1 1
− dy = dx + c
2 y y+2
1
[ln|y| − ln|y + 2|] = x + c
2
1 y
ln =x+c
2 y+2
y
ln = 2x + 2c
y+2

Now, let 2c = c1 . Then the final solution of the equation is as follows:

y
ln = 2x + c1
y+2
y = 0, y = −2

4 Chisara P. Ogbogbo
Example N2

Solve the D.E.: (x2 + 4)y ′ = 2xy

Solution

We can rewrite the equation as follows:


(x2 + 4)dy = 2xydx
Dividing through by (x2 + 4)y, we have
dy 2xdx
= 2 (2)
y x +4
x2 + 4 ̸= 0 ∀ real values of x
We check if y = 0 is a solution
For y = 0 ; dy = 0
Substitute y = 0 into the equation, we see that the function y = 0 is one of the solutions of the equation.
We integrate equation 2, recall the method of substitution.
For the rhs of equation 2, we let u = x2 + 4 and so du = 2xdx

Z Z
2x du
dx = = ln|u| = ln(x2 + 4)
x2 + 4 u

We now have
ln|y| = ln(x2 + 4) + c
let c = lnc1 , c1 > 0
ln|y| = ln(x2 + 4) + lnc1
ln|y| = ln(c1 (x2 + 4)) ⇒ y = c1 [x2 + 4]

The Rate of Cooling of a Chemical Reaction


Newton’s Law of Cooling

If a body cools in a surrounding medium, it might be expected that the rate of change of the temperature
of the body would depend on the difference between the temperature of the body and that of the surrounding
medium.
Newton’s law of cooling asserts that the rate of change is directly proportional to the difference of the tem-
perature. Thus, if u(t) is the temperature of the body at a time, t, and u0 is the constant temperature of the
surrounding medium, then
du
= −k(u(t) − u0 ), where k is a positive constant (3)
dt
The negative sign at rhs of equation 3 occurs because du
dt will be negative when u > u0 , that is, when the body
is expected to cool down from high temperature to that of the surrounding environment.

Example N3

Solve the D.E.


dy
= ky
dt

5 Chisara P. Ogbogbo
This equation is separable as
dy
= k ; Integrating, we have
y
Z Z
dy
= k dt
y
ln|y| = kt + c
taking exponential on both sides, we have
|y| = ekt+c = ec ekt
y = Cekt , putting ec as one constant C

Example N4

Class to solve
dy
(x + 1) = 2y
dx

More examples of separable D.E.

Example N5

Find the general solution of the given D.E.


dy
= 2e−y
dx
‘ Solution

dy
−y
= 2dx ⇒ ey dy = 2dx
Z e Z
So, ey dy = 2 dx

⇒ ey = 2x + c
taking log on both sides, y = ln|2x + c|

Example N6

dy x2 + 6x + 3
=
dx y2
Solution

Z Z
y 2 dy = (x2 + 6x + 3) dx

y3 x3
= + 3x2 + 3x + c
3 3
y 3 = x3 + 9x2 + 9x + 3c
p
3
∴ y = x3 + 9x2 + 9x + 3c

6 Chisara P. Ogbogbo
Example N7

y2 + 4 4 + y2
  
dy 1
= =
dx 2xy 2y x
Z Z
2y 1
So, 2
dy = dx
4+y x
Integral on the lhs can be obtained using technique of substitution

Z
2y
dy ; let u = y 2 + 4
+4 y2
du = 2ydy
Z Z
2y du
Hence, dy = = ln|u| = ln |y 2 + 4|
y2 + 4 u
∴ ln |y 2 + 4| = lnx + c = lnx + lnc

taking exp on both sides


2
y 2 + 4 = eln|y +4|
= elnx+lnc = elnx .elnc

y 2 + 4 = cx ⇒ y = cx − 4

Example N8

Solve the initial value problem


dy
= (x3 + 1)y 2 ; y = 1 whenever x = 2
dx

Solution

Z Z
dy
= (x3 + 1) dx
y2
Z Z
−2
y dy = (x3 + 1) dx

x4
−y −1 = +x+c
4
4
1 x
− = +x+c
y 4
1 x4 + 4x + 4c
− =
y 4
Applying the initial condition y(2) = 1,
1 24
−= +2+c
1 4
⇒ −1 = 4 + 2 + c
6 + c = −1
c = −7
4
∴ y=−
x4 + 4x − 28

7 Chisara P. Ogbogbo
Example

Suppose that an object is heated to 300o F and allowed to cool to a room temperature of 80o F . If after
10 minutes, the temperature is 250o F , what will its temperature be after 20 minutes?

Solution

From equation 3,
du
= −k(u − 80) (4)
dt
and the initial conditions are u(0) = 300 and u(10) = 250
Equation 4 is linear and separable. To determine the constant k, we have
Z 250 Z 10
du
= −k dt (5)
300 u − 80 0

Z 300 Z 10
du
− = −k dt
250 u − 80 0
300 10
ln |u − 80| = kt
250 0
ln |300 − 80| − ln|250 − 80| = 10k
ln |220| − ln |170| = 10k
 
220
ln = 10k
170
 
1 220
∴ k= ln
10 170
= 0.0258

To determine the temperature u(t) of the body when t = 20, we use either equation 4 or equation 5 to write
Z u Z 20
du
= −k dt
300 u − 80 0

evaluating the integrals, we have


u 20
ln|u − 80| = −kt
300 0
ln|u − 80| − ln|300 − 80| = −20k
 
u − 80
ln = −20k
220
Taking exponential on both sides, we obtain
u − 80
= e−20k
220
u = 220e−20k + 80
= 220e−20(0.0258) + 80
u = 212o F

8 Chisara P. Ogbogbo
Solving Linear Equations Using Integrating Factor (I.F)
A first order linear equation is an equation that can be put in the form

dy
+ P (x)y = Q(x)
dx
P and Q are constants or continuous functions of x on the interval. Without going into details of how the IF
is derived, we will define it and give an expression for it. An example of this type is the following:

xy ′ + y = 5x (6)

For x ̸= 0 we can put this equation in the form


dy
+ P (x)y = Q(x) (7)
dx
by dividing through by x to obtain
y
y′ +
=5 (8)
x
Notice that Equation 6 i.e. Equation 8 is not separable i.e. we cannot put Equation 6 or Equation 8 in the
form y ′ = f (x)g(x).
We solve this type using I.F. which we use to multiply equation in the form of Equation 7.
Generally, to solve the linear D.E.
y ′ + P (x)y = Q(x)
We multiply both sides of the equation by the integrating factor (I.F.) given as
R
P (x) dx
I.F. = e

and then integrate both sides.


Integrating factor (I.F.) is that quantity so that when you multiply lhs of Equation 7 with it, we obtain the
derivative of the product IF (y) i.e.
d
IF (lhs) = (IF.y)′ = (IF.y)
dx
We assert that

d
IF × lhs = (IF.y)′ = (IF.y)
dx
R
P (x)dx
For IF given as e , we demonstrate taking derivative of IF.y
d R P (x)dx d R P (x)dx dy R P (x)dx
(e .y) = e .y + e
dx dx dx
R dy R P (x)dx
= ye P (x)dx .P (x) + e
 dx 
R dy
= e P (x)dx yP (x) +
dx

d R P (x)dx R
e y = e P (x)dx Q(x) (9)
dx
But Q(x) = lhs R
d P (x)dx
So we started with dx (IF y) and ended up with e × (lhs) as expected

9 Chisara P. Ogbogbo
Integrating Equation 9, we have

Z Z
d R P (x)dx R
P (x)dx
e y= e Q(x)dx + c
dx
R
Z R
P (x)dx P (x)dx
ye = e Q(x)dx + c
R
P (x)dx
R
e Q(x)dx +c
∴y= R
e (x)dx
P
Z 
R R
− P (x)dx P (x)dx
y=e e Q(x)dx + c

Steps in solving a linear D.E. using IF are given as follows:


(1) Write the equation in the form
dy
+ P (x)y = Q(x)
dx
(2) Identify P (x) and Q(x) R
(3) Integrate P (x) w.r.t x, and write the IF as e P (x)dx
(4) Write the solution as Z
R R
P (x)dx P (x)dx
ye = e Q(x)dx + c

(5) Make y the subject of the formula, if possible

Examples

(a) Solve

y ′ + 2xy = 1

This is in the standard form of Equation 7 where Q(x) = 1 and P (x) = 2x

2
R R
P (x) dx 2x dx
∴ IF = e =e = ex
2
Then, by ex , we get
2 2 2
y ′ ex + 2xyex = ex
2 2
such that (ex y)′ = ex
Integrating on both sides, we have
Z
x2 2
e y = ex dx + c

Z
1 2 2
y = x2 ex dx + ce−x
e
Z
2 2 2
y = e−x ex dx + ce−x

(b) Initial Value Case

Solve the initial value problem

x2 y ′ + xy = 1 x>0 y(1) = 2

10 Chisara P. Ogbogbo
Solution

We put this in standard form as Equation 7, by dividing through by x2


1 1 1 1
y′ + y = 2 ; Q = 2, P =
R 1
x x x x
IF = e x dx = elnx = x
Multiplying through by IF = x, we have
1 1
xy ′ + y =
such that = (xy)′
x x
′ 1
(xy) =
x
integrating both sides, we have
Z
1
xy = dx + c = lnx + c
x
lnx + c
y=
x
At this point, we use initial conditions to obtain c.

Given, y(1) = 2

ln 1 + c 0+c
2= = =2
1 1
c=2
Therefore, the solution of the I.V. problem is
lnx + 2
y=
x
(c) Solve the D.E.
dy
(x + 1) − 3y = (x + 1)5
dx
Solution

Dividing through by (x + 1) to get the form


dy
+ P (x)y = Q(x)
dx
dy 3y
− = (x + 1)4
dx (x + 1)
3
P (x) = − ; Q(x) = (x + 1)4
(x + 1)
−3
Z Z
P (x)dx = dx = −3 ln(x + 1) = ln(x + 1)−3
x+1
−3
IF = eln(x+1) = (x + 1)−3
To get the solution, we have
Z
y(x + 1)−3 = (x + 1)−3 (x + 1)4 dx + c

x2
Z
y(x + 1)−3 = (x + 1) dx + c = +x+c
2
 2 
3 x
∴ y = (x + 1) +x+c
2

11 Chisara P. Ogbogbo
Class to solve

(d) Solve the D.E.


dy
cosx + ysinx = 1
dx

Dividing through by cosx, we have


dy sinx 1
+y =
dx cosx cosx
sinx 1
P (x) = Q(x) = = secx
cosx cosxR
sinx
R
IF = e P (x)dx = e cosx dx
∴ IF = secx

Solution

Z
ysecx = secxsecx dx + c
Z
ysecx = sec2 x dx + c

ysecx = tanx + c
tanx c
∴y= +
secx secx
y = sinx + c cosx

Bernoulli Equations
A differential equation which can be written in the form
dy
+ P (x)y = Q(x)y n
dx
(where P (x) and Q(x) are constants or functions of x alone and n is an integer not equal to zero or 1) is called
a Bernoulli Equation.
To solve this equation, we transform it into a linear DE and solve using IF . Then, we recover original variables
by substitution.
1. We divide the given equation by y n
dy
y −n + P (x)y 1−n = Q(x) (i)
dx

2. We transform Equation i into an equation in another variable, say z. We let

z = y 1−n (ii)

z is a function of y and y is a function of x.


dz dz dy
= .
dx dy dx
From Equation ii
dz
= (1 − n)y −n
dy

12 Chisara P. Ogbogbo
dz dy
∴ = (1 − n)y −n
dx dx
dy dz 1
y −n = . (iii)
dx dx (1 − n)
Substitute iii in i to obtain an equation in z
1 dz
+ P (x)z = Q(x) (iv)
(1 − n) dx

This will be a linear equation in standard form if we multiply Equation iv through by (1 − n)

dz
+ (1 − n)P (x)z = (1 − n)Q(x) (v)
dx
We can now solve Equation v as a linear D.E. to obtain z. Then we use Equation ii to obtain y.

Example 1

dy
+ y = xy 3
dx
Solution

The equation is Bernoulli with n = 3


p(x) = 1, and q(x) = x
Dividing through by y 3 we have
dy
y −3 + y −2 = x (∗)
dx
Let z = y −2
Then
dz dz dy dy
= . = −2y −3
dx dy dx dx

dz dy
= −2y −3
dx dx
dy 1 dz
⇒ y −3 =−
dx 2 dx
dy
Substituting for y −3 dx in Equation ∗ we have

1 dz
− +z =x
2 dx
In standard linear form (multiply through by -2) we have

dz
− 2z = −2x (∗∗)
dx
From Equation ∗∗

P (x) =R−2, Q(x) = −2x


IF = e −2dx = e−2x

13 Chisara P. Ogbogbo
Solving the linear D.E., we have
Z Z
−2x −2x
ze = e (−2x) = −2 e−2x xdx + c
1 −2x
ze−2x = e (2x + 1) + c
2
1
z = x + + ce2x (c is an arbitrary constant)
2
1
But z = y −2 = 2
y
1 1
∴ 2 = x + + ce2x
y 2
Example 2

dy
x + y = xy 3
dx
Divide through by x to get
dy y
+ = y3
dx x

with p(x) = x1 , q(x) = 1 n = 3


Dividing by y n (i.e y 3 ) we have

1 dy 1
+ y −2 = 1 (∗ ∗ ∗)
y 3 dx x

Set z = y 1−n i.e. z = y −2


Then
dz dy
= −2y −3
dx dx
1 dy 1 dz
∴ 3 =−
y dx 2 dx

Substituting into Equation ∗ ∗ ∗ we have


1 dz 1
− + z=1
2 dx x
To put in standard linear form, we multiply by -2
dz 2
+ z = −2
dx x
We solve using IF
R dx 1 −2
IF = e−2 x = e−2lnx = elnx =
x2
1 dz 2 −2
∴ 2 − z= 2
x dx x3 x
i.e.  
d 1 −2
z = 2
dz x2 x

14 Chisara P. Ogbogbo
Z Z Z
1 R
P (x)dx 1 1
z= e Q(x) + C = (−2) = −2 dx + C
x2 x2 x2
 −1 
1 x 2
2
z = −2 +C = +C
x −1 x

(Multiply through by x2 )

z = 2x + Cx2
1 1
But z = 2 ; y 2 =
y z
1
y2 =
2x + Cx2
Example 3

dy 1
+ y = ex y 4
dx 3
The equation is of the form
dy
+ P (x)y = Q(x)y n
dx
n = 4, p(x) = 31 , q(x) = ex

Dividing through by y 4 , we have


1 dy 1
+ y −3 = ex
y 4 dx 3
Let z = y −3 , then
dz dy 3 dy
= −3y −4 =− 4
dx dx y dx
1 dy 1 dz
=−
y 4 dx 3 dx
We now have a new eqn in z
1 dz 1
+ z = ex−
3 dx 3
To have standard linear form, we multiply through by -3
dz
− z = −3ex
dx
Then P (x) = −1 ; Q(x) = −3ex
R R
−dx
IF = e P (x)dx
=e = e−x
For solution, we use
Z Z
e−x z = e−x .(−3ex )dx = −3 dx + c

e−x z = −3x + c
−3x c
∴ z= + −x = −3xex + cex
e−x e
z = ex (c − 3x)
1 1
But z = 3 ⇒ 3 = ex (c − 3x)
y y
1
y3 = x
e (c − 3x)

15 Chisara P. Ogbogbo
Exercise

1.
dy 1
− y = xy 2
dx x
2.
dy y
+ = y2
dx x
3.
dy
5x + y = xy 3
dx
4.
dy 1
+ y = ex y 4
dx 3
5.
dy 2
+ y = −x2 (cosx)y 2
dx x
6.
dy (4x + 5)2 3
2 + ytanx = y
dx cosx
7.
dy
x + y = y 2 x2 lnx
dx
8.
dy
= ycotx + y 3 cosecx
dx

16 Chisara P. Ogbogbo

You might also like