You are on page 1of 5

Engineering Mathematics I Lecture 5: Exact, Linear, and Bernoulli Prof. Dr.

Emad Al-Hemiary
Second Year, First Semester 2021-2022 First Order ODE

Exact First-Order ODE


A differential equation
𝑀(𝑥, 𝑦)𝑑𝑥 + 𝑁(𝑥, 𝑦)𝑑𝑦 = 0 (5.1)
Is exact if there exists a function 𝑔(𝑥, 𝑦), such that
𝑑𝑔(𝑥, 𝑦) = 𝑀(𝑥, 𝑦)𝑑𝑥 + 𝑁(𝑥, 𝑦)𝑑𝑦 (5.2)
Then (5.1) is exact.

Test of Exactness
If 𝑀(𝑥, 𝑦) and 𝑁(𝑥, 𝑦) and there FO derivatives are continuous on some rectangle of 𝑥𝑦-plane,
then (5.1) is exact if-and-only-if:
𝜕𝑀(𝑥, 𝑦) 𝜕𝑁(𝑥, 𝑦)
= (5.3)
𝜕𝑦 𝜕𝑥

Procedure for Solving FO Exact ODE


Step 1: Test Exactness
Step 2: Integrate 𝑀(𝑥, 𝑦) for 𝑑𝑥, you will get 𝑔(𝑥, 𝑦) (implicitly 𝑔(𝑥, 𝑦) = 𝑐) that contains ℎ(𝑦)
as the constant of integration
Step 3: Differentiate 𝑔(𝑥, 𝑦) for 𝑑𝑦 and equate with 𝑁(𝑥, 𝑦), you will get ℎ′ (𝑦)
Step 4: Integrate ℎ′ (𝑦) for 𝑑𝑦 to obtain ℎ(𝑦).
Step 5: Substitute ℎ(𝑦) for result of step 2.

Example 5.1: Solve 2𝑥𝑦𝑑𝑥 + (1 + 𝑥 2 ) 𝑑𝑦 = 0.


Solution: (Note: this can be solved using separation of variables)
Step 1:
𝜕𝑀(𝑥,𝑦) 𝜕𝑁(𝑥,𝑦)
𝑀(𝑥, 𝑦) = 2𝑥𝑦 → = 2𝑥, 𝑁(𝑥, 𝑦) = 1 + 𝑥 2 → = 2𝑥 → 𝐸𝑥𝑎𝑐𝑡
𝜕𝑦 𝜕𝑥

Step 2:

𝑔(𝑥, 𝑦) = ∫ 𝑀(𝑥, 𝑦) 𝑑𝑥 → 𝑔(𝑥, 𝑦) = ∫ 2𝑥𝑦 𝑑𝑥 → 𝑔(𝑥, 𝑦) = 𝑥 2 𝑦 + ℎ(𝑦)

Step 3:
𝜕𝑔(𝑥, 𝑦) 𝜕 2
= 𝑁(𝑥, 𝑦) → {𝑥 𝑦 + ℎ(𝑦)} = 1 + 𝑥 2 → 𝑥 2 + ℎ′ (𝑦) = 1 + 𝑥 2 → ℎ′ (𝑦) = 1
𝜕𝑦 𝜕𝑦
1
Engineering Mathematics I Lecture 5: Exact, Linear, and Bernoulli Prof. Dr. Emad Al-Hemiary
Second Year, First Semester 2021-2022 First Order ODE

Step 4:

ℎ′ (𝑦) = 1 → ∫ ℎ′ (𝑦)𝑑𝑦 = ∫ 𝑑𝑦 → ℎ(𝑦) = 𝑦 + 𝑐1

Step 5:
𝑔(𝑥, 𝑦) = 𝑐
𝑔(𝑥, 𝑦) = 𝑥 2 𝑦 + ℎ(𝑦) → 𝑐 = 𝑥 2 𝑦 + 𝑦 + 𝑐1 → 𝑦(𝑥 2 + 1) = 𝑐 − 𝑐1
𝑘
∴ 𝑦(𝑥) = , 𝑘 = 𝑐 − 𝑐1
(𝑥 2 + 1)

