0% found this document useful (0 votes)
4 views40 pages

Numerical Methods I

The document discusses numerical methods for solving engineering and scientific problems that often involve systems of equations or differential equations, where analytical solutions may be difficult to obtain. It focuses on interpolation techniques using evenly spaced points, including forward and backward differences, and introduces the Newton-Gregory interpolation formulas for approximating functions based on tabulated data. The document also includes examples and exercises to illustrate the application of these methods.

Uploaded by

kashyapkrishnaj
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)
4 views40 pages

Numerical Methods I

The document discusses numerical methods for solving engineering and scientific problems that often involve systems of equations or differential equations, where analytical solutions may be difficult to obtain. It focuses on interpolation techniques using evenly spaced points, including forward and backward differences, and introduces the Newton-Gregory interpolation formulas for approximating functions based on tabulated data. The document also includes examples and exercises to illustrate the application of these methods.

Uploaded by

kashyapkrishnaj
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/ 40

3.

NUMERICAL METHODS-I

Introduction:
Most of the problems of engineering, physical and economical sciences can be
formulated in terms of system of equations, ordinary or partial differential
equations. In majority of the cases, the solutions to these problems in analytical
form are non-existent or difficult. In all such cases, numerical methods provide
approximate solutions, practical for analysis. Numerical methods do not strive for
exactness. Instead, they yield approximations with specified degree of accuracy.
The early disadvantage of the several numbers of computations involved has been
removed through high speed computation using computers, giving results which
are accurate, reliable and fast.

3.1 Interpolation with evenly spaced points

Introduction:
Suppose that a function y = f(x) is given. For a set of values of x in the domain, we
can tabulate the corresponding values of y. The central problem of interpolation is
the converse of this:
Given a set of tabular values ( x0 , y0 ), ( x1 , y1 ), ..., ( xn , yn ) satisfying the relation

y = f(x) where the explicit nature of f(x) is not known, it is required to find a
simpler function, say  ( x ) , which approximates f(x), such that f(x) and  ( x ) agree
at the set of tabulated points. Such a process of approximation of an unknown
function by a known function within the range where it is defined, such that both
functions assume same values at the given set of tabulated points is called
interpolation. The extrapolation is the process of approximating the unknown
function by a function at a point outside the range of definition. If  ( x ) is a
polynomial, then the process is called polynomial interpolation and  ( x ) is called
the interpolating polynomial.
Weierstrass Theorem: If f(x) is continuous in x0  x  xn , then given any ε > 0,
there exists a polynomial P(x) such that f ( x) - P( x)   for all x in ( x0 , xn ).
This approximation theorem justifies the polynomial approximation.
There are two main uses of these approximating polynomials. The first use is to
reconstruct the function f(x) when it is not given explicitly and only values of f(x)
and/ or its certain order derivatives are given at a set of distinct points called nodes
or tabular points. The second use is to perform the required operations which were
intended for f(x), like determination of roots, differentiation and integration etc.
can be carried out using the approximating polynomial P(x). The approximating
polynomial P(x) can be used to predict the value of f(x) at a non-tabular point.
Remark: Through two distinct points, we can construct a unique polynomial of
degree 1(straight line). Through three distinct points, we can construct a unique
polynomial of degree atmost two (a parabola or a straight line). In general, through
n  1 distinct points, we can construct a unique polynomial of degree atmost n. The
interpolation polynomial fitting a given data is unique.
We consider x to be an independent variable and y = f(x) as a function of x where
the explicit nature of y is not known, but a set of values (x0, y0), (x1, y1),
(x2, y2),…,(xn, yn) satisfying yi = f(xi), i = 0, 1, 2, …, n are given.
Interpolation with equally spaced points:
To obtain interpolating polynomials, we use finite differences.
Finite differences
Suppose that
xi = x0 + ih, h > 0, i = 1, 2, …,n.
i.e., the values of x are equally spaced.
The following are the three types of finite differences
1. Forward Differences
2. Backward Differences
3. Central Differences
Forward Differences:
The differences y1 – y0, y2 – y1,…,yn – yn-1 are called first order forward
differences of y and are respectively denoted by y0 , y1 , y2 ,..., yn . We call ‘’,
the forward difference operator. The differences of the first order forward
differences are called second order forward differences and are denoted by
 2 y0 ,  2 y1 ,  2 y2 , ... ,  2 yn 1 . Thus

2y0= y1  y0 = y2 – 2y1 + y0, 2y1= y2  y1 = y3 – 2y2 + y1


and so on. Similarly, one can find the rth order forward differences recursively as,
 r yk   r -1 yk 1  r -1 yk , r = 1, 2, …
These differences can be tabulated and the table so obtained is called forward
difference table and it is read diagonally downwards.
x y  2 3 4

x0 y0
 y0
x1 y1 2 y0
 y1 3y0
x2 y2 2 y1 4 y0
 y2 3 y1
x3 y3 2 y2
 y3
x4 y4
Backward differences:
The differences y1 – y0, y2 – y1,…,yn – yn-1 when denoted by y1, y2,…, yn,
are called first order backward differences of y. The operator  is called the
backward difference operator. The differences of the first order differences are
called second order differences and are denoted by 2y2, 2y3, …,2yn.
Similarly one can define the rth order backward differences,
 r yk   r -1 yk  r -1 yk -1 , r = 1, 2, …

The relation between  and  is given by yr = yr-1.


The backward difference table is as shown below and it is read diagonally
upwards.
x y  2 3 4

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

Other notations for y = f(x) are


