0% found this document useful (0 votes)
34 views37 pages

Unit II - Numerical Methods IV Sem

The document covers numerical methods focusing on finite differences, including forward and backward differences, and interpolation techniques. It provides definitions, formulas, and examples for calculating values using Newton's forward and backward interpolation methods. Additionally, it includes problems demonstrating how to apply these methods to estimate function values and analyze data.

Uploaded by

Surya Anand
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)
34 views37 pages

Unit II - Numerical Methods IV Sem

The document covers numerical methods focusing on finite differences, including forward and backward differences, and interpolation techniques. It provides definitions, formulas, and examples for calculating values using Newton's forward and backward interpolation methods. Additionally, it includes problems demonstrating how to apply these methods to estimate function values and analyze data.

Uploaded by

Surya Anand
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/ 37

Unit - I

Numerical Methods - I
FINITE DIFFERENCES:

FORWARD DIFFERENCES:

Let y0, y1, y2, ……. yr ….. be the values of a function y = f(x) corresponding to the values x0,
x1, x2, ……. xr ….. of x respectively. Then

The first forward difference of f(x) is defined as

yr = yr +1 − yr r = 0, 1, 2, 3, ……..

Here the symbol  is called the forward difference operator.

The second forward difference of f(x) is defined as

 2 yr = yr +1 − yr r = 0, 1, 2, 3, ……..

Similarly the nth forward difference of f(x) is defined as

 n yr =  n −1 yr +1 −  n −1 yr r = 0, 1, 2, 3, ……..

Forward Difference Table:

x y = f(x) y 2y 3y 4y


x0 y0
y0
x1 y1 2y0
y1 3y0
x2 y2  y12
4y0
y2 3y1
x3 y3 2y2
y3
x4 y4

In a difference table the values of x are called arguments and the values of y are called
entries. The first entry y0 is called the leading term and the differences y0, 2y0, 3y0 ….. are
called leading differences.

BACKWARD DIFFERENCES:

Let y0, y1, y2, ……. yr ….. be the values of a function y = f(x) corresponding to the values x0,
x1, x2, ……. xr ….. of x respectively. Then

1
The first backward difference of f(x) is defined as

yr = yr − yr −1 r = 1, 2, 3, ……..

Here the symbol  is called nabla.

The second backward difference of f(x) is defined as

 2 yr = yr − yr −1 r = 2, 3, ……..

Similarly the nth backward difference of f(x) is defined as

 n yr =  n −1 yr −  n −1 yr −1 r = n, n + 1, n + 2, ……..

Forward Difference Table:

x y = f(x) y 2y 3y 4y


x0 y0
y1
x1 y1  2 y2
y2  3 y3
x2 y2  2 y3  4 y4
y3  3 y4
x3 y3  y4
2

y4
x4 y4

Interpolation:

Let y0, y1, y2, ……. yn be n + 1 values of an unknown function y = f(x) corresponding
to the n + 1 values x0, x1, x2, ……. xn of x respectively. With these values of x and y in hand,
suppose we wish to estimate the value of y corresponding to a specified value of x that lies
between x0 and xn. The process of making this estimation is called interpolation. The process
of estimating the values of y for some value of x outside the interval (x0 , xn) is called
extrapolation. The word interpolation generally includes the word extrapolation as well.

Newton – Gregory forward Interpolation formula: (for equidistant arguments)

Statement:

Let x0, x1 = x0 + h, x2 = x1 + h,……. xn = xn - 1 + h be a set of equidistant values of x with the


corresponding values y0 = f(x0), y1 = f(x1), y2 = f(x2), …… yn = f(xn) then the approximate
value of y at x = x0 + rh is

2
r (r − 1) 2 r (r − 1)(r − 2) 3
y = f ( x) = y0 + r y0 +  y0 +  y0 + .........
2! 3!
r (r − 1)(r − 2)..........(r − n + 1) n
......................... +  y0
n!

Newton – Gregory backward Interpolation formula: (for equidistant arguments)

Statement:

Let xn, xn - 1 = xn - h, xn - 2 = xn-1 - h, ……. x0 = x0 - h be a set of equidistant values of x with the


corresponding values yn = f(xn), yn - 1 = f(xn - 1), yn - 2 = f(xn - 2),…… y0 = f(x0), then the
approximate value of y at x = xn - rh is

r (r + 1) 2 r (r + 1)(r + 2) 3
y = f ( x ) = y n + r y n +  yn +  yn + .........
2! 3!
r (r + 1)(r + 2)..........(r + n − 1) n
......................... +  yn
n!

Problem 1: Given

x 0.1 0.2 0.3 0.4 0.5 0.6


f(x) 2.68 3.04 3.38 3.68 3.96 4.21

Find f(0.25).
Solution: We first form the following difference table.

x f(x) y 2y 3y 4y 5y


0.1 2.68
0.36
0.2 3.04 - 0.02
0.34 - 0.02
0.3 3.38 - 0.04 0.04
0.30 0.02 - 0.07
0.4 3.68 - 0 .02 - 0.03
0.28 - 0.01
0.5 3.96 -0.03
0.25
0.6 4.21

From the table, we find that

x0 = 0.1, y0 = 2.68,  y0 = 0.36, 2 y0 = - 0.02, 3 y0 = - 0.02, 4 y0 = 0.04, 5 y0 = - 0.07.

Further we note that h = 0.1.

xr = x0 + rh = 0.25

3
xr − x0 0.25 − 0.1
r = = = 1.5 .
h 0.1

The forward difference formula now gives

r (r − 1) 2 r (r − 1)(r − 2) 3
f ( xr ) = yr = y0 + r y0 +  y0 +  y0
2! 3!
r (r − 1)(r − 2)(r − 3) 4 r (r − 1)(r − 2)(r − 3)(r − 4) 5
+  y0 +  y0
4! 5!

(1.5)(1.5 − 1) (1.5)(1.5 − 1)(1.5 − 2)


f (2.5) = 2.68 + (1.5)(0.36) + (−0.02) + (−0.02)
2 6
(1.5)(1.5 − 1)(1.5 − 2)(1.5 − 3) (1.5)(1.5 − 1)(1.5 − 2)(1.5 − 3)(1.5 − 4)
+ (0.04) + (−0.07)
24 120
= 3.22

Problem 2: Using Newton’s forward formula find the value of f(1.1) if

x 1 1.4 1.8 2.2


f(x) 3.49 4.82 5.96 6.5

Solution: We first form the following difference table.

x f(x) y 2y 3y


1 3.49
1.33
1.4 4.82 -0.19
1.14 -0.41
1.8 5.96 -0.60
0.54
2.2 6.5

From the table, we find that

x0 = 1, y0 = 3.49,  y0 = 1.33, 2 y0 = - 0.19, 3 y0 = - 0.41.

Further we note that h = 0.4.

xr = x0 + rh = 1.1

xr − x0 1.1 − 1
r = = = 0.25 .
h 0.4

The forward difference formula now gives

r (r − 1) 2 r (r − 1)(r − 2) 3
f ( xr ) = yr = y0 + r y0 +  y0 +  y0
2! 3!

4
(0.25)(0.25 − 1) (0.25)(0.25 − 1)(0.25 − 2)
f (1.1) = 3.49 + (0.25)(1.33) + (−0.19) + (−0.41)
2 6

= 3.81789

Problem 3: Find the interpolating polynomial f(x) satisfying f(0) = 0, f(2) = 4, f(4) = 56, f(6)
= 204, f(8) = 496, f(10) = 980 and hence find f(3).

Solution: The forward difference table for the given data is shown below

x f(x) y 2y 3y 4y


0 0
4
2 4 48
52 48
4 56 96 0
148 48
6 204 144 0
292 48
8 496 192
484
10 980

From the table, we find that

x0 = 0.1, y0 = 0,  y0 = 4, 2 y0 = 48, 3 y0 = 48, 4 y0 = 0.

Further we note that h = 2.

xr = x0 + rh = x

xr − x0 x − 0 x
r = = = .
h 2 2

The forward difference formula now gives

r (r − 1) 2 r (r − 1)(r − 2) 3 r (r − 1)(r − 2)(r − 3) 4


f ( xr ) = yr = y0 + r y0 +  y0 +  y0 +  y0
2! 3! 4!

 x  x   x  x  x 
   − 1    − 1  − 2 
x
f ( x) = 0 +   ( 4 ) +  2   2  ( 48 ) +  2   2   2 ( )
48
2 2 6

f ( x) = 2 x + x( x − 2)(6) + x( x − 2)( x − 4)

f ( x) = x 3 − 2 x .

For x = 3 we get

5
f (3) = 33 − 2(3) = 21

Problem 4: From the following table estimate the number of students who obtained marks

(a) less than 45 marks (b) between 40 and 45 marks.

Marks 30 - 40 40 - 50 50 - 60 60 - 70 70 - 80
No. of
31 42 52 35 31
Students

Solution: We shall reconstitute the given table with f(x) representing the number of students
less than x marks. That is,

less than 40 marks 31 students,

