Notes Unit-5 22MA21C
Notes Unit-5 22MA21C
UNIT-V
NUMERICAL METHODS
Introduction:
Numerical analysis plays a great role in engineering and in the quantitative parts of pure and
applied science. Interpolation, the computing of values for a tabulated function at points not
in the table, is historically a most important task. Many famous mathematicians have their
names associated with procedures for interpolation: Gauss, Newton, Bessel, Stirling. The
need to interpolate began with the early studies of astronomy when the motion of heavenly
bodies was to be determined from periodic observations. Interpolation methods demonstrate
some important theory about polynomials and the accuracy of numerical methods.
Interpolating with polynomials serves as an excellent introduction to some techniques for
drawing smooth curves. These methods are the basis of many other procedures. Among
these procedures, we will focus on numerical differentiation and integration in this unit.
Interpolation is the technique of estimating the value of a function for any intermediate value of
the independent variable while the process of computing the value of the function outside the
given range is called extrapolation.
Finite Differences:
The finite difference deals with the changes in the value of the function (dependent variable)
due to the changes in the values of independent variable. The values of the independent
variable x are called Arguments and the corresponding values of dependent variables y are
called Entries.
Forward difference:
1
Second Semester Number theory, Vector calculus and Computational methods (22MA21C)
Department of Mathematics
denoted by , ,......, . i.e. = - , = - , ..., =
-
Here is called the First Entry and , ...... are called the Leading
Differences.
Backward Difference:
2
Second Semester Number theory, Vector calculus and Computational methods (22MA21C)
Department of Mathematics
Problems:
1. Evaluate tan-1 x
Solution: tan-1 x = tan-1 (x + h) – tan-1 x
= tan-1 , - =tan-1 , -
2. Evaluate cos 2x
Solution: cos 2x = { }
cos 2 (x + h) cos 2x
= [cos2(x + 2h) – cos 2 (x + h)] – [cos 2 (x + h) – cos 2x]
= - 2 sin (2x + 3h) sin h + 2 sin (2x + h) sin h
= - 2 sin h [sin (2x + 3h) – sin (2x + h)]
= - 2 sin h [2 cos (2x + 2h) sin h]
= -4 sin2 h cos (2x + 2h)
Differences of a Polynomial:
The nth differences of a polynomial of the nth degree are constant and all higher order
differences are zero.
Let , then
n
n (n - 1) (n - 2) … 1. = n! ........………………(1)
and then for higher orders = . …….……….(2)
Problems:
1. Evaluate 10 [(1 – ax) (1 – b ) (1 – c ) (1 – d )] with h=1, h=2.
Solution: Given,
– – – – = +() +() + ......+1]
3
Second Semester Number theory, Vector calculus and Computational methods (22MA21C)
Department of Mathematics
= [ ( ) = 0 or
]
= (10 !) (for = 1)
Similarly for h =2, = (10!) (2)10
5 10 15 20 25 30
9962 9848 9659 9397 9063 8660
5 9962
10 9848
15 9659
20 9397
25 9063
30 8660
3. Construct the finite difference table for the function where x takes
the values 0,1,2,3,4,5,6. Identify the leading forward and backward differences. Hence
find .
Solution:
First Second Third Fourth
difference difference difference difference
0 1
1 3
6
2 11
6
3 31
6
4 69
6
5 131
6 223
The leading forward differences are 2, 6, 6 and leading backward differences are 92, 30, 6.
, .
4
Second Semester Number theory, Vector calculus and Computational methods (22MA21C)
Department of Mathematics
Note: Third differences are constants and higher order differences are zero as is a
polynomial of third degree.
Remark:
Newton’s Forward Interpolation Formula is used to interpolate the values of y near the
beginning of the set of tabulated values or for extrapolating values of y to the left of the
beginning. Newton’s Backward Interpolation Formula is used to interpolate the values of y
near the end of the set of tabulated values or for extrapolating values of y to the right of the
last tabulated value y.
Examples:
1. Find a cubic polynomial which takes the following data
0 1 2 3
1 2 1 10
Solution: The forward difference table is given by,
x y = f(x)
0 1
1
1 2 -2
-1 12
2 1 10
9
3 10
+ p + +
5
Second Semester Number theory, Vector calculus and Computational methods (22MA21C)
Department of Mathematics
2. The table gives the distance in nautical miles of the visible horizon for the given
heights in feet above the earth’s surface.
Solution:
nautical miles.
6
Second Semester Number theory, Vector calculus and Computational methods (22MA21C)
Department of Mathematics
nautical miles.
3. From the following table, estimate the number of students who obtained marks between 40 and
45:
No. of students(y): 31 42 51 35 31
Taking , , = = 0.5
y(45) =
= 47.87
Exercise:
1. Fit a cubic polynomial to the following data using suitable interpolation formula.
4. Using Newton -Gregory Interpolation formulae, find from the following data.
Inverse interpolation:
The process of estimating the value of x for a given value of is called Inverse interpolation.
So far given a table of values of x and y, using one of the interpolation formulae we find the value
of y corresponding to some value of x which is not in the table. On the other hand the process of
8
Second Semester Number theory, Vector calculus and Computational methods (22MA21C)
Department of Mathematics
estimating the value of x for some value of y which is not in the table is called inverse
interpolation.
This method is used when the values of x are not necessarily equally spaced. Lagrange’s
interpolation formula can be simply viewed as a relation between two variables and any one of
the variable can be taken as an independent variable. Therefore, inverse interpolation formula can
be obtained by interchanging the variables x and y in Lagrange’s formula, we get.
Problems:
1. By using the Lagrange’s interpolation formula to fit a polynomial to the data given
–
for , we get
2. Apply Lagrange’s formula to find f(5) and f(6) given that f(1) =2, f(2)=4,f(3)=8,f(7)=128
and explain why the results differ from those obtained by f(x) = .
Solution: =2 =2 =7
9
Second Semester Number theory, Vector calculus and Computational methods (22MA21C)
Department of Mathematics
By Lagrange’s formula, we have
)+ )+
)+ )
+ (4) +
+ + +
+ + (8) + (128)
But actual values of f(5) and f(6) are f(5) = = 32 and f(6) = = 64.
The difference in values of f(5) and f(6) are due to the assumption of f(x) as a polynomial,
when it is an exponential function of the form .
3. Find for
Solution:
=1 =3 =4
=4 = 12 = 14
+ +
= + + (4)
at
Numerical Differentiation:
Let the function y = f(x) is given by a table of values (x , y) then the process of computing the
derivatives etc. for some particular value of x is called Numerical Differentiation.
10
Second Semester Number theory, Vector calculus and Computational methods (22MA21C)
Department of Mathematics
+P + + + ……….. (1)
+ + + + ……. (3)
( ) = * + …. (5)
( ) = * + …. (6)
Formula (5) is used to compute at any point x = + Ph , whereas formula (6) is used to
compute at any of the value of x when y is specified.
Similarly,
( ) = * + …. (7)
and( ) = * + …. (8)
The formula (7) is used to compute y'' at any point x = +Ph whereas formula (8) is used to
compute y'' at any value of x where y is specified.
11
Second Semester Number theory, Vector calculus and Computational methods (22MA21C)
Department of Mathematics
+ + + + …… ……… (1)
= + + + …… ……… (3)
= …. (4) But,
( ) = * + …. (5)
( ) = * + …. (6)
Formula (5) is used to compute y ' at any point x = + Ph whereas formula (6) is used to
compute at any of the values of x when y is specified.
Similarly
( ) = * + …. (7)
( ) = * + …. (8)
The formula (7) is used to compute y'' at any point whereas formula (8) is used
to compute y'' at any of the values of when is specified.
Problems:
1. Given
Solution: Here, the step-length is . We first form the following difference table.
( ) = * +
Then, ( ) * + = 3.3125
( ) = * +
And ( ) * + = 3.39375
2. Using appropriate interpolation formulas, find the values of when x = 4 using the
following table.
Solution: Here is a specified value of which is at the end of the given table.
For this purpose we take = 4.
The difference table is given by,
1 4
8
2 12 0
8 8
3 20 8
16
4 36
And * + = 16
3. A rod is rotating in a plane, the following table gives the angle θ (in radians) through which the
rod is turned for various values of time t (in seconds): Find the angular velocity and angular
acceleration at t = 0.4 sec.
Solution: Given
0 0
0.12
0.2 0.12 0.25
0.37 0.01
0.4 0.49 0.26 0.00
0.63 0.01
0.6 1.12 0.27 0.00
0.90 0.01
0.8 2.02 0.28 0.00
1.18 0.01
1.0 3.20 0.29
1.47
1.2 4.67
( ) = * +
( ) * + = 2.49
( ) = * +
14
Second Semester Number theory, Vector calculus and Computational methods (22MA21C)
Department of Mathematics
. /
4. The following table gives the temperature θ (in degree Celsius) of a cooling body at different
1 3 5 7 9
1 85.3
-10.8
3 74.5 3.3
-7.5 -2.3
5 67.0 1.0 1.6
-6.5 -0.7
7 60.5 0.3
-6.2
9 54.3
We have, = = 9, = = 54.3
( ) = * +
( ) 0
=
Thus, the body cools at the rate of 3.11875 degree/second.
15
Second Semester Number theory, Vector calculus and Computational methods (22MA21C)
Department of Mathematics
Exercise:
1. Given that,
Find , at and .
2. A slider in a machine moves along a fixed straight rod. Its distance x cm along the rod is
given below for various values of the time ‘t’ seconds. Find the velocity of the slider and its
acceleration when t = 0.1 second.
5. Find (1.5) using the differentiation formula based on Newton’s interpolation for the
following data:
16
Second Semester Number theory, Vector calculus and Computational methods (22MA21C)