1. yx = f(x + h) – f(x),
2. yx = f(x) – f(x –h)
where h is the difference between two consecutive x values.
Shift Operator:
The shift operator, denoted by E, is defined by the equation Eyk = yk+1. The
operator shifts the functional value yk to the next higher value yk+1.
Again operating by E, we get E2yk = E(Eyk) = E(yk+1) = yk+2. In general
Eryk = yk + r.
The inverse shift operator, denoted by E-1, is defined by the equation E-1yk = yk-1.
In general
E-ryk= ykr.
Properties of finite differences:
1. Linearity Property:
For any two constants a and b and for any two functions f(x) and g(x), we
have, (a f(x)  b g(x)) = a f(x)  b g(x)
2. Differences of Polynomial: The first order difference of a polynomial of degree
n is a polynomial of degree n 1. Hence nth difference of a polynomial of degree n
is a constant.
Proof:
Consider
f(x) = a0xn + a1xn-1 + a2xn-2 +…+ an-1x + an, a0  0.
Then,
f ( x)  f ( x  h) - f ( x)
 a0  x  h  n
 xn  
 a1  x  h   x n-1
n -1
  a2  x  h n -2
 x n-2   ...

 a0 nhx n-1  lower deg ree terms


which is a polynomial of degree n1. Similarly,
 2 f ( x)  a0 n(n  1) h 2 x n 2  lower deg ree terms

which is a polynomial of degree n2.


Continuing in this manner, we arrive at
nf(x) = a0n!hn,
which is a constant. Hence nth difference is a constant.
Remark: (n + 1)th and higher order differences of a polynomial of degree n are
zero.
Remark: Converse of the above is also true. i.e., if for a function f(x) the nth order
finite difference is a constant and (n +1)th ordered finite difference is zero then f(x)
is a polynomial of degree n.
3. 1+  = E.
4. 1 = E-1.
4.  = E = E
k k 
5.  yr   (1)i 1   yk  i
k
…….(1)
i 1 i 
Proof: Since
E 1   , wehave   E  1
k k 
  k  (1  E )k   (1)i   E i
i 1 i 
 k k   k k  k k 
 k yr    (1)i   E i  yr   (1)i   E i yr   (1)i   yk i
 i 1 i   i 1 i  i 1 i 
6.  k yr  k yk  r

Example : Making suitable assumptions find the missing terms in the following
table:
x 1 2 3 4 5 6 7
y 103.4 97.6 122.9 ? 179.0 ? 195.8
Solution:
Let y0 =103.4, y1 = 97.6, y2 = 122.9, y3= ?, y4 = 179.0, y5 = ?, y6 = 195.8. Since 5
values of y are known, we assume that y is a polynomial of degree 4, so that the 4 th
order differences are constants and 5th order differences are zero, from which we
obtain (use equation 1)
5y0 = 0  y5 – 5y4 +10y3  10y2 + 5y1  y0 = 0  y5 + 10y3 = 1739.4
5y1 = 0  y6 – 5y5 +10y4  10y3 + 5y2  y1 = 0  5y5 + 10y3 = 2502.7
Solving,
y3 = 154.8575, y5 = 190.825
Exercises 4.1
1. Find the missing values in the table

x 0 1 2 3 4
y 1 3 9 ? 81

Explain why the result differs from the actual value 33 = 27. (Ans: 31)
2. Find the missing points in the following table:

x 45 50 55 60 65
y 3 - 2 - -2.4

(Ans: y(50) = 2.925, y(60) = 0.225)


3. Find the missing values in the following table:

x 0 1 2 3 4 5 6
y 5 11 22 40 - 140 -

4. Given u0 = 10, u1 = 6, u3 = 26 and u5 = 130. Find u2 and u4.

Newton-Gregory Forward Difference Interpolation Formula


Statement: Given a set of points (x0, y0), (x1, y1), (x2, y2),…,(xn, yn) satisfying
y = f(x), where explicit nature of y is not known and values of x are equally
spaced, the nth degree polynomial yn(x) such that f(x) and yn(x) agree at the
tabulated points is given by
p( p  1) 2 p ( p  1)( p  2)...( p  n  1) n
yn ( x)  y0  py0   y0  ...   y0 ........(2)
2! n!
where x = x0 + ph.
Proof: Since yn(x) is a polynomial of degree n, it can be written as
yn ( x )  a0  a1 ( x  x0 )  a2 ( x  x0 )( x  x1 )  ...  an ( x  x0 )( x  x1 )...( x  xn-1 ) ....(3)

yn (x0) = y0 gives a0 = y0.


y0
yn (x1) = y1 gives a1 = .
h
 2 y0
yn (x2) = y2 gives a2 = .
2! h 2
M
 n y0
yn (xn) = yn gives an = .
n!h n
Set x  x0  ph . Then,
x – x0 = ph, x – x1 = (p – 1) h, …, x xn-1 = (p  n +1)h.
Substituting in (3) and simplifying we get (2).
The formula,
p( p  1) 2 p( p  1)...( p  n  1) n
yn ( x)  y0  py0   y0  ...   y0 ,
2! n!
is called Newton- Gregory forward difference interpolation formula and it is
useful for interpolating near the beginning of a set of tabular values.

Newton-Gregory Backward Difference Interpolation Formula


Statement: Given a set of points (x0, y0), (x1, y1), (x2, y2),…,(xn, yn) satisfying
y = f(x), where explicit nature of y is not known and values of x are equally
spaced, the nth degree polynomial yn(x) such that f(x) and yn(x) agree at the
tabulated points is given by
p( p  1) 2 p( p  1)( p  2)...( p  n  1) n
yn ( x)  yn  pyn   yn  ...   yn .......(4)
2! n!
where x = xn + ph.
Proof: Since yn(x) is a polynomial of degree n, it can be written as
yn ( x)  a0  a1 ( x  xn )  a2 ( x  xn )( x  xn-1 )  ...  an ( x  xn )( x  xn-1 )...( x  x1 ) ....(5)

