0% found this document useful (0 votes)
472 views15 pages

Module 4

This document discusses various interpolation methods including Newton's divided difference interpolation, Lagrange interpolation, and Gregory-Newton forward and backward interpolation. Newton's divided difference interpolation fits a polynomial through data points using divided differences calculated in a table. Lagrange interpolation expresses the interpolating polynomial as a weighted sum of values using Lagrangian basis polynomials. Gregory-Newton methods use forward or backward difference tables to calculate coefficients for an interpolating polynomial. Sample problems demonstrate applying these interpolation methods.

Uploaded by

Kim Daniel Estoy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
472 views15 pages

Module 4

This document discusses various interpolation methods including Newton's divided difference interpolation, Lagrange interpolation, and Gregory-Newton forward and backward interpolation. Newton's divided difference interpolation fits a polynomial through data points using divided differences calculated in a table. Lagrange interpolation expresses the interpolating polynomial as a weighted sum of values using Lagrangian basis polynomials. Gregory-Newton methods use forward or backward difference tables to calculate coefficients for an interpolating polynomial. Sample problems demonstrate applying these interpolation methods.

Uploaded by

Kim Daniel Estoy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 15

Module 5

Finite Differences and


Interpolation

Engr. Gerard Ang


School of EECE
Interpolation
Interpolation – it is the technique of estimating the
value of a function for any intermediate value of the
independent variable. The process of computing or
finding the value of a function for any value of the
independent variable outside the given range is called
extrapolation.

The following interpolation formulas are used:


1. Newton’s divided difference interpolation
2. Lagrange interpolation
3. Gregory-Newton forward interpolation
4. Gregory-Newton backward interpolation
Newton's Divided Difference
Interpolation
The simplest form of interpolation is to connect two data points with a straight line. The
coefficients of the polynomial are calculated using divided differences hence Newton’s
polynomial is sometimes called Newton's divided differences interpolation
polynomial.

For any given set of data points, there is only one polynomial (of least possible degree)
that passes through all of them
𝑓 𝑥2 −𝑓 𝑥1
𝑓1 𝑥 = 𝑓 𝑥1 + (𝑥 − 𝑥1 )
𝑥2 −𝑥1
which is the Newton linear-interpolating formula. The notation f1(x) denotes that this is a
first-order interpolating polynomial. The term
𝑓 𝑥2 − 𝑓 𝑥1 /(𝑥2 − 𝑥1 )

Is a finite divided difference approximation of the first derivative.


Newton's Divided Difference
Interpolation
The preceding analysis can be generalized to fit an (n –1)th-order polynomial to n
data points. The (n – 1)th-order polynomial is
𝑓𝑛−1 𝑥 = 𝑏0 + 𝑏1 𝑥 − 𝑥0 + ⋯ + 𝑏𝑛 (𝑥 − 𝑥0 )(𝑥 − 𝑥1 ) ⋯ (𝑥 − 𝑥𝑛−1 )
Where:
𝑏0 = 𝑓(𝑥0 ) 𝑏2 = 𝑓[𝑥2 , 𝑥1 , 𝑥0 ]
𝑏1 = 𝑓[𝑥1 , 𝑥0 ] 𝑏𝑛 = 𝑓[𝑥𝑛 , 𝑥𝑛−1 , ⋯ 𝑥1 , 𝑥0 ]
where the bracketed function evaluations are finite divided differences.
For the first finite difference
𝑓 𝑥𝑖 −𝑓(𝑥𝑗 ) 𝑓 𝑥1 −𝑓(𝑥0 )
𝑓 𝑥𝑖 , 𝑥𝑗 = 𝑥𝑖 −𝑥𝑗
𝑓 𝑥1 , 𝑥0 = 𝑥1 −𝑥0

For the second finite difference


