Adv. Engg. Mathematics
MTH-812 Divided Differences Interpolations
Dr. Yasir Ali (yali@ceme.nust.edu.pk)
DBS&H, CEME-NUST
December 4, 2017
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Interpolation Problem
Given 1 The (n + 1) nodes: x0, x1, ..., xn
2 The functional values f0, f1, ..., fn at these nodes
3 An Intermediate (nontabulated) point: xI
Predict fI : the value at x = xI.
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Suppose that Pn(x) is the nth Lagrange polynomial that agrees with
the function f at the distinct numbers x0, x1, ..., xn.
P(x) = Ln,0(x)f(x0) + Ln,1(x)f(x1) + · · · +, Ln,n(x)f(xn)
=
n
k=0
f(xk)Ln,k(x), where Ln,k(x) =
n
i=0
i=k
x − xi
xk − xi
,
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Suppose that Pn(x) is the nth Lagrange polynomial that agrees with
the function f at the distinct numbers x0, x1, ..., xn.
P(x) = Ln,0(x)f(x0) + Ln,1(x)f(x1) + · · · +, Ln,n(x)f(xn)
=
n
k=0
f(xk)Ln,k(x), where Ln,k(x) =
n
i=0
i=k
x − xi
xk − xi
,
Although this polynomial is unique, there are alternate algebraic
representations that are useful in certain situations. The divided
differences of f with respect to x0, x1, ..., xn are used to express Pn(x)
in the form
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Suppose that Pn(x) is the nth Lagrange polynomial that agrees with
the function f at the distinct numbers x0, x1, ..., xn.
P(x) = Ln,0(x)f(x0) + Ln,1(x)f(x1) + · · · +, Ln,n(x)f(xn)
=
n
k=0
f(xk)Ln,k(x), where Ln,k(x) =
n
i=0
i=k
x − xi
xk − xi
,
Although this polynomial is unique, there are alternate algebraic
representations that are useful in certain situations. The divided
differences of f with respect to x0, x1, ..., xn are used to express Pn(x)
in the form
Pn(x) = a0+a1(x−x0)+a2(x−x0)(x−x1)+ · · ·+an(x−x0) · · · (x−xn−1)
(1)
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Suppose that Pn(x) is the nth Lagrange polynomial that agrees with
the function f at the distinct numbers x0, x1, ..., xn.
P(x) = Ln,0(x)f(x0) + Ln,1(x)f(x1) + · · · +, Ln,n(x)f(xn)
=
n
k=0
f(xk)Ln,k(x), where Ln,k(x) =
n
i=0
i=k
x − xi
xk − xi
,
Although this polynomial is unique, there are alternate algebraic
representations that are useful in certain situations. The divided
differences of f with respect to x0, x1, ..., xn are used to express Pn(x)
in the form
Pn(x) = a0+a1(x−x0)+a2(x−x0)(x−x1)+ · · ·+an(x−x0) · · · (x−xn−1)
(1)
for appropriate constants
a0, a1, ..., an
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
For
Pn(x) = a0+a1(x−x0)+a2(x−x0)(x−x1)+ · · ·+an(x−x0) · · · (x−xn−1)
Pn(x) at x0 leaves
a0 = Pn(x0) = f0 (2)
Pn(x) at x1 leaves
Pn(x1) = a0 + a1(x1 − x0) we know
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
For
Pn(x) = a0+a1(x−x0)+a2(x−x0)(x−x1)+ · · ·+an(x−x0) · · · (x−xn−1)
Pn(x) at x0 leaves
a0 = Pn(x0) = f0 (2)
Pn(x) at x1 leaves
Pn(x1) = a0 + a1(x1 − x0) we know Pn(x1) = f1
a1 =
f1 − a0
x1 − x0
using (2), we get
a1 =
f1 − f0
x1 − x0
(3)
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Pn(x) at x2 leaves
Pn(x2) = a0 + a1(x2 − x0) + a2(x2 − x0)(x2 − x1)
we know Pn(x2) = f2
a2 =
f2 − a0 − a1(x2 − x0)
(x2 − x0)(x2 − x1)
using (2) and (3), we get
a2 =
f2 − f0 − f1−f0
x1−x0
(x2 − x0)
(x2 − x0)(x2 − x1)
After simplification we get
a2 =
f2−f1
x2−x1
− f1−f0
x1−x0
x2 − x0
(4)
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Comparing a0, a1 and a2 can we get some pattern?
a0 = f0
a1 =
f1 − f0
x1 − x0
a2 =
f2−f1
x2−x1
− f1−f0
x1−x0
x2 − x0
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Comparing a0, a1 and a2 can we get some pattern?
a0
depends on x0
= f0
a1
depends on x0 and x1
=
f1 − f0
x1 − x0
a2
depends on x0 x1 and x2
=
f2−f1
x2−x1
− f1−f0
x1−x0
x2 − x0
If we denote a0 = f0 as
f[x0]. Then its easy to write
a1 as
a1 =
f[x1] − f[x0]
x1 − x0
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Comparing a0, a1 and a2 can we get some pattern?
a0
depends on x0
= f0
a1
depends on x0 and x1
=
f1 − f0
x1 − x0
a2
depends on x0 x1 and x2
=
f2−f1
x2−x1
− f1−f0
x1−x0
x2 − x0
If we denote a0 = f0 as
f[x0]. Then its easy to write
a1 as
a1 =
f[x1] − f[x0]
x1 − x0
If we denote a1 = f[x0, x1]. Then
a2 =
f[x2, x1] − f[x1, x0]
x2 − x0
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
By looking at the pattern of a1 and a2 is it possible to write a3?
a1
f[x1,x0]
=
f[x1] − f[x0]
x1 − x0
a2
f[x2,x1,x0]
=
f[x2, x1] − f[x1, x0]
x2 − x0
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
By looking at the pattern of a1 and a2 is it possible to write a3?
a1
f[x1,x0]
=
f[x1] − f[x0]
x1 − x0
a2
f[x2,x1,x0]
=
f[x2, x1] − f[x1, x0]
x2 − x0
a3
f[x3,x2,x1,x0]
=
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
By looking at the pattern of a1 and a2 is it possible to write a3?
a1
f[x1,x0]
=
f[x1] − f[x0]
x1 − x0
a2
f[x2,x1,x0]
=
f[x2, x1] − f[x1, x0]
x2 − x0
a3
f[x3,x2,x1,x0]
=
f[
First three
x3, x2, x1] − f[
Last three
x2, x1, x0]
x3 − x0
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
By looking at the pattern of a1 and a2 is it possible to write a3?
a1
f[x1,x0]
=
f[x1] − f[x0]
x1 − x0
a2
f[x2,x1,x0]
=
f[x2, x1] − f[x1, x0]
x2 − x0
a3
f[x3,x2,x1,x0]
=
f[
First three
x3, x2, x1] − f[
Last three
x2, x1, x0]
x3 − x0
ak
f[x0,x1,··· ,xk]
=
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
By looking at the pattern of a1 and a2 is it possible to write a3?
a1
f[x1,x0]
=
f[x1] − f[x0]
x1 − x0
a2
f[x2,x1,x0]
=
f[x2, x1] − f[x1, x0]
x2 − x0
a3
f[x3,x2,x1,x0]
=
f[
First three
x3, x2, x1] − f[
Last three
x2, x1, x0]
x3 − x0
ak
f[x0,x1,··· ,xk]
=
f[
First k−1
... ] − f[
Last k−1
... ]
xk − x0
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Newton’s Divided Difference
Hence, the interpolating polynomial (1) may be expressed as
Pn(x) = f[x0] + f[x1, x0](x − x0) + a2(x − x0)(x − x1)+
· · · + an(x − x0)(x − x1) · · · (x − xn),
where
ak = f[xk, xk−1, · · · , x1, x0] for k = 0, 1, · · · , n.
f[xi] = f(xi) zeroth divided difference
f[xi+1, xi] =
f[xi+1] − f[xi]
xi+1 − xi
1st divided difference
f[xi+2, xi+1, xi] =
f[xi+2, xi+1] − f[xi+1, xi]
xi+2 − xi
2nd divided difference
f[x0, x1, · · · , xk] =
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Newton’s Divided Difference
Hence, the interpolating polynomial (1) may be expressed as
Pn(x) = f[x0] + f[x1, x0](x − x0) + a2(x − x0)(x − x1)+
· · · + an(x − x0)(x − x1) · · · (x − xn),
where
ak = f[xk, xk−1, · · · , x1, x0] for k = 0, 1, · · · , n.
f[xi] = f(xi) zeroth divided difference
f[xi+1, xi] =
f[xi+1] − f[xi]
xi+1 − xi
1st divided difference
f[xi+2, xi+1, xi] =
f[xi+2, xi+1] − f[xi+1, xi]
xi+2 − xi
2nd divided difference
f[x0, x1, · · · , xk] =
f[xk, xk−1 · · · , x1] − f[xk−1, xk−2, · · · , x0]
xk − x0
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Complete the Divided Difference table for the following data
x 1.0 1.3 1.6 1.9 2.2
f(x) 0.7651 0.6201 0.4554 0.2818 0.1103
i xi f[xi] f[xi, xi−1] f[xi, xi−1, xi−2] f[xi, xi−1, xi−2, xi−3]
0 1.0 0.7651
♥
1 1.3 0.6201
2 1.6 0.4554
3 1.9 0.2818
4 2.2 0.1103
♥
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Complete the Divided Difference table for the following data
x 1.0 1.3 1.6 1.9 2.2
f(x) 0.7651 0.6201 0.4554 0.2818 0.1103
i xi f[xi] f[xi, xi−1] f[xi, xi−1, xi−2] f[xi, xi−1, xi−2, xi−3]
0 1.0 0.7651
♥
1 1.3 0.6201
2 1.6 0.4554
3 1.9 0.2818
4 2.2 0.1103
♥ The First Divided Difference involving x0 and x1 is
f[x0, x1] =
f[x1] − f[x0]
x1 − x0
=
0.6201 − 0.7651
1.3 − 1.0
= −0.4833.
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Complete the Divided Difference table for the following data
x 1.0 1.3 1.6 1.9 2.2
f(x) 0.7651 0.6201 0.4554 0.2818 0.1103
i xi f[xi] f[xi, xi−1] f[xi, xi−1, xi−2] f[xi, xi−1, xi−2, xi−3]
0 1.0 0.7651
♥
1 1.3 0.6201
2 1.6 0.4554
3 1.9 0.2818
4 2.2 0.1103
♥ The First Divided Difference involving x0 and x1 is
f[x0, x1] =
f[x1] − f[x0]
x1 − x0
=
0.6201 − 0.7651
1.3 − 1.0
= −0.4833.
Remaining First Divided Differences are as follows
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Complete the Divided Difference table for the following data
x 1.0 1.3 1.6 1.9 2.2
f(x) 0.7651 0.6201 0.4554 0.2818 0.1103
i xi f[xi] f[xi, xi−1] f[xi, xi−1, xi−2] f[xi, xi−1, xi−2, xi−3]
0 1.0 0.7651
-0.4833
1 1.3 0.6201 ♠
-0.549
2 1.6 0.4554
-0.5787
3 1.9 0.2818
-0.5717
4 2.2 0.1103
♠
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Complete the Divided Difference table for the following data
x 1.0 1.3 1.6 1.9 2.2
f(x) 0.7651 0.6201 0.4554 0.2818 0.1103
i xi f[xi] f[xi, xi−1] f[xi, xi−1, xi−2] f[xi, xi−1, xi−2, xi−3]
0 1.0 0.7651
-0.4833
1 1.3 0.6201 ♠
-0.549
2 1.6 0.4554
-0.5787
3 1.9 0.2818
-0.5717
4 2.2 0.1103
♠The Second Divided Difference involving x0, x1 and x2 is
f[x2, x1, x0] =
f[x2, x1] − f[x1, x0]
x2 − x0
=
−0.549 − (−0.4833)
1.6 − 1.0
= −0.1094
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Complete the Divided Difference table for the following data
x 1.0 1.3 1.6 1.9 2.2
f(x) 0.7651 0.6201 0.4554 0.2818 0.1103
i xi f[xi] f[xi, xi−1] f[xi, xi−1, xi−2] f[xi, xi−1, xi−2, xi−3]
0 1.0 0.7651
-0.4833
1 1.3 0.6201 ♠
-0.549
2 1.6 0.4554
-0.5787
3 1.9 0.2818
-0.5717
4 2.2 0.1103
♠The Second Divided Difference involving x0, x1 and x2 is
f[x2, x1, x0] =
f[x2, x1] − f[x1, x0]
x2 − x0
=
−0.549 − (−0.4833)
1.6 − 1.0
= −0.1094
Remaining Second Divided Difference are as follows
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Complete the Divided Difference table for the following data
x 1.0 1.3 1.6 1.9 2.2
f(x) 0.7651 0.6201 0.4554 0.2818 0.1103
i xi f[xi] f[xi, xi−1] f[xi, xi−1, xi−2] f[xi, xi−1, xi−2, xi−3]
0 1.0 0.7651
-0.4833
1 1.3 0.6201 -0.1094
-0.549 ♣
2 1.6 0.4554 -0.0494
-0.5787
3 1.9 0.2818 0.0117
-0.5717
4 2.2 0.1103
♣
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Complete the Divided Difference table for the following data
x 1.0 1.3 1.6 1.9 2.2
f(x) 0.7651 0.6201 0.4554 0.2818 0.1103
i xi f[xi] f[xi, xi−1] f[xi, xi−1, xi−2] f[xi, xi−1, xi−2, xi−3]
0 1.0 0.7651
-0.4833
1 1.3 0.6201 -0.1094
-0.549 ♣
2 1.6 0.4554 -0.0494
-0.5787
3 1.9 0.2818 0.0117
-0.5717
4 2.2 0.1103
♣The Third Divided Difference f[x3, x2, x1, x0]
=
f[x3, x2, x1] − f[x2, x1, x0]
x3 − x0
=
−0.1094 − (−0.494)
1.9 − 1.0
= −0.0667
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Complete the Divided Difference table for the following data
x 1.0 1.3 1.6 1.9 2.2
f(x) 0.7651 0.6201 0.4554 0.2818 0.1103
i xi f[xi] f[xi, xi−1] f[xi, xi−1, xi−2] f[xi, xi−1, xi−2, xi−3]
0 1.0 0.7651
-0.4833
1 1.3 0.6201 -0.1094
-0.549 ♣
2 1.6 0.4554 -0.0494
-0.5787
3 1.9 0.2818 0.0117
-0.5717
4 2.2 0.1103
♣The Third Divided Difference f[x3, x2, x1, x0]
=
f[x3, x2, x1] − f[x2, x1, x0]
x3 − x0
=
−0.1094 − (−0.494)
1.9 − 1.0
= −0.0667
Remaining Third Divided Differences are as follows
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Complete the Divided Difference table for the following data
x 1.0 1.3 1.6 1.9 2.2
f(x) 0.7651 0.6201 0.4554 0.2818 0.1103
i xi f[xi] f[xi, xi−1] f[xi, xi−1, xi−2] f[xi, xi−1, xi−2, xi−3]
0 1.0 0.7651
-0.4833
1 1.3 0.6201 -0.1094
-0.549 -0.0667
2 1.6 0.4554 -0.0494
-0.5787 0.0679
3 1.9 0.2818 0.0117
-0.5717
4 2.2 0.1103
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Complete the Divided Difference table for the following data
x 1.0 1.3 1.6 1.9 2.2
f(x) 0.7651 0.6201 0.4554 0.2818 0.1103
i xi f[xi] f[xi, xi−1] f[xi, xi−1, xi−2] f[xi, xi−1, xi−2, xi−3]
0 1.0 0.7651
-0.4833
1 1.3 0.6201 -0.1094
-0.549 -0.0667
2 1.6 0.4554 -0.0494
-0.5787 0.0679
3 1.9 0.2818 0.0117
-0.5717
4 2.2 0.1103
The Fourth Divided Difference f[x4, x3, x2, x1, x0]
=
f[x4, x3, x2, x1] − f[x3, x2, x1, x0]
x3 − x0
=
−0.0679 − (−0.0667)
2.2 − 1.0
= −0.001
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Complete the Divided Difference table for the following data
x 1.0 1.3 1.6 1.9 2.2
f(x) 0.7651 0.6201 0.4554 0.2818 0.1103
i xi f[xi] f[xi, xi−1] f[xi, xi−1, xi−2] f[xi, xi−1, xi−2, xi−3]
0 1.0 0.7651
-0.4833
1 1.3 0.6201 -0.1094
-0.549 -0.0667
2 1.6 0.4554 -0.0494
-0.5787 0.0679
3 1.9 0.2818 0.0117
-0.5717
4 2.2 0.1103
The Fourth Divided Difference f[x4, x3, x2, x1, x0]
=
f[x4, x3, x2, x1] − f[x3, x2, x1, x0]
x3 − x0
=
−0.0679 − (−0.0667)
2.2 − 1.0
= −0.001
This would be last divided difference in this case.
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
The coefficients of the Newton forward divided-difference form of the
interpolating polynomial are along the diagonal in the table. This
polynomial is
P4(x) = 0.7651 − 0.4833(x − 1) − 1094(x − 1)(x − 1.3)+
−0667(x − 1)(x − 1.3)(x − 1.6) − 0.001(x − 1)(x − 1.3)(x − 1.6)(x − 1.9)
i xi f[xi] f[xi, xi−1] f[xi, xi−1, xi−2] f[xi, xi−1, xi−2, xi−3]
0 1.0 0.7651
-0.4833
1 1.3 0.6201 -0.1094
-0.549 -0.0667
2 1.6 0.4554 -0.0494
-0.5787 0.0679
3 1.9 0.2818 0.0117
-0.5717
4 2.2 0.1103
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
The coefficients of the Newton forward divided-difference form of the
interpolating polynomial are along the diagonal in the table. This
polynomial is
P4(x) = 0.7651 − 0.4833(x − 1) − 1094(x − 1)(x − 1.3)+
−0667(x − 1)(x − 1.3)(x − 1.6) − 0.001(x − 1)(x − 1.3)(x − 1.6)(x − 1.9)
i xi f[xi] f[xi, xi−1] f[xi, xi−1, xi−2] f[xi, xi−1, xi−2, xi−3]
0 1.0 0.7651
-0.4833
1 1.3 0.6201 -0.1094
-0.549 -0.0667
2 1.6 0.4554 -0.0494
-0.5787 0.0679
3 1.9 0.2818 0.0117
-0.5717
4 2.2 0.1103
f[x4, x3, x2, x1, x0] = −0.001
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Newton’s divided-difference formula can be expressed in a
simplified form when the nodes are arranged consecutively
with equal spacing. In this case, we introduce the notation
xi+1 − xi = h for each i = 0, 1, · · · , n − 1
Let x = x0 + sh, s ∈ R, then we can write
x − xi = (x0 + sh) − (x0 + ih)
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Newton’s divided-difference formula can be expressed in a
simplified form when the nodes are arranged consecutively
with equal spacing. In this case, we introduce the notation
xi+1 − xi = h for each i = 0, 1, · · · , n − 1
Let x = x0 + sh, s ∈ R, then we can write
x − xi = (x0 + sh) − (x0 + ih) ⇒ x − xi = (s − i)h
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Using x − xi = (s − i)h in
Pn(x) = f[x0] + f[x1, x0](x − x0) + a2(x − x0)(x − x1)+
· · · + an(x − x0)(x − x1) · · · (x − xn),
where
ak = f[xk, xk−1, · · · , x1, x0] for k = 0, 1, · · · , n.
We obtain
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Using x − xi = (s − i)h in
Pn(x) = f[x0] + f[x1, x0](x − x0) + a2(x − x0)(x − x1)+
· · · + an(x − x0)(x − x1) · · · (x − xn),
where
ak = f[xk, xk−1, · · · , x1, x0] for k = 0, 1, · · · , n.
We obtain
Pn(x) = Pn(x0 + sh) = f[x0] + shf[x1, x0] + s(s − 1)h2
f[x2, x1, x0]+
s(s − 1)(s − 2)h3
f[x3, x2, x1, x0] + · · · +
+s(s − 1)(s − 2) · · · (s − n + 1)hn
f[xn, xn−1, · · · , x0]
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Using x − xi = (s − i)h in
Pn(x) = f[x0] + f[x1, x0](x − x0) + a2(x − x0)(x − x1)+
· · · + an(x − x0)(x − x1) · · · (x − xn),
where
ak = f[xk, xk−1, · · · , x1, x0] for k = 0, 1, · · · , n.
We obtain
Pn(x) = Pn(x0 + sh) = f[x0] + shf[x1, x0] + s(s − 1)h2
f[x2, x1, x0]+
s(s − 1)(s − 2)h3
f[x3, x2, x1, x0] + · · · +
+s(s − 1)(s − 2) · · · (s − n + 1)hn
f[xn, xn−1, · · · , x0]
Note that
x − x0 = sh
x − x1 = (s − 1)h & x − x0 = sh ⇒
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Using x − xi = (s − i)h in
Pn(x) = f[x0] + f[x1, x0](x − x0) + a2(x − x0)(x − x1)+
· · · + an(x − x0)(x − x1) · · · (x − xn),
where
ak = f[xk, xk−1, · · · , x1, x0] for k = 0, 1, · · · , n.
We obtain
Pn(x) = Pn(x0 + sh) = f[x0] + shf[x1, x0] + s(s − 1)h2
f[x2, x1, x0]+
s(s − 1)(s − 2)h3
f[x3, x2, x1, x0] + · · · +
+s(s − 1)(s − 2) · · · (s − n + 1)hn
f[xn, xn−1, · · · , x0]
Note that
x − x0 = sh
x − x1 = (s − 1)h & x − x0 = sh ⇒ (x − x1)(x − x0) = s(s − 1)h2
similarly (x − x0)(x − x1)(x − x2) = s(s − 1)(s − 2)h3
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Equi-spaced Divided Difference
Pn(x0 + sh) = f[x0] +
n
k=1
s(s − 1) · · · (s − k + 1)hk
f[xk, xk−1, · · · , x0]
Using binomial-coefficient notation,
s
k
=
s(s − 1) · · · (s − k + 1)
k!
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Equi-spaced Divided Difference
Pn(x0 + sh) = f[x0] +
n
k=1
s(s − 1) · · · (s − k + 1)hk
f[xk, xk−1, · · · , x0]
Using binomial-coefficient notation,
s
k
=
s(s − 1) · · · (s − k + 1)
k!
⇒ s(s−1) · · · (s−k +1) = k!
s
k
.
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Equi-spaced Divided Difference
Pn(x0 + sh) = f[x0] +
n
k=1
s(s − 1) · · · (s − k + 1)hk
f[xk, xk−1, · · · , x0]
Using binomial-coefficient notation,
s
k
=
s(s − 1) · · · (s − k + 1)
k!
⇒ s(s−1) · · · (s−k +1) = k!
s
k
.
Thus we can express Pn(x) compactly as
Pn(x) = Pn(x0 + sh) = f[x0] +
n
k=1
k!
s
k
hk
f[xk, xk−1, · · · , x0]
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Newton forward-difference formula
The Newton forward-difference formula, is constructed by making use
of the forward difference notation ∆. With this notation,
f[x1, x0] =
f[x1] − f[x0]
x1 − x0
=
1
h
(f(x1) − f(x0)) =
1
h
∆f(x0)
Similarly
f[x2, x1, x0] =
f[x2, x1] − f[x1, x0]
x2 − x0
=
1
2h
(f[x2, x1] − f[x1, x0])
=
1
2h
1
h
(∆f(x1) − ∆f(x0))
=
1
2h2
(∆(f(x1) − f(x0)))
=
1
2h2
(∆(∆f(x0))) =
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Newton forward-difference formula
The Newton forward-difference formula, is constructed by making use
of the forward difference notation ∆. With this notation,
f[x1, x0] =
f[x1] − f[x0]
x1 − x0
=
1
h
(f(x1) − f(x0)) =
1
h
∆f(x0)
Similarly
f[x2, x1, x0] =
f[x2, x1] − f[x1, x0]
x2 − x0
=
1
2h
(f[x2, x1] − f[x1, x0])
=
1
2h
1
h
(∆f(x1) − ∆f(x0))
=
1
2h2
(∆(f(x1) − f(x0)))
=
1
2h2
(∆(∆f(x0))) =
1
2h2
∆2
f(x0)
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Newton forward-difference formula
Note that
f[x1, x0] =
1
h
∆f(x0)
f[x2, x1, x0] =
1
2h2
∆2
f(x0)
In general
f[xk, xk−1, · · · , x0] =
1
k!hk
∆k
f(x0)
Pn(x) = Pn(x0 + sh) = f[x0] +
n
k=1
k!
s
k
hk
f[xk, xk−1, · · · , x0]
Pn(x) = Pn(x0 + sh) = f(x0) +
n
k=1
s
k
∆k
f(x0)
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Compute cosh 0.56 using Newton’s Forward Difference
Formula (with 4 values)
i xi fi ∆fi ∆2fi ∆3fi
0 .5 1.127626
0.057839
1 .6 1.185465 0.011865
0.069704 0.000697
2 .7 1.255169 0.012562
0.082266
3 .8 1.337435
Using
P3(x) = P3(x0 + sh) = f(x0) +
3
k=1
s = x−x0
h
k
∆k
f(x0).
With x = 0.56, h = 0.1 and x0 = 0.5, we get
P3(0.56) = f(x0)+
0.6
1
∆f(x0)+
0.6
2
∆2
f(x0)+
0.6
3
∆3
f(x0).
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Compute cosh 0.56 using Newton’s Forward Difference
Formula (with 4 values)
i xi fi ∆fi ∆2fi ∆3fi
0 .5 1.127626
0.057839
1 .6 1.185465 0.011865
0.069704 0.000697
2 .7 1.255169 0.012562
0.082266
3 .8 1.337435
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Compute cosh 0.56 using Newton’s Forward Difference
Formula (with 4 values)
i xi fi ∆fi ∆2fi ∆3fi
0 .5 1.127626
0.057839
1 .6 1.185465 0.011865
0.069704 0.000697
2 .7 1.255169 0.012562
0.082266
3 .8 1.337435
Using
x = 0.56,
h = 0.1
and x0 = 0.5,
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Compute cosh 0.56 using Newton’s Forward Difference
Formula (with 4 values)
i xi fi ∆fi ∆2fi ∆3fi
0 .5 1.127626
0.057839
1 .6 1.185465 0.011865
0.069704 0.000697
2 .7 1.255169 0.012562
0.082266
3 .8 1.337435
Using
x = 0.56,
h = 0.1
and x0 = 0.5,
P3(0.56) = f(x0)+
0.6
1
∆f(x0)+
0.6
2
∆2
f(x0)+
0.6
3
∆3
f(x0).
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Compute cosh 0.56 using Newton’s Forward Difference
Formula (with 4 values)
i xi fi ∆fi ∆2fi ∆3fi
0 .5 1.127626
0.057839
1 .6 1.185465 0.011865
0.069704 0.000697
2 .7 1.255169 0.012562
0.082266
3 .8 1.337435
Using
x = 0.56,
h = 0.1
and x0 = 0.5,
P3(0.56) = f(x0)+
0.6
1
∆f(x0)+
0.6
2
∆2
f(x0)+
0.6
3
∆3
f(x0).
cosh(0.56) ≈ 1.127626 + (0.6)0.057839 +
(0.6)(−0.4)
2
0.011865+
(0.6)(−0.4)(−1.4)
6
0.000697 = 1.160944.
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Error in Newton’s Forwards Formula
εn =
hn+1
(n + 1)!
s(s − 1) · · · (s − n)f(n+1)
(t)
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Error in Newton’s Forwards Formula
εn =
hn+1
(n + 1)!
s(s − 1) · · · (s − n)f(n+1)
(t)
n = 3 f(t) = cosh t, f4
(t) = cosh(t)
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
Error in Newton’s Forwards Formula
εn =
hn+1
(n + 1)!
s(s − 1) · · · (s − n)f(n+1)
(t)
n = 3 f(t) = cosh t, f4
(t) = cosh(t)
ε3 =
(0.1)4
4!
0.6(−0.4)(−1.4)(−2.4)f(4)
(t) = −0.00000336 cosh t
We do not know t, but we get an inequality by taking the largest and
smallest cosh t in that interval:
A cosh 0.8 ≤ ε3(x) ≤ A cosh 0.5 where A = −0.00000336
Since
f(x) = P3(x) + ε3(x)
P3(0.56) + A cosh 0.8 ≤ cosh(0.56) ≤ P3(0.56)A cosh 0.5
1.160939 ≤ cosh(0.56) ≤ 1.160941.
Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics

Newtons Divided Difference Formulation

  • 1.
    Adv. Engg. Mathematics MTH-812Divided Differences Interpolations Dr. Yasir Ali (yali@ceme.nust.edu.pk) DBS&H, CEME-NUST December 4, 2017 Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 2.
    Interpolation Problem Given 1The (n + 1) nodes: x0, x1, ..., xn 2 The functional values f0, f1, ..., fn at these nodes 3 An Intermediate (nontabulated) point: xI Predict fI : the value at x = xI. Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 3.
    Suppose that Pn(x)is the nth Lagrange polynomial that agrees with the function f at the distinct numbers x0, x1, ..., xn. P(x) = Ln,0(x)f(x0) + Ln,1(x)f(x1) + · · · +, Ln,n(x)f(xn) = n k=0 f(xk)Ln,k(x), where Ln,k(x) = n i=0 i=k x − xi xk − xi , Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 4.
    Suppose that Pn(x)is the nth Lagrange polynomial that agrees with the function f at the distinct numbers x0, x1, ..., xn. P(x) = Ln,0(x)f(x0) + Ln,1(x)f(x1) + · · · +, Ln,n(x)f(xn) = n k=0 f(xk)Ln,k(x), where Ln,k(x) = n i=0 i=k x − xi xk − xi , Although this polynomial is unique, there are alternate algebraic representations that are useful in certain situations. The divided differences of f with respect to x0, x1, ..., xn are used to express Pn(x) in the form Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 5.
    Suppose that Pn(x)is the nth Lagrange polynomial that agrees with the function f at the distinct numbers x0, x1, ..., xn. P(x) = Ln,0(x)f(x0) + Ln,1(x)f(x1) + · · · +, Ln,n(x)f(xn) = n k=0 f(xk)Ln,k(x), where Ln,k(x) = n i=0 i=k x − xi xk − xi , Although this polynomial is unique, there are alternate algebraic representations that are useful in certain situations. The divided differences of f with respect to x0, x1, ..., xn are used to express Pn(x) in the form Pn(x) = a0+a1(x−x0)+a2(x−x0)(x−x1)+ · · ·+an(x−x0) · · · (x−xn−1) (1) Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 6.
    Suppose that Pn(x)is the nth Lagrange polynomial that agrees with the function f at the distinct numbers x0, x1, ..., xn. P(x) = Ln,0(x)f(x0) + Ln,1(x)f(x1) + · · · +, Ln,n(x)f(xn) = n k=0 f(xk)Ln,k(x), where Ln,k(x) = n i=0 i=k x − xi xk − xi , Although this polynomial is unique, there are alternate algebraic representations that are useful in certain situations. The divided differences of f with respect to x0, x1, ..., xn are used to express Pn(x) in the form Pn(x) = a0+a1(x−x0)+a2(x−x0)(x−x1)+ · · ·+an(x−x0) · · · (x−xn−1) (1) for appropriate constants a0, a1, ..., an Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 7.
    For Pn(x) = a0+a1(x−x0)+a2(x−x0)(x−x1)+· · ·+an(x−x0) · · · (x−xn−1) Pn(x) at x0 leaves a0 = Pn(x0) = f0 (2) Pn(x) at x1 leaves Pn(x1) = a0 + a1(x1 − x0) we know Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 8.
    For Pn(x) = a0+a1(x−x0)+a2(x−x0)(x−x1)+· · ·+an(x−x0) · · · (x−xn−1) Pn(x) at x0 leaves a0 = Pn(x0) = f0 (2) Pn(x) at x1 leaves Pn(x1) = a0 + a1(x1 − x0) we know Pn(x1) = f1 a1 = f1 − a0 x1 − x0 using (2), we get a1 = f1 − f0 x1 − x0 (3) Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 9.
    Pn(x) at x2leaves Pn(x2) = a0 + a1(x2 − x0) + a2(x2 − x0)(x2 − x1) we know Pn(x2) = f2 a2 = f2 − a0 − a1(x2 − x0) (x2 − x0)(x2 − x1) using (2) and (3), we get a2 = f2 − f0 − f1−f0 x1−x0 (x2 − x0) (x2 − x0)(x2 − x1) After simplification we get a2 = f2−f1 x2−x1 − f1−f0 x1−x0 x2 − x0 (4) Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 10.
    Comparing a0, a1and a2 can we get some pattern? a0 = f0 a1 = f1 − f0 x1 − x0 a2 = f2−f1 x2−x1 − f1−f0 x1−x0 x2 − x0 Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 11.
    Comparing a0, a1and a2 can we get some pattern? a0 depends on x0 = f0 a1 depends on x0 and x1 = f1 − f0 x1 − x0 a2 depends on x0 x1 and x2 = f2−f1 x2−x1 − f1−f0 x1−x0 x2 − x0 If we denote a0 = f0 as f[x0]. Then its easy to write a1 as a1 = f[x1] − f[x0] x1 − x0 Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 12.
    Comparing a0, a1and a2 can we get some pattern? a0 depends on x0 = f0 a1 depends on x0 and x1 = f1 − f0 x1 − x0 a2 depends on x0 x1 and x2 = f2−f1 x2−x1 − f1−f0 x1−x0 x2 − x0 If we denote a0 = f0 as f[x0]. Then its easy to write a1 as a1 = f[x1] − f[x0] x1 − x0 If we denote a1 = f[x0, x1]. Then a2 = f[x2, x1] − f[x1, x0] x2 − x0 Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 13.
    By looking atthe pattern of a1 and a2 is it possible to write a3? a1 f[x1,x0] = f[x1] − f[x0] x1 − x0 a2 f[x2,x1,x0] = f[x2, x1] − f[x1, x0] x2 − x0 Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 14.
    By looking atthe pattern of a1 and a2 is it possible to write a3? a1 f[x1,x0] = f[x1] − f[x0] x1 − x0 a2 f[x2,x1,x0] = f[x2, x1] − f[x1, x0] x2 − x0 a3 f[x3,x2,x1,x0] = Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 15.
    By looking atthe pattern of a1 and a2 is it possible to write a3? a1 f[x1,x0] = f[x1] − f[x0] x1 − x0 a2 f[x2,x1,x0] = f[x2, x1] − f[x1, x0] x2 − x0 a3 f[x3,x2,x1,x0] = f[ First three x3, x2, x1] − f[ Last three x2, x1, x0] x3 − x0 Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 16.
    By looking atthe pattern of a1 and a2 is it possible to write a3? a1 f[x1,x0] = f[x1] − f[x0] x1 − x0 a2 f[x2,x1,x0] = f[x2, x1] − f[x1, x0] x2 − x0 a3 f[x3,x2,x1,x0] = f[ First three x3, x2, x1] − f[ Last three x2, x1, x0] x3 − x0 ak f[x0,x1,··· ,xk] = Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 17.
    By looking atthe pattern of a1 and a2 is it possible to write a3? a1 f[x1,x0] = f[x1] − f[x0] x1 − x0 a2 f[x2,x1,x0] = f[x2, x1] − f[x1, x0] x2 − x0 a3 f[x3,x2,x1,x0] = f[ First three x3, x2, x1] − f[ Last three x2, x1, x0] x3 − x0 ak f[x0,x1,··· ,xk] = f[ First k−1 ... ] − f[ Last k−1 ... ] xk − x0 Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 18.
    Newton’s Divided Difference Hence,the interpolating polynomial (1) may be expressed as Pn(x) = f[x0] + f[x1, x0](x − x0) + a2(x − x0)(x − x1)+ · · · + an(x − x0)(x − x1) · · · (x − xn), where ak = f[xk, xk−1, · · · , x1, x0] for k = 0, 1, · · · , n. f[xi] = f(xi) zeroth divided difference f[xi+1, xi] = f[xi+1] − f[xi] xi+1 − xi 1st divided difference f[xi+2, xi+1, xi] = f[xi+2, xi+1] − f[xi+1, xi] xi+2 − xi 2nd divided difference f[x0, x1, · · · , xk] = Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 19.
    Newton’s Divided Difference Hence,the interpolating polynomial (1) may be expressed as Pn(x) = f[x0] + f[x1, x0](x − x0) + a2(x − x0)(x − x1)+ · · · + an(x − x0)(x − x1) · · · (x − xn), where ak = f[xk, xk−1, · · · , x1, x0] for k = 0, 1, · · · , n. f[xi] = f(xi) zeroth divided difference f[xi+1, xi] = f[xi+1] − f[xi] xi+1 − xi 1st divided difference f[xi+2, xi+1, xi] = f[xi+2, xi+1] − f[xi+1, xi] xi+2 − xi 2nd divided difference f[x0, x1, · · · , xk] = f[xk, xk−1 · · · , x1] − f[xk−1, xk−2, · · · , x0] xk − x0 Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 20.
    Dr. Yasir Ali(yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 21.
    Complete the DividedDifference table for the following data x 1.0 1.3 1.6 1.9 2.2 f(x) 0.7651 0.6201 0.4554 0.2818 0.1103 i xi f[xi] f[xi, xi−1] f[xi, xi−1, xi−2] f[xi, xi−1, xi−2, xi−3] 0 1.0 0.7651 ♥ 1 1.3 0.6201 2 1.6 0.4554 3 1.9 0.2818 4 2.2 0.1103 ♥ Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 22.
    Complete the DividedDifference table for the following data x 1.0 1.3 1.6 1.9 2.2 f(x) 0.7651 0.6201 0.4554 0.2818 0.1103 i xi f[xi] f[xi, xi−1] f[xi, xi−1, xi−2] f[xi, xi−1, xi−2, xi−3] 0 1.0 0.7651 ♥ 1 1.3 0.6201 2 1.6 0.4554 3 1.9 0.2818 4 2.2 0.1103 ♥ The First Divided Difference involving x0 and x1 is f[x0, x1] = f[x1] − f[x0] x1 − x0 = 0.6201 − 0.7651 1.3 − 1.0 = −0.4833. Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 23.
    Complete the DividedDifference table for the following data x 1.0 1.3 1.6 1.9 2.2 f(x) 0.7651 0.6201 0.4554 0.2818 0.1103 i xi f[xi] f[xi, xi−1] f[xi, xi−1, xi−2] f[xi, xi−1, xi−2, xi−3] 0 1.0 0.7651 ♥ 1 1.3 0.6201 2 1.6 0.4554 3 1.9 0.2818 4 2.2 0.1103 ♥ The First Divided Difference involving x0 and x1 is f[x0, x1] = f[x1] − f[x0] x1 − x0 = 0.6201 − 0.7651 1.3 − 1.0 = −0.4833. Remaining First Divided Differences are as follows Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 24.
    Complete the DividedDifference table for the following data x 1.0 1.3 1.6 1.9 2.2 f(x) 0.7651 0.6201 0.4554 0.2818 0.1103 i xi f[xi] f[xi, xi−1] f[xi, xi−1, xi−2] f[xi, xi−1, xi−2, xi−3] 0 1.0 0.7651 -0.4833 1 1.3 0.6201 ♠ -0.549 2 1.6 0.4554 -0.5787 3 1.9 0.2818 -0.5717 4 2.2 0.1103 ♠ Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 25.
    Complete the DividedDifference table for the following data x 1.0 1.3 1.6 1.9 2.2 f(x) 0.7651 0.6201 0.4554 0.2818 0.1103 i xi f[xi] f[xi, xi−1] f[xi, xi−1, xi−2] f[xi, xi−1, xi−2, xi−3] 0 1.0 0.7651 -0.4833 1 1.3 0.6201 ♠ -0.549 2 1.6 0.4554 -0.5787 3 1.9 0.2818 -0.5717 4 2.2 0.1103 ♠The Second Divided Difference involving x0, x1 and x2 is f[x2, x1, x0] = f[x2, x1] − f[x1, x0] x2 − x0 = −0.549 − (−0.4833) 1.6 − 1.0 = −0.1094 Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 26.
    Complete the DividedDifference table for the following data x 1.0 1.3 1.6 1.9 2.2 f(x) 0.7651 0.6201 0.4554 0.2818 0.1103 i xi f[xi] f[xi, xi−1] f[xi, xi−1, xi−2] f[xi, xi−1, xi−2, xi−3] 0 1.0 0.7651 -0.4833 1 1.3 0.6201 ♠ -0.549 2 1.6 0.4554 -0.5787 3 1.9 0.2818 -0.5717 4 2.2 0.1103 ♠The Second Divided Difference involving x0, x1 and x2 is f[x2, x1, x0] = f[x2, x1] − f[x1, x0] x2 − x0 = −0.549 − (−0.4833) 1.6 − 1.0 = −0.1094 Remaining Second Divided Difference are as follows Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 27.
    Complete the DividedDifference table for the following data x 1.0 1.3 1.6 1.9 2.2 f(x) 0.7651 0.6201 0.4554 0.2818 0.1103 i xi f[xi] f[xi, xi−1] f[xi, xi−1, xi−2] f[xi, xi−1, xi−2, xi−3] 0 1.0 0.7651 -0.4833 1 1.3 0.6201 -0.1094 -0.549 ♣ 2 1.6 0.4554 -0.0494 -0.5787 3 1.9 0.2818 0.0117 -0.5717 4 2.2 0.1103 ♣ Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 28.
    Complete the DividedDifference table for the following data x 1.0 1.3 1.6 1.9 2.2 f(x) 0.7651 0.6201 0.4554 0.2818 0.1103 i xi f[xi] f[xi, xi−1] f[xi, xi−1, xi−2] f[xi, xi−1, xi−2, xi−3] 0 1.0 0.7651 -0.4833 1 1.3 0.6201 -0.1094 -0.549 ♣ 2 1.6 0.4554 -0.0494 -0.5787 3 1.9 0.2818 0.0117 -0.5717 4 2.2 0.1103 ♣The Third Divided Difference f[x3, x2, x1, x0] = f[x3, x2, x1] − f[x2, x1, x0] x3 − x0 = −0.1094 − (−0.494) 1.9 − 1.0 = −0.0667 Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 29.
    Complete the DividedDifference table for the following data x 1.0 1.3 1.6 1.9 2.2 f(x) 0.7651 0.6201 0.4554 0.2818 0.1103 i xi f[xi] f[xi, xi−1] f[xi, xi−1, xi−2] f[xi, xi−1, xi−2, xi−3] 0 1.0 0.7651 -0.4833 1 1.3 0.6201 -0.1094 -0.549 ♣ 2 1.6 0.4554 -0.0494 -0.5787 3 1.9 0.2818 0.0117 -0.5717 4 2.2 0.1103 ♣The Third Divided Difference f[x3, x2, x1, x0] = f[x3, x2, x1] − f[x2, x1, x0] x3 − x0 = −0.1094 − (−0.494) 1.9 − 1.0 = −0.0667 Remaining Third Divided Differences are as follows Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 30.
    Complete the DividedDifference table for the following data x 1.0 1.3 1.6 1.9 2.2 f(x) 0.7651 0.6201 0.4554 0.2818 0.1103 i xi f[xi] f[xi, xi−1] f[xi, xi−1, xi−2] f[xi, xi−1, xi−2, xi−3] 0 1.0 0.7651 -0.4833 1 1.3 0.6201 -0.1094 -0.549 -0.0667 2 1.6 0.4554 -0.0494 -0.5787 0.0679 3 1.9 0.2818 0.0117 -0.5717 4 2.2 0.1103 Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 31.
    Complete the DividedDifference table for the following data x 1.0 1.3 1.6 1.9 2.2 f(x) 0.7651 0.6201 0.4554 0.2818 0.1103 i xi f[xi] f[xi, xi−1] f[xi, xi−1, xi−2] f[xi, xi−1, xi−2, xi−3] 0 1.0 0.7651 -0.4833 1 1.3 0.6201 -0.1094 -0.549 -0.0667 2 1.6 0.4554 -0.0494 -0.5787 0.0679 3 1.9 0.2818 0.0117 -0.5717 4 2.2 0.1103 The Fourth Divided Difference f[x4, x3, x2, x1, x0] = f[x4, x3, x2, x1] − f[x3, x2, x1, x0] x3 − x0 = −0.0679 − (−0.0667) 2.2 − 1.0 = −0.001 Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 32.
    Complete the DividedDifference table for the following data x 1.0 1.3 1.6 1.9 2.2 f(x) 0.7651 0.6201 0.4554 0.2818 0.1103 i xi f[xi] f[xi, xi−1] f[xi, xi−1, xi−2] f[xi, xi−1, xi−2, xi−3] 0 1.0 0.7651 -0.4833 1 1.3 0.6201 -0.1094 -0.549 -0.0667 2 1.6 0.4554 -0.0494 -0.5787 0.0679 3 1.9 0.2818 0.0117 -0.5717 4 2.2 0.1103 The Fourth Divided Difference f[x4, x3, x2, x1, x0] = f[x4, x3, x2, x1] − f[x3, x2, x1, x0] x3 − x0 = −0.0679 − (−0.0667) 2.2 − 1.0 = −0.001 This would be last divided difference in this case. Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 33.
    The coefficients ofthe Newton forward divided-difference form of the interpolating polynomial are along the diagonal in the table. This polynomial is P4(x) = 0.7651 − 0.4833(x − 1) − 1094(x − 1)(x − 1.3)+ −0667(x − 1)(x − 1.3)(x − 1.6) − 0.001(x − 1)(x − 1.3)(x − 1.6)(x − 1.9) i xi f[xi] f[xi, xi−1] f[xi, xi−1, xi−2] f[xi, xi−1, xi−2, xi−3] 0 1.0 0.7651 -0.4833 1 1.3 0.6201 -0.1094 -0.549 -0.0667 2 1.6 0.4554 -0.0494 -0.5787 0.0679 3 1.9 0.2818 0.0117 -0.5717 4 2.2 0.1103 Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 34.
    The coefficients ofthe Newton forward divided-difference form of the interpolating polynomial are along the diagonal in the table. This polynomial is P4(x) = 0.7651 − 0.4833(x − 1) − 1094(x − 1)(x − 1.3)+ −0667(x − 1)(x − 1.3)(x − 1.6) − 0.001(x − 1)(x − 1.3)(x − 1.6)(x − 1.9) i xi f[xi] f[xi, xi−1] f[xi, xi−1, xi−2] f[xi, xi−1, xi−2, xi−3] 0 1.0 0.7651 -0.4833 1 1.3 0.6201 -0.1094 -0.549 -0.0667 2 1.6 0.4554 -0.0494 -0.5787 0.0679 3 1.9 0.2818 0.0117 -0.5717 4 2.2 0.1103 f[x4, x3, x2, x1, x0] = −0.001 Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 35.
    Newton’s divided-difference formulacan be expressed in a simplified form when the nodes are arranged consecutively with equal spacing. In this case, we introduce the notation xi+1 − xi = h for each i = 0, 1, · · · , n − 1 Let x = x0 + sh, s ∈ R, then we can write x − xi = (x0 + sh) − (x0 + ih) Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 36.
    Newton’s divided-difference formulacan be expressed in a simplified form when the nodes are arranged consecutively with equal spacing. In this case, we introduce the notation xi+1 − xi = h for each i = 0, 1, · · · , n − 1 Let x = x0 + sh, s ∈ R, then we can write x − xi = (x0 + sh) − (x0 + ih) ⇒ x − xi = (s − i)h Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 37.
    Using x −xi = (s − i)h in Pn(x) = f[x0] + f[x1, x0](x − x0) + a2(x − x0)(x − x1)+ · · · + an(x − x0)(x − x1) · · · (x − xn), where ak = f[xk, xk−1, · · · , x1, x0] for k = 0, 1, · · · , n. We obtain Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 38.
    Using x −xi = (s − i)h in Pn(x) = f[x0] + f[x1, x0](x − x0) + a2(x − x0)(x − x1)+ · · · + an(x − x0)(x − x1) · · · (x − xn), where ak = f[xk, xk−1, · · · , x1, x0] for k = 0, 1, · · · , n. We obtain Pn(x) = Pn(x0 + sh) = f[x0] + shf[x1, x0] + s(s − 1)h2 f[x2, x1, x0]+ s(s − 1)(s − 2)h3 f[x3, x2, x1, x0] + · · · + +s(s − 1)(s − 2) · · · (s − n + 1)hn f[xn, xn−1, · · · , x0] Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 39.
    Using x −xi = (s − i)h in Pn(x) = f[x0] + f[x1, x0](x − x0) + a2(x − x0)(x − x1)+ · · · + an(x − x0)(x − x1) · · · (x − xn), where ak = f[xk, xk−1, · · · , x1, x0] for k = 0, 1, · · · , n. We obtain Pn(x) = Pn(x0 + sh) = f[x0] + shf[x1, x0] + s(s − 1)h2 f[x2, x1, x0]+ s(s − 1)(s − 2)h3 f[x3, x2, x1, x0] + · · · + +s(s − 1)(s − 2) · · · (s − n + 1)hn f[xn, xn−1, · · · , x0] Note that x − x0 = sh x − x1 = (s − 1)h & x − x0 = sh ⇒ Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 40.
    Using x −xi = (s − i)h in Pn(x) = f[x0] + f[x1, x0](x − x0) + a2(x − x0)(x − x1)+ · · · + an(x − x0)(x − x1) · · · (x − xn), where ak = f[xk, xk−1, · · · , x1, x0] for k = 0, 1, · · · , n. We obtain Pn(x) = Pn(x0 + sh) = f[x0] + shf[x1, x0] + s(s − 1)h2 f[x2, x1, x0]+ s(s − 1)(s − 2)h3 f[x3, x2, x1, x0] + · · · + +s(s − 1)(s − 2) · · · (s − n + 1)hn f[xn, xn−1, · · · , x0] Note that x − x0 = sh x − x1 = (s − 1)h & x − x0 = sh ⇒ (x − x1)(x − x0) = s(s − 1)h2 similarly (x − x0)(x − x1)(x − x2) = s(s − 1)(s − 2)h3 Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 41.
    Equi-spaced Divided Difference Pn(x0+ sh) = f[x0] + n k=1 s(s − 1) · · · (s − k + 1)hk f[xk, xk−1, · · · , x0] Using binomial-coefficient notation, s k = s(s − 1) · · · (s − k + 1) k! Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 42.
    Equi-spaced Divided Difference Pn(x0+ sh) = f[x0] + n k=1 s(s − 1) · · · (s − k + 1)hk f[xk, xk−1, · · · , x0] Using binomial-coefficient notation, s k = s(s − 1) · · · (s − k + 1) k! ⇒ s(s−1) · · · (s−k +1) = k! s k . Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 43.
    Equi-spaced Divided Difference Pn(x0+ sh) = f[x0] + n k=1 s(s − 1) · · · (s − k + 1)hk f[xk, xk−1, · · · , x0] Using binomial-coefficient notation, s k = s(s − 1) · · · (s − k + 1) k! ⇒ s(s−1) · · · (s−k +1) = k! s k . Thus we can express Pn(x) compactly as Pn(x) = Pn(x0 + sh) = f[x0] + n k=1 k! s k hk f[xk, xk−1, · · · , x0] Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 44.
    Newton forward-difference formula TheNewton forward-difference formula, is constructed by making use of the forward difference notation ∆. With this notation, f[x1, x0] = f[x1] − f[x0] x1 − x0 = 1 h (f(x1) − f(x0)) = 1 h ∆f(x0) Similarly f[x2, x1, x0] = f[x2, x1] − f[x1, x0] x2 − x0 = 1 2h (f[x2, x1] − f[x1, x0]) = 1 2h 1 h (∆f(x1) − ∆f(x0)) = 1 2h2 (∆(f(x1) − f(x0))) = 1 2h2 (∆(∆f(x0))) = Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 45.
    Newton forward-difference formula TheNewton forward-difference formula, is constructed by making use of the forward difference notation ∆. With this notation, f[x1, x0] = f[x1] − f[x0] x1 − x0 = 1 h (f(x1) − f(x0)) = 1 h ∆f(x0) Similarly f[x2, x1, x0] = f[x2, x1] − f[x1, x0] x2 − x0 = 1 2h (f[x2, x1] − f[x1, x0]) = 1 2h 1 h (∆f(x1) − ∆f(x0)) = 1 2h2 (∆(f(x1) − f(x0))) = 1 2h2 (∆(∆f(x0))) = 1 2h2 ∆2 f(x0) Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 46.
    Newton forward-difference formula Notethat f[x1, x0] = 1 h ∆f(x0) f[x2, x1, x0] = 1 2h2 ∆2 f(x0) In general f[xk, xk−1, · · · , x0] = 1 k!hk ∆k f(x0) Pn(x) = Pn(x0 + sh) = f[x0] + n k=1 k! s k hk f[xk, xk−1, · · · , x0] Pn(x) = Pn(x0 + sh) = f(x0) + n k=1 s k ∆k f(x0) Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 47.
    Compute cosh 0.56using Newton’s Forward Difference Formula (with 4 values) i xi fi ∆fi ∆2fi ∆3fi 0 .5 1.127626 0.057839 1 .6 1.185465 0.011865 0.069704 0.000697 2 .7 1.255169 0.012562 0.082266 3 .8 1.337435 Using P3(x) = P3(x0 + sh) = f(x0) + 3 k=1 s = x−x0 h k ∆k f(x0). With x = 0.56, h = 0.1 and x0 = 0.5, we get P3(0.56) = f(x0)+ 0.6 1 ∆f(x0)+ 0.6 2 ∆2 f(x0)+ 0.6 3 ∆3 f(x0). Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 48.
    Compute cosh 0.56using Newton’s Forward Difference Formula (with 4 values) i xi fi ∆fi ∆2fi ∆3fi 0 .5 1.127626 0.057839 1 .6 1.185465 0.011865 0.069704 0.000697 2 .7 1.255169 0.012562 0.082266 3 .8 1.337435 Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 49.
    Compute cosh 0.56using Newton’s Forward Difference Formula (with 4 values) i xi fi ∆fi ∆2fi ∆3fi 0 .5 1.127626 0.057839 1 .6 1.185465 0.011865 0.069704 0.000697 2 .7 1.255169 0.012562 0.082266 3 .8 1.337435 Using x = 0.56, h = 0.1 and x0 = 0.5, Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 50.
    Compute cosh 0.56using Newton’s Forward Difference Formula (with 4 values) i xi fi ∆fi ∆2fi ∆3fi 0 .5 1.127626 0.057839 1 .6 1.185465 0.011865 0.069704 0.000697 2 .7 1.255169 0.012562 0.082266 3 .8 1.337435 Using x = 0.56, h = 0.1 and x0 = 0.5, P3(0.56) = f(x0)+ 0.6 1 ∆f(x0)+ 0.6 2 ∆2 f(x0)+ 0.6 3 ∆3 f(x0). Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 51.
    Compute cosh 0.56using Newton’s Forward Difference Formula (with 4 values) i xi fi ∆fi ∆2fi ∆3fi 0 .5 1.127626 0.057839 1 .6 1.185465 0.011865 0.069704 0.000697 2 .7 1.255169 0.012562 0.082266 3 .8 1.337435 Using x = 0.56, h = 0.1 and x0 = 0.5, P3(0.56) = f(x0)+ 0.6 1 ∆f(x0)+ 0.6 2 ∆2 f(x0)+ 0.6 3 ∆3 f(x0). cosh(0.56) ≈ 1.127626 + (0.6)0.057839 + (0.6)(−0.4) 2 0.011865+ (0.6)(−0.4)(−1.4) 6 0.000697 = 1.160944. Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 52.
    Error in Newton’sForwards Formula εn = hn+1 (n + 1)! s(s − 1) · · · (s − n)f(n+1) (t) Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 53.
    Error in Newton’sForwards Formula εn = hn+1 (n + 1)! s(s − 1) · · · (s − n)f(n+1) (t) n = 3 f(t) = cosh t, f4 (t) = cosh(t) Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics
  • 54.
    Error in Newton’sForwards Formula εn = hn+1 (n + 1)! s(s − 1) · · · (s − n)f(n+1) (t) n = 3 f(t) = cosh t, f4 (t) = cosh(t) ε3 = (0.1)4 4! 0.6(−0.4)(−1.4)(−2.4)f(4) (t) = −0.00000336 cosh t We do not know t, but we get an inequality by taking the largest and smallest cosh t in that interval: A cosh 0.8 ≤ ε3(x) ≤ A cosh 0.5 where A = −0.00000336 Since f(x) = P3(x) + ε3(x) P3(0.56) + A cosh 0.8 ≤ cosh(0.56) ≤ P3(0.56)A cosh 0.5 1.160939 ≤ cosh(0.56) ≤ 1.160941. Dr. Yasir Ali (yali@ceme.nust.edu.pk) Adv. Engg. Mathematics