yn (xn) = yn gives a0 = yn.


y n
yn (xn-1) = yn-1 gives a1 = .
h
 2 yn
yn (xn-2) = yn-2 gives a2 = .
2! h 2
M
 n y0
yn (x1) = y1 gives an = .
n!h n
Set x  xn  ph . Then,
x – xn = ph, x – xn-1 = (p + 1) h, …, x x1 = (p + n 1)h.
Substituting in (5) and simplifying we get (4).
The formula,
p( p  1) 2 p( p  1)...( p  n  1) n
yn ( x)  yn  pyn   yn  ...   yn ,
2! n!
is called Newton- Gregory backward difference interpolation formula and it is
useful for interpolating near the end of a set of tabular values.

Example 1: Find the cubic polynomial which takes the following values:
y (1)  24, y (3)  120, y (5)  336,and y (7)  720. Hence, or otherwise, obtain the
value of y (8).
Solution: We form the difference table:
x y  2 3

1 24
96
3 120 120
216 48
5 336 168
384
7 720

Here h = 2, x0 = 1. Hence p = (x1)/2.


Using forward difference formula, we get,
 x  1  x  1   x  1  x  1  x  1 
   1    1  2
x 1
(96)  
2  2  (120)   2  2  2  (48)
y ( x )  24 
2 2 6
 x 3  6 x 2  11x  6.

y(8) = 83 + 6(82) + 11(8) + 6 = 990.


Example 2: Using Newton’s forward difference formula, find the sum
S n  13  23  33  ...  n3 .

Solution: S n  ( n  1)3 ,  2 S n  3n 2  9n  7,  3S n  6n  12,  4 Sn  6.


Thus Sn is a polynomial of degree 4 in ‘n’.
Further, S1  1, S1  8,  2 S1  19,  3 S1  18,  4 S1  6. Hence,
2
( n  1)( n  2)( n  3)( n  4)  n( n  1) 
S n  1  ( n  1)(8)  ...  (6)    .
24  2
Example 3: Values of x (in degrees) and sin x are given in the following table:
x 15 20 25 30 35 40
sin x 0.2588190 0.3420201 0.4226183 0.5 0.5735764 0.6427876
Determine the value of sin380.
Solution: The difference table is
x sin x  2 3 4 5

15 0.2588190
0.0832011
20 0.3420201 -0.0026029
0.0805982 -0.0006136
25 0.4226183 -0.0032165 0.0000248
0.0773817 -0.0005838 0.0000041
30 0.5 -0.0038053 0.00002879
0.0735764 -0.0005599
35 0.5735764 -0.0043652
0.0692112
40 0.6427876
Here x = 38 and h = 5. Therefore p = -0.4.
Hence,
y (38) = 0.6427876-0.02768448+0.00052382+0.00003583-0.00000120
= 0.6156614.
Example 4: The table below gives the values of tan x for 0.10  x  0.30 :
x 0.10 0.15 0.20 0.25 0.30
y = tan x 0.1003 0.1511 0.2027 0.2553 0.3093

Find: (i) tan 0.12 (ii) tan 0.26 (iii) tan 0.40 and (iv) tan 0.50.
Solution: The difference table is
x tan x  2 3 4

0.10 0.1003
0.0508
0.15 0.1511 0.0008
0.0516 0.0002
0.20 0.2027 0.0010 0.0002
0.0526 0.0004
0.25 0.2553 0.0014
0.0540

0.30 0.3093

(i) p = 0.4, tan (0.12) = 0.1205. (Actual Value : 0.1205)


(ii) p = -0.8, tan (0.26) = 0.2662. (Actual Value : 0.2660)
(iii) p = 2, tan (0.40) = 0.4241. (Extrapolation, Actual Value: 0.4227).
(iv) p = 4, tan (0.50) = 0.5543. (Extrapolation, Actual Value : 0.5463).
Remark: Comparison of the computed and actual values shows that in the first
two cases (i.e., in interpolation) the results obtained are fairly accurate whereas in
the last-two cases (i.e., in extrapolation) the errors are quite considerable. The
example therefore demonstrates the important result that if a tabulated function is
other than a polynomial, then extrapolation very far from the table limits.
Exercises 4.2

1. The population in decennial census was as under. Estimate the population


for the year 1955:
Year 1921 1931 1941 1951 1961
Population 46 66 81 93 101
x
2  1 2
 0
2. The probability integral p  exp   t  dt has the following values:
 2 
x 1.00 1.05 1.10 1.15 1.20 1.25
p 0.682689 0.706282 0.728668 0.749856 0.769861 0.788700
Calculate p for x = 1.235 .

2
The values of the elliptic integral K (m)   1  m sin 2  
-1/ 2
3. d for certain
0

equidistant values of m are given below. Determine K(0.25).


m 0.20 0.22 0.24 0.26 0.28 0.30
K(m) 1.659624 1.669850 1.680373 1.691208 1.702374 1.713889

4. From the following table, find y when x = 1.45.


x 1.0 1.2 1.4 1.6 1.8 2.0
y 0.0 -0.112 -0.016 0.336 0.992 2.0

5. Evaluate sin (0.197) from the following table:


x 0.15 0.17 0.19 0.21 0.23
sinx 0.14944 0.16918 0.18886 0.20846 0.22798

6. Given the table of values:


x 150 152 154 156

y= x 12.247 12.329 12.410 12.490

Evaluate 155 .