𝑓[𝑥𝑖 ,𝑥𝑗 ]−𝑓[𝑥𝑗 ,𝑥𝑘 ] 𝑓[𝑥2 ,𝑥1 ]−𝑓[𝑥1 ,𝑥0 ]
𝑓 𝑥𝑖 , 𝑥𝑗 , 𝑥𝑘 = 𝑥𝑖 −𝑥𝑘
𝑓 𝑥2 , 𝑥1 , 𝑥0 = 𝑥2 −𝑥0
Similarly, for the nth finite difference,
𝑓 𝑥𝑛 ,𝑥𝑛−1 ,⋯,𝑥2 −𝑓 𝑥𝑛−1 ,𝑥𝑛−2 ,𝑥1
𝑓 𝑥𝑛 , 𝑥𝑛−1 , ⋯ , 𝑥2 , 𝑥1 = 𝑥𝑛 −𝑥1
Newton's Divided Difference
Interpolation
The divided differences can be written in a tabular form as

First Divided Second Divided Third Divided


xi f(xi)
Difference Difference Difference
x0 f(x0) f[x1, x0] f[x2, x1, x0] f[x3, x2, x1, x0]

x1 f(x1) f[x2, x1] f[x3, x2, x1]

x2 f(x2) f[x3, x2]

x3 f(x3)
Sample Problems on Newton's
Divided Difference Interpolation
1. Find f(x) as a polynomial in x for the following data by Newton’s divided
difference formula.

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

2. Find f(x) as a polynomial in x for the following data by Newton’s divided


difference formula and interpolate at x = 0.5

x -2 -1 0 1 3 4
f(x) 9 16 17 18 44 81

3. Estimate the natural logarithm of 2 using Newton’s interpolation by


interpolating using the data points 1, 4, 6 and 5.
Excel Output for Newton’s Interpolating Polynomial

Estimate the natural logarithm of 2 using Newton’s interpolation by


interpolating using the data points 1, 4, 6 and 5.

n xi f(xi) 1st 2nd 3rd b1 = 0.000


1 1 0.0000 0.4621 -0.0519 0.0079 b2 = 0.4621
b3 = -0.0519
2 4 1.3863 0.2027 -0.0204
b4 = 0.0079
3 6 1.7918 0.1823
4 5 1.6094

At x = 2;
f3(x)= b1 + b2(x – x1) + + b2(x – x1)(x – x2) + b3(x – x1)(x – x2) +
b4(x – x1)(x – x2)(x – x3)
Lagrange Interpolating Polynomial
The Lagrange interpolating polynomial is simply a reformulation of the Newton
interpolating polynomial. It can be represented concisely as
𝑓𝑛−1 𝑥 = σ𝑛𝑖=1 𝐿𝑖 𝑥 𝑓(𝑥𝑖 )
𝑥−𝑥𝑗
where: 𝐿𝑖 (𝑥) = ς𝑛𝑗=0 𝑥 −𝑥 where:  designates the “product of.”
𝑖 𝑗
𝑗≠1
For a linear version (n = 1)
𝑥−𝑥1 𝑥−𝑥0
𝑓1 𝑥 = 𝑥0 −𝑥1
𝑓(𝑥0 ) + 𝑥1 −𝑥0
𝑓(𝑥1 )
𝑥−𝑥1 𝑥−𝑥0
= 𝐿0 and 𝑥 = 𝐿1
𝑥0 −𝑥1 1 −𝑥0

where L’s are the weighing coefficients.


This equation is referred to as the linear Lagrange interpolating polynomial.

For a second-order Lagrange interpolating polynomial,


𝑥−𝑥1 𝑥−𝑥2 𝑥−𝑥0 𝑥−𝑥2 𝑥−𝑥0 𝑥−𝑥1
𝑓2 𝑥 = 𝑓 𝑥0 + 𝑓 𝑥1 + 𝑓 𝑥2
𝑥0 −𝑥1 𝑥0 −𝑥2 𝑥1 −𝑥0 𝑥1 −𝑥2 𝑥2 −𝑥0 𝑥2 −𝑥1
Sample Problems on
Lagrange Interpolating Polynomial

