Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
15 views25 pages

Module V

The document discusses numerical methods for solving ordinary differential equations that cannot be solved analytically. It introduces various techniques, including Taylor's series method, Modified Euler's method, and Runge-Kutta methods, aimed at approximating solutions to these equations. The learning objectives focus on designing, analyzing, and applying these numerical techniques in physical and engineering contexts.

Uploaded by

manishkreddy123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views25 pages

Module V

The document discusses numerical methods for solving ordinary differential equations that cannot be solved analytically. It introduces various techniques, including Taylor's series method, Modified Euler's method, and Runge-Kutta methods, aimed at approximating solutions to these equations. The learning objectives focus on designing, analyzing, and applying these numerical techniques in physical and engineering contexts.

Uploaded by

manishkreddy123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

RV Institute of Technology & Management ®

MODULE - V
NUMERICAL METHODS - 2

Introduction
Many ordinary differential equations can be solved by analytical methods discussed earlier
giving closed form solutions i.e. expressing y in terms of a finite number of elementary functions
of x. However, a majority of differential equations appearing in physical problems cannot be
solved analytically. Thus, it becomes imperative to discuss their solution by numerical methods.
𝑑𝑦
Here we must solve the differential equation = 𝑓(𝑥, 𝑦), with the condition 𝑦(𝑥0 ) =
𝑑𝑥

𝑦0 numerically. The solutions are either as a power series in x from which the values of y can be
obtained directly by substitution, or as a set of values of x and y. The method of Taylor series
belongs to the first kind whereas Euler, Runge – Kutta, Milne’s and Adams – Bash forth methods
belongs to the second Kind. In the second type of problems, the values of y are calculated in short
steps for equal intervals of x. Therefore, these methods are also called as Step – by – step methods.
Thus, we discuss the following numerical methods for solving an initial value problem.

1. Taylor’s series method

2. Modified Euler’s method

3. Runge - Kutta method of order IV

4. Milne’s Predictor - Corrector Method

5. Adams – Bashforth Predictor - Corrector Method

Topic Learning Objectives:

Upon Completion of this module, students will be able to:

➢ Design and analyze numerical techniques to approximate solutions to differential equations


for which finding an analytic solution is not possible or time-consuming.
➢ Choose an appropriate single step and multi-step numerical methods to solve first order
ordinary differential equations.
➢ Apply the knowledge of numerical methods in the modeling of various physical
and engineering phenomena.

II-Semester: Mathematics-II for Computer Science & Engineering stream (BMATS201)


P a g e 1 | 25
RV Institute of Technology & Management ®

Taylor’s Series method


Consider the first order ordinary differential equation,
dy
= 𝑓(x,y), subject to initial conditions y(𝑥0 ) = 𝑦0 ----- (1)
dx

Let 𝑦 = 𝑦(𝑥) be the exact solution of equation (1) expanding y(x) in Taylor series about the point
x0, we get,
(𝑥 − 𝑥0 ) (𝑥 − 𝑥0 )2 (𝑥 − 𝑥0 )3
𝑦(𝑥) = 𝑦(𝑥0 ) + 𝑦′(𝑥0 ) + 𝑦′′(𝑥0 ) + 𝑦′′′(𝑥0 ) + ⋯
1! 2! 3!
Since 𝑦(𝑥0 ) = 𝑦0 , 𝑦 ′ (𝑥0 ) = 𝑦 ′ 0 , 𝑦 '' (𝑥0 ) = 𝑦 ′′ 0etc., the above equation becomes
(𝑥 − 𝑥0 ) (𝑥 − 𝑥0 )2 (𝑥 − 𝑥0 )3
𝑦(𝑥) = 𝑦0 + 𝑦′0 + 𝑦′′0 + 𝑦′′′0 + ⋯
1! 2! 3!
Setting h = x1- x0and denoting y(x) = y(x1) = y1, the above equation becomes,
ℎ ℎ2 ℎ3
𝑦1 = 𝑦0 + 1! 𝑦′0 + 2! 𝑦′′0 + 3! 𝑦′′′0 +. . ..--------------(2)

This is the Taylor series solution at the point x1= x0+ h. Starting with this x1and repeating the
above procedure we get the solution at the point x2as,
Proceeding like this we get the Taylor series solution at the n𝑡ℎstep given by,
ℎ ℎ2 ℎ3
𝑦𝑛+1 = 𝑦𝑛 + 1! 𝑦′𝑛 + 2! 𝑦′′𝑛 + 3! 𝑦′′′𝑛 +. . ..---------------(3)

The formula given in (3) is known as Taylor’s series method.


Note: It is a single step method.

Problems
1. Use Taylor’s series method to find y at the points x = 0.1, given that
𝑑𝑦
= 𝑥2 + 𝑦2, y(0) = 1.
𝑑𝑥

Solution: Here 𝑥0 = 0, the Taylor’s series solution of the given problem is


𝑥2 𝑥3 𝑥4
𝑦 = 𝑦(0) + 𝑥𝑦 ′ (0) + 𝑦 ′′ (0) + 𝑦 ′′′ (0) + 𝑦 𝑖𝑣 (0)+. . . . . with y(0) = 1…. (i)
2! 3! 4!
′ 2 2 '' ′ ''' ′′ ′ 2 iv ′′′ ′ ′′
Also, 𝑦 = 𝑥 + 𝑦 , y = 2𝑥 + 2𝑦𝑦 , y = 2 + 2{𝑦𝑦 + (𝑦 ) }, y = 2{𝑦𝑦 + 3𝑦 𝑦 } and so on.
Using the condition y(0) = 1 in these we obtain,
𝑦 ′ (0) = 1, y '' (0) = 2, y ''' (0) = 8, y iv (0) = 28.
Using these and the condition y(0) = 1 in (i) we get,
𝑥2 𝑥3 𝑥4
𝑦 =1+𝑥+( × 2) + ( × 8) + ( × 28) +. . . . . ..
2! 3! 4!

II-Semester: Mathematics-II for Computer Science & Engineering stream (BMATS201)


P a g e 2 | 25
RV Institute of Technology & Management ®

4 7
= 1 + 𝑥 + 𝑥 2 + 𝑥 3 + 𝑥 4 +. . . . . . (ii)
3 6
Under the given condition𝑦(𝑥0 ) = 𝑦(0) = 1, this is the Taylor’s series solution for y at a point x
in a neighbourhood of 𝑥0 = 0.
For𝑥 = 𝑥1 = 0.1, expression (ii) yields the solution at 𝑥1 = 0.1 as,
4 7
𝑦(0.1) = 1 + (0.1) + (0.1)2 + (0.1)3 + (0.1)4 +. . . . . . . ≈ 1.11145
3 6

2. Find by Taylor’s series method the value of y at x = 0.1 and x = 0.2 to five places of decimals
𝑑𝑦
from = 𝑥 2 𝑦 − 1, 𝑦(0) = 1. Consider up to 4th degree terms.
𝑑𝑥

Solution: Here 𝑦′ = 𝑥 2 𝑦 − 1&𝑥0 = 0, 𝑦0 = 1


∴ 𝑦′0 = 0 − 1 = −1. Now differentiating successively, we get,
𝑦" = 2𝑥𝑦 + 𝑥 2 𝑦′ ⇒ 𝑦"0 = 0 + 0 = 0
𝑦′′′ = 2𝑦 + 2𝑥𝑦′ + 2𝑥𝑦′ + 𝑥 2 𝑦" = 2𝑦 + 4𝑥𝑦′ + 𝑥 2 𝑦" ⇒ 𝑦′′′0 = 2 × 1 + 0 + 0 = 2
𝑦 𝑖𝑣 = 2𝑦′ + 4𝑦′ + 4𝑥𝑦" + 2𝑥𝑦" + 𝑥 2 𝑦′′′ = 6𝑦′ + 6𝑥𝑦" + 𝑥 2 𝑦′′′ ⇒ 𝑦 𝑖𝑣 0 = 6 × (−1) + 0 + 0
= −6
𝑦 𝑣 = 6𝑦" + 6𝑦" + 6𝑥𝑦′′′ + 2𝑥𝑦′′′ + 𝑥 2 𝑦 𝑖𝑣 = 12𝑦" + 8𝑥𝑦′′′ + 𝑥 2 𝑦 𝑖𝑣 ⇒ 𝑦 𝑣 0 = 12 × 0 + 0 + 0
=0

𝑦 𝑣𝑖 = 12𝑦′′′ + 8𝑦′′′ + 8𝑥𝑦 𝑖𝑣 + 2𝑥𝑦 𝑖𝑣 + 𝑥 2 𝑦 𝑣 = 20𝑦′′′ + 10𝑥𝑦 𝑖𝑣 + 𝑥 2 𝑦 𝑣 ⇒ 𝑦 𝑣𝑖 0 = 20 × (2) +


0 + 0 = 40 & soon.
𝑥2
By putting these values in Taylor’s series 𝑦(𝑥) = 𝑦0 + 𝑥𝑦′0 + 𝑦"0 +. . . . .. we get
2!

𝑥2 𝑥3 𝑥4 𝑥5 𝑥6
𝑦(𝑥) = 1 + 𝑥(−1) + (0) + (2) + (−6) + (0) + (40)+. . . . . . . ..
2! 3! 4! 5! 6!
𝑥3 𝑥4 𝑥6
=1−𝑥+ − + 18 +. . . . . . . . . . ..
3 4
(0.1)3 (0.1)4 (0.1)6
∴ 𝑦(0.1) = 1 − (0.1) + − + +. . . . . . = 0.90031 & ∴ 𝑦(0.2) = 1 − (0.2) +
3 4 18
(0.2)3 (0.2)4 (0.2)6
− + +. . . . . . = 0.80227, correct to five places of decimals.
3 4 18

II-Semester: Mathematics-II for Computer Science & Engineering stream (BMATS201)


P a g e 3 | 25
RV Institute of Technology & Management ®