7. From the following table find the number of students who obtained less than
45 marks.
Marks < 40 40 - 50 50 - 60 60 – 70 70 - 80
No. of
31 42 51 35 31
students
[Hint: Apply NFIF for cumulative frequency]
3.2 Interpolation with unevenly spaced points:
Consider a set of values (x0, y0), (x1, y1), (x2, y2),…,(xn, yn) satisfying yi = f(xi), i = 0,
1, 2, …, n, where values of x not necessarily be equally spaced. In such cases, we
use the following interpolation methods.
1. Lagrange’s Interpolation
2. Newton’s divided differences method
Lagrange’s Interpolation
Consider a set of values (x0, y0), (x1, y1), (x2, y2),…,(xn, yn) satisfying yi = f(xi), i = 0,
1, 2, …, n, where values of x not necessarily be equally spaced. Let yn(x) be the nth
degree polynomial such that yn(x) and f(x) agree at the tabulated values.
Since yn(x) is a polynomial of degree n, it can be put in the form,
yn ( x )  a ( x  x )( x  x )...( x  xn )  a ( x  x )( x  x )...( x  xn )  ...
0 1 2 1 0 2
 a ( x  x )( x  x )...( x  x ) .....(6)
n-1 0 1 n-1
1
yn(x0) = y0 gives a0  y0
( x0  x1 )( x0  x2 )...( x0  xn )
1
yn(x1) = y1 gives a1  y1
( x1  x0 )( x1  x2 )...( x1  xn )

M
1
yn(xn) = yn gives an  yn
( xn  x0 )( xn  x1 )...( xn  xn-1 )
Substituting in (6), we obtain
( x  x0 )( x  x2 )...( x  xn ) ( x  x0 )( x  x2 )...( x  xn )
yn ( x )  y0  y1  ...
( x0  x1 )( x0  x2 )...( x0  xn ) ( x1  x0 )( x1  x2 )...( x1  xn )
( x  x0 )( x  x1 )...( x  xn1 )
 yn .
( xn  x0 )( xn  x1 )...( xn  xn 1 )
This is called Lagrange’s interpolation formula.
Example 1: The values of x and log10 x are (300, 2.4771), (304, 2.4829), (305,
2.4843) and (307, 2.4871). Find log10 301.
Solution:
( 3)( 4)( 6) (1)( 4)( 6)
log10 301  (2.4771)  (2.4829)
(4)( 5)( 7) (4)( 1)( 3)
(1)( 3)( 6) (1)(3)( 4)
 (2.4843)  (2.4871)
(5)(1)(2) (7)(3)(2)
 2.4786.
Example 2: Find the Lagrange’s interpolating polynomial approximating the
function y = log x defined by the following table of values. Hence determine the
value of log 2.7
x 2 2.5 3.0
log x 0.69315 0.91629 1.09861
Solution:
y ( x )  (2 x 2  11x  15)(0.69315)  (4 x 2  20 x  24)(0.91629)  (2 x 2  9 x  10)(1.09861)
  0.08164 x 2  0.81366 x  0.60761,
which is the required quadratic polynomial.
Putting x = 2.7, we get log 2.7  y (2.7)  0.9932518.
Example 3: The function y  sin x is tabulated below
x 0 π/4 π/2
y 0 0.70711 1.0
Using Lagrange’s interpolation formula, find the value of sin π/6)
Solution:
(π/6  0)(π/6  π/2) (π/6  0)(π/6  π/4)
sin(π/6)  (0.70711)+ (1)
(π/4  0)(π/4  π/2) (π/2  0)(π/2  π/4)
 0.51743.
Example 4: Using Lagrange’s interpolation formula, find y as polynomial in x
from the following table:
x 0 1 3 4
y -12 0 12 24

Solution: Since y = 0 when x = 1, it follows that (x1) is a factor.


Let y (x) = (x-1)R(x). Then R(x) = y(x)/(x1). We now tabulate the values of x and
R(x).
x 0 3 4
R(x) 12 6 8
Applying Lagrange’s formula, we get R ( x )  x 2 - 5 x  12.
Hence the required polynomial approximation to y(x) is given by
y ( x )  ( x  1)( x 2  5 x  12).
Inverse interpolation using Lagrange’s Method:
Suppose that a data (xi , f ( xi )), i = 0, 1, ..., n, is given. In interpolation, we predict
the value of the ordinate f(x) at a non-tabular point x. In many applications, we
require the value of the abscissa x for a given value of the ordinate f(x). For this
problem, we consider the given data as ( f ( xi ), xi ), i  0, 1, ..., n and construct
the interpolation polynomial. This procedure is called inverse interpolation. The
Lagrange’s inverse interpolation formula is obtained by interchanging the roles of
x and y and it is given by

x 
 y  y1  y  y2  ... y  yn  x   y  y0   y  y2 ... y  yn  x  .....
 y0  y1  y0  y2 ... y0  yn  0  y1  y0   y1  y2  ... y1  yn  1
Example 1: If y1  4, y3  12, y4  19 and y x  7, find x.
Solution:
(5)(12) (3)(12) (3)( 5)
x (1)  (3)  (4)
(8)(15) (8)(7) (15)(7)
 1.86.

Exercise 4.3
1. Applying Lagrange’s formula, find a cubic polynomial which approximates
the following data:
x -2 -1 2 3
y(x) -12 -8 3 5

2. Given the data points (1,-3), (3,9), (4,30) and (6,132) satisfying the function
y = f(x), compute f(5) .
3. Given the table values
x 50 52 54 56
3
x 3.684 3.732 3.779 3.825

Use Lagrange’s formula to find x when 3


x  3.756.
4. Find a real root of f (t )  0 , if f (1)  2, f (2)  2, f (5)  4 and f (7)  8.

Remark: In Lagrange’s method, if an additional point is added to the existing data,