less than 50 marks 31 + 42 = 73 students,

less than 60 marks 73 + 51 = 124 students,

less than 70 marks 124 + 35 = 159 students,

less than 80 marks 159 + 31 = 190 students.

We have the new table along with the forward differences.

x f(x) = y y 2y 3y 4y


x0 = 40 y0 = 31
y0 = 42
50 73  2 y0 = 9
51 3y0 = -25
60 124 -16 4y0 = 37
35 12
70 159 -4
31
80 190

From the table, we find that

x0 = 40, y0 = 31,  y0 = 42, 2 y0 = 9, 3 y0 = -25, 4 y0 = 37.

Further we note that h = 10.

xr = x0 + rh

6
xr − x0 45 − 40
r = = = 0.5 .
h 10

(a) Applying Newton’s forward interpolation formula, we get

( 0.5 ) (0.5 − 1) ( ) (0.5 − 1)(0.5 − 2)


f (45) = 31 + ( 0.5 ) ( 42 ) + ( 9 ) + 0.5 ( −25 )
2 6
( 0.5 ) (0.5 − 1)(0.5 − 2)(0.5 − 3)
+ ( 37 )
24

f (45) = 47.86  48.

Thus, the number of students obtaining less than 45 marks is 48.

(b) The number of students scoring marks between 40 and 45 = f (45) − f (40) = 48 − 31 − 17

Problem: Given

x 1 2 3 4 5 6
f(x) 4 7 9 20 24 30

Find f(2-5).
Problem: Using Newton’s backward formula find the value of f(7) if

x 2 4 6 8
f(x) 10 25 43 50

7
Newton’s general Interpolation formula:

Let y0, y1, y2, ……. yn be n + 1 values of an unknown function y = f(x) corresponding
to the n + 1 values x0, x1, x2, ……. xn of x, which are not necessarily equally spaced
respectively. Let us define the divided differences

First divided difference for xi, xj

y j − yi
 xi , x j  =
x j − xi

Second divided difference for xi, xj, xk

 x j , xk  −  xi , x j 
 xi , x j , xk  =
xk − xi

Third divided difference for xi, xj, xk

 x j , xk , x p  −  xi , x j , xk 
 xi , x j , xk , x p  =
x p − xi

and so on. Here xi, xj, xk, xp, …. are any specified values of x and yi, yj, yk, yp, …. are the
corresponding values of y = f(x).

Newton’s divided difference formula: (Newton’s general interpolation formula)

y = y0 + ( x − x0 )  x0 , x1  + ( x − x0 ) ( x − x1 )  x0 , x1 , x2  + ( x − x0 ) ( x − x1 )( x − x2 )  x0 , x1 , x2 , x3  +
.............................. + ( x − x0 ) ( x − x1 )( x − x2 ) .......( x − xn−1 )  x0 , x1 , x2 , x3 ,......xn 

Problem 1: Given that f(0) = 8, f(1) = 68 and f(5) = 123 construct a divided difference table
using the table determine the value of f(2).

Solution: Here x0 = 0, x1 = 1, x2 = 5 and y0 = f(0) = 8, y1 = f(1) = 68, y2 = f(2) = 123,

y1 − y0 68 − 8
Now  x0 , x1  = = = 60
x1 − x0 1− 0

y2 − y1 123 − 68
 x1 , x2  = = = 13.75
x2 − x1 5 −1

8
 x1 , x2  −  x0 , x1  = 13.75 − 60 = −9.25
 x0 , x1 , x2  =
x2 − x0 5−0

The divided difference table for the given data is as follows

x f(x) First D.D. Second D.D.


x0 = 0 y0 = 8
68 − 8
 x0 , x1  = = 60
1− 0
x1 = 1 y1 = 68 60 − 13.75
 x0 , x1 , x2  = = −9.25
5−0
123 − 68
 x1 , x2  = = 13.75
5 −1
x2 = 5 y2 = 123

Using the entries in the table and taking x = 2 in the Newton’s divided difference formula we
get y = y0 + ( x − x0 )  x0 , x1  + ( x − x0 ) ( x − x1 )  x0 , x1 , x2 

y = 8 + ( 2 − 0 ) (60) + ( 2 − 0 ) ( 2 − 1) (−9.25)= 109.50 .

Problem 2: Using Newton’s divided difference formula, find f(8), f(15) given

x 4 5 7 10 11 13
f(x) 48 100 294 900 1210 2029

Solution:Here x0 = 4, x1 = 5, x2 = 7, x3 = 10, x4 = 11, x5 = 14

and y0 = 48, y1 = 100, y2 = 294, y3 = 900, y4 = 1210, y5 = 2028.

The divided difference table for the given data is as follows

x f(x) 1st D.D. 2nd D.D. 3rd D.D. 4th D.D.


x0 = 4 y0 = 48
100 − 68
= 52
5−4
x1 = 5 y1 = 100 97 − 52
= 15
7−4
294 − 100 21 − 15
= 97 =1
7−5 10 − 4
x2 = 7 y2 = 294 202 − 97 1−1
= 21 =0
10 − 5 11 − 4
900 − 294 27 − 21
= 202 =1
10 − 7 11 − 5
x3 = 10 y3 = 900 310 − 202 1 −1
= 27 =0
11 − 7 14 − 5

9
1210 − 900 33 − 27
= 310 =1
11 − 10 13 − 7
x4 = 11 y4 = 1210 409 − 310
= 33
13 − 10
2018 − 1210
= 409
14 − 11
x5 = 14 y5 = 2028
Using the entries in the table and taking x = 2 in the Newton’s divided difference formula we
get

f ( x) = y0 + ( x − x0 )  x0 , x1  + ( x − x0 ) ( x − x1 )  x0 , x1 , x2 + ( x − x0 ) ( x − x1 )( x − x2 )  x0 , x1 , x2 , x3 

f ( x) = 48 + ( x − 4 ) 52 + ( x − 4 )( x − 5 )15 + ( x − 4 )( x − 5 )( x − 7 )1

f ( x) = x3 − x 2

f (8) = 83 − 82 = 448

f (15) = 153 − 152 = 3150

Problem 3: Using Newton’s divided difference formula, find f(9) given

x 5 7 11 13 17
f(x) 150 392 1452 2366 5202
Solution: Here x0 = 5, x1 = 7, x2 = 11, x3 = 13, x4 = 17

and y0 = 150, y1 = 392, y2 = 1452, y3 = 2366, y4 = 5202.

The divided difference table for the given data is as follows

x f(x) 1st D.D. 2nd D.D. 3rd D.D. 4th D.D.


x0 = 5 y0 = 150
392 − 150
= 121
7−5
x1 = 7 y1 = 392 265 − 121
= 24
11 − 5
1452 − 392 32 − 24
= 265 =1
11 − 7 13 − 5
x2 = 11 y2 = 1452 457 − 265 1 −1
= 32 =0
13 − 7 17 − 5
2366 − 1452 42 − 32
= 457 =1
13 − 11 17 − 7
x3 = 13 y3 = 2366 709 − 457
= 42
17 − 11
5202 − 2366
= 709
17 − 13
x4 = 17 y4 = 5202

10
Using the entries in the table and taking x = 9 in the Newton’s divided difference formula we
get
f ( x) = y0 + ( x − x0 )  x0 , x1  + ( x − x0 ) ( x − x1 )  x0 , x1 , x2 + ( x − x0 ) ( x − x1 )( x − x2 )  x0 , x1 , x2 , x3 
f ( x) = 150 + ( 9 − 5 )121 + ( 9 − 5 )( 9 − 7 ) 24 + ( 9 − 5 )( 9 − 7 )( 9 − 11)1

f ( x) = 150 + 484 + 192 − 16 = 810

Problem 4: Using Newton’s divided difference formula, determine f(x) as a polynomial in x


for the following data:

x -4 -1 0 2 5
f(x) 1245 33 5 9 1335

Solution: Here x0 = - 4, x1 = - 1, x2 = 0, x3 = 2, x4 = 5

and y0 = 1245, y1 = 33, y2 = 5, y3 = 9, y4 = 1335.

The divided difference table for the given data is as follows

x f(x) 1st D.D. 2nd D.D. 3rd D.D. 4th D.D.


x0 = - 4 y0 = 1245
-404
x1 = - 1 y1 = 33 94
-28 -14
x2 = 0 y2 = 5 10 3
2 13
x3 = 2 y3 = 9 88
442
x4 = 5 y4 = 1335

Using the entries in the table in the Newton’s divided difference formula we get

f ( x) = y0 + ( x − x0 )  x0 , x1  + ( x − x0 ) ( x − x1 )  x0 , x1 , x2 + ( x − x0 ) ( x − x1 )( x − x2 )  x0 , x1 , x2 , x3 
f ( x) = 1245 + ( x + 4 ) ( −404) + ( x + 4 )( x + 1) (94) + ( x + 4 )( x + 1)( x − 0 ) ( −14)
+ ( x + 4 )( x + 1)( x − 0 )( x − 2 ) (3)