3. Employ Taylor’s method to obtain approximate value of y at x = 0.2 for the differential
𝑑𝑦
equation = 2𝑦 + 3𝑒 𝑥 , 𝑦(0) = 0. Compare the numerical solution so obtained with the
𝑑𝑥

exact solution.

Solution: Here 𝑦′ = 2𝑦 + 3𝑒 𝑥 , 𝑥0 = 0&𝑦0 = 0 ⇒ 𝑦′0 = 2 × 0 + 3 × 𝑒 0 = 3 By differentiating


successively we get 𝑦" = 2𝑦′ + 3𝑒 𝑥 ⇒ 𝑦"0 = 2 × 3 + 3 × 𝑒 0 = 6 + 3 = 9
𝑦′′′ = 2𝑦" + 3𝑒 𝑥 ⇒ 𝑦′′′0 = 2 × 9 + 3 × 𝑒 0 = 18 + 3 = 21
𝑦 𝑖𝑣 = 2𝑦′′′ + 3𝑒 𝑥 ⇒ 𝑦0𝑖𝑣 = 2 × 21 + 3 × 𝑒 0 = 42 + 3 = 45
𝑦 𝑣 = 2𝑦 𝑖𝑣 + 3𝑒 𝑥 ⇒ 𝑦0𝑣 = 2 × 45 + 3𝑒 0 = 93& so on
𝑥2 𝑥3 𝑥2 𝑥3 𝑥4
Therefore,𝑦(𝑥) = 𝑦0 + 𝑥𝑦′0 + 𝑦"0 + 𝑦′′′0 +. . . . . . . = 0 + 3𝑥 + ×9+ × 21 + 24 ×
2! 3! 2 6
𝑥5
45 + 120 × 93+. . . ..
9 7 15 31
= 3𝑥 + 2 𝑥 2 + 2 𝑥 3 + 𝑥 4 + 40 𝑥 5 +. . . . . . . ..
8

9 7 15 31
∴ 𝑦(0.2) = 3 × 0.2 + (0.2)2 + (0.2)3 + (0.2)4 + (0.2)5 +. . . . . . . . = 0.811248
2 2 8 40
𝑑𝑦
Direct method: Now 𝑑𝑥 − 2𝑦 = 3𝑒 𝑥 , is a linear Differential equation in x.

I.F. = 𝑒 ∫ 𝑃𝑑𝑥 = 𝑒 ∫ −2𝑑𝑥 = 𝑒 −2𝑥 .


3𝑒 −𝑥
∴solution is 𝑦. 𝑒 −2𝑥 = ∫ 𝑒 −2𝑥 . 3𝑒 𝑥 𝑑𝑥 = 3 ∫ 𝑒 −𝑥 𝑑𝑥 = +𝑐
−1

⇒ 𝑦 = −3𝑒 𝑥 + 𝑐𝑒2𝑥 . But 𝑦 = 0 when 𝑥 = 0 ⇒ 𝑐 = 3


Hence 𝑦 = −3𝑒 𝑥 + 3𝑒2𝑥 = 3(𝑒 2𝑥 − 𝑒 𝑥 ) ⇒ 𝑦(0.2) = 3(𝑒 0.4 − 𝑒 0.2 ) = 0.811266
Therefore, the approximate value is obtained by Taylor’s method up to 4 decimal places.

4. Using the Taylor’s series method, find the approximate solution (up to 4 places of decimal),
𝑑𝑦
at the point 0.1, of the following initial value problem: 𝑑𝑥 = 𝑥 − 𝑦 2 , 𝑦(0) = 1.

Solution: Here 𝑦′ = 𝑥 − 𝑦 2 , xo = 0, 𝑦𝑜 = 1. ∴ 𝑦′0 = 0 − 12 = −1

𝑦" = 1 − 2𝑦𝑦′ ⇒ 𝑦"𝑜 = 1 − 2 × 1 × (−1) = 1 + 2 = 3.


𝑦′′′ = −2[𝑦𝑦" + 𝑦′𝑦′] = −2[𝑦𝑦" + 𝑦′2 ] ⇒ 𝑦𝑜′′′ = −2[1 × 3 + (−1)2 = −2[3 + 1] = −8.
𝑦 𝑖𝑣 = −2[𝑦𝑦′′′ + 𝑦′𝑦" + 2𝑦′𝑦"] = −2[𝑦𝑦′′′ + 3𝑦′𝑦"] ⇒ 𝑦𝑜𝑖𝑣 = −2[1 × (−8) + 3 × (−1) ×
3] = 34
𝑦 𝑣 = −2[𝑦𝑦 𝑖𝑣 + 𝑦′𝑦′′′ + 3𝑦′𝑦′′′ + 3𝑦′′2 ] = −2[𝑦𝑦 𝑖𝑣 + 4𝑦′𝑦′′′ + 3𝑦"2 ] ⇒ 𝑦𝑜𝑣 = −2[1 × 34 +
4 × (−1) × (−8) + 3(3)2 ] = −186 and so on.

II-Semester: Mathematics-II for Computer Science & Engineering stream (BMATS201)


P a g e 4 | 25
RV Institute of Technology & Management ®

𝑥2 𝑥3 𝑥4 𝑥5
∴ 𝑦(𝑥) = 1 + 𝑥(−1) + × 3 + × (−8) + × 34 + × (−186)+. . . . . . ..
2! 3! 4! 5!
3 4 17 31
= 1 − 𝑥 + 2 𝑥 2 − 3 𝑥 3 + 12 𝑥 4 − 20 𝑥 5 +. . . . . . . ..
3 4 17 31
Hence 𝑦(0.1) = 1 − (0.1) + 2 (0.1)2 − 3 (0.1)3 + 12 (0.1)4 − 20 (0.1)5 +. . . . . . . . . = 0.9138.

𝑑𝑦
5. Find y at x = 1.02 correct to five decimal places given = 𝑥𝑦 − 1 and y = 2 at x = 1 applying
𝑑𝑥

Taylor’s series method.


Solution: Taylor’s series expansion is given by,
(𝑥 − 𝑥0 ) (𝑥 − 𝑥0 )2 (𝑥 − 𝑥0 )3
𝑦(𝑥) = 𝑦0 + 𝑦′0 + 𝑦′′0 + 𝑦′′′0 + ⋯
1! 2! 3!
Here 𝑦′ = 𝑥𝑦 − 1, 𝑥𝑜 = 1, 𝑦𝑜 = 2. ∴ 𝑦′0 = 1
𝑦" = 𝑥𝑦′ + 𝑦 ⇒ 𝑦"𝑜 = 3.
𝑦′′′ = 𝑥𝑦" + 𝑦′ + 𝑦′ = 𝑥𝑦" + 2𝑦′ ⇒ 𝑦𝑜′′′ = 5.
(1.02−1)2 (1.02−1)3
∴ 𝑦(1.02) = 2 + (1.02 − 1) × 1 + ×3+ × 5+. . . . . . ..
2! 3!

= 2.02061
Hence 𝑦(1.02) = 2.02061.

Exercises:
𝑑𝑦
1) Using Taylor’s method, compute the solution of = 𝑥 + 𝑦, 𝑦(0) = 1 at the point x = 0.2
𝑑𝑥

correct to 3 decimal places.

2) Evaluate𝑦(0.1) correct to 6 places of decimals by Taylor’s series method if𝑦(𝑥) satisfies 𝑦′ =


𝑥𝑦 + 1, 𝑦(0) = 1.

3) Solve 𝑦′ = 𝑦 2 + 𝑥, 𝑦(0) = 1using Taylor’s series method & compute 𝑦(0.1)&𝑦(0.2)

4) By using Taylor’s series method find an approximate solution at 𝑥 = 1.02of the initial – value
problem 𝑦′ = 𝑥𝑦 − 1, 𝑦(1) = 2.

5) Using Taylor’s series method, find the solution at 𝑥 = 2.1of the differential equation 𝑥𝑦′ =
𝑥 − 𝑦, given that 𝑦(2) = 2

1
6) Use the Taylor’s series method to find 𝑦(4.1)&𝑦(4.2), given that 𝑦′ = 𝑥 2 +𝑦 2 , 𝑦(4) = 4.

II-Semester: Mathematics-II for Computer Science & Engineering stream (BMATS201)


P a g e 5 | 25
RV Institute of Technology & Management ®

𝑑𝑦
7) Obtain the Taylor’s series solution of the problem = 𝑦 𝑠𝑖𝑛 𝑥 + 𝑐𝑜𝑠 𝑥 , 𝑦(0) = 0.
𝑑𝑥

Answers: 1) 1.243 2) 1.1053425 3) 1.1164; 1.2725


𝑥3 𝑥5
4) 2.02061 5) 2.00238 6) 4.0049; 4.0098 7) 𝑦 = 𝑥 + + 120 +. . . . . . . ..
6

Predictor-Corrector Method:
Taylor’s method discussed above to solve a first order differential equation, require information
about the solution at a single point say 𝑥𝑛 for computing the solution at 𝑥𝑛 + 1. Hence this method
is called single-step method.
In the Predictor-Corrector Methods, a predictor formula is used to predict the value 𝑦𝑖 + 1 y at
x𝑖 + 1and then a corrector formula is used to improve the value of 𝑦𝑖 + 1 The corrector formula
is used repeatedly until two consecutive values of 𝑦𝑖 + 1 are almost equal.

Euler's Modified Method


In this case the curve is approximated by a straight line through (𝑥0 , 𝑦0 ) and having the slope as
(1) (1)
the average of slopes at (𝑥0 , 𝑦0 ) and (𝑥0 , 𝑦1 ) where 𝑦1 is the first approximation of y at 𝑥 = 𝑥1
and is given by
(0)
𝑦1 = 𝑦0 + ℎ𝑓(𝑥0 , 𝑦0 )
In general
(𝑖) ℎ (𝑖−1)
𝑦𝑛 = 𝑦𝑛−1 + [𝑓(𝑥𝑛−1 , 𝑦𝑛−1 ) + 𝑓(𝑥𝑛 , 𝑦𝑛 )]
2
(𝑖)
where 𝑦𝑛 denotes the iteration of 𝑦𝑛 up to 'i' times.
(1)
Note: In this method, 𝑦1 is found using Euler's method (Predictor value) and then substituted in
the original formula to get the corrector value. Hence Euler's modified method is a predictor-
corrector method.

