Module 2 Notes
Module 2 Notes
These methods yields solutions either as a power series in 𝑥 from which the values
of 𝑦 can be found by direct substitution, or set of values of 𝑥 and 𝑦.
The initial condition in (1) is specified at the point 𝑥0 . Such problems in which all
the conditions are given at the initial point only are called initial value problems.
But there are problems involving second and higher order differential equations in
which the conditions may be given at two or more points. These are known as
boundary value problems.
the initial condition 𝑦(𝑥0 ) = 𝑦0 . The solution 𝑦(𝑥) is approximated to power series
in 𝑥 − 𝑥0 using Taylor’s series. We have Taylor’s series expansion of 𝑦(𝑥) about
the point 𝑥0 in the form
(𝒙 − 𝒙𝟎 ) ′ (𝒙 − 𝒙𝟎 )𝟐 ′′ (𝒙 − 𝒙𝟎 )𝟑 ′′′ (𝒙 − 𝒙𝟎 )𝟒 ′𝒗
𝒚(𝒙) = 𝒚(𝒙𝟎 ) + 𝒚 (𝒙𝟎 ) + 𝒚 (𝒙𝟎 ) + 𝒚 (𝒙𝟎 ) + 𝒚 (𝒙𝟎 ) + ⋯
𝟏! 𝟐! 𝟑! 𝟒!
1. Find by Taylor’s series method the value of 𝑦 at 𝑥 = 0.1 and 𝑥 = 0.2 to five places
𝑑𝑦
of decimals from = 𝑥 2 𝑦 − 1 with 𝑦(0) = 1.
𝑑𝑥
𝒚(𝟎) = 𝟏
𝑥2 𝑥3 𝑥4
𝑦(𝑥) = 1 + 𝑥(−1) + (0) + (2) + (−6) + ⋯
2 6 24
𝒙𝟑 𝒙𝟒
∴ 𝒚(𝒙) = 𝟏 − 𝒙 + − + ⋯
𝟑 𝟒
(0.1)3 (0.1)4
Hence 𝑦(0.1) = 1 − (0.1) + − => 𝒚(𝟎. 𝟏) = 𝟎. 𝟗𝟎𝟎𝟑𝟑.
3 4
(0.2)3 (0.2)4
𝑦(0.2) = 1 − (0.2) + − => 𝒚(𝟎. 𝟐) = 𝟎. 𝟖𝟎𝟐𝟐𝟕.
3 4
𝑑𝑦
2. Solve by Taylor’s series method the equation = log(𝑥𝑦) for 𝑦(1.1) and (1.2)
𝑑𝑥
correct to 5 decimal places, given 𝑦(1) = 2.
Solution: We have Taylor’s series expansion of 𝑦(𝑥)
(𝒙 − 𝒙𝟎 ) ′ (𝒙 − 𝒙𝟎 )𝟐 ′′ (𝒙 − 𝒙𝟎 )𝟑 ′′′ (𝒙 − 𝒙𝟎 )𝟒 ′𝒗
𝒚(𝒙) = 𝒚(𝒙𝟎 ) + 𝒚 (𝒙𝟎 ) + 𝒚 (𝒙𝟎 ) + 𝒚 (𝒙𝟎 ) + 𝒚 (𝒙𝟎 ) + ⋯
𝟏! 𝟐! 𝟑! 𝟒!
Given 𝑥0 = 1, 𝑦0 = 2 𝑎𝑛𝑑 𝑦 ′ (𝑥) = log(𝑥𝑦) = log 𝑥 + log 𝑦
′ (1)
(𝑥 − 1)2 ′′ (𝑥 − 1)3 ′′′ (𝑥 − 1)4 ′𝑣
∴ 𝑦(𝑥) = 𝑦(1) + (𝑥−1)𝑦 + 𝑦 (1) + 𝑦 (1) + 𝑦 (1) + ⋯ (1)
2 6 24
𝒚(𝟏) = 𝟐
𝑦 ′ (𝑥) = log 𝑥 + log 𝑦 => 𝑦 ′ (1) = log 1 + log 2 => 𝒚′ (𝟏) = 𝟎. 𝟔𝟗𝟑𝟏𝟓
1 1 ′ 1 1
𝑦 ′′ (𝑥) = + 𝑦 => 𝑦 ′′ (1) = + (0.69315) => 𝒚′′ (𝟏) = 𝟏. 𝟑𝟒𝟔𝟓𝟖
𝑥 𝑦 1 2
1 1 ′ 2 1 ′′ 1 1 1
𝑦 ′′′ (𝑥) = − − (𝑦 ) + 𝑦 => 𝑦 ′′′
(1) = − − (0.69315)2
+ (1.34658)
𝑥2 𝑦2 𝑦 (1)2 (2)2 2
(𝒙 − 𝟏)𝟐 (𝒙 − 𝟏)𝟑
∴ 𝒚(𝒙) = 𝟐 + (𝒙 − 𝟏)(𝟎. 𝟔𝟗𝟑𝟏𝟓) + (𝟏. 𝟑𝟒𝟔𝟓𝟖) + (−𝟎. 𝟒𝟒𝟔𝟖𝟐) + ⋯
𝟐 𝟔
Hence
(1.1 − 1)2 (1.1 − 1)3
𝑦(1.1) = 2 + (1.1 − 1)(0.69315) + (1.34658) − (0.44682)
2 6
𝑑𝑦
3. Solve = 2𝑦 + 3𝑒 𝑥 , 𝑦(0) = 0 using Taylor’s series method and find y(0.1) &
𝑑𝑥
′ (0)
𝑥 2 ′′ 𝑥 3 ′′′ 𝑥 4 ′𝑣
∴ 𝑦(𝑥) = 𝑦(0) + 𝑥𝑦 + 𝑦 (0) + 𝑦 (0) + 𝑦 (0) + ⋯ (1)
2 6 24
𝒚 ( 𝟎) = 𝟎
𝑦 ′ (𝑥) = 2𝑦 + 3𝑒 𝑥 => 𝑦 ′ (0) = 2(0) + 3𝑒 0 => 𝒚′ (𝟎) = 𝟑
𝑥2 𝑥3 𝑥4
𝑦(𝑥) = 0 + 𝑥(3) + (9) + (21) + (45) + ⋯
2 6 24
1. Employ Taylor’s series method to find an approximate solution correct to fourth decimal
𝑑𝑦
places for the following initial value problem at 𝑥 = 0.1, = 𝑥−𝑦 2 , 𝑦(0) = 1.
𝑑𝑥
2. Evaluate y(0.1) correct to 6 decimal places by Taylor’s series method if y(x) satisfies
𝑑𝑦
= 𝑥𝑦 + 1, 𝑦(0) = 1.
𝑑𝑥
𝑑𝑦
3. Use Taylor’s series method to find 𝑦 at 𝑥 = 0.1, 0.2, given that = 𝑥 2 + 𝑦 2 and
𝑑𝑥
(2) ℎ (1)
𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓 (𝑥1 , 𝑦1 )].
2
(3) ℎ (2)
𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓 (𝑥1 , 𝑦1 )] and so on.
2
(1) 0.3
𝑦1 =1+ [1 + 1.6] => 𝒚(𝟏)
𝟏 = 𝟏. 𝟑𝟗𝟎𝟎𝟎
2
(2) ℎ (1) (2) 0.3
𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓 (𝑥1 , 𝑦1 )] => 𝑦1 = 1 + [𝑓(0, 1) + 𝑓(0.3, 1.39)]
2 2
(2) 0.3
𝑦1 =1+ [1 + 1.69] => 𝒚(𝟐)
𝟏 = 𝟏. 𝟒𝟎𝟑𝟓𝟎
2
(3) ℎ (2) (3) 0.3
𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓 (𝑥1 , 𝑦1 )] => 𝑦1 = 1 + [𝑓(0, 1) + 𝑓(0.3, 1.4035)]
2 2
(3) 0.3
𝑦1 =1+ [1 + 1.7035] => 𝒚(𝟑)
𝟏 = 𝟏. 𝟒𝟎𝟓𝟓𝟑
2
(4) ℎ (3) (4) 0.3
𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓 (𝑥1 , 𝑦1 )] => 𝑦1 = 1 + [𝑓(0, 1) + 𝑓(0.3, 1.40553)]
2 2
(4) 0.3
𝑦1 =1+ [1 + 1.70553] => 𝒚(𝟒)
𝟏 = 𝟏. 𝟒𝟎𝟓𝟖𝟑
2
(5) ℎ (4) (5) 0.3
𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓 (𝑥1 , 𝑦1 )] => 𝑦1 = 1 + [𝑓(0, 1) + 𝑓(0.3, 1.40583)]
2 2
(5) 0.3
𝑦1 =1+ [1 + 1.70583] => 𝒚(𝟐)
𝟏 = 𝟏. 𝟒𝟎𝟓𝟖𝟕
2
(6) ℎ (5) (6) 0.3
𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓 (𝑥1 , 𝑦1 )] => 𝑦1 = 1 + [𝑓(0, 1) + 𝑓(0.3, 1.40587)]
2 2
(6) 0.3
𝑦1 =1+ [1 + 1.70587] => 𝒚(𝟔)
𝟏 = 𝟏. 𝟒𝟎𝟓𝟖𝟖
2
(7) ℎ (6) (7) 0.3
𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓 (𝑥1 , 𝑦1 )] => 𝑦1 = 1 + [𝑓(0, 1) + 𝑓(0.3, 1.40588)]
2 2
(7) 0.3
𝑦1 =1+ [1 + 1.70588] => 𝒚(𝟕)
𝟏 = 𝟏. 𝟒𝟎𝟓𝟖𝟖
2
∴ 𝑦(𝑥0 + ℎ) = 𝑦(0 + 0.3) = 𝒚(𝟎. 𝟑) = 𝟏. 𝟒𝟎𝟓𝟖𝟖
II Stage: We need to find 𝑦(0.4) using 𝑦(0.2) = 0.2468 as the initial condition and
taking ℎ = 0.2. Now 𝒙𝟎 = 𝟎. 𝟐, 𝒚𝟎 = 𝟎. 𝟐𝟒𝟔𝟖, 𝒇(𝒙, 𝒚) = 𝒚 + 𝒆𝒙 .
𝑥1 = 𝑥0 + ℎ = 0.2 + 0.2 => 𝒙𝟏 = 𝟎. 𝟒.
From Euler’s formula, 𝑦1 = 𝑦0 + ℎ𝑓(𝑥0 , 𝑦0 )
𝑦1 = 0.2468 + 0.2𝑓(0.2, 0.2468) => 𝑦1 = 0.2468 + 0.2(1.4682) => 𝒚𝟏 = 𝟎. 𝟓𝟒𝟎𝟒
From modified Euler’s formula,
(1) ℎ
𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓(𝑥1 , 𝑦1 )]
2
(1) 0.2
=> 𝑦1 = 0.2468 + [𝑓(0.2, 0.2468) + 𝑓(0.4, 0.5404)]
2
(1) (𝟏)
=> 𝑦1 = 0.2468 + (0.1)[1.4682 + 2.0322] => 𝒚𝟏 = 𝟎. 𝟓𝟗𝟔𝟖
(2) ℎ (1)
𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓 (𝑥1 , 𝑦1 )]
2
(2) 0.2
=> 𝑦1 = 0.2468 + [𝑓(0.2, 0.2468) + 𝑓(0.4, 0.5968)]
2
(2) (𝟐)
=> 𝑦1 = 0.2468 + (0.1)[1.4682 + 2.0886] => 𝒚𝟏 = 𝟎. 𝟔𝟎𝟐𝟓
(3) ℎ (2)
𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓 (𝑥1 , 𝑦1 )]
2
(3) 0.2
=> 𝑦1 = 0.2468 + [𝑓(0.2, 0.2468) + 𝑓(0.4, 0.6025)]
2
(3) (𝟑)
=> 𝑦1 = 0.2468 + (0.1)[1.4682 + 2.0943] => 𝒚𝟏 = 𝟎. 𝟔𝟎𝟑𝟏
(4) ℎ (3)
𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓 (𝑥1 , 𝑦1 )]
2
(4) 0.2
=> 𝑦1 = 0.2468 + [𝑓(0.2, 0.2468) + 𝑓(0.4, 0.6031)]
2
(4) (𝟒)
=> 𝑦1 = 0.2468 + (0.1)[1.4682 + 2.0949] => 𝒚𝟏 = 𝟎. 𝟔𝟎𝟑𝟏
𝑑𝑦
3. Use Modified Euler’s method to solve = 𝑥 + │√𝑦│ , y (0) = 1, for the range
𝑑𝑥
0 < 𝑥 < 0.6 taking h = 0.2. (Carry out computations correct to 3 decimal places)
Solution:
I Stage: We need to find 𝑦(0.2) by taking ℎ = 0.2.
(1) ℎ
𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓(𝑥1 , 𝑦1 )]
2
(1) 0.2
=> 𝑦1 = 1.231 + [𝑓(0.2, 1.231) + 𝑓(0.4, 1.493)]
2
(1) (𝟏)
=> 𝑦1 = 1.231 + (0.1)[1.310 + 1.622] => 𝒚𝟏 = 𝟏. 𝟓𝟐𝟒
(2) ℎ (1)
𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓 (𝑥1 , 𝑦1 )]
2
(2) 0.2
=> 𝑦1 = 1.231 + [𝑓(0.2, 1.231) + 𝑓(0.4, 1.524)]
2
(1) (𝟏)
=> 𝑦1 = 1.231 + (0.1)[1.310 + 1.635] => 𝒚𝟏 = 𝟏. 𝟓𝟐𝟓
(3) ℎ (2)
𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓 (𝑥1 , 𝑦1 )]
2
(3) 0.2
=> 𝑦1 = 1.231 + [𝑓(0.2, 1.231) + 𝑓(0.4, 1.525)]
2
(3) (𝟏)
=> 𝑦1 = 1.231 + (0.1)[1.310 + 1.635] => 𝒚𝟏 = 𝟏. 𝟓𝟐𝟓
∴ 𝑦(𝑥0 + ℎ) = 𝑦(0.2 + 0.2) = 𝒚(𝟎. 𝟒) = 𝟏. 𝟓𝟐𝟓
III Stage: We need to find 𝑦(0.6) using 𝑦(0.4) = 1.525 as the initial condition and
taking ℎ = 0.2. Now 𝒙𝟎 = 𝟎. 𝟒, 𝒚𝟎 = 𝟏. 𝟓𝟐𝟓, 𝒇(𝒙, 𝒚) = 𝒙 + √𝒚.
(2) ℎ (1)
𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓 (𝑥1 , 𝑦1 )]
2
(2) 0.2
=> 𝑦1 = 1.525 + [𝑓(0.4, 1.525) + 𝑓(0.6, 1.885)]
2
(2) (𝟐)
=> 𝑦1 = 1.525 + (0.1)[1.635 + 1.973] => 𝒚𝟏 = 𝟏. 𝟖𝟖𝟔
(3) ℎ (2)
𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓 (𝑥1 , 𝑦1 )]
2
(3) 0.2
=> 𝑦1 = 1.525 + [𝑓(0.4, 1.525) + 𝑓(0.6, 1.886)]
2
(3) (𝟑)
=> 𝑦1 = 1.525 + (0.1)[1.635 + 1.973] => 𝒚𝟏 = 𝟏. 𝟖𝟖𝟔
∴ 𝑦(𝑥0 + ℎ) = 𝑦(0.4 + 0.2) = 𝒚(𝟎. 𝟔) = 𝟏. 𝟖𝟖𝟔
𝑦
1. Using modified Euler’s method find 𝑦 𝑎𝑡 𝑥 = 0.2, given 𝑦 ′ = 3𝑥 + 𝑤𝑖𝑡ℎ 𝑦(0) = 1,
2
𝑑𝑦
2. Using Modified Euler’s method to find y (0.1) given = 𝑥 2 + 𝑦 , 𝑦(0) = 1 by taking
𝑑𝑥
𝑑𝑦 1
3. Given = − 2𝑦 2 , 𝑦(0) = 0 Find 𝑦(0.5) in two steps, using the Modified
𝑑𝑥 1+𝑥 2
Calculate successively
𝑘1 = ℎ𝑓(𝑥0 , 𝑦0 )
ℎ 𝑘1
𝑘2 = ℎ𝑓 (𝑥0 + , 𝑦0 + )
2 2
ℎ 𝑘2
𝑘3 = ℎ𝑓 (𝑥0 + , 𝑦0 + ) 𝑎𝑛𝑑
2 2
𝑘4 = ℎ𝑓 (𝑥0 + ℎ, 𝑦0 + 𝑘3 ).
1
Finally compute 𝑘 = (𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4 ) which gives the required
6
approximate value 𝒚𝟏 = 𝒚𝟎 + 𝒌.
𝑑𝑦
1. Apply Runge-Kutta method of fourth order to solve = 𝑥 + 𝑦, 𝑦(0) = 1 at
𝑑𝑥
𝑥 = 0.2 with step length h = 0.2. (carry out computations correct to 4 decimal
places)
Solution: Here 𝑥0 = 0, 𝑦0 = 1, 𝒇(𝒙, 𝒚) = 𝒙 + 𝒚 and ℎ = 0.2.
From Runge Kutta method,
𝑘1 = ℎ𝑓(𝑥0 , 𝑦0 ) = 0.2𝑓(0, 1) = 0.2(1) => 𝒌𝟏 = 𝟎. 𝟐
ℎ 𝑘1 0.2 0.2
𝑘2 = ℎ𝑓 (𝑥0 + , 𝑦0 + ) = 0.2𝑓 (0 + ,1 + ) = 0.2𝑓(0.1, 1.1)
2 2 2 2
=> 𝑘2 = 0.2(1.2) => 𝒌𝟐 = 𝟎. 𝟐𝟒
ℎ 𝑘2 0.2 0.24
𝑘3 = ℎ𝑓 (𝑥0 + , 𝑦0 + ) = 0.2𝑓 (0 + ,1+ ) = 0.2𝑓(0.1, 1.12)
2 2 2 2
=> 𝑘3 = 0.2(1.22) => 𝒌𝟑 = 𝟎. 𝟐𝟒𝟒
𝑘4 = ℎ𝑓(𝑥0 + ℎ, 𝑦0 + 𝑘3 ) = 0.2𝑓(0 + 0.2, 1 + 0.244) = 0.2𝑓(0.2, 1.244)
=> 𝑘4 = 0.2(1.444) => 𝒌𝟒 = 𝟎. 𝟐𝟖𝟖𝟖
1 1
∴ 𝑘 = (𝑘1 + 2𝑘2 + 3𝑘3 + 𝑘4 ) = (0.2 + 2(0.24) + 2(0.244) + 0.2888)
6 6
=> 𝒌 = 𝟎. 𝟐𝟒𝟐𝟖
Hence the required approximate value of 𝑦 is
𝑦1 = 𝑦(𝑥0 + ℎ) = 𝑦0 + 𝑘 => 𝑦(0 + 0.2) = 1 + 0.2428
∴ 𝒚(𝟎. 𝟐) = 𝟏. 𝟐𝟒𝟐𝟖
𝑑𝑦 𝑦 2 −𝑥 2
2. Using Runge- Kutta 4th order method to solve = with 𝑦(0) = 1 at
𝑑𝑥 𝑦 2 +𝑥 2
𝑥 = 0.2, 0.4. (carry out computations correct to 5 decimal places)
I Stage: First we need to find 𝑦(0.2).
𝒚𝟐 −𝒙𝟐
Here 𝑥0 = 0, 𝑦0 = 1, 𝒇(𝒙, 𝒚) = and ℎ = 0.2.
𝒚𝟐 +𝒙𝟐
II Stage: We need to find 𝑦(0.4) using 𝑦(0.2) = 1.196 as the initial condition.
𝒚𝟐 −𝒙𝟐
Here 𝑥0 = 0.2, 𝑦0 = 1.196, 𝒇(𝒙, 𝒚) = and ℎ = 0.2.
𝒚𝟐 +𝒙𝟐
𝑑𝑦 𝑦
3. Using Runge-Kutta method of order 4, Solve = 3𝑥 + , 𝑦(0) = 1 at the points
𝑑𝑥 2
𝑥 = 0.1, 0.2 by taking step length take h = 0.1. (carry out computations correct to
4 decimal places)
II Stage: We need to find 𝑦(0.2) using 𝑦(0.1) = 1.0669 as the initial condition.
Here 𝑥0 = 0.1, 𝑦0 = 1.0669, 𝒇(𝒙, 𝒚) = 𝟑𝒙 + 𝒚/𝟐 and ℎ = 0.1.
From Runge Kutta method,
𝑘1 = ℎ𝑓(𝑥0 , 𝑦0 ) = 0.1𝑓(0.1, 1.0699) = 0.1(0.8335) => 𝒌𝟏 = 𝟎. 𝟎𝟖𝟑𝟑
ℎ 𝑘1 0.1 0.0833
𝑘2 = ℎ𝑓 (𝑥0 + , 𝑦0 + ) = 0.1𝑓 (0.1 + , 1.0669 + ) = 0.1𝑓(0.15, 1.1086)
2 2 2 2
=> 𝑘2 = 0.1(1.0043) => 𝒌𝟐 = 𝟎. 𝟏𝟎𝟎𝟒
ℎ 𝑘2 0.1 0.1004
𝑘3 = ℎ𝑓 (𝑥0 + , 𝑦0 + ) = 0.1𝑓 (0.1 + , 1.0669 + ) = 0.1𝑓(0.15, 1.1171)
2 2 2 2
=> 𝑘3 = 0.1(1.0086) => 𝒌𝟑 = 𝟎. 𝟏𝟎𝟎𝟗
𝑘4 = ℎ𝑓(𝑥0 + ℎ, 𝑦0 + 𝑘3 ) = 0.1𝑓(0.1 + 0.1, 1.0669 + 0.1009) = 0.1𝑓(0.2, 1.1678)
=> 𝑘4 = 0.1(1.1839) => 𝒌𝟒 = 𝟎. 𝟏𝟏𝟖𝟒
1 1
∴ 𝑘 = (𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4 ) = (0.0835 + 2(0.1004) + 2(0.1009) + 0.1184)
6 6
=> 𝒌 = 𝟎. 𝟏𝟎𝟎𝟕
Hence the required approximate value of 𝑦 is
𝑦1 = 𝑦(𝑥0 + ℎ) = 𝑦0 + 𝑘 => 𝑦(0.1 + 0.1) = 1.0669 + 0.1008
∴ 𝒚(𝟎. 𝟐) = 𝟏. 𝟏𝟔𝟕𝟔
𝑑𝑦
1. Apply Runge-Kutta method of order 4, to compute 𝑦(0.2) given 10 = 𝑥 2 + 𝑦2,
𝑑𝑥
𝑑𝑦
2. Use Runge-Kutta method of 4th order for 𝑦(0.1), 𝑦(0.2) given that = 𝑦(𝑥 + 𝑦),
𝑑𝑥
𝑑𝑦 𝑦−𝑥
3. Using Runge-Kutta method of order 4, find y(0.2) for the equation = ,
𝑑𝑥 𝑦+𝑥