Example 5.2: Evaluate cos(𝑥 + 𝑦) 𝑑𝑥 + {3𝑦 2 + 2𝑦 + cos(𝑥 + 𝑦)} 𝑑𝑦 = 0


Solution:
We first test for exactness:
𝜕𝑀(𝑥,𝑦) 𝜕𝑁(𝑥,𝑦)
𝑀(𝑥, 𝑦) = cos(𝑥 + 𝑦) → = − sin(𝑥 + 𝑦), 𝑁(𝑥, 𝑦) = 3𝑦 2 + 2𝑦 + cos(𝑥 + 𝑦) → =
𝜕𝑦 𝜕𝑥
− sin(𝑥 + 𝑦) → 𝐸𝑥𝑎𝑐𝑡

𝑔(𝑥, 𝑦) = ∫ 𝑀(𝑥, 𝑦) 𝑑𝑥 → 𝑔(𝑥, 𝑦) = ∫ cos(𝑥 + 𝑦) 𝑑𝑥 → 𝑔(𝑥, 𝑦) = sin(𝑥 + 𝑦) + ℎ(𝑦)

𝜕𝑔(𝑥, 𝑦) 𝜕
= 𝑁(𝑥, 𝑦) → {sin(𝑥 + 𝑦) + ℎ(𝑦)} = 3𝑦 2 + 2𝑦 + cos(𝑥 + 𝑦) → cos(𝑥 + 𝑦) + ℎ′ (𝑦)
𝜕𝑦 𝜕𝑦
= 3𝑦 2 + 2𝑦 + cos(𝑥 + 𝑦) → ℎ′ (𝑦) = 3𝑦 2 + 2𝑦

∫ ℎ′ (𝑦)𝑑𝑦 = ∫(3𝑦 2 + 2𝑦)𝑑𝑦 + 𝑐1 → ℎ(𝑦) = 𝑦 3 + 𝑦 2 + 𝑐1

𝑔(𝑥, 𝑦) = sin(𝑥 + 𝑦) + ℎ(𝑦) → 𝑐 = sin(𝑥 + 𝑦) + ℎ(𝑦) → 𝑐 = sin(𝑥 + 𝑦) + 𝑦 3 + 𝑦 2 + 𝑐1


∴ sin(𝑥 + 𝑦) + 𝑦 3 + 𝑦 2 = 𝑘 𝑘 = 𝑐 − 𝑐1

Procedure for Solving Non-Exact ODE (Integrating Factors)


If equation (5.1) is not exact, it is possible to transform it into exact by introducing Integrating
factors and as follows:
Let 𝐼(𝑥. 𝑦) is an integrating factor, then:
𝐼(𝑥. 𝑦)[𝑀(𝑥, 𝑦)𝑑𝑥 + 𝑁(𝑥, 𝑦)𝑑𝑦] = 0 (5.4)
Is Exact.

2
Engineering Mathematics I Lecture 5: Exact, Linear, and Bernoulli Prof. Dr. Emad Al-Hemiary
Second Year, First Semester 2021-2022 First Order ODE

If:
1 𝜕𝑀 𝜕𝑁
( − ) ≡ 𝑔(𝑥) → 𝐼(𝑥, 𝑦) = 𝑒 ∫ 𝑔(𝑥)𝑑𝑥 (5.5)
𝑁 𝜕𝑦 𝜕𝑥
If:
1 𝜕𝑀 𝜕𝑁
( − ) ≡ ℎ(𝑦) → 𝐼(𝑥, 𝑦) = 𝑒 − ∫ ℎ(𝑦)𝑑𝑦 (5.6)
𝑀 𝜕𝑦 𝜕𝑥

Example 5.3: Evaluate (𝑒 𝑥+𝑦 + 𝑦𝑒 𝑦 ) 𝑑𝑥 + (𝑥𝑒 𝑦 − 1) 𝑑𝑦 = 0