Problems:
𝒅𝒚
1. Solve = 𝟏 − 𝒚 with the initial condition y(0)=0 using Euler's modified method and find
𝒅𝒙

y(0.1).
𝒅𝒚
Solution: Given 𝒅𝒙 = 𝟏 − 𝒚 = 𝑓(𝑥, 𝑦) , 𝑥0 = 0, 𝑦0 = 0, ℎ = 0.1.

Let us first find y(0.1) as a first approximation using Euler's method.

II-Semester: Mathematics-II for Computer Science & Engineering stream (BMATS201)


P a g e 6 | 25
RV Institute of Technology & Management ®

(0)
∴ 𝑦1 = 𝑦0 + ℎ𝑓(𝑥0, 𝑦0 )
= 0 + 0.1(1 − 0) = 0.1
We now apply Euler's modified method to get more accurate value of y.
(𝑖) 1 (𝑖−1)
𝑦𝑛 = 𝑦𝑛−1 + ℎ[𝑓(𝑥𝑛−1 , 𝑦𝑛−1 ) + 𝑓(𝑥𝑛 , 𝑦𝑛 )]
2
(𝑖)
where 𝑦𝑛 denotes the iteration of 𝑦𝑛 up to 'i' times.
∴ For the first iteration we have,
(1) ℎ (0)
𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓(𝑥1 , 𝑦1 )]
2
0.1
=0+ [1 − 0 + 1 − 0.1]
2
= 0.095
Second iteration,
(2) ℎ (1)
𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓(𝑥1 , 𝑦1 )]
2
0.1
=0+ [1 − 0 + 1 − 0.095]
2
= 0.09525

Third iteration,
(3) ℎ (2)
𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓(𝑥1 , 𝑦1 )]
2
0.1
=0+ [1 − 0 + 1 − 0.09525]
2
= 0.0952375
∴ The approximate value of y is 0.0952.

𝑑𝑦
2. Given = 3𝑦 + 𝑒 𝑥 , 𝑦(0) = 1. Take ℎ = 0.1 and compute 𝑦(0.2) by Modified Euler’s
𝑑𝑥

method.
Solution: Here 𝑓(𝑥, 𝑦) = 3𝑦 + 𝑒 𝑥 , x0 = 0, 𝑦0 = 1&ℎ = 0.1.
(0)
𝐴𝑡 𝑥 = 0.1, 𝑦1 = 𝑦0 + ℎ𝑓(𝑥0 , 𝑦0 ) = 1.4
(1) ℎ (0)
𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓(𝑥1 , 𝑦1 )] = 1.4653
2

II-Semester: Mathematics-II for Computer Science & Engineering stream (BMATS201)


P a g e 7 | 25
RV Institute of Technology & Management ®

(2) ℎ (1)
𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓(𝑥1 , 𝑦1 )]=1.4751
2
(0)
𝐴𝑡 𝑥 = 0.2, 𝑦1 = 𝑦0 + ℎ𝑓(𝑥0 , 𝑦0 ) = 2.0281
(1) ℎ (0)
𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓(𝑥1 , 𝑦1 )] = 2.1169
2
(2) ℎ (1)
𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓(𝑥1 , 𝑦1 )] = 2.1302
2
∴ The approximate value of y is 2.1302.

𝑑𝑦
3. Using Modified Euler’s method, find an approximate value of y when x = 0.2, given that 𝑑𝑥 =

𝑥 + 𝑦 &𝑦 = 1when x = 0. Take h = 0.1.


Solution: Here 𝑓(𝑥, 𝑦) = 𝑥 + 𝑦, x0 = 0, 𝑦0 = 1&ℎ = 0.1.

Hence𝑓(𝑥0 , 𝑦0 ) = 0 + 1 = 1
(0)
∴ 𝑦1 = 𝑦0 + ℎ𝑓(𝑥0 , 𝑦0 ) = 1 + 0.1 × 1 = 1.1
(0)
Now 𝑓(𝑥1 , 𝑦1 ) = 0.1 + 1.1 = 1.2
(1) ℎ (0) 0.1
∴ 𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓(𝑥1 , 𝑦1 )] = 1 + [1 + 1.2] = 1.11
2 2
(1)
Now 𝑓(𝑥1 , 𝑦1 ) = 0.1 + 1.11 = 1.21
(2) ℎ (1) 0.1
∴ 𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓(𝑥1 , 𝑦1 )] = 1 + [1 + 1.21] = 1.1105
2 2
(2)
Now 𝑓(𝑥1 , 𝑦1 ) = 0.1 + 1.1105 = 1.2105
(3) ℎ (2) 0.1
∴ 𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓(𝑥1 , 𝑦1 )] = 1 + [1 + 1.2105] = 1.1105
2 2
Hence 𝑦1 = 𝑦(0.1) = 1.1105
Now 𝑓(𝑥1 , 𝑦1 ) = 0.1 + 1.1105 = 1.2105.
(0)
∴ 𝑦2 = 𝑦1 + ℎ𝑓(𝑥1 , 𝑦1 ) = 1.1105 + 0.1 × 1.2105 = 1.2316
(0)
Now 𝑓(𝑥2 , 𝑦2 ) = 0.2 + 1.2316 = 1.4316
(1) ℎ (0) 0.1
∴ 𝑦2 = 𝑦1 + [𝑓(𝑥1 , 𝑦1 ) + 𝑓(𝑥2 , 𝑦2 )] = 1.1105 + [1.2105 + 1.4316] = 1.2426.
2 2
(1)
Now 𝑓(𝑥2 , 𝑦2 ) = 0.2 + 1.2426 = 1.4426
(2) ℎ (1) 0.1
∴ 𝑦2 = 𝑦1 + [𝑓(𝑥1 , 𝑦1 ) + 𝑓(𝑥2 , 𝑦2 )] = 1.1105 + [1.2105 + 1.4426] = 1.2432.
2 2
(2)
Now 𝑓(𝑥2 , 𝑦2 ) = 0.2 + 1.2432 = 1.4432

II-Semester: Mathematics-II for Computer Science & Engineering stream (BMATS201)


P a g e 8 | 25
RV Institute of Technology & Management ®

(3) ℎ (2) 0.1


∴ 𝑦2 = 𝑦1 + [𝑓(𝑥1 , 𝑦1 ) + 𝑓(𝑥2 , 𝑦2 )] = 1.1105 + [1.2105 + 1.4432] = 1.2432.
2 2
Hence 𝑦2 = 𝑦(0.2) = 1.2432.

4. Using Modified Euler’s method, find an approximate value of y when x = 0.4, given that
𝑑𝑦
= log(𝑥 + 𝑦) &𝑦 = 2 when x = 0. Take h = 0.2.
𝑑𝑥

Solution: Here 𝑓(𝑥, 𝑦) = log(𝑥 + 𝑦), x0 = 0, 𝑦0 = 2&ℎ = 0.2

Now 𝑓(𝑥0 , 𝑦0 ) = 𝑙𝑜𝑔( 0 + 2) = 𝑙𝑜𝑔 2 = 0.3010


(0)
∴ 𝑦1 = 𝑦0 + ℎ𝑓(𝑥0 , 𝑦0 ) = 2 + 0.2 × 0.3010 = 2.0602.
(0)
Now 𝑓(𝑥1 , 𝑦1 ) = 𝑙𝑜𝑔( 0.2 + 2.0602) = 𝑙𝑜𝑔 2 . 2602 = 0.3541
(1) ℎ (0) 0.2
∴ 𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓(𝑥1 , 𝑦1 )] = 2 + [0.3010 + 0.3541] = 2.0655
2 2
(1)
Now 𝑓(𝑥1 , 𝑦1 ) = 𝑙𝑜𝑔( 0.2 + 2.0655) = 𝑙𝑜𝑔 2 . 2655 = 0.3552
(2) ℎ (1) 0.2
∴ 𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓(𝑥1 , 𝑦1 )] = 2 + [0.3010 + 0.3552] = 2.0656
2 2
(2)
Now 𝑓(𝑥1 , 𝑦1 ) = 𝑙𝑜𝑔( 0.2 + 2.0656) = 𝑙𝑜𝑔 2 . 2656 = 0.3552
(3) ℎ (2) 0.2
∴ 𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓(𝑥1 , 𝑦1 )] = 2 + [0.3010 + 0.3552] = 2.0656
2 2
Hence 𝑦1 = 𝑦(0.2) = 2.0656.
Now 𝑓(𝑥1 , 𝑦1 ) = 𝑙𝑜𝑔( 0.2 + 2.0656) = 𝑙𝑜𝑔 2 . 2656 = 0.3552
(0)
∴ 𝑦2 = 𝑦1 + ℎ𝑓(𝑥1 , 𝑦1 ) = 2.0656 + 0.2 × 0.3552 = 2.1366.
(0)
Now 𝑓(𝑥2 , 𝑦2 ) = 𝑙𝑜𝑔( 0.4 + 2.1366) = 𝑙𝑜𝑔 2 . 5366 = 0.4043
(1) ℎ (0) 0.2
∴ 𝑦2 = 𝑦1 + [𝑓(𝑥1 , 𝑦1 ) + 𝑓(𝑥2 , 𝑦2 )] = 2.0656 + [0.3552 + 0.4043] = 2.1416
2 2
(1)
Now 𝑓(𝑥2 , 𝑦2 ) = 𝑙𝑜𝑔( 0.4 + 2.1416) = 𝑙𝑜𝑔 2 . 5416 = 0.4051
(2) ℎ (1) 0.2
∴ 𝑦2 = 𝑦1 + [𝑓(𝑥1 , 𝑦1 ) + 𝑓(𝑥2 , 𝑦2 )] = 2.0656 + [0.3552 + 0.4051] = 2.1416
2 2
Hence 𝑦2 = 𝑦(0.4) = 2.1416
𝑑𝑦
5. Using Euler’s modified method, obtain a solution of the equation = 𝑥 + |√𝑦|, with initial
𝑑𝑥

