0% found this document useful (0 votes)
47 views21 pages

Interpolation (1) امير

Uploaded by

alifadhil199898
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)
47 views21 pages

Interpolation (1) امير

Uploaded by

alifadhil199898
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/ 21

2.

Interpolation and finite differences


2.1 Introduction to Finite differences:
Numerical Analysis is a branch of mathematics which leads to approximate
solution by repeated application of four basic operations of Algebra. The
knowledge of finite differences is essential for the study of Numerical Analysis. In
this chapter we introduce few basic operators.

2.1.1 Forward Difference Operator:


Let y = f(x) be any function given by the values y0, y1, y2, …, yn, which it
takes for the equidistant values x0, x1, x2, …, xn, of the independent variable x, then
y1 – y0, y2 – y1, …, yn – yn – 1 are called the first differences of the function y. They
are denoted by Δy0, Δy1, …, etc.
∴ we have:
∆ = −
∆ = −
….
∆ = −
The symbol Δ is called the difference operator. The differences of the first
differences denoted by ∆ ,∆ ,∆ …… ∆ are called second differences,
where:

Δ2 is called the second difference operator. Similarly:

21 of 1Page
It is a convenient method for displaying the successive differences of a function.
The following table is an example to show how the differences are formed.

The above table is called a diagonal difference table. The first term in the table is
y0, it is called the leading term. The differences ∆ , ∆ ,∆ ,..., are called the
leading differences. The differences ∆ with a fixed subscript i lie along the
diagonal downward sloping are called forward differences. In forming such a
difference table care must be taken to maintain correct sign. A convenient check
may be obtained by noting the sum of the entries in any column equals the
differences between the first and the last entries in preceding column.

Example 2.1:
Construct a forward difference table for the following data:

Solution:

21 of 2Page
2.1.2 BACKWARD DIFFERENCES:
Let y = f(x) be a function given by the values y0, y1, … yn which it takes for
the equally spaced values x0, x1, …, xn of the independent variable x. Then y1 – y0,
y2 – y1, …, yn – yn– 1 are called the first backward differences of y = f(x). They are
denoted by , , …, respectively. Thus we have:

where is called the backward difference operator.

Note: In the above table the differences with a fixed subscript i, lie along the
diagonal upward sloping are called backward differences.

2.1.3 ERROR PROPAGATION IN A DIFFERENCE TABLE:


Let y0, y1, y2, …, yn be the values of the function y = f(x) and the value y5 be
effected with an error ∈, such that the erroneous value of y5 is y5 + ∈. In this case
the error ∈ effects the successive differences and spreads out face wise as higher
orders are formed in the table. The table given below shows us the effect of the
error.

21 of 3Page
Example 2.2:
The following is a table of values of a polynomial of degree 5. It is given that
(3) is in error. Correct the error:

Solution: It is given that y = f(x) is a polynomial of degree 5.


∴ Δ y must be constant, (3) is in error.
Let 254 + ∈ be the true value, now we form the difference table:

∆ ∆ ∆

0 1

1 2 30

31 160 +

2 33 190 + 200 − 4

221 + 360 − 3 220 + 10

3 254 + 550 − 2 420 + 6

771 − 780 + 3 20 − 10

4 1025 1330 + 400 − 4

2101 1220 −

5 3126 2550

4651

6 7777

Since the fifth differences of y are constant:


220 + 10 ∈= 20 − 10 ∈
⇒ 20 ∈= −200
⇒ ∈= −10
∴ (3) = 254+∈
⇒ (3) = 244.

21 of 4Page
2.1.4 CENTRAL DIFFERENCES:
The operator δ: We now introduce another operator known as the central
difference operator to represent the successive differences of a function in a more
convenient way. In general form:

= ⁄ − ⁄ -------- (2.1)

The first central difference operator, denoted by the symbol δ, by substituting with
= 1⁄2 = 1 is defined by:
y1 - y0 = ⁄
y2 – y1 = ⁄
……
yn – yn -1 = ⁄

For higher order differences:

In its alternative notation:

where h is the interval of differencing. The central difference table can be formed
as follows:

21 of 5Page
2.2 Interpolation with equal intervals:

2.2.1 Introduction:
The word interpolation denotes the method of computing the value of the
function = ( ) for any given value of the independent variable x when a set of
values of = ( ) for certain values of x are given.
The process of computing the value of function outside the range of given values
of the variable is called extrapolation.
Interpolation is based on the following assumption:
1. The values of the function should be in an increasing or decreasing order i.e.,
there are no sudden change (Jumps or falls) in the values during the period of
under consideration.
2. The jumps and falls in the values should be uniform; this implies that the
changes in the values of the observations should be in a uniform pattern.
3. When we apply calculus of finite differences on this, we assume that given set of
observations are capable of being expressed in a polynomial form.

There are three methods to interpolate the certain quantity.


1. Graphical Method: According the Graphical Method, take a suitable scale for
the values of x and y i.e., for arguments and entries values, and plot the
different points on the Graph for these values of x and y. Draw the Curve
passes through the different plotted points and find a point on the curve
corresponding to argument x and obtain the corresponding entry value y. This
method is not reliable most of the cases.
2. Method of curves fitting: This method can be used only in those cases in which
the form of the function in known. This method is not exact and becomes more
complicated when the number of observations is sufficiently large. The only
merit of this method lies in the fact that it gives closer approximation than the
graphical method.
3. Use the calculus of finite differences: The study of finite differences for the
purpose of interpolation can be divided into three parts.
(a) The technique of interpolation with equal intervals.
(b) The technique of interpolation with unequal intervals.
(c) The technique of central differences.
These methods are less approximate than the others and do not assume the form of
the function to be known. On using the method of calculus of finite difference, the
calculations remain simple even if some additional observations are included in the
given data.
Let = ( ) be a function which takes the values y0, y1, y2, …, yn, corresponding
to the values x0, x1, x2, …, xn of the independent variable x. If the form of the
function = ( ) is known we can very easily calculate the value of y
corresponding to any value of x. But in most of the practical problems, the exact
form of the function is not known. In such cases we can re-express the function
( ) as interpolating function by the following formulae.

21 of 6Page
2.2.2 NEWTON’S GREGORY forward interpolation formula:

Let = ( ) be a given function of x which takes the value ( ),


( + ) , ( + ). . . ( + ) for (n + 1) equally spaced values , +
, + ,... + of the independent variable x. Assume that ( ) be a
polynomial of nth degree, given by:
f(x) = A0 + A1 (x – a) + A2 (x – a)(x – a – h) + A3 (x – a)(x – a – h) (x – a –
2h)+... An(x – a)... ( − − ( − )h) ----- (2.2)
Where A0, A1, A2, ... An are to be determined. Now to find the values of A0, A1, A2,
... An put = , + ℎ, + 2ℎ, . . . + ℎ in equation (2.2) successively.
Therefore for x = a,
( ) =A0 ...(2.3)
For = + ℎ, f(a + h) = A0 + A1 (a + h – a)
( + ℎ) = A0 + hA1
( + ℎ) – ( ) = hA1 [from (2.3)]
∆ ( )
∴ =

f(a + 2h) = A0+ A1 (2h) + A2(2h)h
∆ ( )
= ( ) + 2ℎ( ) + 2ℎ A2.
⇒ 2h 2A2 = ( + 2ℎ) – 2 ( + ℎ) + ( ) = ( )

∆ ( )
∴ =
2! ℎ
∆ ( )
; = ;
3! ℎ
∆ ( )
; =
!ℎ
Put the values of A0, A1, A2, A3 ... An, in the equation (2.2), we get:
∆ ( ) ∆ ( )
( )= ( )+ ( – ) + ( – )( – – ℎ) +⋯
ℎ 2! ℎ
∆ ( )
+( – ) … . . [ – – ( − 1)ℎ]
!ℎ
Again, put = + ℎ ⇒ = , we have:
∆ ( ) ℎ ( ℎ – ℎ)
( + ℎ )= ( )+ ℎ + ∆ ( )
ℎ 2! ℎ
ℎ( ℎ – ℎ)( ℎ – 2ℎ) … . . [ ℎ – ( − 1)ℎ]
+⋯+ ∆ ( )
!ℎ
Or;

