Physics department (2023-2024)
Differential Equations
Methods of solving differential equations of the first order
and first degree
Now we study some elementary methods for solving Frist order and first-degree
differential equation. A differential equation of first order and first degree has the
form
𝑑𝑦
𝑦′ = = 𝑓(𝑥, 𝑦) ------1 Normal form or explicit
𝑑𝑥
form
𝑀(𝑥, 𝑦)𝑑𝑥 + 𝑁(𝑥, 𝑦)𝑑𝑦 = 0 ------2 Differential form
𝐹(𝑥, 𝑦, 𝑦 ′ ) = 0 ------3 Implicit form
From equation 1, we can get eq 2 as follows:
𝑀(𝑥,𝑦)
If 𝑓(𝑥, 𝑦) = − , N(x,y)≠ 0, then equation 1 can be written equivalently to
𝑁(𝑥,𝑦)
𝑑𝑦 𝑀(𝑥,𝑦)
differential form =− implies 𝑁(𝑥, 𝑦)𝑑𝑦 = −𝑀(𝑥, 𝑦)𝑑𝑥 means
𝑑𝑥 𝑁(𝑥,𝑦)
𝑀(𝑥, 𝑦)𝑑𝑥 + 𝑁(𝑥, 𝑦)𝑑𝑦 = 0.
𝑑𝑦
Example 1: Solve = 1 + 𝑒 2𝑥
𝑑𝑥
Solution. 𝑑𝑦 = (1 + 𝑒 2𝑥 )𝑑𝑥
Integrate both sides we get
9
Physics department (2023-2024)
Differential Equations
1
𝑦=𝑥+ 𝑒 2𝑥 + 𝐶
2
𝑑𝑦
Example 2: Solve = sin 𝑥
𝑑𝑥
Solution. 𝑑𝑦 = sin 𝑥 𝑑𝑥
Integrate both sides we get
𝑦 = − cos 𝑥 + 𝐶 is a general solution of the given differential
equation.
𝑑𝑦 𝑥
Example 3: Solve =− subject to 𝑦(4) = 3
𝑑𝑥 𝑦
Solution. 𝑦𝑑𝑦 = −𝑥𝑑𝑥
⇒ ∫ 𝑦𝑑𝑦 = ∫ −𝑥𝑑𝑥
𝑥2 + 𝑦2 = 𝐶 is general solution where 𝐶 = 2𝐶1 .
For 𝑥 = 4 &𝑦 = 3
42 + 32 = 𝐶 ⇒ 𝐶 = 25
∴ 𝑥 2 + 𝑦 2 = 25
Example 4 : Solve (1 + 𝑥 2 ) 𝑑𝑦 − 𝑥𝑦 𝑑𝑥 = 0
Solution. Dividing by y(1 + x2) and transposing we get
𝑑𝑦 𝑥 𝑑𝑥
𝑦
= 1+𝑥 2
1
Integrating both sides, we get ln 𝑦 = ln(1 + 𝑥 2 ) + ln 𝐶
2
Or
1
ln 𝑦 = ln 𝐶 (1 + 𝑥 2 )2
1
Taking exponentials 𝑦 = 𝐶(1 + 𝑥 2 )2
The arbitrary constant was added in the form “ln C” to facilitate the final
representation.
10
Physics department (2023-2024)
Differential Equations
𝑑𝑦 2
Example 5: Solve 𝑑𝑥 = 2𝑥(1 + 𝑦 2 )𝑒 𝑥
1 2
Solution. 𝑑𝑦 = 2𝑥𝑒 𝑥 𝑑𝑥
1+𝑦 2
1 2
∫ 1+𝑦2 𝑑𝑦 = ∫ 2𝑥𝑒 𝑥 𝑑𝑥 𝑢 = 𝑥 2 & 𝑑𝑢 = 2𝑥𝑑𝑥
1
∫ 1+𝑦2 𝑑𝑦 = ∫ 𝑒 𝑢 𝑑𝑢
tan−1 𝑦 = 𝑒 𝑢 + 𝐶
2
tan−1 𝑦 = 𝑒 𝑥 + 𝐶
2
𝑦 = tan(𝑒 𝑥 + 𝐶) is a general solution of diff. eq.
Example 6: Solve (𝑥 + 1)𝑦𝑑𝑥 + (𝑥 − 1)(𝑦 + 1)𝑑𝑦 = 0
Solution. Divide the differential equation by (𝑥 − 1)𝑦
𝑥+1 𝑦+1
𝑑𝑥 + 𝑑𝑦 = 0 is separable diff. eq.
𝑥−1 𝑦
𝑥+1 𝑦+1
∫ 𝑑𝑥 + ∫ 𝑑𝑦 = 0
𝑥−1 𝑦
𝑥+1+1−1 𝑦+1
∫ 𝑑𝑥 + ∫ 𝑑𝑦 = 0
𝑥−1 𝑦
2 1
∫(1 + 𝑥−1) 𝑑𝑥 + ∫(1 + 𝑦)𝑑𝑦 = 0
𝑥 + 2 ln(𝑥 − 1) + 𝑦 + ln 𝑦 = 𝐶
𝑥 + ln(𝑥 − 1)2 + 𝑦 + ln 𝑦 = 𝐶
𝑥 + 𝑦 + ln(𝑥 − 1)2 𝑦 = 𝐶 is a general solution.
Example 7: Solve (𝑥𝑦 + 𝑦)𝑑𝑥 + (𝑦 2 𝑥 − 𝑦 2 − 𝑥 + 1)𝑑𝑦 = 0
Solution. (𝑥 + 1)𝑦𝑑𝑥 + 𝑦 2 (𝑥 − 1) − (𝑥 − 1)𝑑𝑦 = 0
(𝑥 + 1)𝑦𝑑𝑥 + (𝑦 2 − 1)(𝑥 − 1)𝑑𝑦 = 0
Divide the differential equation by (𝑥 − 1)𝑦
𝑥+1 𝑦2 −1
𝑑𝑥 + 𝑑𝑦 = 0 is separable diff. eq.
𝑥−1 𝑦
𝑥+1 𝑦2 − 1
∫ 𝑑𝑥 + ∫ 𝑑𝑦 = 0
𝑥−1 𝑦
11
Physics department (2023-2024)
Differential Equations
𝑥+1+1−1 1
∫ 𝑑𝑥 + ∫(𝑦 − )𝑑𝑦 = 0
𝑥−1 𝑦
2 1
∫(1 + 𝑥−1) 𝑑𝑥 + ∫(𝑦 − 𝑦)𝑑𝑦 = 0
1
𝑥 + 2 ln(𝑥 − 1) + 𝑦 2 − ln 𝑦 = 𝐶
2
1
𝑥 + ln(𝑥 − 1)2 + 2 𝑦 2 − ln 𝑦 = 𝐶
1 (𝑥−1)2
𝑥 + 2 𝑦 2 + ln =𝐶 is a general solution.
𝑦
Exercises:
𝑑𝑦 1
1) = sin 5𝑥 𝐴𝑛𝑠. 𝑦 = − cos 5𝑥 + 𝐶
𝑑𝑥 5
1 −3𝑥
2) 𝑑𝑥 + 𝑒 3𝑥 𝑑𝑦 = 0 𝐴𝑛𝑠. 𝑦 = 𝑒 +𝐶
3
𝑑𝑦
3) (1 + 𝑥) =𝑥+6 𝐴𝑛𝑠. 𝑦 = 𝑥 + 5 ln|𝑥 + 1| + 𝐶
𝑑𝑥
4) 𝑥𝑦 ′ = 4𝑦 𝐴𝑛𝑠. 𝑦 = 𝐶𝑥 4
𝑑𝑦 𝑦 3
5) = 𝐴𝑛𝑠. 𝑦 −2 = 2𝑥 −1 + 𝐶
𝑑𝑥 𝑥 2
𝑑𝑥 𝑥2 𝑦2
6) = 𝐴𝑛𝑠. − 3 + 3𝑥 ln 𝑥 = 𝑥𝑦 3 + 3𝑥𝐶
𝑑𝑦 1+𝑥
𝑑𝑦
7) = 𝑒 (3𝑥+2𝑦) 𝐴𝑛𝑠. −3𝑒 −2𝑦 = 2𝑒 3𝑥 + 𝐶 𝑤ℎ𝑒𝑟𝑒 𝐶 = 6𝐶1
𝑑𝑥
8)(4𝑦 + 𝑦 𝑥 2 )𝑑𝑦 − (2𝑥 + 𝑥𝑦 2 )𝑑𝑥 = 0 𝐴𝑛𝑠. 2 + 𝑦 2 = 𝐶 (4 + 𝑥 2 ) 𝑤ℎ𝑒𝑟𝑒 𝐶 = 𝑒 2𝐶1
9) 2𝑦(𝑥 + 1)𝑑𝑦 = 𝑥𝑑𝑥 𝐴𝑛𝑠. 𝑦 2 = 𝑥 − ln|𝑥 + 1| + 𝐶
𝑑𝑥 𝑦+1 2 𝑥3 𝑥3
10)𝑦 ln 𝑥 =( ) 𝐴𝑛𝑠. ln 𝑥 −
𝑑𝑦 𝑥 3 9
𝑦2
= + 2𝑦 + ln|𝑦| + 𝐶
2
11) 𝑠𝑒𝑐 2 𝑥 𝑑𝑦 + 𝑐𝑠𝑐𝑦 𝑑𝑥 = 0 𝐴𝑛𝑠. 4 cos 𝑦 = 2𝑥 + sin 2𝑥 + 4𝐶
12) 𝑒 𝑦 sin 2𝑥 𝑑𝑥 + cos 𝑥( 𝑒 2𝑦 − 𝑦) 𝑑𝑦 = 0 𝐴𝑛𝑠. −2 cos 𝑥 + 𝑒 𝑦 − 𝑦𝑒 −𝑦 − 𝑒 −𝑦 = 𝐶
13) (𝑒 𝑦 + 1)2 𝑒 −𝑦 𝑑𝑥 + (𝑒 𝑥 + 1)3 𝑒 −𝑥 𝑑𝑦 = 0 𝐴𝑛𝑠. (𝑒 𝑥 + 1)−2 + 2 (𝑒 𝑦 + 1)−1 = 𝐶
12
Physics department (2023-2024)
Differential Equations
Definition: Homogenous equations:
A function is called homogeneous of degree n if 𝑓(𝑡𝑥, 𝑡𝑦) = 𝑡 𝑛 𝑓(𝑥, 𝑦)for all𝑥, 𝑦, 𝑡.
Example:𝑓(𝑥, 𝑦) = 𝑥 − 3√𝑥𝑦 + 5𝑦
Solution: 𝑓(𝑡𝑥, 𝑡𝑦) = 𝑡𝑥 − 3√(𝑡𝑥)(𝑡𝑦) + 5𝑡𝑦
= 𝑡𝑥 − 3𝑡√𝑥𝑦 + 5𝑡𝑦
= 𝑡(𝑥 − 3√𝑥𝑦 + 5𝑦)
𝑓(𝑡𝑥, 𝑡𝑦) = 𝑡𝑓(𝑥, 𝑦)
Thus the given function is homogeneous With degree one.
Example:𝑓(𝑥, 𝑦) = √ 𝑥 3 + 𝑦 3
Solution: 𝑓(𝑡𝑥, 𝑡𝑦) = √ 𝑡 3 𝑥 3 + 𝑡 3 𝑦 3
= 𝑡 3⁄2 √ 𝑥 3 + 𝑦 3
= 𝑡 3⁄2 𝑓(𝑥, 𝑦)
Thus 𝑓(𝑥, 𝑦)is homogeneous With degree 3⁄2.
Example:𝑓(𝑥, 𝑦) = 𝑥 2 + 𝑦 2 + 1
Solution: 𝑓(𝑡𝑥, 𝑡𝑦) = (𝑡𝑥)2 + (𝑡𝑦)2 + 1
= 𝑡 2 𝑥 2 + 𝑡 2 𝑦 2 + 1 ≠ 𝑡 𝑛 𝑓(𝑥, 𝑦)
𝑓(𝑥, 𝑦)is not homogeneous
Example: 𝑓(𝑥, 𝑦) = ln 𝑥 2 − 2 ln 𝑦 = 2 ln 𝑥 − 2 ln 𝑦
Solution: 𝑓(𝑡𝑥, 𝑡𝑦) = 2 ln 𝑡𝑥 − 2 ln 𝑡𝑦
= 2 ln 𝑡 + 2 ln 𝑥 − 2 ln 𝑡 − 2 ln 𝑦
13
Physics department (2023-2024)
Differential Equations
= 2 ln 𝑥 − 2 ln 𝑦
𝑓(𝑡𝑥, 𝑡𝑦) = 𝑡 0 𝑓(𝑥, 𝑦)
Thus the given function is homogeneous With degree zero.
Theorem: The ODE 𝑀(𝑥, 𝑦) + 𝑁(𝑥, 𝑦)𝑦 ′ = 0 is said to be homogeneous of
degree n if both 𝑀(𝑥, 𝑦) and 𝑁(𝑥, 𝑦)are homogeneous of degree 𝑛. Then the ODE
can be reduced to a seperable equation by transformation 𝑣 = 𝑦/𝑥 or 𝑣 = 𝑥/𝑦.
𝑑𝑦 𝑦−𝑥
Example1 : Solve =
𝑑𝑥 𝑦+𝑥
Solution. We cannot separate the variables,
𝑀(𝑡𝑥, 𝑡𝑦) = 𝑡𝑥 − 𝑡𝑦 = 𝑡(𝑥 − 𝑦)
𝑀(𝑡𝑥, 𝑡𝑦) = 𝑡𝑀(𝑥, 𝑦)
The function 𝑀(𝑥, 𝑦) is homogeneous of degree 1
𝑁(𝑡𝑥, 𝑡𝑦) = 𝑡𝑦 + 𝑡𝑥 = 𝑡(𝑦 + 𝑥)
𝑁(𝑡𝑥, 𝑡𝑦) = 𝑡𝑁(𝑥, 𝑦)
The function 𝑁(𝑥, 𝑦) is homogeneous of degree 1
Then the differential equation is homogeneous of degree 1.
(𝑦 − 𝑥 )𝑑𝑥 − (𝑥 + 𝑦)𝑑𝑦 = 0
Substituting
𝑑𝑦 𝑑𝑢
𝑦 = 𝑢𝑥 and =𝑢+𝑥 or 𝑑𝑦 = 𝑢𝑑𝑥 + 𝑥𝑑𝑢
𝑑𝑥 𝑑𝑥
14
Physics department (2023-2024)
Differential Equations
we get
𝑦
𝑑𝑦 −1 𝑑𝑢 𝑢−1
𝑥
= 𝑦 ⇒ 𝑢+𝑥 =
𝑑𝑥
𝑥
+1 𝑑𝑥 𝑢+1
𝑑𝑢 𝑢−1 𝑑𝑢 𝑢−1−𝑢2 −𝑢
𝑥 = −𝑢 ⇒𝑥 =
𝑑𝑥 𝑢+1 𝑑𝑥 𝑢+1
𝑑𝑢 1+𝑢2 (𝑢+1)𝑑𝑢 𝑑𝑥
𝑥 𝑑𝑥 = − 𝑢+1 ⇒ + =0
𝑢2 +1 𝑥
𝑢 𝑑𝑢 𝑑𝑥
∫ 𝑢2 +1 𝑑𝑢 + ∫ 𝑢2 +1 + ∫ 𝑥
=0
1
ln(𝑢2 + 1) + tan−1 𝑢 + ln 𝑥 = ln 𝐶
2
1 𝑦2 𝑦
⇒ ln ( + 1) + tan−1 + ln 𝑥 = ln 𝐶 is a general solution
2 𝑥2 𝑥
𝑑𝑦 3 𝑦 2 +𝑥𝑦
Example2: Solve = where 𝑦(1) = −0.5.
𝑑𝑥 𝑥2
Solution:
15
Physics department (2023-2024)
Differential Equations
Example3: Solve (𝑥 2 − 𝑦 2 )𝑑𝑥 + 2𝑥𝑦𝑑𝑦 = 0
Solution. We cannot separate the variables,
𝑀(𝑡𝑥, 𝑡𝑦) = (𝑡𝑥)2 − (𝑡𝑦)2 = 𝑡 2 (𝑥 2 − 𝑦 2 )
𝑀(𝑡𝑥, 𝑡𝑦) = 𝑡 2 𝑀(𝑥, 𝑦)
The function 𝑀(𝑥, 𝑦) is homogeneous of degree 2
𝑁(𝑡𝑥, 𝑡𝑦) = 2𝑡 2 𝑥𝑦 = 𝑡 2 (2𝑥𝑦)
𝑁(𝑡𝑥, 𝑡𝑦) = 𝑡 2 𝑁(𝑥, 𝑦)
16
Physics department (2023-2024)
Differential Equations
The function 𝑁(𝑥, 𝑦) is homogeneous of degree 2
Then the differential equation is homogeneous of degree 2.
Substituting
𝑦 = 𝑢𝑥 and 𝑑𝑦 = 𝑢𝑑𝑥 + 𝑥𝑑𝑢
we get
(1 − 𝑢2 )𝑑𝑥 + 2𝑢(𝑢𝑑𝑥 + 𝑥𝑑𝑢) = 0
Separating the variables gives
2𝑢𝑑𝑢 𝑑𝑥
=−
𝑢2 +1 𝑥
Integrating we get
ln(𝑢2 + 1) = − ln 𝑥 + ln 𝐶
Taking exponentials we obtain
𝑥(𝑢2 + 1) = 𝐶
𝑦
Finally, since = , this becomes
𝑥
𝑥 2 + 𝑦 2 = 𝐶𝑥
Example4: Solve (𝑥 2 + 𝑦 2 )𝑑𝑥 + (𝑥 2 − 𝑥𝑦)𝑑𝑦 = 0
y y−x
Example 5: Solve the O.D.E. y = + sin( )
x x
Solution:
Let 𝑦 = 𝑢𝑥 . Hence we
du du
u+x = u + sin(u − 1) or x = sin(u − 1)
dx dx
1 dx
Separating the variables, we get du =
sin(u − 1) x
Integrating we get csc(𝑢 − 1) – cot (𝑢 − 1) = 𝐶𝑥
17
Physics department (2023-2024)
Differential Equations
𝑢=𝑦/𝑥 𝑦 𝑦
1 – cos(𝑢 − 1) = 𝐶𝑥 sin (𝑢 − 1) ⇒ 1 – cos ( − 1) = 𝐶𝑥 sin ( − 1)
𝑥 𝑥
Example 6. Find the general solutions of
𝑑𝑦 −2𝑥+5𝑦
=
𝑑𝑥 2𝑥+𝑦
−2𝑥+5𝑦
Solution: It is easy to check that 𝑓 (𝑥, 𝑦) = is
2𝑥+𝑦
homogeneous;
𝑦
Consider 𝑦 = 𝑢𝑥 ⇒ 𝑢 =
𝑥
We have
−2𝑥+5𝑥𝑢 −2+5𝑢
𝑥𝑢′ + 𝑢 = ( = )
2𝑥+𝑥𝑢 2+𝑢
which can be rewritten as
1 −2+5𝑢
𝑢′ = ( −𝑢)
𝑥 2+𝑢
This is a separable equation.
−4 ln(|𝑢 − 2|) + 3 ln(|𝑢 − 1|) = ln(|𝑥 |) + 𝐶
Back to the function y, we get
−4 ln(|𝑦 − 2𝑥 |) + 3 ln(|𝑦 − 𝑥 |) = 𝐶
18
Physics department (2023-2024)
Differential Equations
Exercises:
19
Physics department (2023-2024)
Differential Equations
20