Interpolation and Approximation
Interpolation and Approximation
Reconstructing the function when it is not given explicitly and only the values of 𝑓(𝑥)
and/or its certain order derivatives at a set of points, known as nodes/tabular
points/arguments are given.
Replace the function 𝑓(𝑥) by an interpolating polynomial 𝑃(𝑥) so that many common
operations such as determination of roots, differentiation, and integration etc which are
intended for the function 𝑓(𝑥) may be performed using 𝑃 𝑥 .
Definition: A polynomial 𝑃(𝑥) is called interpolating polynomial if the values of 𝑃(𝑥) and/or its
certain order derivatives coincide with those of 𝑓(𝑥) and/or its same order derivatives at one or
more tabular points.
The reason behind choosing the polynomials ahead of any other functions is that polynomials
approximate continuous functions with any desired accuracy. That is, for any continuous
function 𝑓(𝑥) on an interval 𝑎 ≤ 𝑥 ≤ 𝑏 and error bound 𝛽 > 0 there is a polynomial 𝑝𝑛 (𝑥) (of
sufficiently large degree) such that 𝑓 𝑥 − 𝑝𝑛 𝑥 < 𝛽 for all 𝑥 ∈ 𝑎, 𝑏 . This is the famous
Weierstrass approximation theorem.
1. Lagrange’s interpolation
2. Newton’s divided difference interpolation
3. Newton’s forward and backward difference interpolation
1. Lagrange’s Interpolation
Assume that 𝑓 𝑥 is continuous on [𝑎, 𝑏] and further assume that we have 𝑛 + 1 distinct points
𝑎 ≤ 𝑥0 < 𝑥1 < 𝑥2 < ⋯ < 𝑥𝑛−1 < 𝑥𝑛 ≤ 𝑏. Let the values of the function 𝑓(𝑥) at these points are
known and are denoted by 𝑓0 = 𝑓 𝑥0 , 𝑓1 = 𝑓 𝑥1 , …, 𝑓𝑛 = 𝑓 𝑥𝑛 . We aim to find a polynomial
𝑃𝑛 𝑥 = 𝑎0 + 𝑎1 𝑥 + 𝑎2 𝑥2 + ⋯ + 𝑎𝑛 𝑥𝑛 satisfying 𝑃𝑛 𝑥𝑖 = 𝑓 𝑥𝑖 , 𝑖 = 0,1, …, 𝑛.
Linear Interpolation
Let 𝑛 = 1. Then the nodes are 𝑥0 and 𝑥1 . The Lagrange linear interpolating polynomial is given
by
𝑃1 𝑥 = 𝑎0 + 𝑎1 𝑥,
𝑓1 = 𝑎0 + 𝑎1 𝑥1 .
𝑃1 𝑥 = 𝑙0 𝑥 𝑓0 + 𝑙1 𝑥 𝑓1,
𝑥−𝑥1 𝑥−𝑥0
where 𝑙0 𝑥 = and 𝑙1 𝑥 = are called Lagrange’s fundamental polynomials. The
𝑥0−𝑥1 𝑥1 −𝑥0
properties of the Lagrange fundamental polynomials are as follows:
(i) 𝑙0 𝑥 + 𝑙1 𝑥 = 1.
(ii) 𝑙0 𝑥0 = 1, 𝑙0 𝑥1 = 0; 𝑙1 𝑥0 = 0, 𝑙1 𝑥1 = 1.
(iii) The degrees of 𝑙0 (𝑥) and 𝑙1 𝑥 are one.
1
𝐸1 𝑥, 𝑓 = 𝑥 − 𝑥0 𝑥 − 𝑥1 𝑓'' 𝜉 , 𝑥0 ≤ 𝜉 ≤ 𝑥1 .
2
The bound for the truncation error in linear interpolation is given by
2
𝑥1 − 𝑥0
𝐸1 𝑥, 𝑓 ≤ max |𝑓'' (𝑥)| .
8 𝑥0≤𝑥≤𝑥1
Example 1: Given that 𝑓 2 = 4, 𝑓 2.5 = 5.5. Find the linear interpolating polynomial using
Lagrange’s interpolation and hence find an approximate value of 𝑓 2.2 .
𝑥 − 𝑥1 𝑥 − 2.5
𝑙0 𝑥 = = = 2 2.5 − 𝑥 = 5 − 2𝑥,
𝑥0 − 𝑥1 2 − 2.5
𝑥 − 𝑥0 𝑥−2
𝑙1 𝑥 = = = 2 𝑥 − 2 = 2𝑥 − 4.
𝑥1 − 𝑥0 2.5 − 2
𝑃1 𝑥 = 𝑙0 𝑥 𝑓0 + 𝑙1 𝑥 𝑓1 = 4 5 − 2𝑥 + 5.5 2𝑥 − 4 = 3𝑥 − 2.
Quadratic Interpolation
Here 𝑛 = 2. We need to find an interpolating polynomial of the form
𝑃2 𝑥 = 𝑎0 + 𝑎1 𝑥 + 𝑎2 𝑥2
𝑎0 + 𝑎1 𝑥0 + 𝑎2 𝑥20 = 𝑓0
𝑎0 + 𝑎1 𝑥1 + 𝑎2 𝑥22 = 𝑓1
𝑎0 + 𝑎1 𝑥2 + 𝑎2𝑥22 = 𝑓2 .
𝑃2 𝑥 = 𝑙0 𝑥 𝑓0 + 𝑙1 𝑥 𝑓1 + 𝑙2 𝑥 𝑓2
where 𝑙0 𝑥 , 𝑙1 (𝑥) and 𝑙2 (𝑥) are Lagrange’s fundamental polynomial and are defined by
𝑥 − 𝑥1 (𝑥 − 𝑥2 ) 𝑥 − 𝑥0 (𝑥 − 𝑥2 ) 𝑥 − 𝑥0 (𝑥 − 𝑥1 )
𝑙0 𝑥 = , 𝑙1 𝑥 = 𝑎𝑛𝑑 𝑙2 𝑥 = .
𝑥0 − 𝑥1 (𝑥0 − 𝑥2 ) 𝑥1 − 𝑥0 (𝑥1 − 𝑥2 ) 𝑥2 − 𝑥0 (𝑥2 − 𝑥1 )
1
𝐸2 𝑥, 𝑓 = 𝑥 − 𝑥0 𝑥 − 𝑥1 𝑥 − 𝑥2 𝑓''' 𝜉 , 𝑥0 ≤ 𝜉 ≤ 𝑥2 .
3!
The bound for the quadratic Lagrange’s interpolating polynomial is
𝑀3
𝐸2 𝑥, 𝑓 ≤ max 𝑥 − 𝑥0 𝑥 − 𝑥1 𝑥 − 𝑥3 , 𝑀3 = max 𝑓''' 𝑥 .
6 0≤𝑥≤𝑥2
𝑥 𝑥0≤𝑥≤𝑥2
Example:
General Formula
The general Lagrange’s interpolating polynomial for 𝑛 + 1 nodes 𝑥0 , 𝑥1 , …, 𝑥𝑛 is given by
𝑛
𝑃𝑛 𝑥 = 𝑙𝑘 𝑥 𝑓𝑘 ,
𝑘=0
where 𝑤 𝑥 = 𝑥 − 𝑥0 𝑥 − 𝑥1 ⋯ 𝑥 − 𝑥𝑛 .
𝑥 − 1 (𝑥 − 3) 1
𝑙0 𝑥 = = 𝑥 − 1 (𝑥 − 3)
0 − 1 (0 − 3) 3
𝑥 − 0 (𝑥 − 3) 1 𝑥 − 0 (𝑥 − 1) 1
𝑙1 𝑥 = =− 𝑥 𝑥 − 3 , 𝑙2 𝑥 = = 𝑥 𝑥−1 .
1 − 0 (1 − 3) 2 3 − 0 (3 − 1) 6
1 3 55
𝑃2 𝑥 = 𝑙0 𝑥 𝑓0 + 𝑙1 𝑥 𝑓1 + 𝑙2 𝑥 𝑓2 = 𝑥−1 𝑥−3 − 𝑥 𝑥−3 + 𝑥 𝑥−1
3 2 6
= 8𝑥2 − 6𝑥 + 1
1
𝐸2 𝑥 = 𝑥 𝑥 − 1 𝑥 − 3 𝑓''' 𝜉 , 0 ≤ 𝜉 ≤ 3.
6
𝑓 𝑥0 = 𝑓 𝑥0 = 𝑓0 .
𝑓1 − 𝑓0
𝑓 𝑥0, 𝑥1 = .
𝑥1 − 𝑥0
Nodes Functional Values 1st order Div. Diff. 2nd order Div. Diff.
𝑥0 𝑓[𝑥0 ]
𝑥1 𝑓[𝑥1 ] 𝑓[𝑥0 , 𝑥1 ]
𝑥2 𝑓[𝑥2 ] 𝑓[𝑥1 , 𝑥2 ] 𝑓[𝑥0 , 𝑥1 , 𝑥2 ]
𝑃𝑛 𝑥 = 𝑓 𝑥0 + 𝑥 − 𝑥0 𝑓 𝑥0 , 𝑥1 + 𝑥 − 𝑥0 𝑥 − 𝑥1 𝑓 𝑥0 , 𝑥1 , 𝑥2 + ⋯
+ 𝑥 − 𝑥0 ⋯ 𝑥 − 𝑥𝑛−1 𝑓 𝑥0 , 𝑥1 , ⋯, 𝑥𝑛 .
Hence find the interpolating polynomial and an approximation to the value 𝑓(7).
Repeated application of the difference operators lead to the following higher order differences.
𝑥 − 𝑥0 𝑥 − 𝑥0 (𝑥 − 𝑥1 ) 2 𝑥 − 𝑥0 ⋯ 𝑥 − 𝑥𝑛−1 𝑛
𝑃𝑛 𝑥 = 𝑓0 + ∆𝑓0 + ∆ 𝑓0 + ⋯ + ∆ 𝑓0 .
ℎ 2! ℎ2 𝑛! ℎ𝑛
Putting 𝑢 = (𝑥 − 𝑥0 )/ℎ, the interpolating polynomial using forward difference operator becomes
𝑛
𝑢 𝑖
𝑃𝑛 𝑥 = ∆ 𝑓0 ,
𝑖
𝑖=0