( – 1) ( – 1)( – 2) … . . ( – + 1)
( + ℎ )= ( )+ ∆ ( )+ ∆ ( ) +⋯+ ∆ ( )
2! !

The above formula is called Newton’s forward interpolation formula.


21 of 7Page
Note:
1. Newton forward interpolation formula is used to interpolate the values of y near
the beginning of a set of tabular values.
2. ( ) may be taken as any point of the table, but the formula contains only those
values of y which come after the value chosen as ( ).

Example 2.3:
The following table gives the distance in nautical miles of the visible horizon for
the given heights in feet above the earth’s surface.

Use Newton’s forward formula to find when = 218 .

Solution:
Let us form the difference table:

Here, ℎ = 50, = 100 =


− 218 − 100
∴ = = = 2.36
ℎ 50
Now, applying Newton’s forward difference formula:

21 of 8Page
( – 1) ( – 1)( – 2)
(218) = ( )+ ∆ ( )+ ∆ ( )+ ∆ ( )
2! 3!
( – 1)( – 2)( – 3) ( – 1)( – 2)( – 3)( – 4)
+ ∆4 ( ) + ∆5 ( )
4! 5!
( – 1)( – 2)( – 3)( – 4)( – 5)
+ ∆6 ( )
6!

= 10.63 + 5.664 – 0.625872 + 0.0288864 + 0.002156 + 0.00020212776 -0.00008893621


= 16.3252453777 – 0.62596093621
= 15.69928 (Approx.) Ans.
Example 2.4:
Find the cubic polynomial which takes the following data:

Solution:
Let us first form the difference table:

Now, = + ℎ
− −0
= = =
ℎ 1
Therefore; from N.F.D. to ∆ as shown:

( – 1) ( – 1)( – 2)
( + ℎ) = ( )+ ∆ ( )+ ∆ ( )+ ∆ ( )
2! 3!

21 of 9Page
( – 1) ( – 1)( – 2)
= + (−1) + (2) + (6)
2! 3!
= 1– + – + –2 – + 2
∴ = –2 + 1 … .

4.2.3 NEWTON’S GREGORY backward interpolation formula:

Let = ( ) be a given function of x which takes the value ( ),


( + ) , ( + ). . . ( + ) for (n + 1) equally spaced values , +
, + ,... + of the independent variable x. Assume that ( ) be a
polynomial of nth degree, given by:
( )= + ( − − ) + ( − − )[ − − ( − ) ] + ⋯ . +
( − − )[ − − ( − ) ]. . . ( – – ) ……..(2.4)

Where A0, A1, A2, ... An are to be determined.


Put = + ℎ, + ( − 1)ℎ, . . . in (2.4) respectively.
Put = + ℎ, then;
( + ℎ) = A0 ...(2.5)
Put = + ( – 1)ℎ, then:
[ + ( − 1)ℎ]=A0−hA1= ( + ℎ) −hA1 (from 4.5)
∇ ( + ℎ)
∴ =

Put x = a + (n – 2)h, then
f(a+n−2h)=A0−2hA1+(−2h)(−h)A2
2! ℎ = ( + [ − 2ℎ]) − ( + ℎ) + 2 ( + ℎ) = ( + ℎ)
f(a + 2h) = A0+ A1 (2h) + A2(2h)h

∇ ( + ℎ)
∴ =
2! ℎ
∇ ( + ℎ)
; = ;
!ℎ
Substituting the values in (2.4), we get:

∇ ( + ℎ) ∇2 ( + ℎ)
( )= ( + ℎ) + ( – − ℎ) +( – − ℎ)( – – [ − 1] ℎ )
ℎ 2! ℎ2
∇ ( + ℎ)
+ ⋯+ ( – − ℎ) … . (2.6)
!ℎ
Put = + ℎ ∓ ℎ, then;
– – ℎ = ∓ ℎ; and
21 of 10Page
– – ( – 1)ℎ = ∓ ( + 1)ℎ
---
---
– – ℎ = [ + ( − 1)]ℎ
∴ Equation (4.6) becomes:
( + 1)
( + ℎ + ℎ) = ( + ℎ) + ∇ ( + ℎ) + ∇ ( + ℎ) + ⋯
2!
( + 1)( + − 1)
+ ∇ ( + ℎ)
!
The above formula is called Newton’s backward interpolation formula.
Note:
Newton backward interpolation formula is used to interpolate the values of y near
the end of a set of tabular values.