we need to do the computations all over again. The nth degree Lagrange
polynomial obtained earlier will be of no use. This is the disadvantage of the
Lagrange interpolation. However, Lagrange interpolation is a fundamental result
and is used in proving many theoretical results of interpolation.
Newton’s divided difference formula: To overcome the disadvantage of
Lagrange’s method, Newton defined, what are known as divided differences, and
derived an interpolation formula using these differences.
Divided differences:
If  x0 , y0  ,  x1 , y1  ,  x2 , y2  ,,  xn , yn  be the given points. Then the first order
divided difference for the arguments x 0 and x1 is defined by the relation

y1  y0
 x0 , x1  
x1  x0
Similarly,
y2  y1 y  y2 y  yn 1
 x1, x2   ,  x2 , x3   3 , …,  xn 1 , xn   n .
x2  x1 x3  x2 xn  xn1
The second order divided differences are defined as
 x1, x2    x0 , x1   x , x    x1, x2  , … ,
 x0 , x1, x2   ,  x1, x2 , x3   2 3
x2  x0 x3  x1

 xn1, xn    xn2 , xn1 


 xn2 , xn1, xn   .
xn  xn2
The third order divided differences are defined as
 x1, x2 , x3    x0 , x1, x2  ,  x2 , x3 , x4    x1, x2 , x3  ,,
 x0 , x1, x2 , x3    x1, x2 , x3 , x4  
x3  x0 x4  x1

 xn2 , xn1, xn    xn3 , xn2 , xn1  .


 xn3 , xn2 , xn1, xn  
xn  xn3
Similarly higher order divided differences are also defined.
Divided difference table:
First Order Second Order nth Order
x y
Differences Differences Differences
x0 y0

 x0 , x1 
x1 y1
 x0 , x1, x2 
 x1 , x2 
x2 y2
 x1, x2 , x3 
 x2 , x3 
x3 y3
. .
. . ……  x0 , x1,, xn 
. .
. .
. .
. .
 xn  2 , xn1   xn3 , xn2 , xn1 
xn1 yn 1

 xn1, xn   xn2 , xn1 , xn 


xn yn

Note: The divided differences are symmetric and independent of the order of the
arguments. That is,
[ x0 , x1 ]  [ x1 , x0 ] ,
[ x0 , x1 , x2 ]  [ x2 , x1 , x0 ]  [ x0 , x2 , x1 ]  [ x1 , x2 , x0 ]  [ x1 , x0 , x2 ]  [ x2 , x0 , x1 ]
and similarly for higher order differences.
Newton’s Divided Difference Interpolation Formula:
Let y0 , y1 ,, yn be the values of y = f(x) corresponding to the arguments

x0 , x1 ,, xn . Then from the definition of divided differences, we have


y  y0
 x0 , x1    y  y0  ( x  x0 )  x, x0  ……….(1)
x  x0
Again
 x, x0    x0 , x1 
 x, x0 , x1     x, x0    x0 , x1    x - x1   x, x0 , x1 .
x - x1
On using this in (1)
y  y0  ( x - x0 )  x0 , x1  + ( x - x0 )( x - x1 )  x, x0 , x1  ………….(2)

Also, from
 x, x0 , x1  -  x0 , x1, x2 
 x, x0 , x1, x2  
x - x2
  x, x0 , x1    x0 , x1 , x2   ( x - x2 )  x, x0 , x1 , x2 

Using this in (2), we get


y  y0  ( x  x0 ) x0 , x1  +  x  x0   x  x1   x0 , x1 , x2 

  x  x0   x  x1  x  x2   x, x0 , x1 , x2 .

Proceeding in this manner, we arrive at


y  y0  ( x  x0 ) x0 , x1  +  x  x0   x  x1   x0 , x1 , x2 

  x  x0   x  x1  x  x2   x, x0 , x1 , x2   

+  x-x 0   x-x1  x-x 2 …  x-x n-1   x 0 , x1 , …, x n 


  x-x 0   x-x1  x-x 2 …  x-x n   x, x 0 , x1 , …, x n 

This is called Newton’s divided difference interpolation formula, the last term
being the remainder term after (n + 1) terms.
Example 1:
Given the values
x 5 7 11 13 17
f(x) 150 392 1452 2366 5202
Evaluate f(9) using Newton's divided difference formula.

Solution:
x f(x) First Order Second Third order Fourth
Differences Order Differences order
Differences Differences
5 150

121
24
7 392
265 1
32

11 1452 0
457
13 2366 42 1
709
17 5202

On using divided difference formula, we have


f  9  150 121 9  5  24  9  5 9  7 

 1(9  5) (9  7) (9 11)  810.


Example 2: Use Newton’s divided difference formula to find f(4) from the given
data:

x 0 2 3 6
f(x) 4 2 14 158

Solution:
x y First Order Second Third order
Differences Order Differences
Differences
0 4

2 2 3

12 1

3 14 9

48

6 158

On using divided difference formula, we have


y  f (4)  4  (4  0)3  (4  0)(4  2)3  (4  0)(4  2)(4  3)1  40.

Example 3: Find the interpolating polynomial using Newton’s divided difference


formula for the following data and also find y when x = 8.
x 0 1 2 5
y 2 3 12 147

Solution:
x y First Order Second Third order
Differences Order Differences
Differences
0 2

1
1 3 4

9 1

2 12 9

45

5 147

y  2 ( x -0)(1) ( x - 0) ( x -1) (4) ( x - 0) ( x -1) ( x - 2)1


= x3  x 2 - x  2
y 8 =570 .