Solution:
We first test for exactness:
𝜕𝑀(𝑥,𝑦) 𝜕𝑁(𝑥,𝑦)
𝑀(𝑥, 𝑦) = 𝑒 𝑥+𝑦 + 𝑦𝑒 𝑦 → = 𝑒 𝑥+𝑦 + 𝑦𝑒 𝑦 + 𝑒 𝑦 , 𝑁(𝑥, 𝑦) = 𝑥𝑒 𝑦 − 1 → = 𝑒 𝑦 → 𝑁𝑜𝑡 𝐸𝑥𝑎𝑐𝑡
𝜕𝑦 𝜕𝑥

Check (5.5)
1 𝜕𝑀 𝜕𝑁 1 𝑒 𝑥+𝑦 + 𝑦𝑒 𝑦
( − )= 𝑦 (𝑒 𝑥+𝑦 + 𝑦𝑒 𝑦 + 𝑒 𝑦 − 𝑒 𝑦 ) = ≠ 𝑔(𝑥)
𝑁 𝜕𝑦 𝜕𝑥 𝑥𝑒 − 1 𝑥𝑒 𝑦 − 1
Check (5.6)
1 𝜕𝑀 𝜕𝑁 1 𝑥+𝑦 𝑦 𝑦 𝑦)
𝑒 𝑥+𝑦 + 𝑦𝑒 𝑦
( − ) = 𝑥+𝑦 (𝑒 + 𝑦𝑒 + 𝑒 − 𝑒 = = 1 = ℎ(𝑦)
𝑀 𝜕𝑦 𝜕𝑥 𝑒 + 𝑦𝑒 𝑦 𝑒 𝑥+𝑦 + 𝑦𝑒 𝑦
Hence:

𝐼(𝑥, 𝑦) = 𝑒 − ∫ ℎ(𝑦)𝑑𝑦 = 𝑒 − ∫ 𝑑𝑦 = 𝑒 −𝑦
Therefore from (5.4), we get:
𝑒 −𝑦 {(𝑒 𝑥+𝑦 + 𝑦𝑒 𝑦 ) 𝑑𝑥 + (𝑥𝑒 𝑦 − 1) 𝑑𝑦} = 0 → (𝒆𝒙 + 𝒚) 𝒅𝒙 + (𝒙 − 𝒆−𝒚 ) 𝒅𝒚 = 𝟎 𝑖𝑠 𝐸𝑥𝑎𝑐𝑡
Test for exactness:
𝜕𝑀(𝑥,𝑦) 𝜕𝑁(𝑥,𝑦)
𝑀(𝑥, 𝑦) = 𝑒 𝑥 + 𝑦 → = 1, 𝑁(𝑥, 𝑦) = 𝑥 − 𝑒 −𝑦 → = 1 → 𝐸𝑥𝑎𝑐𝑡
𝜕𝑦 𝜕𝑥

Solve:

𝑔(𝑥, 𝑦) = ∫ 𝑀(𝑥, 𝑦) 𝑑𝑥 → 𝑔(𝑥, 𝑦) = ∫(𝑒 𝑥 + 𝑦) 𝑑𝑥 → 𝑔(𝑥, 𝑦) = 𝑒 𝑥 + 𝑦𝑥 + ℎ(𝑦)

𝜕𝑔(𝑥, 𝑦) 𝜕 𝑥
= 𝑁(𝑥, 𝑦) → {𝑒 + 𝑦𝑥 + ℎ(𝑦)} = 𝑥 − 𝑒 −𝑦 → 𝑥 + ℎ′ (𝑦) = 𝑥 − 𝑒 −𝑦 → ℎ′ (𝑦) = −𝑒 −𝑦
𝜕𝑦 𝜕𝑦

ℎ(𝑦) = ∫(−𝑒 −𝑦 )𝑑𝑦 → ℎ(𝑦) = 𝑒 −𝑦 + 𝑐1

3
Engineering Mathematics I Lecture 5: Exact, Linear, and Bernoulli Prof. Dr. Emad Al-Hemiary
Second Year, First Semester 2021-2022 First Order ODE

𝑔(𝑥, 𝑦) = 𝑒 𝑥 + 𝑦𝑥 + ℎ(𝑦) → 𝑐 = 𝑒 𝑥 + 𝑦𝑥 + 𝑒 −𝑦 + 𝑐1 → 𝑒 𝑥 + 𝑦𝑥 + 𝑒 −𝑦 = 𝑘 (𝑘 = 𝑐 − 𝑐1 )

Linear First-Order ODE

A homogeneous linear ODE of the first order is given by:


𝑦 ′ + 𝑝(𝑥)𝑦 = 0 (5.7)
Which is solved by separation of variables:

𝑦(𝑥) = 𝑐𝑒 − ∫ 𝑝(𝑥)𝑑𝑥 (5.8)


A non-homogeneous linear ODE of the first order is given by:
𝑦 ′ + 𝑝(𝑥)𝑦 = 𝑟(𝑥) (5.9)
To solve, use the integrating factor:

𝐼(𝑥) = 𝑒 ∫ 𝑝(𝑥)𝑑𝑥 (5.10)


Multiplying both sides of (5.9) by 𝐼(𝑥), yields:
𝐼(𝑥)𝑦 ′ + 𝑝(𝑥)𝐼(𝑥)𝑦 = 𝐼(𝑥)𝑟(𝑥) (5.11)
𝐼𝑦 ′ + 𝑝𝐼𝑦 = 𝐼𝑟
Recall from (5.10):
𝑑𝐼
𝐼(𝑥) = 𝑒 ∫ 𝑝(𝑥)𝑑𝑥 → = 𝑝𝑒 ∫ 𝑝(𝑥)𝑑𝑥 → 𝐼 ′ = 𝑝𝐼
𝑑𝑥
𝑑(𝑦𝐼) 𝑑𝐼 𝑑𝑦 𝑑(𝑦𝐼) 𝑑(𝑦𝐼)
Since: = 𝑦 𝑑𝑥 + 𝐼 𝑑𝑥 → → = 𝑦(𝑝𝐼) + 𝐼𝑦 ′ = 𝐼𝑟
𝑑𝑥 𝑑𝑥 𝑑𝑥

Thus:
𝑑(𝑦𝐼)
= 𝐼𝑟 (5.12)
𝑑𝑥
How to solve Equation (5.12):
1. Integrate both sides of (5.12) for 𝑑𝑥
2. Solve the result for 𝑦

4
Engineering Mathematics I Lecture 5: Exact, Linear, and Bernoulli Prof. Dr. Emad Al-Hemiary
Second Year, First Semester 2021-2022 First Order ODE

Bernoulli First-Order ODE:

A Bernoulli Differential equation has the form:


𝑦 ′ + 𝑝(𝑥)𝑦 = 𝑔(𝑥)𝑦 𝑛 (5.13)
𝑦 ′ = 𝑔(𝑥)𝑦 𝑛 − 𝑝(𝑥)𝑦 (5.14)
Which is nonlinear. To reduce it to linear form, we do the following:
Let:
𝑢(𝑥) = [𝑦(𝑥)]1−𝑛
Results in with substitution of (5.14):
𝑢′ = (1 − 𝑛)𝑦 −𝑛 𝑦 ′ = (1 − 𝑛)𝑦 −𝑛 (𝑔𝑦 𝑛 − 𝑝𝑦)
𝑢′ = (1 − 𝑛)(𝑔 − 𝑝𝑦1−𝑛 ) (5.15)
Since 𝑦1−𝑛 = 𝑢, then:
𝑢′ + (1 − 𝑛)𝑝𝑢 = (1 − 𝑛)𝑔 (5.16)
Eq. (5.16) is the linear form of (5.13)

You might also like