Example 2.5:
The table below gives the value of for . ≤ ≤ .
0.1 0.15 0.20 0.25 0.30

0.1003 0.1511 0.2027 0.2553 0.3093

Find (a) tan 0.50 (b) tan 0.26 (c) tan 0.40
Solution:
First of all we construct the difference table:

(a) Here, ℎ = 0.05, ( + ℎ) = 0.30, = 0.50


21 of 11Page
0.5 − 0.3
= =4
0.05
( + 1)
(0.5) = ( + ℎ) + ∇ ( + ℎ) + ∇ ( + ℎ)
2!
( + 1)( + 2) ( + 1)( + 2)( + 3)
+ ∆ ( + ℎ) + ∆ ( + ℎ)
3! 4!
4∗5 4∗5∗6
(0.5) = 0.3093 + 4 ∗ 0.054 + 0.0014 + 0.0004
2 6
4∗5∗6∗7
+ 0.0002
24
= 0.5543 Ans.

(b) Here, h = 0.05, a = 0.30, x = 0.26


0.26 − 0.3
= = −0.8
0.05
(−0.8) ∗ (0.2)
(0.26) = 0.3093 + (−0.8) ∗ 0.054 + 0.0014
2
(−0.8) ∗ (0.2) ∗ (1.2) (−0.8) ∗ (0.2) ∗ (1.2) ∗ (2.2)
+ 0.0004 + 0.0002
6 24
= 0.2662 Ans.

(c) Here, h = 0.05, a = 0.30, x = 0.40

0.4 − 0.3
= =2
0.05
2∗3 2∗3∗4
(0.4) = 0.3093 + 2 ∗ 0.054 + 0.0014 + 0.0004
2 6
2∗3∗4∗5
+ 0.0002
24
= 0.4241 Ans.

2.2.4 Central Interpolation Formula:


As earlier we study formulae for leading terms and differences. These formulae are
fundamental and are applicable to nearly all cases of interpolation, but they do not
converge as rapidly as central difference formulae.
The main advantage of central difference formulae is that:
1. They give more accurate result than other method of interpolation.
2. Converges faster than the others.
Their disadvantages lie in:
1. Complicated calculations.
2. Tedious expression, which are rather difficult to remember.
Note:
These formulae are used for interpolation near the middle of an argument values.
In this category we use the following formulae:

2.2.4.1 Gauss Forward Difference Formula:


We know Newton’s Gregory forward difference formula is given by:
21 of 12Page
( – ) ( – )( – )
( + )= ( )+ ∆ ( )+ ∆ ( )+ ∆ ( )
! !
– – –
+ ∆ ( ) ……. (2.7)
!

Substitute a = 0, h = 1 in (2.7), we get:


( – ) ( – )( – )
( )= ( )+ ∆ ( )+ ∆ ( )+ ∆ ( )
! !
( – )( – )( – )
+ ∆ ( )+⋯ ……….( . )
!

Now obtain the values of Δ2 (0),Δ3 (0),Δ4 (0) …


To get these values,
Δ3 (−1) = Δ2 (0) −Δ2 (−1)
⇒ Δ2 f (0) = Δ3 (−1)+Δ2 (−1)
Also, Δ4 (−1) = Δ3 (0) −Δ3 (−1)
⇒ Δ3 f (0) = Δ4 (−1) +Δ3 (−1)
Δ5 (−1) = Δ (0) − Δ (−1)
⇒ Δ4 f (0) = Δ5 (−1) +Δ4 (−1)
Δ6 (−1) = Δ5 (0) −Δ5 (−1)
⇒ Δ5 f (0) = Δ6 (−1) +Δ5 (−1) .... and so on.
Substituting these values in equation (2.8):

( – ) ( + ) ( – )
( )= ( )+ ∆ ( )+ ∆ (− ) + ∆ (− )
! !
( + ) ( – )( – )
+ ∆ (− )
!
( + ) ( – )( – )( – )
+ ∆ (− ) … … … … . ( . )
!

21 of 13Page
(– 2) = (– 1) – (– 2)
⇒ (– 1) = (– 2) + (– 2)
(– 2) = (– 1) − (– 2)
⇒ (– 1) = (– 2) + (– 2)
The equation (4.9) becomes:
( – ) ( +) ( – )
( )= ( )+ ∆ ( )+ ∆ (− ) + ∆ (− )
! !
( + ) ( – )( – ) ( + ) ( – )( – )
+ ∆ (− ) + ∆ (− )
! !
( + ) ( – )( – )( – )
+ ∆ (− )
!
( + ) ( – )( – )( – )
+ ∆ (− ) + ⋯
!

( – ) ( + ) ( – )
( )= ( )+ ∆ ( )+ ∆ (− ) + ∆ (− )
! !
( + ) ( – )( – )
+ ∆ (− )
!
( + )( + ) ( – )( – )
+ ∆ (− )
!
( + )( + ) ( – )( – )( – )
+ ∆ (− ) + ⋯ ………( . )
!
This formula is known as Gauss forward difference formula
This formula is applicable when u lies between .

Example 2.6:
Given that:

Find . .
Solution:

21 of 14Page
= + ℎ , = 37, = 35, ℎ = 5
37 − 35
= = 0.4
5
( – ) ( + ) ( – )
( )= ( )+ ∆ ( )+ ∆ (− ) + ∆ (− )
! !
( + ) ( – )( – )
+ ∆ (− )
!

⇒ 3.7 = 37 – 10 = 1.56819272 – 1 = 0.56819272. .

2.2.4.2 Gauss Backward Difference Formula:


This formula is also solved by using Newton’s forward difference formula.
Now, we know Newton’s formula for forward interpolation is:
( – ) ( – )( – )
( + )= ( )+ ∆ ( )+ ∆ ( )+ ∆ ( )
! !
– – –
+ ∆ ( ) + …. ….. (2.11)
!
Substitute a = 0, h = 1 in (2.11), we get:
( – ) ( – )( – )
( ) = ( )+ ∆ ( )+ ∆ ( )+ ∆ ( )
! !
( – )( – )( – )
+ ∆ ( )+⋯ ……….( . )
!

Now obtain the values of Δ2 (0),Δ3 (0),Δ4 (0) …


To get these values,
∆ (0) = ∆ (−1) + Δ (−1)
Δ (0) = Δ (−1) + Δ (−1)
Δ (0) = Δ (−1) + Δ (−1)
Δ (0) = Δ (−1) + Δ (−1).... and so on.
Substituting these values in equation (2.12):

21 of 15Page
( + ) ( + ) ( – )
( )= ( )+ ∆ (− ) + ∆ (− ) + ∆ (− )
! !
( ) – –
+ ∆ (− ) +…. …… (2.13)
!

Again; Δ (−1) = Δ (−2) + Δ (−2)


Δ (−1) = Δ (−2) + Δ (−2)
Δ (−1) = Δ (−2) + Δ (−2).... and so on.
Substituting these values in equation (2.13):

( + ) ( + ) ( – )
( )= ( )+ ∆ (− ) + ∆ (− ) + ∆ (− )
! !
( + )( + ) ( – ) ( + )( + ) ( – )( – )
+ ∆ (− ) + ∆ (− )
! !
( + )( + )( + ) ( – )( – )
+ ∆ (− ) + ⋯ ………( . )
!

This formula is known as Gauss backward difference formula


This formula is applicable when u lies between − .

Example 2.7:
Given that:

Using Gauss’s backward formula, find the value of tan 51° 42′

21 of 16Page
Solution:
Take the origin at 52° and given h = 1

= = 51° 42 − 52° = −18 = −0.3

Now using Gauss backward formula:


( + ) ( + ) ( – )
( )= ( )+ ∆ (− ) + ∆ (− ) + ∆ (− )
! !

( . )(−0.3)
(−0.3) = . + (−0.3) ∗ . + .
( . )(−0.3)(− . )
+ .
= 1.266188 (Approx.) Ans.

2.2.4.3 Stirling’s Formula:


This is another central difference formula is obtained by taken mean of
Gauss forward and Gauss backward difference formula.
Take mean of Equation (2.10) and (2.14):
∆ (0) + ∆ (−1) ( + 1) ( − 1) ∆ (−1) + ∆ (−2)
( ) = (0) + + ∆ (−1) +
2 2! 3! 2
( + 1) ( − 1) ( + 2)( + 1) ( − 1)( − 2) ∆ (−2) + ∆ (−3)
+ ∆ (−2) +
4! 5! 2

…( . )

Note: − < <

Example 2.8:
Find the value of at = 0.644 using by Stirling’s formula. The following
data given below:

21 of 17Page
Solution:
For the given data difference table is as:

. .
Here h = 0.01; = = 0.4
.

By Stirling's formula, we get,


∆ (0) + ∆ (−1) ( + 1) ( − 1) ∆ (−1) + ∆ (−2)
( ) = (0) + + ∆ (−1) +
2 2! 3! 2
( + 1) ( − 1) ( + 2)( + 1) ( − 1)( − 2) ∆ (−2) + ∆ (−3)
+ ∆ (−2) +
4! 5! 2

= 1.896481 + 0.0075862 + 0.00001512– 0.000000112 – 0.0000000112


+ 0.000000026 – 0.0000002
= 1.904081. ( .) .
21 of 18Page
2.3 Interpolation with unequal intervals:
2.3.1 LAGRANGE’S Interpolation Formula:
Let = ( ) be a function which assumes the values ( ), ( ), ( ), …,
( ) corresponding to the values x = x0, x1, x2, …, xn, where the values of x are
not equispaced. Since (n + 1) values of the ordinate are given corresponding to the
(n + 1) values of the independent variable x, we can represent the function
= ( ) be a polynomial in x of degree n.
Let the polynomial be:

---- (2.16)
Each term in equation (2.16) being a product of n factors in x of degree n, putting x
= x0 in (2.16) we get:
( )= ( − )( − )…( − )
( )
≫ =
( − )( − )…( − )
Putting = in(4.16) we get:
( )= ( − )( − )…( − )
( )
≫ =
( − )( − )…( − )
Similarly putting x = x2, x = x3 , … x = xn in (2.16) we get:
( )
≫ =
( − )( − )…( − )


( )
≫ =
( − )( − )…( − )

Substituting the values of a0, a1, …, an in (2.16) we get:

21 of 19Page
( − )( − ) … ( − ) ( − )( − ) … ( − )
= ( )= ( )+ ( )
( − )( − ) … ( − ) ( − )( − ) … ( − )
( − )( − ) … ( − )
+⋯+ ( ) … … … … (2.17)
( − )( − ) … ( − )

( )= = ( )= ℓ( )

Where;
( − 1) ( − 2) ( − −1 ) ( − +1 ) ( − )
( )= ∗ ∗ ∗ ……∗
( − 1) ( − 2) ( − −1 ) ( − +1 ) ( − )

Or;

( )= = 1, 2, … . . ,

Example 2.9:
Given the data points:

i 0 1 2
x 0 2 3
y 7 11 28

Use Lagrange’s method to determine y at x = 1.

Solution:
( − 1) ( − 2) (1 − 2) (1 − 3)
( )= = =
( 0 − 1 ) ( 0 − 2 ) (0 − 2) (0 − 3)
( − 0) ( − 2) (1 − 0) (1 − 3)
( )= = =1
( 1 − 0 ) ( 1 − 2 ) (2 − 0) (2 − 3)
( − 0) ( − 1) (1 − 0) (1 − 2)
( )= = =−
( 2 − 0 ) ( 2 − 1 ) (3 − 0) (3 − 2)
= + + =4
∴ ( )= .

21 of 20Page
Example 2.10:
Apply Lagrange’s formula to find the cubic polynomial which includes the
following values of x and y.
0 1 4 6

1 -1 1 -1

Solution:
Here x0 = 0, x1 = 1, x2 = 4, x3 = 6 and y0 = 1, y1 = – 1, y2 = 1, y3 = – 1
Putting the above values in Lagrange’s formula, we get:

21 of 21Page

You might also like