Example 4: Find the Newton’s divided differences polynomials for the data and
also find f(2.5).
x 3 1 0 3 5
f(x) 30 22 12 330 3458
x f(x) First Order Second Third order Fourth
Differences Order Differences order
Differences Differences
3 30

1 22 2
10 4

0 12 26 5

114

3 330 44
290
1564
5 3458

On using Newton’s divided difference polynomial, we have


y  f  x   -30   x  3 4   x  3 x 1 2   x  3 x 1 x -0 4
+  x+3 x+1 x  x-3 .
y  f  x   5x4  9 x3 -27 x2 - 21x -12.
When x  2.5 , y  102.6785.
Exercise 4.4
1. Fit an interpolating polynomial for the data
u10  355, u0  -5,u8  -21,u1  -14,u4  -125 by using Newton’s interpolation
formula and hence evaluate u 2 .

2. Construct the interpolation polynomial for the data given below using
Newton’s general interpolation formula for the divided differences
x 2 4 5 6 8 10
y 10 96 196 350 868 1746

3. Find f(4.5) by using suitable interpolation


x 1 0 2 5 10
f(x) 2 1 7 124 999

4. Fit a polynomial to the data (-4, 1245), (-1, 33), (0, 5), (2, 9), (5, 1335). Hence
find f(1) and f(7)
3.3 Numerical Differentiation:
Let y0 , y1 ,, yn be the values of a function y  f ( x) corresponding to
x0 , x1 ,, xn , the process of computing successive derivatives at some
particular value of independent variable x is known as numerical
differentiation.

The approximate values of these derivatives are obtained by differentiating

an appropriate interpolation formula. If x is nearer to x0 or nearer to xn we


use Newton’s forward or backward interpolation formula provided the
values x0 , x1 ,, xn are equidistant. If the values x0 , x1 , , xn are at unequal
intervals we use Newton’s general interpolation formula.
Numerical Differentiation Using Newton’s Forward Difference Formula
Let the given values of x be equidistant with step lengthh > 0.
Newton’s forward difference polynomial is given by
p( p  1) 2 p( p  1)( p  2) 3
y  y  p y   y   y 
0 0 2 0 3! 0

dy dy dp

dx dp dx
1 2 p -1 2 3 p2 - 6 p  2 3 4 p 3 -18 p 2  22 p - 6 4 
 y0   y0   y0   y0 
h 2 6 24 

……….(1)
Differentiating again,
d2y 1  2 6 p 2 18 p  11 4 
   y  ( p  1)  3
y   y 
dx2 h2  0 0
12 0

………(2)
In a similar way the higher order derivatives can be computed. The
expressions (1) and (2) take a simpler form when the derivative is required at
x = x0, because at this point p = 0. Hence we get
 dy  1 1 1 1 
 dx   y0   2 y0   3 y0   4 y0 
  x x h 2 3 4 
0
and
 d2y  1 11 5 
 2   2   2 y0   3 y0   4 y0   5 y0 
 dx  x x h  12 6 
0

The given values of x are equidistant and the given x is near to xn , we use
the backward difference table and consider Newton’s backward interpolation
formula.
p( p  1) 2 p( p  1)( p  2) 3
y  f  xn  ph   yn  pyn   yn   yn 
2 3!
Differentiating with respect to p, we obtain
dy 1  2 p 1 2 3 p2  6 p  2 3 
 yn   yn   yn  …… (3)
dx h  2 3! 

Again on differentiation, we have


d2y 1

dx 2 h 2
 2 yn  ( p  1)3 yn  …….

(4)
The expressions (3) and (4) take a simpler form when the derivative is
required at x = xn, because at this point p = 0. Hence we get
 dy  1 1 1 1 
 dx   yn   2 yn  3 yn   4 yn 
  x xn h  2 3 4 

and

 d2y  1  2 11 4 5 5 
 2   2  yn   yn   yn   yn 
3

 dx  x xn h  12 6 

Example 1:
Given that

𝑥 1.0 1.1 1.2 1.3 1.4 1.5 1.6


𝑦 7.989 8.403 8.781 9.129 9.451 9.75 10.031

find at 𝑥 = 1.1 and 𝑥 = 1.6.

𝑥 𝑦 ∆ ∆ ∆ ∆ ∆ ∆
1.0 7.989
0.414
1.1 8.403 −0.036

0.378 0.006
1.2 8.781 −0.030 −0.002

0.348 0.004 0.001


1.3 9.129
−0.026 −0.001 0.002
0.322
1.4 9.451 0.003 0.003
−0.023 0.002
0.299
1.5 9.75 0.005
−0.018
0.281
1.6 10.031
(a) At x = 1.1, h = 0.1,
𝑑𝑦 1 1 1 1 1
= 0.378 − (−0.03) + (0.004) − (0) + (−0.001) = 3.941.
𝑑𝑥 0.1 2 3 4 5
(b) At x = 1.6, h = 0.1,
𝑑𝑦 1 2 1 1
= 0.281 + 0.5 (−0.018) + (0.005) + (−0.001) + (−0.001)
𝑑𝑥 0.1 6 4 5
= 2.732.

Example 2: Given that

𝑥 1.0 1.2 1.4 1.6 1.8 2.0 2.2


𝑦 2.7183 3.3201 4.0552 4.9530 6.0496 7.3891 9.0250

dy d 2y
Compute and at x = 1.2 and x = 2.0.
dx dx 2

𝑥 𝑦 ∆ ∆ ∆ ∆ ∆ ∆
1.0 2.7183
0.6018
1.2 3.3201 0.1333

0.7351 0.0294
1.4 4.0552 0.1627 0.0067

0.8978 0.0361 0.0013


