Lecture 07 - 2
Lecture 07 - 2
Lecture 7
Method of solution:
The general solution of the first order linear differential equation is given by
u ( x) q ( x ) dx + C
y=∫
u ( x)
Where u ( x) = exp(∫ p ( x)dx )
The function u (x ) is called the integrating factor. If it is an IVP then use it to find the
constant C.
Summary:
1. Identify that the equation is 1st order linear equation. Rewrite it in the form
dy
+ p ( x) y = q( x)
dx
if the equation is not already in this form.
2. Find the integrating factor
u ( x) = e ∫
p ( x ) dx
y=
∫ u ( x ) q ( x ) dx + C
u ( x)
4. If you are given an IVP, use the initial condition to find the constant C.
5. Plug in the calculated value to write the particular solution of the problem.
Page 1 of 7
© Copyright Virtual University of Pakistan
Differential Equations (MTH401)
Example 1:
2. Since
∫ tan x dx = − ln cos x = ln sec x
u ( x) = e ∫ tan x dx = sec x
3. Further, because
4. We use the initial condition y (0) = 2 to find the value of the constant C
y ( 0) = C = 2
y = (sin x + 2 ) cos x
Page 2 of 7
© Copyright Virtual University of Pakistan
Differential Equations (MTH401)
dy 2t 2
Example 2: Solve the IVP − y = , y (0) = 0.4
dt 1 + t 2 1+ t 2
Solution:
1.The given equation is a 1st order linear and is already in the requisite form
dy
+ p( x) y = q( x)
dx
2t
p (t ) = − 1 + t 2
with 2
q(t ) =
1+ t2
⌠ 2t
2. Since − 2
dt = − ln | 1 + t 2 |
⌡ 1+ t
Therefore, the integrating factor is given by
⌠ 2t
− dt
⌡ 1+ t 2
u (t ) = e = (1 + t 2 ) −1
3. Hence, the general solution is given by
∫ u (t )q(t )dt + C , ⌠ 2
y=
u (t ) ∫ u(t )q(t )dt = ⌡ (1 + t 2 2
)
dt
⌠ 2 ⌠ 1+ t 2 − t 2 ⌠ 1 t2
Now dt = 2 (1 + t 2 ) 2 dt = 2 1 + t 2 (1 + t 2 ) 2 dt
−
⌡ (1 + t )
2 2
⌡ ⌡
The first integral is clearly tan −1 t . For the 2nd we will use integration by parts
with t as first function and 2t
(1 + t 2 ) 2
as 2nd function.
⌠ 2t 2 1 ⌠ 1 t
(1 + t 2 ) 2 dt = t − 1 + t 2 + dt = − + tan −1 (t )
⌡ 1+ t 1+ t
2 2
⌡
⌠ 2 t t
dt = 2 tan −1 (t ) + − tan −1 (t ) = tan −1 (t ) +
⌡ (1 + t ) 1+ t 1+ t2
2 2 2
-1 t
The general solution is: y = (1 + t ) tan (t ) + +
2
C
1+ t2
4. The condition y (0) = 0.4 gives C = 0.4
5. Therefore, solution to the initial value problem can be written as:
y = t + (1 + t 2 ) tan −1 (t ) + 0.4(1 + t 2 )
Page 3 of 7
© Copyright Virtual University of Pakistan
Differential Equations (MTH401)
Example 3:
Therefore
tan t + C 1 C
y= = + = sec t + C csc t
sin t cos t sin t
Page 4 of 7
© Copyright Virtual University of Pakistan
Differential Equations (MTH401)
Example 4
Solve ( x + 2 y ) dy
3
dx
=y
Solution:
We have
dy y
=
dx x + 2 y 3
This equation is not linear in y . Let us regard x as dependent variable and y as
independent variable. The equation may be written as
dx x + 2 y 3
=
dy y
dx 1
or − x = 2y2
dy y
Which is linear in x
⌠ 1 1 1
IF = exp − dy = exp ln =
⌡ y y y
1
Multiplying with the IF = , we get
y
1 dx 1
− x = 2y
y dy y 2
d x
= 2y
dy y
Integrating, we have
x
= y2 + c
y
(
x = y y2 + c )
is the required solution.
Page 5 of 7
© Copyright Virtual University of Pakistan
Differential Equations (MTH401)
Example 5
Solve
(x − 1)3 dy + 4(x − 1)2 y = x + 1
dx
Solution:
dy 4 x +1
+ y=
dx x − 1 (x − 1)3
4
Here P(x ) = .
x −1
4dx
IF = exp ⌠
⌡ x − 1
[ 4
]
= exp ln( x − 1) = ( x − 1)
4
or
d
dx
[ ]
y ( x − 1)4 = x 2 − 1
x3
y ( x − 1) = − x + c
4
3
which is the required solution.
Page 6 of 7
© Copyright Virtual University of Pakistan
Differential Equations (MTH401)
Exercise
dy 2 x + 1 −2 x
1. + y = e
dx x
dy
2. + 3 y = 3 x 2 e −3 x
dx
dy
3. x + (1 + x cot x ) y = x
dx
4. (x + 1) dy − ny = e x (x + 1)n+1
dx
5. (1 + x ) dy
2
+ 4 xy =
1
dx (1 + x ) 2 2
dr
6. + r secθ = cosθ
dθ
dy 1 − e −2 x
7. +y= x
dx e + e −x
(
8. dx = 3e y − 2 x dy )
Solve the initial value problems
9.
dy
dx
(
= 2 y + x e 3x − e 2 x , ) y (0) = 2
dy
10. x(2 + x ) + 2(1 + x ) y = 1 + 3x 2 , y (− 1) = 1
dx
Page 7 of 7
© Copyright Virtual University of Pakistan