f ( x) = 3x 4 − 5 x3 + 6 x 2 − 14 x + 5

11
Problem: Use Newton’s divided difference method to compute f(5.5) from the following
data

x 0 1 4 5 6
f(x) 1 14 15 6 3

Problem: Obtain the Newton’s divided difference interpolation polynomial and hence find
f(6) from the following data

x 3 7 9 10
f(x) 168 120 72 63

Problem: Obtain the Newton’s divided difference interpolation polynomial from the
following data

x -1 0 1 3
f(x) 2 1 0 -1

Problem: Obtain the Newton’s divided difference interpolation polynomial from the
following data

x 5 6 9 11
f(x) 12 13 14 16

Problem: Obtain the Newton’s divided difference interpolation polynomial from the
following data

x -1 0 3 6 7
f(x) 3 -6 39 822 1611

12
Lagrange’s Interpolation Formula: (Values of x are not necessarily equally spaced)

Let y0, y1, y2, ……. yn be n + 1 values of an unknown function y = f(x) corresponding
to the n + 1 values x0, x1, x2, ……. xn of x, which are not necessarily equally spaced
respectively. It can be proved that the polynomial representation of y is given by the
following formula

( x − x1 )( x − x2 ) ( x − x3 ) ......... ( x − xn ) ( x − x0 ) ( x − x2 ) ( x − x3 ) ......... ( x − xn )
y = f ( x) = y0 + y +
( x0 − x1 )( x0 − x2 )( x0 − x3 ) ......... ( x0 − xn ) ( x1 − x0 ) ( x1 − x2 ) ( x1 − x3 ) .........( x1 − xn ) 1
( x − x0 ) ( x − x1 ) ( x − x3 ) ......... ( x − xn )
+ y + ........................................................................
( x2 − x0 ) ( x2 − x1 ) ( x2 − x3 ) ......... ( x2 − xn ) 2
( x − x0 ) ( x − x1 )( x − x2 ) ......... ( x − xn−1 )
+ ........................................................................+ y
( xn − x0 )( xn − x1 )( xn − x2 ) ......... ( xn − xn−1 ) n

This formula is known as Lagrange’s Interpolation formula. The polynomial on the R. H. S.


of this formula is called Lagrange’s Interpolating polynomial.

Problem 1: Using Lagrange’s interpolation formula, find f(11) from the following data:

x 2 5 8 14
y = f(x) 94.8 87.9 81.3 68.7

Solution: Here x0 = 2, x1 = 5, x2 = 8, x3 = 14,

and y0 = 94.8, y1 = 87.9, y2 = 81.3, y3 = 68.7 and x = 11.

Lagrange’s formula is

( x − x1 )( x − x2 ) ( x − x3 ) ( x − x0 ) ( x − x2 ) ( x − x3 )
y = f ( x) = y0 + y +
( x0 − x1 )( x0 − x2 )( x0 − x3 ) ( x1 − x0 ) ( x1 − x2 ) ( x1 − x3 ) 1
( x − x0 ) ( x − x1 ) ( x − x3 ) ( x − x0 ) ( x − x1 )( x − x2 )
+ y2 + y
( x2 − x0 ) ( x2 − x1 ) ( x2 − x3 ) ( x3 − x0 )( x3 − x1 )( x3 − x2 ) 3

Substituting the above values, we get

(11 − 5 )(11 − 8 ) (11 − 14 ) ( )( )( )


f (11) = ( 94.8) + 11 − 2 11 − 8 11 − 14 ( 87.9 ) +
( 2 − 5 )( 2 − 8 ) ( 2 − 14 ) ( 5 − 2 )( 5 − 8 )( 5 − 14 )
( ) (11 − 5 ) (11 − 14 ) ( )( )( )
+ 11 − 2 ( 81.3) + 11 − 2 11 − 5 11 − 8 ( 68.7 )
( 8 − 2 )( 8 − 5 )(8 − 14 ) (14 − 2 ) (14 − 5 )(14 − 8 )

f (11) = 23.7 − 87.9 + 121.95 + 17.175 = 74.9

13
Problem 2: Using Lagrange’s interpolation formula, find f(6) from the following data:

x 3 7 9 10
y = f(x) 168 120 72 63

Solution: Here x0 = 3, x1 = 7, x2 = 9, x3 = 10,

and y0 = 168, y1 = 120, y2 = 72, y3 = 63 and x = 6.

Lagrange’s formula is

( x − x1 )( x − x2 ) ( x − x3 ) ( x − x0 ) ( x − x2 ) ( x − x3 )
y = f ( x) = y0 + y +
( x0 − x1 )( x0 − x2 )( x0 − x3 ) ( x1 − x0 ) ( x1 − x2 ) ( x1 − x3 ) 1
( x − x0 ) ( x − x1 ) ( x − x3 ) ( x − x0 ) ( x − x1 )( x − x2 )
+ y2 + y
( x2 − x0 ) ( x2 − x1 ) ( x2 − x3 ) ( x3 − x0 )( x3 − x1 )( x3 − x2 ) 3

Substituting the above values, we get

( 6 − 7 )( 6 − 9 )( 6 − 10 ) ( )( )( )
f (6) = (168) + 6 − 3 6 − 9 6 − 10 (120 ) +
( 3 − 7 )( 3 − 9 )( 3 − 10 ) ( 7 − 3)( 7 − 9 )( 7 − 10 )
( 6 − 3)( 6 − 7 )( 6 − 10 ) ( )( )( )
+ ( 72 ) + 6 − 3 6 − 7 6 − 9 ( 72 )
( 9 − 3)( 9 − 7 )( 9 − 10 ) (10 − 3)(10 − 7 )(10 − 9 )

f (6) = 12 + 180 − 72 + 27 = 147

Problem 3: Use Lagrange’s interpolation formula to find y at x = 10 given

x 5 6 9 11
y = f(x) 12 13 14 16
Solution:

Here x0 = 5, x1 = 6, x2 = 9, x3 = 11, and y0 = 12, y1 = 13, y2 = 14, y3 = 16 and x = 10.

Lagrange’s formula is

( x − x1 )( x − x2 ) ( x − x3 ) ( x − x0 ) ( x − x2 ) ( x − x3 )
y = f ( x) = y0 + y +
( x0 − x1 )( x0 − x2 )( x0 − x3 ) ( x1 − x0 ) ( x1 − x2 ) ( x1 − x3 ) 1
( x − x0 ) ( x − x1 ) ( x − x3 ) ( x − x0 ) ( x − x1 )( x − x2 )
+ y2 + y
( x2 − x0 ) ( x2 − x1 ) ( x2 − x3 ) ( x3 − x0 )( x3 − x1 )( x3 − x2 ) 3

Substituting the above values, we get

14
(10 − 6 )(10 − 9 )(10 − 11) ( )( )( )
f (6) = (12 ) + 10 − 5 10 − 9 10 − 11 (13) +
( 5 − 6 )( 5 − 9 )( 5 − 11) ( 6 − 5 )( 6 − 9 )( 6 − 11)
(10 − 5 )(10 − 6 )(10 − 11) ( )( )( )
+ (14 ) + 10 − 5 10 − 6 10 − 9 (16 )
( 9 − 5 )( 9 − 6 )( 9 − 11) (10 − 5 )(10 − 6 )(10 − 9 )

f (6) = 2 − 4.3333 + 11.6667 + 5 = 14.3334

Problem 4: Using Lagrange’s interpolation formula, find f(5) from the following data:

x 1 3 4 6 9
y = f(x) -3 9 30 132 156

Solution: Here x0 = 1, x1 = 3, x2 = 4, x3 = 6, , x4 = 9

and y0 = - 3, y1 = 9, y2 = 30, y3 = 132, y4 = 156 and x = 5.

Lagrange’s formula is

( x − x1 )( x − x2 ) ( x − x3 ) ( x − x4 ) ( x − x0 ) ( x − x2 ) ( x − x3 ) ( x − x4 )
y = f ( x) = y0 + y +
( x0 − x1 )( x0 − x2 )( x0 − x3 )( x0 − x4 ) ( x1 − x0 ) ( x1 − x2 ) ( x1 − x3 )( x0 − x4 ) 1
( x − x0 ) ( x − x1 ) ( x − x3 ) ( x − x4 ) ( x − x0 ) ( x − x1 )( x − x2 )( x − x4 )
+ y2 + y +
( x2 − x0 ) ( x2 − x1 ) ( x2 − x3 )( x0 − x4 ) ( x3 − x0 )( x3 − x1 )( x3 − x2 )( x0 − x4 ) 3
( x − x0 ) ( x − x1 )( x − x2 ) ( x − x3 )
+ y
( x4 − x0 ) ( x4 − x1 )( x4 − x2 ) ( x4 − x3 ) 4

Substituting the above values, we get