1. Estimate the natural logarithm of 2 using Lagrange’s


interpolation by interpolating using the data points 1, 4, 6 and 5.

2. Construct the Lagrange interpolation polynomial for the data and


interpolate at x = 5.

x -1 1 4 7
f(x) -2 0 63 342
Gregory−Newton Forward
Interpolation Method
This method uses the formula
Δ𝑓 Δ2 𝑓0
𝑓 𝑥 = 𝑓(𝑥0 ) + 𝑥 − 𝑥0 1!ℎ0 + 𝑥 − 𝑥0 𝑥 − 𝑥1 2!ℎ2
+⋯
𝑛
Δ 𝑓0
+(𝑥 − 𝑥0 )(𝑥 − 𝑥1 ) ⋯ (𝑥 − 𝑥𝑛 )
𝑛! ℎ𝑛

This relation is called the Newton’s forward difference interpolation formula.

where:
Δ = is the forward difference operator
f0 = is the first value of the data set
Δf0 = is the first forward divided difference
Δ2f0 = is the second forward divided difference
Δ3f0 = is the third forward divided difference
Δnf0 = is the nth forward divided difference
Gregory−Newton Forward
Interpolation Method
The forward differences can be written in a tabular form as

xi f(xi) Δf Δ 2f Δ 3f

x0 f(x0) Δf0 = f1 – f0 Δ2f0 = Δf1 – Δf0 Δ3f0 = Δ2f1 – Δ2f0

x1 f(x1) Δf1 = f2 – f1 Δ2f1 = Δf2 – Δf1

x2 f(x2) Δf2 = f3 – f2

x3 f(x3)
Sample Problem in Gregory−Newton
Forward Interpolation Method

For the data


x -2 -1 0 1 2 3
f(x) 15 5 1 3 11 25

construct the forward difference table and find f(0.5).


Gregory−Newton Backward
Interpolation Method
This method uses the formula
𝛻𝑓(𝑥 ) 𝛻2 𝑓(𝑥𝑛 )
𝑓 𝑥 = 𝑓(𝑥𝑛 ) + 𝑥 − 𝑥𝑛 1!ℎ𝑛 + 𝑥 − 𝑥𝑛 𝑥 − 𝑥𝑛−1 2!ℎ2 + ⋯
𝛻 𝑛 𝑓(𝑥𝑛 )
+(𝑥 − 𝑥𝑛 )(𝑥 − 𝑥𝑛−1 ) ⋯ (𝑥 − 𝑥1 )
𝑛! ℎ𝑛

This relation is called the Newton’s backward difference interpolation formula.

where:
𝛻 = is the backward difference operator
f(xn) = is the last value of the data set
𝛻f(xn) = is the first backward divided difference
𝛻2f(xn) = is the second backward divided difference
𝛻3f(xn) = is the third backward divided difference
𝛻nf(xn) = is the nth backward divided difference
Gregory−Newton Backward
Interpolation Method
The backward differences can be written in a tabular form as

xi f(xi) 𝛻f 𝛻 2f 𝛻 3f

x0 f(x0)

x1 f(x1) 𝛻f1 = f1 – f0

x2 f(x2) 𝛻f2 = f2 – f1 𝛻2f2 = 𝛻f2 – 𝛻f1

x3 f(x3) 𝛻f3 = f3 – f2 𝛻2f3 = 𝛻f3 – 𝛻f2 𝛻3f3 = Δ2f3 – Δ2f2


Sample Problem in Gregory−Newton
Backward Interpolation Method
For the following data, calculate the differences and obtain the
Newton’s forward and backward difference interpolation polynomials.
Are these polynomials different? Also, interpolate at x = 0.25 and x =
0.35.

x 0.1 0.2 0.3 0.4 0.5


f(x) 1.40 1.56 1.76 2.00 2.28

You might also like