Numerical Analysis Lecture 26
Chapter 5 Interpolation
Finite Difference Operators Newton’s Forward Difference Finite Difference Operators Newton’s Forward Difference Interpolation Formula Newton’s Backward Difference Interpolation Formula Lagrange’s Interpolation Formula Divided Differences Interpolation in Two Dimensions Cubic Spline Interpolation
DIVIDED DIFFERENCES
The zero-th order divided difference
The first order divided difference is defined as
Second order divided difference
Generally
NEWTON’S DIVIDED DIFFERENCE INTERPOLATION FORMULA
Newton’s divided difference interpolation formula
Newton’s divided differences can also be expressed in terms of forward, backward and central differences.
In terms of forward differences
In terms of backward differences
In terms of central differences
Newton’s Divided Difference Formula with Error Term
Following the basic definition of divided differences, we have for any x
Multiplying the second Equation by (x – x0), third by (x – x0)(x – x1) and so on, and the last by (x – x0)(x – x1) … (x – xn-1) and adding the resulting equations, we obtain
Please note that for x = x0, x1, …, xn, the error term vanishes Where Please note that for x = x0, x1, …, xn, the error term vanishes
Error Term in Interpolation Formulae We know, if y (x) is approximated by a polynomial Pn (x) of degree n then the error is given by where,
Alternatively it is also expressed as Now, consider a function F (x), such that Determine the constant K in such a way that F(x) vanishes for x = x0, x1, …, xn and also for an arbitrarily chosen point , which is different from the given (n + 1) points.
Let I denotes the closed interval spanned by the values Let I denotes the closed interval spanned by the values Then F (x) vanishes (n + 2) times in the interval I. By Rolle’s theorem vanishes at least (n + 1) times in the interval I, at least n times, and so on.
Eventually, we can show that Eventually, we can show that vanishes at least once in the interval I, say at Thus, we obtain Since Pn(x) is a polynomial of degree n, its (n + 1)th derivative is zero. Also, from the definition of
Therefore, we get Hence for some in the interval I.
Further more, we observe that Thus the error committed in replacing y (x) by either Newton’s divided difference formula or by an identical Lagrange’s formula is
INTERPOLATION IN TWO DIMENSIONS
Let u be a polynomial function in two variables, say x and y, in particular quadratic in x and cubic in y, which in general can be written as
This relation involves many terms This relation involves many terms. If we have to write a relation involving three or more variables, even low degree polynomials give rise to long expressions. If necessary, we can certainly write, but such complications can be avoided by handling each variable separately.
If we let x, a constant, say x = c, the equation simplifies to the form Now we adopt the following procedure to interpolate at a point (1, m) in a table of two variables, by treating one variable a constant say x = x1. The problem reduces to that of a single variable interpolation.
Any one of the methods discussed in preceding sections can then be applied to get f (x1, m). Then we repeat this procedure for various values of x say x = x2, x3, …, xn keeping y constant. Thus, we get a new table with y constant at the value y = m and with x varying. We can then interpolate at x = 1.
Example Tabulate the values of the function f (x) = x2+y2-y for x = 0,1,2,3,4 and y = 0,1,2,3,4. Using the table of the values, compute f(2.5, 3.5) by numerical double interpolation
Solution The values of the function for the given values of the given values of x and y are given in the following table X …… y…. 1 2 3 4 6 12 7 13 10 16 9 11 15 21 18 22 28
Cont! Using quadratic interpolation in both x and y directions we need to consider three points in x and y directions. To start with we have to treat one variable as constant, say x. Keeping x = 2.5, y = 3.5 as near the center of the set, we choose the table of values corresponding to x = 1,2, 3 and y = 2, 3, 4.
Cont ! The region of fit for the construction of our interpolation polynomial is shown in different color in the table X …… y…. 1 2 3 4 6 12 7 13 10 16 9 11 15 21 18 22 28
Cont ! Thus using Newton’s forward difference formula, we have At x = 1 Y f 2 3 7 4 13 6
Cont ! Similarly At x = 2 Y f 2 6 3 10 4 16
Cont ! Similarly At x = 3 Y f 2 11 3 15 4 21 6
Cont !
Cont !
Cont ! Therefore we arrive at the following result At y=3.5 X f 1 9.75 2 12.75 3 17.75 5
Cont !
Cont ! And hence no error in interpolation !!! From the functional relation, we also find that And hence no error in interpolation !!!
Numerical Analysis Lecture 26