( 5 − 3)( 5 − 4 )( 5 − 6 )( 5 − 9 ) ( )( )( )( )
f (5) = ( −3) + 5 − 1 5 − 4 5 − 6 5 − 9 ( 9 ) +
(1 − 3) (1 − 4 ) (1 − 6 )(1 − 9 ) ( 3 − 1)( 3 − 4 )( 3 − 6 )( 3 − 9 )
( 5 − 1)( 5 − 3)( 5 − 6 )( 5 − 9 ) ( )( )( )( )
+ ( 30 ) + 5 − 1 5 − 3 5 − 4 5 − 9 (132 )
( 4 − 1) ( 4 − 3)( 4 − 6 )( 4 − 9 ) ( 6 − 1)( 6 − 3)( 6 − 4 )( 6 − 9 )
( 5 − 1)( 5 − 3)( 5 − 4 )( 5 − 6 )
+ (156 )
( 9 − 1)( 9 − 3)( 9 − 4 )( 9 − 6 )

f (5) = −0.1 − 4 + 32 + 46.9333 − 1.7333 = 73.1

Problem 5: Using Lagrange’s interpolation formula, find f(9) from the following data:

x 5 7 11 13 17
y = f(x) 150 392 1452 2366 5202
Solution: Here x0 = 5, x1 = 7, x2 = 11, x3 = 13, , x4 = 17

and y0 = 150, y1 = 392, y2 = 1452, y3 = 2366, y4 = 5202 and x = 9.

Lagrange’s formula is

15
( x − x1 )( x − x2 ) ( x − x3 ) ( x − x4 ) ( x − x0 ) ( x − x2 ) ( x − x3 ) ( x − x4 )
y = f ( x) = y0 + y +
( x0 − x1 )( x0 − x2 )( x0 − x3 )( x0 − x4 ) ( x1 − x0 ) ( x1 − x2 ) ( x1 − x3 )( x0 − x4 ) 1
( x − x0 ) ( x − x1 ) ( x − x3 ) ( x − x4 ) ( x − x0 ) ( x − x1 )( x − x2 )( x − x4 )
+ y2 + y +
( x2 − x0 ) ( x2 − x1 ) ( x2 − x3 )( x0 − x4 ) ( x3 − x0 )( x3 − x1 )( x3 − x2 )( x0 − x4 ) 3
( x − x0 ) ( x − x1 )( x − x2 ) ( x − x3 )
+ y
( x4 − x0 ) ( x4 − x1 )( x4 − x2 ) ( x4 − x3 ) 4

Substituting the above values, we get

( 9 − 7 )( 9 − 11)( 9 − 13)( 9 − 17 ) ( )( )( )( )
f (5) = (150 ) + 9 − 5 9 − 11 9 − 13 9 − 17 ( 392 ) +
( 5 − 7 )( 5 − 11)( 5 − 13)( 5 − 17 ) ( 7 − 5 )( 7 − 11)( 7 − 13 )( 7 − 17 )
( 9 − 5)( 9 − 7 )( 9 − 13)( 9 − 17 ) ( )( )( )( )
+ (1452 ) + 9 − 5 9 − 7 9 − 11 9 − 17 ( 2366 )
(11 − 5)(11 − 7 )(11 − 13)(11 − 17 ) (13 − 5 )(13 − 7 )(13 − 11)(13 − 17 )
( 9 − 5 )( 9 − 7 )( 9 − 11)( 9 − 13)
+ ( 2366 )
(17 − 5 )(17 − 7 )(17 − 11)(17 − 13)

f (9) = −16.6667 + 209.0667 + 1290.6667 − 788.6667 + 115.6 = 810

Problem 6: If y(1) = 3, y(3) = 9, y(4) = 30, y(6) = 132 find Lagrange’s interpolation
polynomial and hence find y at x = 5.

Solution: Here x0 = 1, x1 = 3, x2 = 4, x3 = 6,

and y0 = 3, y1 = 9, y2 = 30, y3 = 132 and x = x.

Lagrange’s formula is

( x − x1 )( x − x2 ) ( x − x3 ) ( x − x0 ) ( x − x2 ) ( x − x3 )
y = f ( x) = y0 + y +
( x0 − x1 )( x0 − x2 )( x0 − x3 ) ( x1 − x0 ) ( x1 − x2 ) ( x1 − x3 ) 1
( x − x0 ) ( x − x1 ) ( x − x3 ) ( x − x0 ) ( x − x1 )( x − x2 )
+ y2 + y
( x2 − x0 ) ( x2 − x1 ) ( x2 − x3 ) ( x3 − x0 )( x3 − x1 )( x3 − x2 ) 3

Substituting the above values, we get

( x − 3)( x − 4 )( x − 6 ) ( )( )( )
f ( x) = ( 3) + x − 1 x − 4 x − 6 ( 9 ) +
(1 − 3) (1 − 4 ) (1 − 6 ) ( 3 − 1)( 3 − 4 )( 3 − 6 )
( x − 1)( x − 3)( x − 6 ) ( )( )( )
+ ( 30 ) + x − 1 x − 3 x − 4 (132 )
( 4 − 1) ( 4 − 3)( 4 − 6 ) ( 6 − 1)( 6 − 3)( 6 − 4 )

1 3 3 22
f ( x) = − ( x − 13x 2 + 54 x − 72 ) + ( x3 − 11x 2 + 34 x − 24 )− ( 5) ( x3 − 10 x 2 + 27 x − 18 ) + ( x3 − 8 x 2 + 19 x − 12 )
10 2 5
4 2 29 42 1
f ( x) = x 3 − x 2 − x+ = ( 4 x3 − 2 x 2 − 29 x + 42 )
5 5 5 5 5

4 3 2 2 29 42
f (5) = ( 5) − ( 5) − ( 5) + = 69.4
5 5 5 5

16
Problem 7: Find Lagrange’s interpolation polynomial for the function f(x) given by the
following table.

x 0 -1 1
f(x) 1 2 3

Solution: Here x0 = 0, x1 = -1, x2 = 1,

and y0 = 1, y1 = 2, y2 = 3 and x = x.

Lagrange’s formula is

( x − x1 )( x − x2 ) ( x − x0 ) ( x − x2 ) ( x − x0 ) ( x − x1 )
y = f ( x) = y0 + y1 + y
( x0 − x1 )( x0 − x2 ) ( x1 − x0 ) ( x1 − x2 ) ( x2 − x0 ) ( x2 − x1 ) 2

Substituting the above values, we get

( x + 1)( x − 1) ( )( ) ( )( )
f ( x) = (1) + x − 0 x − 1 ( 2 ) + x − 0 x + 1 ( 3)
( 0 + 1)( 0 − 1) ( −1 − 0 ) −1 − 1
( ) (1 − 0 ) 1 + 1
( )

3
f ( x) = − ( x 2 − 1) + ( x 2 − x )+ ( x 2 + x )
2

3 2 1
f ( x) = x + x+ 1
2 2

Problem 8: Find Lagrange’s interpolation polynomial for the function f(x) given by the
following table.

x 1 2 3 4
f(x) 5 19 49 101

Solution: Here x0 = 1, x1 = 2, x2 = 3, x3 = 4,

and y0 = 5, y1 = 19, y2 = 49, y3 = 101 and x = x.

Lagrange’s formula is

17
( x − x1 )( x − x2 ) ( x − x3 ) ( x − x0 ) ( x − x2 ) ( x − x3 )
y = f ( x) = y0 + y +
( x0 − x1 )( x0 − x2 )( x0 − x3 ) ( x1 − x0 ) ( x1 − x2 ) ( x1 − x3 ) 1
( x − x0 ) ( x − x1 ) ( x − x3 ) ( x − x0 ) ( x − x1 )( x − x2 )
+ y2 + y
( x2 − x0 ) ( x2 − x1 ) ( x2 − x3 ) ( x3 − x0 )( x3 − x1 )( x3 − x2 ) 3

Substituting the above values, we get

( x − 2 )( x − 3)( x − 4 ) ( )( )( )
f ( x) = ( 5 ) + x − 1 x − 3 x − 4 (19 ) +
(1 − 2 ) (1 − 3) (1 − 4 ) ( 2 − 1) ( 2 − 3) ( 2 − 4 )
( x − 1)( x − 2 )( x − 4 ) ( )( )( )
+ ( 49 ) + x − 1 x − 2 x − 3 (132 )
( 3 − 1)( 3 − 2 )( 3 − 4 ) ( 4 − 1)( 4 − 2 ) ( 4 − 3)

5 19 49 101 3
f ( x) = − ( x3 − 9 x 2 + 26 x − 24 ) + ( x3 − 8 x 2 + 19 x − 12 )− ( x 3 − 7 x 2 + 12 x − 8 ) + ( x − 6 x 2 + 11x − 6 )
6 2 2 6
f ( x) = x 3 + 2 x 2 + 2 x + 1

Problem 9: Find Lagrange’s interpolation polynomial for the function f(x) given by the
following table.

x 1 2 4 5
f(x) 14 41 197 360

Solution: Here x0 = 1, x1 = 2, x2 = 4, x3 = 5,

and y0 = 14, y1 = 41, y2 = 197, y3 = 360 and x = x.

Lagrange’s formula is

