Differential Equations
Differential Equations
Equations
FIRST-ORDER DIFFERENTIAL EQUATIONS
Introduction to differential Equations
Definition : A differential equation is an equation that involve a function (dependent variable) and
its derivative and the independent variable.
𝑑𝑦 𝑑2𝑦
𝐹 𝑥, 𝑦 , , , ⋯ =0
𝑑𝑥 𝑑𝑥 2
The highest order of derivative appearing in the equation is the order of the differential equation,
Type differential equations: Ordinary differential equation (ODE) involving ordinary derivatives , and Partial differential Equation involving partial
derivatives. In the next section we will discuss the basics differential equations namely : Separable equation, linear equation, exact equation,
Homogeneous substitution equation, and Bernoulli equation.
Differential equation arise in many fields like Biology, Chemistry, Physics, and Engineering
A. Separable Equations
Form :
𝑑𝑦
= 𝑔 𝑦 ℎ(𝑥)
𝑑𝑥
Method for solving Separable equations
𝑑𝑦
න = න ℎ 𝑥 𝑑𝑥
𝑔(𝑦)
′ 1+3𝑥 2
Example : Solve 3𝑦𝑦 = , 𝑦 0 =2
𝑦−2
Solution :
1. Separate variables
3𝑦 𝑦 − 2 𝑦 ′ = 1 + 3𝑥 2
A. Separable Equations
Separating the variables
3𝑦 𝑦 − 2 𝑦 ′ = 1 + 3𝑥 2
න 3𝑦 2 − 6𝑦 𝑦 ′ 𝑑𝑦 = න 1 + 3𝑥 2 𝑑𝑥
න 3𝑦 2 − 6𝑦 𝑑𝑦 = න 1 + 3𝑥 2 𝑑𝑥
𝑦 3 − 3𝑦 2 = 𝑥 + 𝑥 3 + 𝐶
23 − 3 ∙ 22 = 0 + 03 + 𝐶 ∴ 𝐶 = −4
P.S: 𝑦 3 − 3𝑦 2 = 𝑥 + 𝑥 3 − 4
𝑑𝑦 𝑏(𝑥) 𝑐(𝑥)
+ 𝑦 =
𝑑𝑥 𝑎(𝑥) 𝑎(𝑥)
𝑏(𝑥) 𝑐(𝑥)
Letting 𝑝 𝑥 = , & 𝑞 𝑥 =
𝑎(𝑥) 𝑎(𝑥)
1. Check if the linear equation is written in standard form (the coefficient of the derivative term
must be 1) if not divide each side by the coefficient of the derivative term.
𝜇 𝑥 ∙ 𝑦 = න 𝜇 𝑥 ∙ 𝑞 𝑥 𝑑𝑥 + 𝑐
4. Perform the integration and solves for 𝑦 by dividing both sides of the equation by 𝜇 𝑥 .
𝑑𝑦 𝑦
Example : Solve: = 𝑥 + 2𝑥 + 1 𝑦 1 =0
𝑑𝑥
Solution
1 1
∙𝑦 = න 2+ 𝑑𝑥 + 𝐶
𝑥 𝑥
1
𝑦 = 2𝑥 + ln 𝑥 + 𝐶
𝑥
So the General Solution : 𝑦 = 2𝑥 2 + 𝑥 ln 𝑥 + 𝐶𝑥
B. First order Linear differential
equation
Particular Solution: we use the initial condition to find 𝑦 1 = 0
0 = 2 ∙ 12 + 1 ∙ ln 1 + 𝐶 ∙ 1 ∴ 𝐶 = −2
𝑑𝑦
Exercise : Solve =𝑥+𝑦+1
𝑑𝑥
C. Exact Equation
Form :
𝑀 𝑥, 𝑦 𝑑𝑥 + 𝑁 𝑥, 𝑦 𝑑𝑦 = 0
Where
𝜕𝑀(𝑥, 𝑦) 𝜕𝑁(𝑥, 𝑦)
=
𝜕𝑦 𝜕𝑥
METHOD FOR SOLVING EXACT EQUATION
𝑓 𝑥, 𝑦 = න 𝑀 𝑥, 𝑦 𝑑𝑥 + 𝑔 𝑦 (3)
2. 𝑔 𝑦 is the constant of integration and can be found by differentiating both sides with respect
to 𝑦, solving for 𝑔′ (𝑦) and integrating to get
𝜕
𝑔 𝑦 = න 𝑁 𝑥, 𝑦 − න 𝑀 𝑥, 𝑦 𝑑𝑥 + 𝐶 𝑑𝑦
𝜕𝑦
3. 𝑓 𝑥, 𝑦 can be found by substituting the equation found for 𝑔(𝑦) back into the equation
C. Exact Equation
3. 𝑓 𝑥, 𝑦 can be found by substituting the equation found for 𝑔(𝑦) back into the equation for
𝑓 𝑥, 𝑦 found in step 1. The final solution 𝑓 𝑥, 𝑦 = 𝐶 (implicitly)
𝑓𝑦 = 𝑁 𝑥, 𝑦 = 𝑥 2 + 2𝑦 (2)
𝑓 𝑥, 𝑦 = න 𝑀 𝑥, 𝑦 𝑑𝑥 + 𝑔(𝑦)
C. Exact Equation
𝑓 𝑥, 𝑦 = න 2𝑥𝑦 − sec 2 𝑥 𝑑𝑥 + 𝑔 𝑦 = 𝑥 2 𝑦 − tan 𝑥 + 𝑔 𝑦
𝑓 𝑥, 𝑦 = 𝑥 2 𝑦 − tan 𝑥 + 𝑔 𝑦 (3)
𝑓𝑦 = 𝑥 2 + 𝑔′ 𝑦 (4)
4 = (2)
𝑥 2 + 𝑔′ 𝑦 = 𝑥 2 + 2𝑦 𝑔′ 𝑦 = 2𝑦 ∴ 𝑔 𝑦 = 𝑦2
𝑓 𝑥, 𝑦 = 𝑥 2 𝑦 − tan 𝑥 + 𝑦 2
𝑓 𝑥, 𝑦 = 𝐶
Exercise : Solve 𝑦𝑒 𝑥 − 𝑥𝑒 𝑥 𝑑𝑥 + 1 + 𝑒 𝑥 𝑑𝑦 = 0, 𝑦 0 =2
D. Homogeneous substitution
Definition : 1. A function 𝑓(𝑥) is homogeneous of order n if 𝑓 𝑘𝑥 = 𝑘 𝑛 𝑓(𝑥)
𝑓 𝑘𝑥, 𝑘𝑦 = 𝑘 2 𝑥𝑦 + 𝑘 2 𝑦 2 = 𝑘 2 𝑥𝑦 + 𝑦 2 = 𝑘 2 𝑓(𝑥, 𝑦)
D. Homogeneous substitution
3. 𝑓 𝑥, 𝑦 = 𝑥 + 𝑥𝑦 is not homogeneous since 𝑓 𝑘𝑥, 𝑘𝑦 = 𝑘𝑥 + 𝑘𝑥 𝑘𝑦 = 𝑘𝑥 + 𝑘 2 𝑥𝑦
since 𝑓 𝑘𝑥, 𝑘𝑦 = 𝑘 𝑥 + 𝑘𝑥𝑦 so we fail to find n such that 𝑓(𝑘𝑥, 𝑘𝑦) = 𝑘 𝑛 𝑓(𝑥, 𝑦)
HOMOGENEOUS SUBSTITUTION
𝑑𝑦 𝑦
Form : 𝑑𝑥
=𝑔 𝑥
𝑑𝑦 𝑥 2 +𝑥𝑦+𝑦 2
Example: Solve =
𝑑𝑥 𝑥2
𝑔 𝑥, 𝑦 homogeneous of order 0.
D. Homogeneous substitution
𝑦 𝑑𝑦 𝑑𝑣
To solve we let 𝑣 = 𝑥
𝑦 = 𝑥𝑣 𝑑𝑥
= 𝑣 + 𝑥 𝑑𝑥
𝑑𝑦 𝑥 2 𝑥𝑦 𝑦 2
𝑑𝑦 𝑦 𝑦 2
= 2+ 2+ 2 or =1+ +
𝑑𝑥 𝑥 𝑥 𝑥 𝑑𝑥 𝑥 𝑥
𝑑𝑣 𝑑𝑣
𝑣+𝑥 = 1 + 𝑣 + 𝑣2 𝑜𝑟 𝑥 = 1 + 𝑣2
𝑑𝑥 𝑑𝑥
Separating the variable we get
1 𝑑𝑣 1
∙ =
1 + 𝑣 2 𝑑𝑥 𝑥
Integrating each side with respect to x we get
D. Homogeneous substitution
1 𝑑𝑣 1
න 2 𝑑𝑥 = න 𝑑𝑥
𝑣 + 1 𝑑𝑥 𝑥
1 1
න 2 𝑑𝑣 = න 𝑑𝑥
𝑣 +1 𝑥
arctan 𝑣 = ln 𝑥 + 𝐶 𝑜𝑟 𝑣 = tan ln 𝑥 + 𝐶
𝑦
Substituting 𝑥 for v we get the General Solution
𝑦
= tan ln 𝑥 + 𝐶 𝑜𝑟 𝑦 = 𝑥 tan ln 𝑥 +𝐶
𝑥
D. Homogeneous Substitution
𝑑𝑦 4𝑦 − 3𝑥
Exercise: Solve =
𝑑𝑥 2𝑥 −𝑦
Hint: to check if the RHS is homogeneous all the terms in numerator and denominator must have
the same order (or degree) if so divide each term both in numerator and denominator by the
𝑦 𝑑𝑦 𝑑𝑣
highest power of x and substitute 𝑏𝑦 𝑣 and 𝑏𝑦 𝑣 + 𝑥
𝑥 𝑑𝑥 𝑑𝑥
E. Bernoulli Equation
FORM :
𝑑𝑦
+ 𝑝 𝑥 𝑦 = 𝑞 𝑥 𝑦𝑛, 𝑛 ≠ 0, 1
𝑑𝑥
Method for solving Bernoulli equation
1
𝑧 ′ + 𝑝 𝑥 𝑧 = 𝑞(𝑥)
1−𝑛
The resulting equation obtained is linear for which it written in standard form by multiplying each
side by (1 − 𝑛) to have
𝑧 ′ + 1 − 𝑛 𝑝 𝑥 𝑧 = 1 − 𝑛 𝑞(𝑥)
𝑑𝑦
Example : Solve + 2𝑦 = 𝑥𝑦 −2
𝑑𝑥
E. Bernoulli Equation
Solution here 𝑛 = −2,
𝜇 𝑥 = 𝑒 6 𝑑𝑥 = 𝑒 6𝑥
𝑒 6𝑥 . 𝑧 = න 3𝑥 𝑒 6𝑥 𝑑𝑥 + 𝐶
(L-I-A-T-E) : 𝑢 = 3𝑥 𝑑𝑢 = 3 𝑑𝑥
1 6𝑥
𝑑𝑣 = 𝑒 6𝑥 𝑑𝑥 𝑣= 6
𝑒
E. Bernoulli Equation
Integration by parts Formula: 𝑣𝑢 = 𝑣𝑑 𝑢 − 𝑢𝑑 𝑣
1 1 1 1 1 1 6𝑥
3𝑥𝑒 6𝑥 𝑑𝑥 = 6
3𝑥𝑒 6𝑥 − 𝑒 6𝑥 3 𝑑𝑥 =
6 2
𝑥𝑒 6𝑥 −
2
𝑒 6𝑥 𝑑𝑥 =
2
𝑥𝑒 6𝑥 −
12
𝑒 +𝐶
6𝑥
1 6𝑥 1 6𝑥
𝑒 . 𝑧 = 𝑥𝑒 − 𝑒 + 𝐶
2 12
1 1
𝑧= 𝑥− + 𝐶𝑒 −6𝑥
2 12
Substituting 𝑦 3 for z we get
1 3
1 3 1 1
𝑦 = 𝑥− + 𝐶𝑒 −6𝑥 𝑜𝑟 𝑦= 𝑥− + 𝐶𝑒 −6𝑥
2 12 2 12
E. Bernoulli Equation
𝑑𝑦 1
Exercise : 𝑑𝑥
+ 𝑥 𝑦 = 𝑥2𝑦2
First order Linear Differential Equations
Application of 1st ODE
MIXTURE PROBLEM
Mixture problem
Consider the situation depicted in Figure below. A tank initially
contains 𝑉0 liters of a solution in which is dissolved 𝐴0 grams of a certain chemical. A solution containing 𝑐1
grams/liter of the same chemical flows into the tank at a constant rate of 𝑟1 liters/minute, and the mixture
flows out at a constant rate of 𝑟2 liters/minute. We assume that the mixture is kept uniform by stirring. Then
at any time t the concentration of chemical in the tank, 𝑐2 (𝑡), is the same throughout the tank and is given
by
𝐴(𝑡)
𝑐2 𝑡 = 𝑉(𝑡)
Mixture Problem
respectively. These equations describe the rates of change of V and A over the short, but
finite, time interval ∆t. In order to determine the instantaneous rates of change of V and
Substituting for V into the second Equation and rearranging terms yields the linear equation for A(t) :
This differential equation can be solved, subject to the initial condition A(0) = 𝐴0 , to determine the behavior
of A(t).
Mixture Problem : Example
Mixture Problem Example
Solution : We are given
Mixture Problem Example
Integrating this equation and imposing the initial condition that V (0) = 8 yields
Mixture Problem Example
Substituting for V, From ,
We solve
Mixture Problem Example
Consequently, the solution of the resulted linear equation is given
𝑡 + 4 𝐴 = 𝑡(+ 4) 8 dt + C
𝑡 + 4 𝐴 = 4𝑡 2 + 32𝑡 + 𝐶
Therefore,
4𝑡 2 +32𝑡+𝐶
𝐴 𝑡 = 𝑡+4
Which is the amount of the chemical remaining in the tank at any time t
Mixture Problem Example
Since initially they were 32 g of chemical dissolved in the tank, we have that the initial condition in
A(t) is that 𝐴 0 = 32 Thus,
4∙02 +32∙0+𝐶
32 = 4
So, 𝐶 = 128
Therefore, the amount of the Chemical ant any time t>0 is given by
4𝑡 2 +32𝑡+128
𝐴 𝑡 =
4
Mixture Problem Example
Setting 𝑡 = 20, gives us the values for part 1 and 2,
4×202 +32×20+128 296
1, We have , 𝐴 20 = = g
20+4 3
- NEIL ARMSTRONG