condition𝑦 = 1 at 𝑥 = 0, for the range 0 ≤ 𝑥 ≤ 0.4 in steps of 0.2.


Solution: Here 𝑓(𝑥, 𝑦) = 𝑥 + |√𝑦|, x0 = 0, 𝑦0 = 1&ℎ = 0.2

II-Semester: Mathematics-II for Computer Science & Engineering stream (BMATS201)


P a g e 9 | 25
RV Institute of Technology & Management ®

Now 𝑓(𝑥0 , 𝑦0 ) = 0 + |√1| = 1


(0)
∴ 𝑦1 = 𝑦0 + ℎ𝑓(𝑥0 , 𝑦0 ) = 1 + 0.2 × 1 = 1.2
(0)
Now 𝑓(𝑥1 , 𝑦1 ) = 0.2 + |√1.2| = 1.2954
(1) ℎ (0) 0.2
∴ 𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓(𝑥1 , 𝑦1 )] = 1 + [1 + 1.2954] = 1.2295
2 2
(1)
Now 𝑓(𝑥1 , 𝑦1 ) = 0.2 + |√1.2295| = 1.3088
(2) ℎ (1) 0.2
∴ 𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓(𝑥1 , 𝑦1 )] = 1 + [1 + 1.3088] = 1.2309
2 2
(2)
Now 𝑓(𝑥1 , 𝑦1 ) = 0.2 + |√1.2309| = 1.3095
(3) ℎ (2) 0.2
∴ 𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓(𝑥1 , 𝑦1 )] = 1 + [1 + 1.3095] = 1.2310
2 2
(3)
Now 𝑓(𝑥1 , 𝑦1 ) = 0.2 + |√1.2310| = 1.3095
(4) ℎ (3) 0.2
∴ 𝑦1 = 𝑦0 + [𝑓(𝑥0 , 𝑦0 ) + 𝑓(𝑥1 , 𝑦1 )] = 1 + [1 + 1.3095] = 1.2310
2 2
Hence 𝑦1 = 𝑦(0.2) = 1.2310.
Now 𝑓(𝑥1 , 𝑦1 ) = 0.2 + |√1.2310| = 1.3095
(0)
∴ 𝑦2 = 𝑦1 + ℎ𝑓(𝑥1 , 𝑦1 ) = 1.2310 + 0.2 × 1.3095 = 1.4929
(0)
Now 𝑓(𝑥2 , 𝑦2 ) = 0.4 + |√1.4929| = 1.6218
(1) ℎ (0) 0.2
∴ 𝑦2 = 𝑦1 + [𝑓(𝑥1 , 𝑦1 ) + 𝑓(𝑥2 , 𝑦2 )] = 1.2310 + [1.3095 + 1.6218] = 1.5241
2 2
(1)
Now 𝑓(𝑥2 , 𝑦2 ) = 0.4 + |√1.5241| = 1.6345
(2) ℎ (1) 0.2
∴ 𝑦2 = 𝑦1 + [𝑓(𝑥1 , 𝑦1 ) + 𝑓(𝑥2 , 𝑦2 )] = 1.2310 + [1.3095 + 1.6345] = 1.5254
2 2
(2)
Now 𝑓(𝑥2 , 𝑦2 ) = 0.4 + |√1.5254| = 1.6351
(3) ℎ (2) 0.2
∴ 𝑦2 = 𝑦1 + [𝑓(𝑥1 , 𝑦1 ) + 𝑓(𝑥2 , 𝑦2 )] = 1.2310 + [1.3095 + 1.6351] = 1.5255
2 2
Hence 𝑦2 = 𝑦(0.4) = 1.5255

Exercises:
1) Apply Modified Euler’s method to solve 𝑦′ = 𝑥 + 𝑦, 𝑦(0) = 0, choosing the step length h =
0.2.

II-Semester: Mathematics-II for Computer Science & Engineering stream (BMATS201)


P a g e 10 | 25
RV Institute of Technology & Management ®

𝑑𝑦 𝑦−𝑥
2) Given = with boundary condition y = 1 when x = 0, find approximately y for x = 0.1
𝑑𝑥 𝑦+𝑥

by Modified Euler’s method.

𝑑𝑦
3) Given that 𝑑𝑥 = 𝑥 + 𝑦 2 &𝑦 = 1at 𝑥 = 0. Find a approximate value of y at x = 0.5 by Modified

Euler’s method.

𝑑𝑦
4) Solve the differential equation = −𝑥𝑦 2 , 𝑦 = 2at 𝑥 = 0, by Modified Euler’s method &
𝑑𝑥

obtain y at x = 0.2 in two stages of 0.1 each.

𝑑𝑦
5) Given that = 2 + √𝑥𝑦, y = 1 at x = 1, find approximate value of y at x = 2 in steps of 0.2,
𝑑𝑥

by Modified Euler’s method

6) Given that 𝑦′ = 𝑥 2 + 𝑦&𝑦 = 1at x = 0. Find an approximate value of y at x = 0.5 by Modified


Euler’s method. Take h = 0.125.

7) By using the Modified Euler’s method, solve the problem 𝑦′ = 𝑥 2 + 𝑦, 𝑦(0) = 1 at x = 0.02,
0.04 & 0.06.

8) Using Modified Euler’s method, obtain the solution of 𝑦′ = 1 − 𝑦, 𝑦(0) = 0, at x = 0.2 by


taking h = 0.1.

Answers: 1) 1.1831808 2) 1.0928 3) 2.2352 4) 1.9227


5) 5.051 6) 1.6951 7) 1.0619 8) 0.1810

Runge – Kutta fourth order method


In this method first, we have to find the quantities 𝑘1 , k 2 , 𝑘3 &𝑘4 using the following formulae –
𝑘1 = ℎ𝑓(𝑥0 , 𝑦0 )
1 1
𝑘2 = ℎ𝑓 (𝑥0 + 2 ℎ, 𝑦0 + 2 𝑘1 )
1 1
𝑘3 = ℎ𝑓 (𝑥0 + 2 ℎ, 𝑦0 + 2 𝑘2 )

𝑘4 = ℎ𝑓(𝑥0 + ℎ, 𝑦0 + 𝑘3 ),

Then calculate k =
1
k1 + 2k2 + 2k3 +k 4 
6
Then 𝑦1 = 𝑦0 + 𝑘, gives the required approximate value of y at 𝑥 = 𝑥1 .

II-Semester: Mathematics-II for Computer Science & Engineering stream (BMATS201)


P a g e 11 | 25
RV Institute of Technology & Management ®

Problems:
1. Apply Runge – Kutta fourth order method to find an approximate value of y when x = 0.2
𝑑𝑦
given that 𝑑𝑥 = 𝑥 + 𝑦&𝑦 = 1when x = 0.

Solution: Here 𝑓(𝑥, 𝑦) = 𝑥 + 𝑦, x0 = 0, 𝑦0 = 1&𝑡𝑎𝑘𝑒ℎ = 0.2, then

𝑘1 = ℎ𝑓(𝑥0 , 𝑦0 ) = 0.2 × (0 + 1) = 0.2


1 1 1 1
𝑘2 = ℎ𝑓 (𝑥0 + ℎ, 𝑦0 + 𝑘1 ) = 0.2 × 𝑓 (0 + × 0.2, 1 + × 0.2) = 0.2 × 𝑓(0.1, 1.1)
2 2 2 2
= 0.2 × (0.1 + 1.1) = 0.24

( ) ( )
k3 = hf x0 + 1 h, y0 + 1 k2 = 0.2  f 0 + 1  0.2, 1 + 1  0.24 = 0.2  f (0.1, 1.12) = 0.2  (0.1 + 1.12) = 0.244
2 2 2 2
𝑘4 = ℎ𝑓(𝑥0 + ℎ, 𝑦0 + 𝑘3 ) = 0.2 × 𝑓(0.2, 1.244) = 0.2 × (0.2 + 1.244) = 0.2888,

Then k =
1
k1 + 2k2 + 2k3 +k 4  = 1 0.2 + 2  0.24 + 2  0.244 + 0.2888 = 0.2428
6 6
Hence𝑦1 = 𝑦(0.2) = 𝑦0 + 𝑘 = 1 + 0.2428 = 1.2428

2. Apply Runge – Kutta fourth order method to find an approximate value of y for x = 0.1 in steps
𝑑𝑦
of 0.1, if 𝑑𝑥 = 𝑥 + 𝑦 2 , given that y = 1 when x = 0.

Solution: Here 𝑓(𝑥, 𝑦) = 𝑥 + 𝑦 2 , x0 = 0, 𝑦0 = 1&ℎ = 0.1. Then

𝑘1 = ℎ𝑓(𝑥0 , 𝑦0 ) = 0.1 × (0 + 12 ) = 0.1


1 1
𝑘2 = ℎ𝑓 (𝑥0 + ℎ, 𝑦0 + 𝑘1 ) = 0.1 × 𝑓(0.05, 1.05) = 0.1 × (0.05 + 1.052 ) = 0.1153
2 2
1 1
𝑘3 = ℎ𝑓 (𝑥0 + ℎ, 𝑦0 + 𝑘2 ) = 0.1 × 𝑓(0.05, 1.0576) = 0.1 × (0.05 + 1.05762 ) = 0.1169
2 2
𝑘4 = ℎ𝑓(𝑥0 + ℎ, 𝑦0 + 𝑘3 ) = 0.1 × 𝑓(0.1, 1.1169) = 0.1 × (0.1 + 1.11692 ) = 0.1347,

Then k =
1
k1 + 2k2 + 2k3 +k 4  = 1 0.1 + 2  0.1153+ 2  0.1169 + 0.1347 = 0.1165
6 6
Hence𝑦1 = 𝑦(0.1) = 𝑦0 + 𝑘 = 1 + 0.1165 = 1.1165.

3. Use R-K Method of 4th order to compute y(1.1) given that


𝑑𝑦
= 𝑥𝑦 1/3 , 𝑦(1) = 1.
𝑑𝑥

Solution: Here 𝑓(𝑥, 𝑦) = 𝑥𝑦1/3 , 𝑥0 = 1, 𝑦0 = 1 & ℎ = 0.1. Then


𝑘1 = ℎ𝑓(𝑥0 , 𝑦0 ) = 0.1 × [(1)(1)1/3 ] = 0.1

II-Semester: Mathematics-II for Computer Science & Engineering stream (BMATS201)


P a g e 12 | 25
RV Institute of Technology & Management ®

1 1
𝑘2 = ℎ𝑓 (𝑥0 + ℎ, 𝑦0 + 𝑘1 ) = 0.1 × 𝑓(1.05, 1.05) = 0.1 × [(1.05)(1.05)1/3 ] = 0.1067
2 2
1 1
𝑘3 = ℎ𝑓 (𝑥0 + ℎ, 𝑦0 + 𝑘2 ) = 0.1 × 𝑓(1.05, 1.05335) = 0.1 × [(1.05)(1.05335)1/3 ]
2 2
= 0.1068
𝑘4 = ℎ𝑓(𝑥0 + ℎ, 𝑦0 + 𝑘3 ) = 0.1 × 𝑓(1.1, 1.1068) = 0.1 × [(1.1)(1.1068)1/3 ] = 0.1138,
1
Then 𝑦(𝑥1 ) = 𝑦(1.1) = 𝑦0 + 6 (𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4 ) =1.1068

Hence 𝑦(1.1) = 1.1068.

4. Use R-K Method of 4th order to estimate the solution of IVP


𝑑𝑦
3 𝑑𝑥 + 5𝑦 2 = 𝑠𝑖𝑛𝑥, 𝑦(0.3) = 5 with step size of h=0.2 at 𝑦(0.5).

Solution: Here, 𝒇(𝒙, 𝒚, 𝒛 ) = (𝒔𝒊𝒏𝒙 − 𝟓𝒚𝟐 )/𝟑. Hence,

ℎ 𝑘1
𝑘1 = ℎ𝑓(𝑥0 , 𝑦0 ) = -8.3136 𝑘2 = ℎ𝑓 (𝑥0 + 2 , 𝑦0 + ) =-0.2110
2
ℎ 𝑘2
𝑘3 = ℎ𝑓 (𝑥0 + 2 , 𝑦𝑜 + ) = -7.9594 𝑘4 = ℎ𝑓(𝑥0 + ℎ, 𝑦𝑜 + 𝑘3 ) =-2.8874
2
1
Therefore, 𝑦(𝑥1 ) = 𝑦0 + 6 (𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4 ) =0.4097

𝑑𝑦 𝑦 2 −𝑥 2
5. Using Runge – Kutta fourth order method, solve = with 𝑦(0) = 1 at x = 0.2, 0.4.
𝑑𝑥 𝑦 2 +𝑥 2

𝑦 2 −𝑥 2
Solution: Here𝑓(𝑥, 𝑦) = 𝑦 2+𝑥 2 , x0 = 0, 𝑦0 = 1&ℎ = 0.2, then

Step I:
1−0
𝑘1 = ℎ𝑓(𝑥0 , 𝑦0 ) = 0.2 × = 0.2
1+0
1 1 (1.1)2 − (0.1)2
𝑘2 = ℎ𝑓 (𝑥0 + ℎ, 𝑦0 + 𝑘1 ) = 0.2 × 𝑓(0.1, 1.1) = 0.2 × = 0.1967
2 2 (1.1)2 + (0.1)2

( 2 2
)
k3 = hf x0 + 1 h, y0 + 1 k 2 = 0.2  f (0.1, 1.0984) = 0.2 
(1.0984) 2 − (0.1) 2
(1.0984) 2 + (0.1) 2
= 0.1967 𝑘4 =

(1.1967)2 −(0.2)2
ℎ𝑓(𝑥0 + ℎ, 𝑦0 + 𝑘3 ) = 0.2 × 𝑓(0.2, 1.1967) = 0.2 × (1.1967)2+(0.2)2 = 0.1891,

Then k =
1
k1 + 2k2 + 2k3 +k 4  = 1 0.2 + 2  0.1967 + 2  0.1967 + 0.1891 = 0.196
6 6
Hence𝑦1 = 𝑦(0.2) = 𝑦0 + 𝑘 = 1 + 0.196 = 1.196
Step II:

II-Semester: Mathematics-II for Computer Science & Engineering stream (BMATS201)


P a g e 13 | 25
RV Institute of Technology & Management ®

(1.196)2 − (0.2)2
𝑘1 = ℎ𝑓(𝑥1 , 𝑦1 ) = 0.2 × = 0.1891
(1.196)2 + (0.2)2
1 1 (1.2906)2 − (0.3)2
𝑘2 = ℎ𝑓 (𝑥1 + ℎ, 𝑦1 + 𝑘1 ) = 0.2 × 𝑓(0.3, 1.2906) = 0.2 × = 0.1795
2 2 (1.2906)2 + (0.3)2

( 2 2
)
k3 = hf x1 + 1 h, y1 + 1 k 2 = 0.2  f (0.3, 1.2857) = 0.2 
(1.2857) 2 − (0.3) 2
(1.2857) 2 + (0.3) 2
= 0.1793𝑘4 =

(1.3753)2 −(0.4)2
ℎ𝑓(𝑥1 + ℎ, 𝑦1 + 𝑘3 ) = 0.2 × 𝑓(0.4, 1.3753) = 0.2 × (1.3753)2 +(0.4)2 = 0.1688,

Then k =
1
k1 + 2k2 + 2k3 +k 4  = 1 0.1891+ 2  0.1795 + 2  0.1793+ 0.1688 = 0.1793
6 6
Hence𝑦2 = 𝑦(0.4) = 𝑦1 + 𝑘 = 1.196 + 0.1793 = 1.3753

Exercises:
𝑑𝑦
1) Using Runge – Kutta method of order 4, compute 𝑦(0.2) from 10 𝑑𝑥 = 𝑥 2 + 𝑦 2 , 𝑦(0) = 1,

taking h = 0.1

2) Use Runge – Kutta fourth order method to find y when x = 1.2 in steps of 0.1 given that

𝑑𝑦
= 𝑥 2 + 𝑦 2 & 𝑦(1) = 1.5
𝑑𝑥

𝑑𝑦 𝑦−𝑥
3) Using Runge – Kutta method of order 4, find y(0.2) for the equation 𝑑𝑥 = 𝑦+𝑥 , 𝑦(0) = 1. Take

h = 0.2.

𝑑𝑦 1
4) Using Runge – Kutta fourth order method, find y(0.2)given that = 3𝑥 + 2 𝑦, 𝑦(0) = 1,
𝑑𝑥

taking h = 0.1

5) Using the fourth order Runge – Kutta method, solve the equation (𝑥 + 𝑦)𝑦 1 = 1at x = 0.5
given that 𝑦(0.4) = 1.

6) By using the 4th order Runge – Kutta method with step – length h = 0.2, find a approximate
solution at x = 1.2 of the initial value problem 𝑦 1 = 𝑥𝑦, y(1) = 2.

7) Using the Runge – Kutta fourth order method, solve the problem 𝑦 1 = 𝑥 + 𝑦 2 , y(0)=1,at x =
0.2 in steps of 0.1

II-Semester: Mathematics-II for Computer Science & Engineering stream (BMATS201)


P a g e 14 | 25
RV Institute of Technology & Management ®

8) By using the Runge – Kutta fourth order method, find the solution of the problem 𝑦 1 = 1 +
𝑦 2 , y(0) = 0 for x = 0.2, 0.4, 0.6

9) Given that 𝑦 1 − 𝑥 2 𝑦 = 𝑥, y(0) =1, find y(0.1) & y(0.2) by using the Runge – Kutta fourth order
method.

10) By using the Runge – Kutta fourth order method, solve the problem 𝑦1 = 1 − 2𝑥𝑦,

y (0) = 0 for x = 0.1, 0.2, 0.3


Answers:
1) 1.0207 2) 2.5005 3) 1.1678 4) 1.1749
5) 1.06744 6) 2.4921429 7) 1.1165, 1.27358 8) 0.2027074,
0.42279, 0.684135 9) 1.0053, 1.0227 10) 0.09934, 0.194751, 0.28263

Milne’s method
The Predictor-Corrector methods form a large class of general methods for numerical integration
of ordinary differential equations. As an illustration, consider Milne's method for the first-order
equation 𝑦′(𝑥) = 𝑓(𝑦(𝑥), 𝑥) initial value y(x0) = y0.
Define
𝑦𝑛 = 𝑦(𝑥0 + 𝑛ℎ),
𝑦′𝑛 = 𝑦′(𝑥0 + 𝑛ℎ) = 𝑓(𝑦𝑛 , 𝑥0 + 𝑛ℎ)
Then by Simpson's rule
𝑦′𝑛+1 = 𝑓(𝑦𝑛+1, 𝑥 + (𝑛 + 1)ℎ)
This corrector equation is an implicit equation for yn+1; if h is sufficiently small, and if a first
approximation for yn+1 can be found, the equation is solved simply by iteration, i.e., by repeated
evaluations of the right-hand side. To provide the first approximation for yn+1, an explicit predictor
formula is needed, e.g. Milne's formula
𝑦𝑛+1 = 𝑦𝑛−3 + (4ℎ/3)(2𝑦′𝑛 − 𝑦′𝑛−1 + 2𝑦′𝑛−2 ) + 𝑂(ℎ5 )
(𝑝) 4ℎ ′ ′
Predictor Formula: i.e., for n = 3 𝑦𝑛+1 = 𝑦𝑛−3 + [2𝑦𝑛−2 − 𝑦𝑛−1 + 2𝑦𝑛′ ]
3
(𝑝) 4ℎ
i.e., for n = 4 we have 𝑦5 = 𝑦1 + (2𝑓2 − 𝑓3 + 2𝑓4 )
3

(𝑐) ′ ℎ ′
Corrector Formula: i.e., for n = 3 𝑦𝑛+1 = 𝑦𝑛−1 + 3 [𝑦𝑛−1 + 4𝑦𝑛′ + 𝑦𝑛+1 ]

II-Semester: Mathematics-II for Computer Science & Engineering stream (BMATS201)


P a g e 15 | 25
RV Institute of Technology & Management ®

(𝑐) ℎ (𝑝)
i.e., for n = 4 we have 𝑦5 = 𝑦3 + (𝑓3 + 4𝑓4 + 𝑓5 ).
3

The need for a corrector formula arises because the predictor alone is numerically unstable; it gives
spurious solutions growing exponentially. Milne's predictor uses four previous values of y, these
values can be obtained by using Taylor’s or Runge-Kutta method.
Problems
𝑑𝑦
1. Using Milne’s method find y at x = 0.4 given that = 𝑥𝑦 + 𝑦 2 , 𝑦(0) = 1, 𝑦(0.1) = 1.1169,
𝑑𝑥

𝑦(0.2) = 1.2773&𝑦(0.3) = 1.504


Solution: Here 𝑓(𝑥, 𝑦) = 𝑥𝑦 + 𝑦 2 , 𝑥0 = 0, 𝑦0 = 1, x1 = 0.1, 𝑦1 = 1.1169, x2 = 0.2, 𝑦2 =
1.2773, x3 = 0.3, 𝑦3 = 1.504

 𝑓0 = 𝑓(𝑥0 , 𝑦0 ) = 0 + 12 = 1
𝑓1 = 𝑓(𝑥1 , 𝑦1 ) = 0.1 × 1.1169 + 1.11692 = 1.3592
𝑓2 = 𝑓(𝑥2 , 𝑦2 ) = 0.2 × 1.2773 + 1.27732 = 1.8870
𝑓3 = 𝑓(𝑥3 , 𝑦3 ) = 0.3 × 1.504 + 1.5042 = 2.7132
Now using predictor formula, we get,
(𝑝) 4ℎ 4 × 0.1
𝑦4 = 𝑦0 + (2𝑓1 − 𝑓2 + 2𝑓3 ) = 1 + (2 × 1.3592 − 1.8870 + 2 × 2.7132)
3 3
= 1.8344
(𝑝)
Now𝑓4 = 𝑓(0.4, 1.8344) = 0.4 × 1.8344 + 1.83442 = 4.0988.
Again, using corrector formula, we get
(𝑐) ℎ (𝑝) 0.1
𝑦4 = 𝑦2 + (𝑓2 + 4𝑓3 + 𝑓4 ) = 1.2773 + (1.8870 + 4 × 2.7132 + 4.0988) = 1.8386
3 3
(𝑝)
Again 𝑓4 = 𝑓(0.4, 1.8386) = 0.4 × 1.8386 + 1.83862 = 4.1159
So again, using corrector formula we get,
(𝑐) ℎ (𝑝) 0.1
𝑦4 = 𝑦2 + (𝑓2 + 4𝑓3 + 𝑓4 ) = 1.2773 + (1.8870 + 4 × 2.7132 + 4.1159) = 1.8392
3 3
(𝑝)
Now 𝑓4 = 𝑓(0.4, 1.8392) = 0.4 × 1.8392 + 1.83922 = 4.1183
So, using corrector formula we get,
(𝑐) ℎ (𝑝) 0.1
𝑦4 = 𝑦2 + (𝑓2 + 4𝑓3 + 𝑓4 ) = 1.2773 + (1.8870 + 4 × 2.7132 + 4.1183) = 1.8392
3 3
Hence 𝑦(0.4) = 1.8392

II-Semester: Mathematics-II for Computer Science & Engineering stream (BMATS201)


P a g e 16 | 25
RV Institute of Technology & Management ®

2. Using Milne's Predictor-Corrector method evaluate the integral of


𝑦 ′ − 4𝑦 = 0 at 0.4, given that 𝑦(0) = 1, 𝑦(0.1) = 1.492, 𝑦(0.2) = 2.226,
𝑦(0.3) = 3.320
𝑑𝑦
Solution: Here, 𝑑𝑥 = 4𝑦So 𝑓(𝑥, 𝑦) = 𝑦′ = 4𝑦

h=0.1, 𝑥0 = 0, 𝑥1 = 0.1, 𝑥2 = 0.2, 𝑥3 = 0.3, 𝑥4 = 0.4


For predictor value of y(0.4) :
(𝑝) 4ℎ 1 1
𝑦𝑛+1 = 𝑦𝑛−3 + [2𝑦𝑛−2 − 𝑦𝑛−1 + 2𝑦𝑛1 ] with n=3
3

(𝑝) 4ℎ
𝑦4 = 𝑦0 + [2𝑦11 − 𝑦21 + 2𝑦31 ]
3
Here, h=0.1,
𝑦0 = 1, 𝑦11 = 4𝑦1 = 4(1.492) = 5.968
𝑦21 = 4𝑦2 = 4(2.226) = 8.904
𝑦31 = 4𝑦3 = 4(3.32) = 13.28 ∴ 𝑦 𝑝 4 = 𝑦(𝑥4 ) = 𝑦(0.4)
4(0.1)
=1+ [2(5.968) − 8.904 + 2(13.28)] = 4.9456
3
𝑆𝑜 𝑦41 = 4𝑦4 = 4(4.9456) = 19.7824
For corrector value of y(0.4):
(𝑐) ℎ 1 𝑝
𝑦𝑛+1 = 𝑦𝑛−1 + [𝑦𝑛−1 + 4𝑦𝑛1 + 𝑦𝑛+1 ]
3
(𝑐) ℎ
with n=3, 𝑦4 = 𝑦2 + 3 [𝑦21 + 4𝑦31 + 𝑦41 ]

0.1
∴ 𝑦4 = 𝑦(0.4) = 2.226 + (2.226 + 4(13.28) + 19.7824 = 4.95288 (first approximation of
3

y4).

Second approximation of y4:

(𝐶1 ) ℎ (𝑐)
𝑦4 = 𝑦2 + [𝑦21 + 4𝑦31 + 𝑦4 ]
3

𝑦4 (1) = 4(4.95288) = 19.81152

0.1
∴ 𝑦4 = 𝑦(0.4) = 2.226 + 3
(2.226 + 4(13.28) + 19. .81152) = 4.731251.

Similarly, third approximation of y4:

II-Semester: Mathematics-II for Computer Science & Engineering stream (BMATS201)


P a g e 17 | 25
RV Institute of Technology & Management ®

0.1
∴ 𝑦4 = 𝑦(0.4) = 2.226 + (2.226 + 4(13.28) + 4(4.731251)) = 4.701700.
3

Fourth approximation of y4:

0.1
∴ 𝑦4 = 𝑦(0.4) = 2.226 + (2.226 + 4(13.28) + 4(4.701700)) = 4.69776.
3

Fifth approximation of y4:

0.1
∴ 𝑦4 = 𝑦(0.4) = 2.226 + (2.226 + 4(13.28) + 4(4.69776)) = 4.697234.
3

∴ The approximate value of y(0.4) is 4.697.

3. Using the Milne’s predictor-corrector method, find an approximate solution of the initial value
𝑑𝑦 2𝑦
problem 𝑑𝑥 = , 𝑥 ≠ 0, at the point x = 2, given y(1) = 2, y(1.25) = 3.13, y(1.5) = 4.5 and y(1.75)
𝑥

= 6.13. Apply the corrector twice.


2𝑦
Solution: Here 𝑓 = 𝑓(𝑥, 𝑦) = , x0 = 1, y0 = 2, x1 = 1.25, y1 = 3.13, x2 = 1.5, y2 = 4.5, x0 = 1, y3
𝑥

= 6.13 h = 0.25, also f1 =f(x1,y1) = 5.008, f2 =f(x2,y2) = 6.00, f3 =f(x3,y3) = 7.0057


4ℎ
Using Milne predictor yields the value of y4 as: 𝑦4 (𝑝) = 𝑦0 + (2𝑓1 − 𝑓2 + 2𝑓3 ) = 8.0091
3

This give f4(p) =f(x4, y4) = 8.0091


The Milne corrector gives the improved value of y4 as:

𝑦4 (𝑐) = 𝑦2 + 3 (𝑓2 + 4𝑓3 + 𝑓4 (𝑝) ) = 8.0027,

Further computing f4(p) =f(x4, y4) = 8.0027, applying the corrector again y4(c) = 8.0021
The approximate solution for ‘y’ at the point x =2, is 8.0021.

𝑑𝑦 2𝑥𝑦
4. Obtain y(0.5) for the IVP = 1+𝑥 2 , y(0.1) = 1, y(0.2) = 1.0199, y(0.3) =
𝑑𝑥

1.04 and y(0.4) = 1.0603, by Milne’s method.


𝟐𝒙𝒚
Solution: Here 𝒇 = 𝒇(𝒙, 𝒚) = 𝟏+𝒙𝟐, x0 = 0.1, y0 = 1, x1 = 0.2, y1 =𝟏. 𝟎𝟏𝟗𝟗, x2 = 0.3, y2 = 𝟏. 𝟎𝟒,
x0 = 0.4, y3 = 𝟏. 𝟎𝟔𝟎𝟑, h = 0.1, also f1 = f(x1, y1) = 0.3923, f2 =f(x2,y2) = 0.5725, f3 =f(x3,y3) = 0.7312.
4ℎ
Using Milne predictor yields the value of y4 as: 𝑦4 (𝑝) = 𝑦0 + 3 (2𝑓1 − 𝑓2 + 2𝑓3 ) =1.2233.

( )
This gives f 4P = f x4 , y4P = 0.9786.

The Milne corrector gives the improved value of y4 as:

II-Semester: Mathematics-II for Computer Science & Engineering stream (BMATS201)


P a g e 18 | 25
RV Institute of Technology & Management ®


𝑦4 (𝑐) = 𝑦2 + (𝑓2 + 4𝑓3 + 𝑓4 (𝑝) ) = 1.1974.
3

5. By using the Milne’s method find a solution of the differential equation 𝑦 ′ = 𝑥 2 + 𝑦 2 at x = 0.4
for the boundary condition y = 1 at x = 0. [Take h = 0.1]
Solution: To apply Milne’s method, we required the value of y at x = 0.2, x = 0.4 & x = 0.6. For
that, we can use Taylor series method. So, referring to the problem 1 in Taylor’s series, we have
obtained y(0.1) = 1.1113 considering up to 3rd degree term. Similarly, we can obtain by Taylor
series method y(0.2) = 1.2507, y(0.3) = 1.426.
To find y at x = 0.4: Here 𝑓(𝑥, 𝑦) = 𝑥 2 + 𝑦 2 , x0 = 0, 𝑦0 = 10 & ℎ = 0.1.

Now we can use Milne’s method to find 𝑦4 = 𝑦(0.4) .


Now 𝑓0 = 𝑓(𝑥0 , 𝑦0 ) = 02 + 12 = 1, 𝑓1 = 𝑓(𝑥1 , 𝑦1 ) = 0.12 + 1.11132 = 1.245,
𝑓2 = 𝑓(𝑥2 , 𝑦2 ) = 0.22 + 1.25072 = 1.6043,
& 𝑓3 = 𝑓(𝑥3 , 𝑦3 ) = 0.32 + 1.4262 = 2.1235,
(𝑝) 4ℎ
Now using Predictor formula 𝑦4 = 𝑦0 + (2𝑓1 − 𝑓2 + 2𝑓3 ), we get
3

(𝑝) 4 × 0.1
𝑦4 = 1+ (2 × 1.245 − 1.6043 + 2 × 2.1235) = 1.6844
3
(𝑝)
So 𝑓4 = 𝑓(𝑥4 , 𝑦4 ) = 0.42 + 1.68442 = 2.9972
(𝑐) ℎ (𝑝)
Using corrector formula 𝑦4 = 𝑦2 + 3 (𝑓2 + 4𝑓3 + 𝑓4 ), we get

(𝑐) 0.1
𝑦4 = 1.2507 + (1.6043 + 4 × 2.1235 + 2.9972) = 1.6872
3
(𝑝)
Now 𝑓4 = 𝑓(𝑥4 , 𝑦4 ) = 0.42 + 1.68722 = 3.0067 = 𝑓4 (𝑠𝑎𝑦)& again using corrector formula,
we get
(𝑐) 0.1
𝑦4 = 1.2507 + (1.6043 + 4 × 2.1235 + 3.0067) = 1.6875.
3
(𝑝)
Now 𝑓4 = 𝑓(𝑥4 , 𝑦4 ) = 0.42 + 1.68752 = 3.0077 = 𝑓4 (𝑠𝑎𝑦) & again using corrector formula
(𝑐)
we get 𝑦4 = 1.6876.
(𝑝)
Now 𝑓4 = 𝑓(𝑥4 , 𝑦4 ) = 0.42 + 1.68762 = 3.008 = 𝑓4 (𝑠𝑎𝑦) & again using corrector formula
(𝑐)
we get 𝑦4 = 1.6876.
Hence 𝑦4 = 𝑦(0.4) = 1.6876.

II-Semester: Mathematics-II for Computer Science & Engineering stream (BMATS201)


P a g e 19 | 25
RV Institute of Technology & Management ®

Self-Study

Adams – Bash forth method


dy
Given = f ( x, y) & y( x0 ) = y0 . First we compute
dx
𝑦1 = 𝑦(𝑥0 + ℎ), 𝑦2 = 𝑦(𝑥0 + 2ℎ), 𝑦3 = 𝑦(𝑥0 + 3ℎ),using one of the single step method. Then
calculate 𝑓1 = 𝑓(𝑥0 + ℎ, 𝑦1 ), 𝑓2 = 𝑓(𝑥0 + 2ℎ, 𝑦2 ), 𝑓3 = 𝑓(𝑥0 + 3ℎ, 𝑦3 )

Then using this in the formula 𝑦4𝑃 = 𝑦3 + 24 (55𝑓3 − 59𝑓2 + 37𝑓1 − 9𝑓0 ) ------- (1)
(𝑝)
This is called as Adams – Bashforth predictor formula. Then find 𝑓4 = 𝑓(𝑥0 + 4ℎ, 𝑦4𝑃 ) and use

the formula 𝑦4𝐶 = 𝑦3 + 24 (𝑓1 − 5𝑓2 + 19𝑓3 + 9𝑓4𝑝 ) -------- (2)

This formula is called as Adams – Bashforth corrector formula.


Again, an improved value of 𝑦4 is obtained by using corrector formula (2) repeatedly.
Problems:
dy
1. Given = x 2 (1 + y) & y(1) = 1, y(1.1) = 1.233, y(1.2) = 1.548, y(1.3) = 1.979. Evaluate y (1.4)
dx
by Adams – Bashforth method.

Solution: Here f ( x, y) = x 2 (1 + y), 𝑦0 = 1, 𝑦1 = 1.233, 𝑦2 = 1.548, 𝑦3 = 1.979


 𝑓0 = 12 (1 + 1) = 2, 𝑓1 = 1.12 (1 + 1.233) = 2.7019, 𝑓2 = 1.22 (1 + 1.548) = 3.6691, &
𝑓3 = 1.32 (1 + 1.979) = 5.0345.

Now using Adams – Bashforth predictor formula 𝑦4𝑃 = 𝑦3 + 24 (55𝑓3 − 59𝑓2 + 37𝑓1 − 9𝑓0 ) we
0.1
get, 𝑦4𝑃 = 1.979 + 24 (55 × 5.0345 − 59 × 3.6691 + 37 × 2.7019 − 9 × 2) = 2.5724
(𝑝)
𝑓4 = 1.42 (1 + 2.5724) = 7.0019

Using Adams – Bashforth corrector formula 𝑦4𝐶 = 𝑦3 + 24 (𝑓1 − 5𝑓2 + 19𝑓3 + 9𝑓4𝑝 ), we get,
0.1
𝑦4𝐶 = 1.979 + 24 (9 × 7.0019 + 19 × 5.0345 − 5 × 3.6691 + 2.7019) = 2.575
(𝑝)
Now 𝑓4 = 1.42 (1 + 2.575) = 7.007
So again, from Adams – Bashforth corrector formula we get
(𝑐) 0.1
𝑦4 = 1.979 + 24 (9 × 7.007 + 19 × 5.0345 − 5 × 3.6691 + 2.7019) = 2.5751, which is

same as above.
Hence y(1.4) = 2.5751.

II-Semester: Mathematics-II for Computer Science & Engineering stream (BMATS201)


P a g e 20 | 25
RV Institute of Technology & Management ®

𝑑𝑦
2. Solve the initial value problem = 𝑥 − 𝑦 2 , 𝑦(0) = 1 to find 𝑦(0.4) by Adams – Bash forth
𝑑𝑥

method for the data: 𝑦(0.1) = 0.9138, 𝑦(0.2) = 0.8512, 𝑦(0.3) = 0.8076.
Solution: Here 𝑓(𝑥, 𝑦) = 𝑥 − 𝑦 2 , 𝑦0 = 1, 𝑦1 = 0.9138, 𝑦2 = 0.8512, 𝑦3 = 0.8076.
Now we can use Predictor corrector formula to find y at 0.4 with
𝑦0 = 1, 𝑦1 = 0.9138, 𝑦2 = 0.8512, 𝑦3 = 0.8076 & 𝑠𝑜 𝑓0 = 0 − 12 = −1,
𝑓1 = 0.1 − 0.91382 = −0.7350, 𝑓2 = 0.2 − 0.85122 = −0.5245
& 𝑓3 = 0.3 − 0.80762 = −0.3522

Hence by Adams – Bashforth predictor formula 𝑦4𝑃 = 𝑦3 + 24 (55𝑓3 − 59𝑓2 + 37𝑓1 − 9𝑓0 ) we get
(𝑝) 0.1
𝑦4 = 0.8076 + 24 (55 × (−0.3522) − 59 × (−0.5245) + 37 × (−0.735) − 9 × (−1))

= 0.7800
(𝑝)
Now 𝑓4 = 0.4 − 0.78002 = −0.2084

Using Adams – Bashforth corrector formula 𝑦4𝐶 = 𝑦3 + 24 (𝑓1 − 5𝑓2 + 19𝑓3 + 9𝑓4𝑝 ) we get,

(𝑐) 0.1
𝑦4 = 0.8076 + (9 × (−0.2084) + 19 × (−0.3522) − 5 × (−0.5245) + (−0.7350))
24
= 0.7798
(𝑝)
Again 𝑓4 = 0.4 − 0.77982 = −0.2080
(𝑐) 0.1
𝑦4 = 0.8076 + (9 × (−0.2080) + 19 × (−0.3522) − 5 × (−0.5245) + (−0.7350))
24
= 0.7798
Hence y(0.4) = 0.7798.

dy y 1
3. Solve the initial value problem dx + x = x2 and compute y at x = 1.4 by Adams-Bashforth

method, given that y(1) = 1, y(1.1) = 0.996, y(1.2) = 0.986, y(1.3) = 0.972.
Solution: Given that, 𝑥0 = 1, 𝑥1 = 1.1, 𝑥2 = 1.2, 𝑥3 = 1.3 & 𝑦0 = 1, 𝑦1 = 0.996,
1 𝑦
𝑦2 = 0.986, 𝑦3 = 0.972. We have 𝑓(𝑥, 𝑦) = − .
𝑥2 𝑥

Therefore, we get
𝟏 𝟎.𝟗𝟗𝟔
𝒇𝟎 = 𝒇(𝒙𝟎 , 𝒚𝟎 ) = 𝟏 − 𝟏 = 0, 𝒇𝟏 = 𝒇(𝒙𝟏 , 𝒚𝟏 ) = (𝟏.𝟏)𝟐 − = − 0.079
𝟏.𝟏
𝟏 𝟎.𝟗𝟖𝟔 𝟏 𝟎.𝟗𝟕𝟐
𝒇𝟐 = 𝒇(𝒙𝟐 , 𝒚𝟐 ) = (𝟏.𝟐)𝟐
− 𝟏.𝟐
= − 0.1272, 𝒇𝟑 = 𝒇(𝒙𝟑 , 𝒚𝟑 ) = (𝟏.𝟑)𝟐
− 𝟏.𝟑
= − 0.1560


Hence by Adams – Bashforth predictor formula 𝑦4𝑃 = 𝑦3 + 24 (55𝑓3 − 59𝑓2 + 37𝑓1 − 9𝑓0 ) we get

II-Semester: Mathematics-II for Computer Science & Engineering stream (BMATS201)


P a g e 21 | 25
RV Institute of Technology & Management ®

(𝑝) 0.1
𝑦4 = 0.972 + (55 × (− 0.1560) − 59 × (− 0.1272) + 37 × (− 0.079) − 9 × 0)
24
= 0.9553
(𝑝)
Now 𝑓4 = − 0.1722

Using Adams – Bashforth corrector formula 𝑦4𝐶 = 𝑦3 + 24 (𝑓1 − 5𝑓2 + 19𝑓3 + 9𝑓4𝑝 ) we get,

(𝑐) 0.1
𝑦4 = 0.972 + (− 0.079 − 5 × (− 0.1272) + 19 × (− 0.1560) + 9 × (− 0.1722))
24
= 0.9555
Hence 𝑦(1.4) = 0.9555

𝑑𝑦 𝑥2
4. Given = 1+𝑦 2 𝑤𝑖𝑡ℎ 𝑦(0) = 1, 𝑦(0.25) = 1.0026, 𝑦(0.5) = 1.0206, 𝑦(0.75) = 1.0679.
𝑑𝑥

Solve the given ODE by Adams-Bashforth method at 𝑥 = 1.


Solution: Given that, 𝑥0 = 0, 𝑥1 = 0.25, 𝑥2 = 0.5, 𝑥3 = 0.75 & 𝑦0 = 1, 𝑦1 = 1.0026,
𝑥2
𝑦2 = 1.0206, 𝑦3 = 1.0679. We have 𝑓(𝑥, 𝑦) = .
1+𝑦 2

Therefore, we get
𝟎𝟐 𝟎.𝟐𝟓𝟐
𝒇𝟎 = 𝒇(𝒙𝟎 , 𝒚𝟎 ) = 𝟏+𝟏𝟐 = 0, 𝒇𝟏 = 𝒇(𝒙𝟏 , 𝒚𝟏 ) = 𝟏+𝟏.𝟎𝟎𝟐𝟔𝟐 = 0.0312,
𝟎.𝟓𝟐 𝟎.𝟕𝟓𝟐
𝒇𝟐 = 𝒇(𝒙𝟐 , 𝒚𝟐 ) = = 0.1225, 𝒇𝟑 = 𝒇(𝒙𝟑 , 𝒚𝟑 ) = = 𝟎. 𝟐𝟔𝟐𝟖
𝟏+𝟏.𝟎𝟐𝟎𝟔𝟐 𝟏+𝟏.𝟎𝟔𝟕𝟗𝟐


Hence by Adams – Bashforth predictor formula 𝑦4𝑃 = 𝑦3 + 24 (55𝑓3 − 59𝑓2 + 37𝑓1 − 9𝑓0 ) we get

(𝑝) 0.25
𝑦4 = 1.0679 + (55 × ( 𝟎. 𝟐𝟔𝟐𝟖) − 59 × (0.1225) + 37 × (0.0312) − 9 × 0)
24
= 1.1552
(𝑝) 12
Now 𝑓4 = 1+1.15522 = 0.4284

Using Adams – Bashforth corrector formula 𝑦4𝐶 = 𝑦3 + 24 (𝑓1 − 5𝑓2 + 19𝑓3 + 9𝑓4𝑝 ) we get,
(𝑐) 0.25
𝑦4 = 1.0679 + (0.0312 − 5 × (0.1225) + 19 × (0.2628) + 9 × (0.4284)) = 1.1540
24

Hence 𝑦(1.4) = 1.1540

𝑑𝑦
5. Using Adams-Bashforth method, find 𝑦(4.4) given 5𝑥 𝑑𝑥 + 𝑦 2 = 2 with y(4) = 1, y(4.1) =

1.0049, y(4.2) = 1.0097, y(4.3) = 1.0143 .


Solution: Given that, 𝑥0 = 4 𝑥1 = 4.1, 𝑥2 = 4.2, 𝑥3 = 4.3 & 𝑦0 = 1, 𝑦1 = 1.0049,

II-Semester: Mathematics-II for Computer Science & Engineering stream (BMATS201)


P a g e 22 | 25
RV Institute of Technology & Management ®

2 − 𝑦2
𝑦2 = 1.0097, 𝑦3 = 1.0143. We have 𝑓(𝑥, 𝑦) = .
5𝑥

Therefore, we get
𝟐 − 𝟏𝟐 𝟐 − 𝟏.𝟎𝟎𝟒𝟗𝟐
𝒇𝟎 = 𝒇(𝒙𝟎 , 𝒚𝟎 ) = = 0.05, 𝒇𝟏 = 𝒇(𝒙𝟏 , 𝒚𝟏 ) = = 0.0483,
𝟓(𝟒) 𝟓(𝟒.𝟏)
2 − 1.00972 2 − 1.01432
𝑓2 = 𝑓(𝑥2 , 𝑦2 ) = = 0.0467, 𝑓3 = 𝑓(𝑥3 , 𝑦3 ) = = 0.0452
5(4.2) 5(4.3)

Hence by Adams – Bashforth predictor formula 𝑦4𝑃 = 𝑦3 + 24 (55𝑓3 − 59𝑓2 + 37𝑓1 − 9𝑓0 ) we get

(𝑝) 0.1
𝑦4 = 1.0143 + (55 × ( 0.0452) − 59 × ( 0.0467) + 37 × ( 0.0483) − 9 × 0.05)
24
= 1.0187
(𝑝) 2 − 1.01872
Now 𝑓4 = = 0.0437
5(4.4)

Using Adams – Bashforth corrector formula 𝑦4𝐶 = 𝑦3 + 24 (𝑓1 − 5𝑓2 + 19𝑓3 + 9𝑓4𝑝 ) we get,

(c) 0.1
y4 = 1.0143 + (0.0483 − 5 × (0.0467) + 19 × ( 0.0452) + 9 × (0.0437)) = 1.0187
24
Hence 𝑦(1.4) = 1.0187

Exercises:
dy
1) Given 2 = (1 + x 2 ) y 2 & y(0) = 1, y(0.1) = 1.06, y(0.2) = 1.12, y(0.3) = 1.21. Evaluate
dx
y (0.4) by Milne’s predictor – corrector method.