( x − x1 )( x − x2 ) ( x − x3 ) ( x − x0 ) ( x − x2 ) ( x − x3 )
y = f ( x) = y0 + y +
( x0 − x1 )( x0 − x2 )( x0 − x3 ) ( x1 − x0 ) ( x1 − x2 ) ( x1 − x3 ) 1
( x − x0 ) ( x − x1 ) ( x − x3 ) ( x − x0 ) ( x − x1 )( x − x2 )
+ y2 + y
( x2 − x0 ) ( x2 − x1 ) ( x2 − x3 ) ( x3 − x0 )( x3 − x1 )( x3 − x2 ) 3

Substituting the above values, we get

( x − 2 )( x − 4 )( x − 5 ) ( )( )( )
f ( x) = (14 ) + x − 1 x − 4 x − 5 ( 41) +
(1 − 2 )(1 − 4 ) (1 − 5 ) ( 2 − 1)( 2 − 4 ) ( 2 − 5 )
( x − 1)( x − 2 )( x − 5 ) ( )( )( )
+ (197 ) + x − 1 x − 2 x − 4 ( 350 )
( 4 − 1)( 4 − 2 ) ( 4 − 5 ) ( 5 − 1)( 5 − 2 )( 5 − 4 )

7 41 197 3 175 3
f ( x) = − ( x3 − 11x 2 + 38 x − 40 ) + ( x3 − 10 x 2 + 29 x − 20 )− ( x − 8 x 2 + 17 x − 10 ) + ( x − 7 x 2 + 14 x − 8 )
6 6 6 6
f ( x) = 2 x 3 + 3 x 2 + 4 x + 5

18
Problem 10: Find Lagrange’s interpolation polynomial for the function f(x) given by the
following table.

x 0 1 2 5
f(x) 2 3 12 147

Hence find f(3)

Solution: Here x0 = 0, x1 = 1, x2 = 2, x3 = 5,

and y0 = 2, y1 = 3, y2 = 12, y3 = 147 and x = x.

Lagrange’s formula is

( x − x1 )( x − x2 ) ( x − x3 ) ( x − x0 ) ( x − x2 ) ( x − x3 )
y = f ( x) = y0 + y +
( x0 − x1 )( x0 − x2 )( x0 − x3 ) ( x1 − x0 ) ( x1 − x2 ) ( x1 − x3 ) 1
( x − x0 ) ( x − x1 ) ( x − x3 ) ( x − x0 ) ( x − x1 )( x − x2 )
+ y2 + y
( x2 − x0 ) ( x2 − x1 ) ( x2 − x3 ) ( x3 − x0 )( x3 − x1 )( x3 − x2 ) 3

Substituting the above values, we get

( x − 1)( x − 2 )( x − 5 ) ( )( )( )
f ( x) = ( 2 ) + x − 0 x − 2 x − 5 ( 3) +
( 0 − 1)( 0 − 2 )( 0 − 5 ) (1 − 0 ) (1 − 2 ) (1 − 5 )
( x − 0 )( x − 1)( x − 5 ) ( )( )( )
+ (12 ) + x − 0 x − 1 x − 2 (147 )
( 2 − 0 ) ( 2 − 1) ( 2 − 5 ) ( 5 − 0 )( 5 − 1)( 5 − 2 )

1 3 49 3
f ( x) = − ( x3 − 8 x 2 + 17 x − 10 ) + ( x3 − 7 x 2 + 10 x )− 2 ( x3 − 6 x 2 + 5 x ) + ( x − 3x 2 + 2 x )
5 4 20

f ( x) = x 3 + x 2 − x + 2

19
INVERSE INTERPOLATION:

The process of finding a value of x that corresponds to a value of y is known as inverse


interpolation.

Lagrange’s Inverse Interpolation Formula:

Let y0, y1, y2, ……. yn be n + 1 values of an unknown function y = f(x) corresponding
to the n + 1 values x0, x1, x2, ……. xn of x respectively. Then

( y − y1 )( y − y2 ) ( y − y3 ) ......... ( y − yn ) ( y − y0 ) ( y − y2 ) ( y − y3 ) .........( y − yn )
x= x0 + x +
( y0 − y1 )( y0 − y2 )( y0 − y3 ) ......... ( y0 − yn ) ( y1 − y0 ) ( y1 − y2 ) ( y1 − y3 ) ......... ( y1 − yn ) 1
( y − y0 ) ( y − y1 ) ( y − y3 ) ......... ( y − yn )
+ x + ........................................................................
( y2 − y0 ) ( y2 − y1 ) ( y2 − y3 ) ......... ( y2 − yn ) 2
( y − y0 ) ( y − y1 )( y − y2 ) ......... ( y − yn−1 )
+ ........................................................................+ x
( yn − y0 )( yn − y1 )( yn − y2 ) ......... ( yn − yn−1 ) n

Note: Lagrange’s inverse interpolation formula is obtained by interchanging x and y in


Lagrange’s formula.

Problem 1: Given

x 2 5 9 11
y = f(x) 10 12 15 19
Find x corresponding to y = 16.

Solution: Here x0 = 2, x1 = 5, x2 = 9, x3 = 11,

and y0 = 10, y1 = 12, y2 = 15, y3 = 19 and y = 16.

Lagrange’s inverse interpolation formula with y = 16 gives

( y − y1 )( y − y2 ) ( y − y3 ) ( y − y0 ) ( y − y2 ) ( y − y3 )
x= x0 + x +
( y0 − y1 )( y0 − y2 )( y0 − y3 ) ( y1 − y0 ) ( y1 − y2 ) ( y1 − y3 ) 1
( y − y0 ) ( y − y1 ) ( y − y3 ) ( y − y0 ) ( y − y1 )( y − y2 )
+ x2 + x
( y2 − y0 ) ( y2 − y1 ) ( y2 − y3 ) ( y3 − y0 )( y3 − y1 )( y3 − y2 ) 3

Substituting the above values, we get

20
(16 − 12 )(16 − 15 )(16 − 19 ) ( )( )( )
x= ( 2 ) + 16 − 10 16 − 15 16 − 19 ( 5) +
(10 − 12 )(10 − 15 )(10 − 19 ) (12 − 10 )(12 − 15 )(12 − 19 )
(16 − 10 )(16 − 12 )(16 − 19 ) ( )( )( )
+ ( 9 ) + 16 − 10 16 − 12 16 − 15 (11)
(15 − 10 )(15 − 12 )(15 − 19 ) (19 − 10 )(19 − 12 )(19 − 15 )

x = 0.2667 − 2.1428 + 10.8 + 1.0476 = 9.9715

Problem 2: If y1 = 4, y3 = 12, y4 = 19 and yx = 7 find x.

Solution: Here x0 = 1, x1 = 3, x2 = 4,

and y0 = 4, y1 = 12, y2 = 19 and y = 7.

Lagrange’s inverse interpolation formula with y = 7 gives

( y − y1 )( y − y2 ) ( y − y0 ) ( y − y2 ) ( y − y0 ) ( y − y1 )
x= x0 + x1 + x
( y0 − y1 )( y0 − y2 ) ( y1 − y0 ) ( y1 − y2 ) ( y2 − y0 ) ( y2 − y1 ) 2

Substituting the above values, we get

( 7 − 12 )( 7 − 19 ) ( )( ) ( )( )
x= (1) + 7 − 4 7 − 19 ( 3) + 7 − 4 7 − 12 ( 4 )
( 4 − 12 ) ( 4 − 19 ) (12 − 4 ) (12 − 19 ) (19 − 4 )(19 − 12 )

x = 0.5 + 1.9285 − 0.5714 = 1.857

Problem 3: Apply Lagrange’s formula to find a root of the equation f(x) = 0 given that
f(30) = - 30, f(34) = - 13, f(38) = 3, f(42) = 18.

Solution: Here x0 = 30, x1 = 34, x2 = 38, x3 = 42,

and y0 = - 30, y1 = - 13, y2 = 3, y3 = 18 and y = 0.

Lagrange’s inverse interpolation formula with y = 0 gives

( y − y1 )( y − y2 ) ( y − y3 ) ( y − y0 ) ( y − y2 ) ( y − y3 )
x= x0 + x +
( y0 − y1 )( y0 − y2 )( y0 − y3 ) ( y1 − y0 ) ( y1 − y2 ) ( y1 − y3 ) 1
( y − y0 ) ( y − y1 ) ( y − y3 ) ( y − y0 ) ( y − y1 )( y − y2 )
+ x2 + x
( y2 − y0 ) ( y2 − y1 ) ( y2 − y3 ) ( y3 − y0 )( y3 − y1 )( y3 − y2 ) 3

Substituting the above values, we get

( 0 + 13)( 0 − 3)( 0 − 18 ) ( 0 + 30 )( 0 − 3)( 0 − 18 )


x= ( 30 ) + ( 34 ) +
( −30 + 13)( −30 − 3)( −30 − 18 ) ( −13 + 30 )( −13 − 3)( −13 − 18 )
( 0 + 30 )( 0 + 13)( 0 − 18 ) ( )( )( )
+ ( 38) + 0 + 30 0 + 13 0 − 3 ( 42 )
( 3 + 30 )( 3 + 13)( 3 − 18 ) (18 + 30 )(18 + 13)(18 − 3)

21
x = −0.7820 + 6.5322 + 33.6818 − 2.2016 = 37.23

Problem 4: The following table gives the values of f() for certain values of . Find  when
f() = 0.3887

 210 230 250


y = f() 0.3706 0.4068 0.4433

Solution: Here 0 = 21, 1 = 23, 2 = 25,

and y0 = 0.3706, y1 = 0.4068, y2 = 0.4433 and y = 0.3887.

Lagrange’s inverse interpolation formula with y = 0.3887 gives

( y − y1 )( y − y2 ) ( y − y0 ) ( y − y2 ) ( y − y0 ) ( y − y1 )
x= x0 + x1 + x
( y0 − y1 )( y0 − y2 ) ( y1 − y0 ) ( y1 − y2 ) ( y2 − y0 ) ( y2 − y1 ) 2

Substituting the above values, we get

( 0.3887 − 0.4068 )( 0.3887 − 0.4433) ( )( )


x= ( 21) + 0.3887 − 0.3706 0.3887 − 0.4433 ( 23)
( 0.3706 − 0.4068 )( 0.3706 − 0.4433) ( 0.4068 − 0.3706 )( 0.4068 − 0.4433)
( 0.3887 − 0.3706 )( 0.3887 − 0.4068 )
+ ( 25 )
( 0.4433 − 0.3706 )( 0.4433 − 0.4068 )

x = 7.88583 + 17.2027 − 3.08653 = 22.002

Problem 5: Solve the equation f(x) = 0 given

x 0 0.1 0.2 0.3 0.4


f(x) 1 0.80484 0.61873 0.44082 0.27032

Solution: Here x0 = 0, x1 = 0.1, x2 = 0.2, x3 = 0.3, x4 = 0.4,

and y0 = 1, y1 = 0.80484, y2 = 0.61873, y3 = 0.44082, y4 = 0.27032 and y = 0

Lagrange’s inverse interpolation formula with y = 0 gives

22
( y − y1 )( y − y2 ) ( y − y3 ) ( y − y4 ) ( y − y0 ) ( y − y2 ) ( y − y3 ) ( y − y4 )
x= x0 + x +
( y0 − y1 )( y0 − y2 )( y0 − y3 )( y0 − y4 ) ( y1 − y0 ) ( y1 − y2 ) ( y1 − y3 ) ( y1 − y4 ) 1
( y − y0 ) ( y − y1 ) ( y − y3 ) ( y − y4 ) ( y − y0 ) ( y − y1 )( y − y2 )( y − y4 )
+ x2 + x +
( y2 − y0 ) ( y2 − y1 ) ( y2 − y3 ) ( y2 − y4 ) ( y3 − y0 )( y3 − y1 )( y3 − y2 )( y3 − y4 ) 3
( y − y0 ) ( y − y1 )( y − y2 ) ( y − y3 )
+ x
( y4 − y0 ) ( y4 − y1 )( y4 − y2 ) ( y4 − y3 ) 4

Substituting the above values, we get

( 0 − 0.80484 )( 0 − 0.61873)( 0 − 0.44082 )( 0 − 0.27032 )


x= ( 0)
(1 − 0.80484 )(1 − 0.61873)(1 − 0.44082 )(1 − 0.27032 )
( 0 − 1)( 0 − 0.61873)( 0 − 0.44082 )( 0 − 0.27032 )
+ ( 0.1) +
( 0.80484 − 1)( 0.80484 − 0.61873)( 0.80484 − 0.44082 )( 0.80484 − 0.27032 )
( 0 − 1)( 0 − 0.80484 )( 0 − 0.44082 )( 0 − 0.27032 )
+ ( 0.2 )
( 0.61873 − 1)( 0.61873 − 0.80484 )( 0.61873 − 0.44082 )( 0.61873 − 0.27032 )
( 0 − 1)( 0 − 0.80484 )( 0 − 0.61873)( 0 − 0.27032 )
+ ( 0.3) +
( 0.44082 − 1)( 0.44082 − 0.80484 )( 0.44082 − 0.61873)( 0.44082 − 0.27032 )
( 0 − 1)( 0 − 0.80484 )( 0 − 0.61873)( 0 − 0.44082 )
+ ( 0.4 )
( 0.27032 − 1)( 0.27032 − 0.80484 ) ( 0.27032 − 0.61873)( 0.27032 − 0.44082 )

x = 0 − 1.04326 + 4.361 − 6.54046 + 3.78984 = 0.567114

Problem 6: Given

x 2 2.2 2.4 2.6 2.8


f(x) -0.6 -0.45 -0.29 -0.12 0.5

Find x for which f(x) = 0 using Lagrange’s interpolation formula.

Solution: Here x0 = 2, x1 = 2.2, x2 = 2.4, x3 = 2.6, x4 = 2.8,

and y0 = -0.6, y1 = -0.45, y2 = -0.29, y3 = -0.12, y4 = 0.5 and y = 0

Lagrange’s inverse interpolation formula with y = 0 gives

( y − y1 )( y − y2 ) ( y − y3 ) ( y − y4 ) ( y − y0 ) ( y − y2 ) ( y − y3 ) ( y − y4 )
x= x0 + x +
( y0 − y1 )( y0 − y2 )( y0 − y3 )( y0 − y4 ) ( y1 − y0 ) ( y1 − y2 ) ( y1 − y3 ) ( y1 − y4 ) 1
( y − y0 ) ( y − y1 ) ( y − y3 ) ( y − y4 ) ( y − y0 ) ( y − y1 )( y − y2 )( y − y4 )
+ x2 + x +
( y2 − y0 ) ( y2 − y1 ) ( y2 − y3 ) ( y2 − y4 ) ( y3 − y0 )( y3 − y1 )( y3 − y2 )( y3 − y4 ) 3
( y − y0 ) ( y − y1 )( y − y2 ) ( y − y3 )
+ x
( y4 − y0 ) ( y4 − y1 )( y4 − y2 ) ( y4 − y3 ) 4

Substituting the above values, we get

23
( 0 + 0.45 )( 0 + 0.29 )( 0 + 0.12 )( 0 − 0.5 )
x= ( 2)
( −0.6 + 0.45 )( −0.6 + 0.29 )( −0.6 + 0.12 )( −0.6 − 0.5 )
( 0 + 0.6 )( 0 + 0.29 )( 0 + 0.12 )( 0 − 0.5 )
+ ( 2.2 ) +
( −0.45 + 0.6 )( −0.45 + 0.29 )( −0.45 + 0.12 )( −0.45 − 0.5 )
( 0 + 0.6 )( 0 + 0.45 )( 0 + 0.12 )( 0 − 0.5 )
+ ( 2.4 )
( −0.29 + 0.6 )( −0.29 + 0.45 )( −0.29 + 0.12 )( −0.29 − 0.5 )
( 0 + 0.6 ) ( 0 + 0.45 )( 0 + 0.29 )( 0 − 0.5 )
+ ( 2.6 ) +
( −0.12 + 0.6 )( −0.12 + 0.45 )( −0.12 + 0.29 )( −0.12 − 0.5 )
( 0 + 0.6 )( 0 + 0.45 )( 0 + 0.29 )( 0 + 0.12 )
+ ( 2.8 )
( 0.5 + 0.6 )( 0.5 + 0.45 )( 0.5 + 0.29 )( 0.5 + 0.12 )

x = − 0.63783 + 3.05263 − 5.83672 + 6.0969 + 0.0514003 = 2.72639

24
NUMERICAL INTEGRATION

Numerical integration is the process of computing the value of a definite integral from the
tabulated values of the integrand. When applied to the integration of a function of a single
variable, the process is known as quadrature. The expression for the integral so obtained is
called a quadrature formula.

Trapezoidal Rule:
xn x0 + nh

 f ( x)dx =  f ( x)dx =
h
2
( y0 + yn ) + 2 ( y1 + y2 + y3 + ............. + yn−1 )
x0 x0

Note:

The Trapezoidal rule is applicable where n may be even or odd.

Simpson’s one – third Rule:


xn x0 + nh

 f ( x)dx = 
x0 x0
f ( x)dx

=
h
3
( y0 + yn ) + 4 ( y1 + y3 + y5 + ............. + yn−1 ) + 2 ( y2 + y4 + y6 + ....... + yn−2 )
Note:

The Simpson’s one – third rule is applicable when n is an even number.

Simpson’s three – eighth Rule:


xn x0 + nh

 f ( x)dx = 
x0 x0
f ( x)dx

=
3h
8
( y0 + yn ) + 3 ( y1 + y2 + y4 + y5 + ............. + yn−2 + yn−1 ) + 2 ( y3 + y6 + y9 + ....... + yn−3 )
Note:

The Simpson’s three– eighth rule is applicable when n is a multiple of 3.

Weddle’s Rule:
xn x0 + nh


x0
f ( x)dx = 
x0
f ( x)dx

3h
=  y0 + 5 y1 + y2 + 6 y3 + y4 + 5 y5 + 2 y6 + 5 y7 + y8 ...................
10

25
The co - efficients may be remembered in groups of six

First group 1, 5, 1, 6, 1, 5

All interior groups 2, 5, 1, 6, 1, 5

Last group 2, 5, 1, 6, 1, 5, 1.

Note:

The Weddle’s rule is applicable when n is a multiple of 6.

Note:

Weddle’s rule for n = 6


x6

 f ( x)dx = 10 ( y + y6 ) + 5 ( y1 + y5 ) + ( y2 + y4 ) + 6 y3 
3h
0
x0

Weddle’s rule for n = 12( Not in syllabus)


x12

 f ( x)dx =
3h
10
( y0 + y6 ) + 5 ( y1 + y5 + y7 + y11 ) + ( y2 + y4 + y8 + y10 ) + 2 y6 + 6 ( y3 + y9 )
x0

Problem:

Given

x 1 2 3 4 5 6 7
y = f(x) 2.105 2.808 3.614 4.604 5.857 7.451 9.467
7
evaluate  f ( x)dx using
1

(a)Trapezoidal rule (b) Simpson’s 1/3rd rule

(c) Simpson’s 3/8th rule and (d) Weddle’s rule.

Solution:

Here the step length is h = 1,

Also, Here x0 = 1, x1 = 2, x2 = 3, x3 = 4, x4 = 5, x5 = 6, x6 = 7

and y0 = 2.105, y1 = 2.808, y2 = 3.614, y3 = 4.604, y4 = 5.857, y5 = 7.451, y6 = 9.467.

(a) Hence Trapezoidal Rule gives

26
7

 f ( x)dx = 2 ( y + y6 ) + 2 ( y1 + y2 + y3 + y4 + y5 )
h
0
1

1
= ( 2.105 + 9.467 ) + 2 ( 2.808 + 3.614 + 4.604 + 5.857 + 7.451)
2

= 30.12.

(b) Simpson’s one – third Rule:


7

 f ( x)dx = 3 ( y + y6 ) + 4 ( y1 + y3 + y5 ) + 2 ( y2 + y4 )
h
0
1

1
= ( 2.105 + 9.467 ) + 2 ( 2.808 + 4.604 + 7.451) + 2 ( 3.614 + 5.857 )
3

= 29.9887

(c) Simpson’s three – eighth Rule:


7

 f ( x)dx = 8 ( y + yn ) + 3 ( y1 + y2 + y4 + y5 ) + 2 y3 
3h
0
1

3
= ( 2.105 + 9.467 ) + 3 ( 2.808 + 3.614 + 5.857 + 7.451) + 2 ( 4.604 )
8

= 29.9888

(d) Weddle’s rule


7

 f ( x)dx = 10 ( y + y6 ) + 5 ( y1 + y5 ) + ( y2 + y4 ) + 6 y3 
3h
0
1

3
= ( 2.105 + 9.467 ) + 5 ( 2.808 + 7.451) + ( 3.614 + 5.857 ) + 6 ( 4.604 )
10

= 29.9886

Problem 2:
6
dx
Evaluate 1+ x
0
2
by using (a) Trapezoidal rule (b) Simpson’s 1/3rd rule

(c) Simpson’s 3/8th rule and (d) Weddle’s rule.

Solution:

27
1
Here f ( x) = , x0 = 0, xn = 6.
1 + x2

Let us divide the interval [x0, xn] = [0. 6] in to six equal parts with h = 1 as the length of each
part. So that n = 6. Let us find the values of y = f(x) at x0 = 0, x1 = 1, x2 = 2, x3 = 3, x4 = 4, x5 =
5, x6 = 6. The values are shown in the following table

x 0 1 2 3 4 5 6
y = f(x) 1 0.5 0.2 0.1 0.0588 0.0384 0.027

Here x0 = 0, x1 = 1, x2 = 2, x3 = 3, x4 = 4, x5 = 5, x6 = 6

and y0 = 1, y1 = 0.5, y2 = 0.2, y3 = 0.1, y4 = 0.0588, y5 = 0.0384, y6 = 0.027.

(a) Hence Trapezoidal Rule gives


6

1+ x
dx
2
=
h
2
( y0 + y6 ) + 2 ( y1 + y2 + y3 + y4 + y5 )
0

1
= (1 + 0.027 ) + 2 ( 0.5 + 0.2 + 0.1 + 0.0588 + 0.0384 )
2

= 1.4107.

(b) Simpson’s one – third Rule:


6

1+ x
dx
2
=
h
3
( y0 + y6 ) + 4 ( y1 + y3 + y5 ) + 2 ( y2 + y4 )
0

1
= (1 + 0.027 ) + 2 ( 0.5 + 0.1 + 0.0384 ) + 2 ( 0.2 + 0.0588)
3

= 1.36607

(c) Simpson’s three – eighth Rule:


6

1+ x
dx
2
=
3h
8
( y0 + yn ) + 3 ( y1 + y2 + y4 + y5 ) + 2 y3 
0

3
= (1 + 0.027 ) + 3 ( 0.5 + 0.2 + 0.0588 + 0.0384 ) + 2 ( 0.1)
8

= 1.35697

(d) Weddle’s rule

28
6

1+ x
dx
2
=
3h
10
( y0 + y6 ) + 5 ( y1 + y5 ) + ( y2 + y4 ) + 6 y3 
0

3
= (1 + 0.027 ) + 5 ( 0.5 + 0.0384 ) + ( 0.2 + 0.0588) + 6 ( 0.1)
10

= 1.37334.

Problem 3:
1
dx
Evaluate 1+ x
0
2
taking 7 ordinates by using (a) Trapezoidal rule (b) Simpson’s 1/3rd rule

(c) Simpson’s 3/8th rule and (d) Weddle’s rule. Hence evaluate an approximate value of 
using Simpson’s 1/3rd rule.

Solution:

1
Here f ( x) = , x0 = 0, xn = 1 and n = 7 – 1 = 6.
1 + x2

xn − x0 1 − 0 1
Therefore h = = =
6 6 6

Let us divide the interval [x0, xn] = [0. 1] in to six equal parts with h = 1/6 as the length of
each part. The values of y = f(x) at different values of x are shown in the following table

x 0 1/6 1/3 1/2 2/3 5/6 1


y = f(x) 1 0.9729 0.9 0.8 0.6923 0.5901 0.5

Here x0 = 0, x1 = 1/6, x2 = 1/3, x3 = 1/2, x4 = 2/3, x5 = 5/6, x6 = 1

and y0 = 1, y1 = 0.9729, y2 = 0.9, y3 = 0.8, y4 = 0.6923, y5 = 0.5901, y6 = 0.5.

(a) Hence Trapezoidal Rule gives


1

1+ x
dx
2
=
h
2
( y0 + y6 ) + 2 ( y1 + y2 + y3 + y4 + y5 )
0

(1 / 6)
= (1 + 0.5) + 2 ( 0.9729 + 0.9 + 0.8 + 0.6923 + 0.5901)
2

= 0.784217.

(b) Simpson’s one – third Rule:

29
1

1+ x
dx
2
=
h
3
( y0 + y6 ) + 4 ( y1 + y3 + y5 ) + 2 ( y2 + y4 )
0

(1 / 6)
= (1 + 0.5) + 4 ( 0.9729 + 0.8 + 0.5901) + 2 ( 0.9 + 0.6923)
3

= 0.785367

(c) Simpson’s three – eighth Rule:


1

1+ x
dx
2
=
3h
8
( y0 + yn ) + 3 ( y1 + y2 + y4 + y5 ) + 2 y3 
0

3(1 / 6)
= (1 + 0.5) + 3 ( 0.9729 + 0.9 + 0.6923 + 0.5901) + 2 ( 0.8 )
8

= 0.785369

(d) Weddle’s rule


1

1+ x
dx
2
=
3h
10
( y0 + y6 ) + 5 ( y1 + y5 ) + ( y2 + y4 ) + 6 y3 
0

3(1 / 6)
= (1 + 0.5) + 2 ( 0.9729 + 0.5901) + ( 0.9 + 0.6923) + 6 ( 0.8 )
10

= 0.785365.

Deduction:

Using Simpson’s 1/3rd rule we have


1
dx
 1+ x
0
2
= 0.785367

Integrating L.H.S. w. r. t. x we get

( tan −1 x )0 = 0.785367
1

( tan −1 1 − tan −1 0 ) = 0.785367

 
 − 0  = 0.785367
4 


= 0.785367   = 4 ( 0.785367 ) = 3.141468
4

30
Problem 3:
1
xdx
Evaluate 1+ x
0
2
taking six equal strips by using

(a) Trapezoidal rule (b) Simpson’s 1/3rd rule

(c) Simpson’s 3/8th rule and (d) Weddle’s rule. Hence evaluate an approximate value of
log e 2 using Simpson’s 1/3rd rule.