1.6 4.9530
0.1988 0.0080 0.0001
1.0966
1.8 6.0496 0.0441 0.0014
0.2429 0.0094
1.3395
2.0 7.3891 0.0535
0.2964
1.6359
2.2 9.0250
(a) At x = 1.2, h = 0.2,
𝑑𝑦 1 1 1 1 1
= 0.7351 − (0.1627) + (0.0361) − (0.0080) + (0.0014)
𝑑𝑥 0.2 2 3 4 5
= 3.3205
𝑑 𝑦 1 11 5
= 0.1627 − 0.0361 + (0.0080) − (0.0014) = 3.318.
𝑑𝑥 (0.2) 12 6
(b) At x=2.0, h = 0.2,

𝑑𝑦 1 1 1 1 1
= 1.3395 + (0.2429) + (0.0441) + (0.0080) + (0.0013)
𝑑𝑥 0.2 2 3 4 5
= 7.3896
𝑑 𝑦 1 11 5
= 0.2429 + 0.0441 + (0.0080) − (0.0013) = 7.3854.
𝑑𝑥 (0.2) 12 6

Exercise 4.5
1. A rod is rotating in a plane. The following table gives the angle  in radians
through which the rod has turned for various values of the time t seconds.
t 0 0.2 0.4 0.6 0.8 1.0 1.2
 0 0.12 0.49 1.12 2.02 3.2 4.67
Calculate the angular velocity and angular acceleration of the rod when
t = 0.2 sec and t = 1.2 sec.
1. The following data gives corresponding values of pressure and specific
volume of a superheated steam
v 2 4 6 8 10
p 105 42.7 25.3 16.7 13
Find the rate of change of pressure with respect to volume when v  2.
2. Given the following table of values of x and y
x 1.00 1.05 1.10 1.15 1.20 1.25 1.30
y 1.0000 1.0247 1.0488 1.0723 1.0954 1.1180 1.1401
dy d2y
Find and at x  1.00 .
dx dx 2
4. A function is given according to the table below.
𝑥 1.5 2.0 2.5 3.0 3.5 4.0
𝑦 3.375 7.000 13.625 24.000 38.875 59.000

Find and at 𝑥 = 1.5 and 𝑥 = 3.5.


5. Given that
𝑥 1.96 1.98 2.00 2.02 2.04
𝑦 0.7825 0.7739 0.7651 0.7563 0.7473

Find and at 𝑥 = 1.98 and 𝑥 = 2.04.

6. From the following table of values of x and y:


𝑥 1.00 1.05 1.10 1.15 1.20 1.25 1.30
𝑦 1.0000 1.0247 1.0488 1.0723 1.0954 1.1180 1.1401

Find and at 𝑥 = 1.00 and 𝑥 = 1.25.


3.4 NUMERICAL INTEGRATION
Consider the definite integral
b
I   y dx
a

where y is known to be a function of x. If the function y = f(x) is not known


explicitly, or the function cannot be integrated by analytical methods, then we use
numerical integration. The process of evaluating a definite integral from a set of
tabulated values of the integrand f(x) is called numerical integration. Given a set of
data points  x0 , y0  ,  x1, y1  ,...,  xn , yn  of a function y = f(x), to evaluate the value
b
of the definite integral I   ydx , we replace f(x) by an interpolating polynomial
a

  x  and on integration we obtain an approximate value of the definite integral.


Thus we can obtain different integration formulae depending upon the type of
interpolation formula used.

Newton-Cotes quadrature formula:


This formula is obtained by using Newton’s forward difference interpolation
formula.
We divide the interval [a, b] into n equal subintervals, each of width h, such that
a  x0  x1  ...  xn  b. Then, xk  x0  kh, k  1, 2, , n .
Approximating y by Newton’s forward difference formula, we obtain
p  p -1 2 p  p -1 p - 2  3
b xn
 
I   y dx    y0  py0   y0   y0  ... dx
a x0 
2 6 

Since x  x0  ph , dx  hdp , when x  x0 , p  0 and when x  xn , p  n , the


above integral becomes
n
p  p -1 2 p  p -1 p - 2  3 
I  h   y0  py0   y0   y0  ... dp
0
2 6 
which gives, on simplification
xn  n n  2 n - 3  n  n - 2 
2

 ydx  nh  y0  2 y0  12  y0  24  y0  ...
 2 3
(1)
x0  
This is known as Newton-Cotes quadrature formula. From this general formula we
can obtain different integration formulae by taking n = 1, 2, 3, … .

Trapezoidal rule:
Put n = 1 in (1). Then all differences higher than the first will become zero and we
obtain
x1
 1   1  h
 ydx  h  0 2 0   0 2 1 0   2  y0  y1 
y  y  h y   y - y 
x0

Similarly, for the interval  x1 , x2  ,


x2
h
 ydx   y1  y2 
x1
2

M
for the last interval  xn-1 , xn  we have
xn
h
 ydx   yn-1  yn 
xn -1
2

Summing up, we obtain


xn
h
 ydx 2  y0  2  y1  y2  ...  yn-1   yn 
x0

which is known as the trapezoidal rule.


Geometrical significance
The curve y = f(x) is replaced by n straight line segements joining the points
 x0 , y0  and  x1, y1  ;  x1, y1  and x2 , y2 ;...;  xn-1, yn-1  and  xn , yn  . Then the area
bounded by the curve y = f (x), the ordinates x = x0 and x = xn and the X-axis is
approximately equal to the sum of the areas of the n trapeziums thus obtained.
Note: The error in the trapezoidal formula is
 b - a  h 2 y
E   x   O(h2 )
12
where y  x  denotes the largest value of the second derivative.
Simpson’s 1/3 – rule:
Put n =2 in (1), we get
x2
 1  h
 ydx2h  y0  y0  6 
