You are on page 1of 7

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

Emad Al-Hemiary
Second Year, First Semester Bernoulli 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:

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

𝜕𝑔(𝑥, 𝑦) 𝜕 2
= 𝑁(𝑥, 𝑦) → {𝑥 𝑦 + ℎ(𝑦)} = 1 + 𝑥 2 → 𝑥 2 + ℎ′ (𝑦) = 1 + 𝑥 2 → ℎ′ (𝑦) = 1
𝜕𝑦 𝜕𝑦
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 Prof. Dr. Emad Al-Hemiary
Second Year, First Semester Bernoulli 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 Prof. Dr. Emad Al-Hemiary
Second Year, First Semester Bernoulli 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:
𝑑(𝑦𝐼)
= 𝐼𝑟
𝑑𝑥
Integrating both sides for dx we get:

𝑦𝐼 = ∫ 𝐼𝑟 𝑑𝑥 + 𝐶 (5.12)

4
Engineering Mathematics I Lecture 5: Exact, Linear, and Prof. Dr. Emad Al-Hemiary
Second Year, First Semester Bernoulli 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)

Example 5.4 Solve the following linear first order ODE


𝑥𝑦 ′ = 𝑥 2 + 3𝑦, 𝑥>0
Solution:
3
This is non-homogeneous linear ODE: 𝑥𝑦 ′ − 3𝑦 = 𝑥 2 → 𝑦 ′ − 𝑦 = 𝑥
𝑥

3 3 1
𝑝(𝑥) = − → 𝐼(𝑥) = 𝑒 ∫ 𝑝(𝑥)𝑑𝑥 = 𝑒 − ∫𝑥𝑑𝑥 = 𝑒 −3𝑙𝑛𝑥 = 3
𝑥 𝑥
𝑟(𝑥) = 𝑥
The solution is as given in 5.12:

𝑦𝐼 = ∫ 𝐼𝑟 𝑑𝑥 + 𝐶

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

𝑦 1
= ∫ 𝑑𝑥 + 𝐶
𝑥3 𝑥2
𝑦 1
3
=− +𝐶
𝑥 𝑥
∴ 𝑦(𝑥) = −𝑥 2 + 𝐶𝑥 3

Example 5.5: Find the particular solution of:


3𝑥𝑦 ′ − 𝑦 = ln 𝑥 + 1, 𝑥 > 0, 𝑦(1) = −2
Solution:
1 ln 𝑥 + 1
𝑦′ − 𝑦=
3𝑥 3𝑥
1
1 1 1 − 1
𝑝(𝑥) = − → 𝐼(𝑥) = 𝑒 ∫ −3𝑥𝑑𝑥 = 𝑒 −3 ln 𝑥 = 𝑒 ln 𝑥 3 = 𝑥 −3
3𝑥
ln 𝑥 + 1
𝑟(𝑥) =
3𝑥
The solution is as given in 5.12:
1 ln 𝑥 + 1 −1
𝑦𝑥 −3 = ∫ 𝑥 3 𝑑𝑥 + 𝐶
3𝑥
1 1 4
𝑦𝑥 −3 = ∫(ln 𝑥 + 1)𝑥 −3 𝑑𝑥 + 𝐶
3
1 4 1
𝐿𝑒𝑡 𝑢 = (ln 𝑥 + 1) → 𝑑𝑢 = 𝑑𝑥, 𝑑𝑣 = 𝑥 −3 𝑑𝑥 → 𝑣 = −3𝑥 −3
𝑥
1

1

1 𝑥 −3
𝑦𝑥 3 = −𝑥 3 (ln 𝑥 + 1) + ∫ 𝑑𝑥 + 𝐶
𝑥
1 1 1
𝑦𝑥 −3 = −𝑥 −3 (ln 𝑥 + 1) − 3𝑥 −3 + 𝐶
1
𝑦 = −(ln 𝑥 + 1) − 3 + 𝐶𝑥 3
1
∴ 𝑦(𝑥) = − ln 𝑥 − 4 + 𝐶𝑥 3
Substitute 𝑦(1) = −2:
1
−2 = − ln 1 − 4 + 𝐶(1)3 → 𝐶 = 2
1
∴ 𝑦(𝑥) = − ln 𝑥 − 4 + 2𝑥 3

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

Example 5.6 Solve the following Bernoulli first order ODE:


𝑦 ′ − 𝑦 = −𝑦 2
Solution:
This is Bernoulli equation with order 𝑛 = 2
𝑝(𝑥) = −1, 𝑔(𝑥) = −1
We assume that 𝑢 = 𝑦 1−𝑛 → 𝑢 = 𝑦 −1 , therefore:
𝑢′ + (1 − 𝑛)𝑝𝑢 = (1 − 𝑛)𝑔

𝑢′ + 𝑢 = 1 (𝑇ℎ𝑖𝑠 𝑖𝑠 𝑎 𝑙𝑖𝑛𝑒𝑎𝑟 𝑒𝑞𝑢𝑎𝑡𝑖𝑜𝑛 𝑤𝑖𝑡ℎ 𝑝 = 1, 𝑟 = 1, 𝑎𝑛𝑑 𝐼 = 𝑒 ∫ 𝑑𝑥 = 𝑒 𝑥

𝑢𝑒 𝑥 = ∫ 𝑒 𝑥 𝑑𝑥 + 𝐶 → 𝑢 = 1 + 𝐶𝑒 −𝑥

Since 𝑢 = 𝑦 −1, thus:


1
∴ 𝑦(𝑥) =
1 + 𝐶𝑒 −𝑥

You might also like