Solution:

x
Here f ( x) = , x0 = 0, xn = 1 and n = 6.
1 + x2

xn − x0 1 − 0 1
Therefore h = = =
6 6 6

Let us divide the interval [x0, xn] = [0. 1] in to six equal parts with h = 1/6 as the length of
each part. The values of y = f(x) at different values of x are shown in the following table

x 0 1/6 1/3 1/2 2/3 5/6 1


y = f(x) 0 0.1621 0.3 0.4 0.4615 0.4918 0.5

Here x0 = 0, x1 = 1/6, x2 = 1/3, x3 = 1/2, x4 = 2/3, x5 = 5/6, x6 = 1

and y0 = 0, y1 = 0.1621, y2 = 0.3, y3 = 0.4, y4 = 0.4615, y5 = 0.4918, y6 = 0.5.

(a) Hence Trapezoidal Rule gives


1
xdx
1+ x 2
=
h
2
( y0 + y6 ) + 2 ( y1 + y2 + y3 + y4 + y5 )
0

(1 / 6)
= ( 0 + 0.5) + 2 ( 0.1621 + 0.3 + 0.4 + 0.4615 + 0.4918 )
2

= 0.344233 .

(b) Simpson’s one – third Rule:


1
xdx
1+ x 2
=
h
3
( y0 + y6 ) + 4 ( y1 + y3 + y5 ) + 2 ( y2 + y4 )
0

(1 / 6)
= ( 0 + 0.5) + 4 ( 0.1621 + 0.4 + 0.4918) + 2 ( 0.3 + 0.4615)
3

31
= 0.346589.

(c) Simpson’s three – eighth Rule:


1
xdx
1+ x 2
=
3h
8
( y0 + yn ) + 3 ( y1 + y2 + y4 + y5 ) + 2 y3 
0

3(1 / 6)
= ( 0 + 0.5) + 3 ( 0.1621 + 0.3 + 0.4615 + 0.4918) + 2 ( 0.4 )
8

= 0.346638.

(d) Weddle’s rule


1
xdx
1+ x 2
=
3h
10
( y0 + y6 ) + 5 ( y1 + y5 ) + ( y2 + y4 ) + 6 y3 
0

3(1 / 6)
= ( 0 + 0.5) + 2 ( 0.1621 + 0.4918) + ( 0.3 + 0.4615) + 6 ( 0.4 )
10

= 0.34655.

Deduction:

Using Simpson’s 1/3rd rule we have


1
xdx
 1+ x
0
2
= 0.346589

1
1 2 xdx
2 0 1 + x 2
= 0.346589

Integrating L.H.S. w. r. t. x we get

1
log e (1 + x 2 )0 = 0.346589
1

loge 2 − loge 1 = 2 ( 0.346589)


log e 2 = 0.693178

Problem:

A curve is drawn to pass through the points given by the following table

x 1.0 1.5 2.0 2.5 3.0 3.5 4.0


y 2 2.4 2.7 2.8 3 2.6 2.1

32
Using weddle’s rule estimate the area bounded by the curve, the x – axis and lines x = 1,
x = 4.

Solution:

Here the step length is h = 0.5,

Also, Here x0 = 1, x1 = 1.5, x2 = 2, x3 = 2.5, x4 = 3, x5 = 3.5, x6 = 4

and y0 = 2, y1 = 2.4, y2 = 2.7, y3 = 2.8, y4 = 3, y5 = 2.6, y6 = 2.1.

Weddle’s rule
4
Required area =  f ( x)dx =
3h
10
( y0 + y6 ) + 5 ( y1 + y5 ) + ( y2 + y4 ) + 6 y3
1

3(0.5)
= ( 2 + 2.1) + 5 ( 2.4 + 2.6 ) + ( 2.7 + 3) + 6 ( 2.8)
10

= 7.74.

Problem:

The following table gives the values of a function y = f(x) for some equidistant values of x

x 0 0.25 0.5 0.75 1.0


y = f(x) 0.79788 0.77334 0.70415 0.60227 0.48394

1
Evaluate  f ( x)dx by using Trapezoidal rule.
0

Problem:

Evaluate the following integrals by using the Trapeziodal rule


1

 x dx with h = 0.2.
3
(1)
0

 x dx with h = 1.
4
(2)
−3

Problem:

By using the Trapeziodal rule evaluate the following integrals


 2 0.6

 e
− x2
(1) Cosxdx (2) dx
0 0

33
dividing the interval in to 10 equal parts.

Problem:
5
By using the Simpson’s 1/3 rule evaluate  f ( x)dx , given
rd

x 1 2 3 4 5
y = f(x) 13 50 70 80 100

Problem:
2
By using the Simpson’s 1/3 rule evaluate  f ( x)dx , given
rd

x 0.0 0.5 1.0 1.5 2.0


y = f(x) 0.399 0.352 0.242 0.129 0.054

Problem:
 2
Evaluate 0
Cosxdx by dividing the interval in to eight equal parts.

Problem:
0.6

e
− x2
Evaluate dx taking seven ordinates.
0

Problem:
1
Evaluate  e− x dx dividing the interval (0, 1) in to ten sub intervals (h = 0.1).
2

Problem:
1
dx
Evaluate  4x + 5
0
dividing the interval (0, 1) in to ten sub intervals (h = 0.1).

Problem:

Evaluate

34
1 1 7
dx 1 x 2 dx
(1)  with h = (2)  with n = 4. (3) x
2
log e xdx with n = 4.
0
1+ x 8 0 1+ x
3
3
 2 5
(4)  Sin d
0
with n = 10.. (5)  log e xdx with n = 10.
1

Problem:

By dividing the range in to 6 equal parts, find the approximate value of  eSinx dx using
0

Simpson’s 1/3rd rule.

Problem:

A solid of revolution is formed by rotating about the x – axis, the area between the x – axis,
the lines x = 0, x = 1 and a curve through the points with the following co ordinates

x 0.00 0.25 0.50 0.75 1.00


y 1.0000 0.9896 0.9589 0.9089 0.8415

Using Simpson’s rule find the volume of the solid formed.

Problem:

A rocket is launched from the ground. It’s acceleration f is registered during the first 80
seconds and is tabulated below. Using the Simpson’s rule, find the velocity of the rocket at
t = 80 seconds

t (Sec) 0 10 20 30 40 50 60 70 80
f (cm/sec2) 30 31.63 33.34 35.47 37.75 40.33 43.25 46.69 50.67

Problem:

The velocity v (km/min) of a moped which starts from rest is given at fixed interval of time
t(min) as follows

t 0 2 4 6 8 10 12 14 16 18 20
v 0 10 18 25 29 32 20 11 5 2 0

Estimate approximately the distance covered in 20 minutes.

Problem:

The following table gives 7 values of an independent variable x and the corresponding values
of y = f(x)

35
x 0 1 2 3 4 5 6
y 0.146 0.161 0.176 0.190 0.204 0.217 0.230

6
Evaluate  f ( x)dx
0
by using Simpson’s 3/8th rule.

Problem:
0.3
Using Simpson’s 3/8th rule evaluate 
0
1 − 8x3 dx taking 7 ordinates.

Problem:
1
dx
Evaluate 1+ x
0
taking 7 ordinates by applying Simpson’s 3/8th rule. Hence deduce the value

of loge2.

Problem:
1
Using Simpson’s 3/8th rule evaluate  e− x dx taking 4 ordinates.
2

Problem:

Evaluate the following using Simpson’s 3/8th rule


4  2
(1)  e dx taking n = 3. e
Sin
1x
(2) d taking n = 3.
1 0

3 5.2
dx
(3)  (1 + x ) 2
with six subintervals of [0, 3]. (4)  log xdx with n = 12
4
0

 2
(5) 
0
Cosxdx by dividing the interval in to six equal parts.

 2
(6) 0
Sinxdx by dividing the interval in to three equal parts.

Problem:
5.2
Evaluate  log xdx by using Weddle’s rule taking 7 ordinates.
4

Problem:

36
 2
Evaluate 
0
1 − 0.162Sin 2 d by using Weddle’s rule taking 7 ordinates.

Problem:
1.4
Evaluate  ( Sinx − log x + e ) dx by using Weddle’s rule taking n = 12 ordinates.
0.2
x

Problem:
1.6
Evaluate  xCosexhxdx by using Weddle’s rule taking n = 12 ordinates.
0.4

Problem:

The velocity v of a particle at distance s from a point on its linear path is given by the
following table

s(m) 0 2.5 5.0 7.5 10.0 12.5 15.0 17.5 20.0


v(m/sec) 16 19 21 22 20 17 13 11 9

Estimate the time taken by the particle to traverse the distance 20 meters, using Simpson’s
1/3rd rule.

Problem:

A river is 80 ft wide. The depth d in feet at a distance x ft from one bank is given by the
following table

x 0 10 20 30 40 50 60 70 80
d 0 4 7 9 12 15 14 8 3

Find approximately the area of the cross section.

37

You might also like