2) Given y1 = x 2 − y, y(0) = 1 & the starting values y(0.1) = 0.90516, y(0.2) = 0.82127,
y(0.3) = 0.74918. Evaluate y (0.4) using Adams – Bashforth method.

3) By using the Milne’s predictor – corrector method, find an approximate solution of the
dy 2 y
equation = , x  0 at the point x = 2, given that y(1) = 2, y(1.25) = 3.13, y(1.5) = 4.5 &
dx x
y(1.75) = 6.13

y
4) The following table gives the solutions of the differential equation y1 = x 2 + for 1  x  1.3
2
at steps of 0.1. Find y at 1.4 using the Milne’s predictor – corrector method.

II-Semester: Mathematics-II for Computer Science & Engineering stream (BMATS201)


P a g e 23 | 25
RV Institute of Technology & Management ®

x 1 1.1 1.2 1.3


y 2 2.2156 2.4649 2.7514

5) Use Milne’s method to find y (0.3) from y1 = x 2 + y 2 , y(0) = 1 after computing


y(−0.1), y(0.1) & y(0.2) by the Taylor’s series method.

6) By employing the Adams – Bashforth predictor – corrector method, find the solution of the

equation y1 = 1 + y 2 at the point x = 0.8, given that y(0) = 0. Take step length h = 0.2.

dy
7) The following table gives the solution of the equation = 1 + xy 2 at specified values of x.
dx
Find the value of y at x = 0.4 using the Adams – Bashforth method.

X 0 0.1 0.2 0.3


Y 1 1.105 1.223 1.355
dy
8) The following table gives the solution of the equation = 2e x − y at specified values of x.
dx
Find the value of y at x = 0.4 & x = 0.5 using the Adams – Bashforth method.

X 0 0.1 0.2 0.3


Y 2 2.010 2.04 2.09

9) The following table gives the solution of the equation 5xy1 + y 2 − 2 = 0 at specified values of
x. Find the value of y at x = 4.4 using the Milne’s predictor – corrector method.

X 4 4.1 4.2 4.3


Y 1 1.0049 1.0097 1.0143
Answers:
1) 1.2797 2) 0.6897 3) 8.0021 4) 3.0794 5) 1.439538
6) 1.03 7) 1.5 8) 2.162 & 2.256 9) 1.0187

Video Links:

1. Numerical Solution of Ordinary Differential Equation-Introduction:


https://youtu.be/QugqSa3Gl-w
2. Taylor’s series method

II-Semester: Mathematics-II for Computer Science & Engineering stream (BMATS201)


P a g e 24 | 25
RV Institute of Technology & Management ®

https://youtu.be/3yGx-_qcdMM
3. Euler's Methods and Second-Order Methods
https://youtu.be/VmIwt7sM1rw
4. Runge - Kutta method of order IV
https://youtu.be/QQFIWwDA9NM
5. Introduction to Predictor-Corrector Methods
https://youtu.be/LNn2qb1dPlI

Disclaimer: The content provided is prepared by department of Mathematics for the specified
syllabus by using reference books mentioned in the syllabus. This material is specifically for the
use of RVITM students and for education purpose only.

II-Semester: Mathematics-II for Computer Science & Engineering stream (BMATS201)


P a g e 25 | 25

You might also like