2
y0    y0  4 y1  y2 
x0  3
x4
h
Similarly,  ydx   y2  4 y3  y4 
x2
3

M
xn
h
and finally  ydx   yn-2  4 yn-1  yn 
xn -2
3

Summing up, we obtain


xn
h
 ydx  3  y0  4  y1  y3  ...  yn-1   2  y2  y4  ...  yn-2   yn 
x0

which is Simpson’s 1/3 – rule.


Remark: While applying Simpson’s 1/3 – rule, the given interval must be divided
into even number of equal subintervals.
Note: The error in Simpson’s 1/3 rule is
 b - a  h4 y iv
E  x
180
where y iv  x  denotes the largest value of the fourth derivative.
Simpson’s 3/8 – rule:
Put n = 3 in (1), we obtain
x3
 3 3 1  3h
 ydx 3h  y0  2 y0  4 
2
y0  3 y0    y0  3 y1  3 y2  y3 
x0
8  8
x6
3h
Similarly,  ydx  8  y3  3 y4  3 y5  y6 
x3

M
xn
3h
and finally,  ydx   yn-3  3 yn-2  3 yn-1  yn 
xn -3
8

Summing up, we obtain


xn
3h
 ydx  8 ( y0  yn )  3( y1  y2  y4  y5  L  yn-2  yn-1 )  2( y3  y6  L  yn3 ) 
x0

Remark: Simpson’s 3/8 – rule can be applied only if the number of sub-intervals
is a multiple of 3.
Note: The error in Simpson’s 3/8 – rule is
3(b  a ) 4 iv
E h y x 
80
iv
where y ( x ) denotes the largest value of the fourth derivative.

Example 1:
6
dx
1. Evaluate  1  x2 by using
0
(i) Trapezoidal rule (ii) Simpson’s 1/3 rule (iii) Simpson’s 3/8 – rule
by dividing the interval into six equal subintervals.
Solution:
ba 60
Given n = 6, hence h    1.
n 6
x 0 1 2 3 4 5 6
y 1 0.5 0.2 0.1 0.0588 0.0385 0.027
y0 y1 y2 y3 y4 y5 y6

(i) By Trapezoidal rule


6
dx h
 1  x 2 2  y0  y6   2  y`1  y2  y3  y4  y5 

0
1
 1  0.027   2  0.5  0.2  0.1  0.0588  0.0385   1.4108
2
(ii) By Simpson’s 1/3 – rule
6
dx h
 1  x 2  3  y0  y6   4  y`1  y3  y5   2  y2  y4 
0
1
 1  0.027   4  0.5  0.1  0.0385   2  0.2  0.0588  1.3662
3
(iii) By Simpson’s 3/8 – rule
6
dx 3h
 1  x 2 8  y0  y6   3 y`1  y2  y4  y5   2 y3 

0
3
 1  0.027   3 0.5  0.2  0.0588  0.0385   2  0.1  1.3571
8
2. A solid of revolution is formed by rotating about the x-axis the area between
X-axis, the lines x=0 and x = 1 and a curve through the points with the
following coordinates:
x 0.00 0.25 0.50 0.75 1.00
y 1.0000 0.9896 0.9589 0.9089 0.8415
Estimate the volume of the solid formed.
Solution:
1
Volume V=   y 2 dx
0

x 0.00 0.25 0.50 0.75 1.00


y2 1.0000 0.9793 0.9195 0.8261 0.7081

h = 0.25.
Using Simpson’s 1/3 rule,
π  0.25
V= 1  4  0.9793  0.8261  2  0.9195   0.7081 2.8192 .
3 
1.4

  sin x  log x  e  dx using Simpson’s 3/8th rule.


x
3. Compute the value of
0.2

Solution:
Let y  sin x  log x  e x and h  0.2, n  6
The values of y are as given below:
x 0.2 0.4 0.6 0.8 1.00 1.2 1.4
y 3.0295 2.7975 2.8976 3.1660 3.5597 4.0698 4.4042

By Simpson’s 3/8th rule, we have


1.4

  sin x  log x  3h
 e x dx   y0  y6   3  y`1  y2  y4  y5   2 y3 
0.2
8 
3  0.2
  3.0295  4.4042   3  2.7975  2.8976  3.5597  4.0698 
8 
2  3.1660  
4.0304

Exercise 4.6
1. Given that
x 4.0 4.2 4.4 4.6 4.8 5.00 5.2
y=log x 1.3863 1.4351 1.4816 1.5261 1.5686 1.6094 1.6487

5.2
Evaluate  ydx by
4

(i) Trapezoidal rule (ii) Simpson’s 1/3 rule (iii) Simpson’s 3/8 – rule

2
2. Evaluate  cos d using Simpson’s 1/3 rule by taking 9 ordinates.
0

3. A reservoir discharging water trough sluices at a depth h below the water


surface has a surface area A for various values of h as given below:
h (ft) 10 11 12 13 14
A (sq.ft) 950 1070 1200 1350 1530

If t denotes time t in minutes, the rate of flow of the surface is given by


dh h
  48 . Estimate the time taken for the water level to fall from 14 to
dt A
10ft above the sluices.
4. The velocities of a car (running on a straight road) at intervals of 2 minutes
are given below.
Time in
0 2 4 6 8 10 12
minutes
Velocity
0 22 30 27 18 7 0
in km/hr
Apply Simpson’s rule to find the distance covered by the car.
5. A curve is drawn to pass through the points given by the following table:
x 1 1.5 2 2.5 3 3.5 4
y 2 2.4 2.7 2.8 3 2.6 2.1
Estimate the area bounded by the curve, X-axis and the lines x = 1, x = 4.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy