1
Notes for Numerical Analysis
Math 5466
by
S. Adjerid
Virginia Polytechnic Institute
and State University
(A Rough Draft)
2
Contents
1 Polynomial Interpolation
1.1
1.2
1.3
1.4
1.5
1.6
1.7
1.8
1.9
Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . .
Lagrange Interpolation . . . . . . . . . . . . . . . . . . . . .
Interpolation error and convergence . . . . . . . . . . . . . .
1.4.1 Interpolation error . . . . . . . . . . . . . . . . . . .
1.4.2 Convergence . . . . . . . . . . . . . . . . . . . . . . .
Interpolation at Chebyshev points . . . . . . . . . . . . . . .
Hermite interpolation . . . . . . . . . . . . . . . . . . . . . .
1.6.1 Lagrange form of Hermite interpolation polynomials .
1.6.2 Newton form of Hermite interpolation polynomial . .
1.6.3 Hermite interpolation error . . . . . . . . . . . . . . .
Spline Interpolation . . . . . . . . . . . . . . . . . . . . . . .
1.7.1 Piecewise Lagrange interpolation . . . . . . . . . . .
1.7.2 Cubic spline interpolation . . . . . . . . . . . . . . .
1.7.3 Convergence of cubic splines . . . . . . . . . . . . . .
1.7.4 B-splines . . . . . . . . . . . . . . . . . . . . . . . . .
Interpolation in multiple dimensions . . . . . . . . . . . . . .
Least-squares Approximations . . . . . . . . . . . . . . . . .
3
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
5
5
6
7
11
12
15
19
26
26
28
30
32
32
34
46
55
58
58
4
CONTENTS
Chapter 1
Polynomial Interpolation
1.1
Review
Mean-value theorem: Let
f
there exists c 2 (a; b) such that
f 0 (c)
2
=
C [a; b]
and dierentiable on (a; b) then
f (b)
f (a)
b
Weighted Mean-value theorem: If
then there exists c 2 (a; b) such that
Z
b
a
Rolle's theorem: If
then there exists c 2
f (x)g (x)dx
a
f
2 C [a; b] and g(x) > 0 on [a; b],
= f (c)
2
:
Zb
a
g (x)dx:
f
C [a; b], dierentiable
(a; b) such that f 0 (c) = 0.
on (a; b) and f (a) = f (b),
Generalized Rolle's theorem: If f 2 C [a; b], n + 1 times dierentiable on
(a; b) and admits
f n (c) = 0.
(
n+2
zeros in [a; b], then there exists
+1)
c
2 (a; b) such that
Intermediate value theorem: If f 2 C [a; b] such that f (a) 6= f (b), then
for each y between f (a) and f (b) there exists c 2 (a; b) such that f (c) = y .
5
6
CHAPTER 1.
1.2
POLYNOMIAL INTERPOLATION
Introduction
From the Webster dictionary the denition of interpolation reads as follows:
\Interpolation is the act of introducing something, especially, spurious and
foreign, the act of calculating values of functions between values already
known"
Our goal is approximate a set of data points or a function by a simpler
polynomial function. Given a set of data points xi ; i = 0; 1; n; xi 6=
xj ; if i 6= j we would like to construct a polynomial pm (x) such that
pm (xi )
(k )
= f (xi ); i = 0; 1; m;
(k )
k
= 0; 1; ni ; with n =
m
X
ni
1:
i=0
Lagrange Interpolation:
Taylor Interpolation:
= 0, m 1 , pn (xi ) = f (xi ); i = 0; 1; ; n
ni
n0 >
Hermite Interpolation:
k = 0; 1; ni .
1, m = 0 , pnk (x ) = f k (x );
( )
0
( )
0
k
= 0; 1; ; n .
1, m 1 , pnk (xi) = f k (xi );
( )
ni
( )
0
i
= 0; 1; ; m;
Why Interpolation? For instance interpolation is used to approximate
integrals
Zb
f (x)dx
Z
a
a
derivatives
f (k) (x)
b
pm (x)dx
pmk (x)
( )
and plays a major role in approximating dierential equations.
Taylor interpolation:
We rst study Taylor polynomials dened as
pn (x)
= f (x ) + (x
0
0
x0 )f (x0 ) +
(x
x0 )2
2
f (2) (x0 ) +
+ (x
x0 )n
n!
f (n) (x0 ):
1.3.
7
LAGRANGE INTERPOLATION
The interpolation error or remainder formula in Taylor expansions is written
as
(x x )n
f (x) pn (x) =
f n ( )
(n + 1)!
+1
0
Example: f (x) = sin(x);
x0
(
+1)
=0
p2n+1 (x)
=
n
X
( 1)k
k =0
x2k+1
(2k + 1)!
The interpolation error can be written as
jsin(x)
n
n
j = (2jxnj + 3)! jcos( )j < (2jxnj + 3)!
2
p2n+1 (x)
+3
2
+3
On the interval 0 < x < 1=2 the interpolation error is bounded as
jsin(x)
1.3
j
p2n+1 (x) <
2
2n+3
1
:
(2n + 3)!
Lagrange Interpolation
Lagrange form:
Given a set of points (xi ; f (xi )); i = 0; 1; 2; n; xj 6= xi we dene the
Lagrange coeÆcient polynomials li (x); i = 0; 1; n: such as
(
li (xj )
and is dened as
(x
li (x) =
(xi
x0 )(x
x0 )(xi
=
1; if i = j
0; otherwise
(x
x ) (xi
x1 )
1
xi
xi
1
)(x
)(xi
1
xi+1 )
xi+1
The Lagrange form of the interpolation polynomial is
pn (x)
=
n
X
i=0
f (xi )li (x)
(x
) (xi
xn )
xn )
:
8
POLYNOMIAL INTERPOLATION
CHAPTER 1.
Example: Let us consider the data set x = [0; 1; 2];
l0 (x)
=
(x
1)(x 2)
= (x
( 1)( 2)
2)
= x + 2x
(1)( 1)
x(x 1)
= (x x)=2
(x) =
(2)(1)
l1 (x)
l2
p2 (x)
= [ 2; 1; 2]
3x + 2)=2
2
=
x(x
f
2
2
= 2l (x)
0
l1 (x) + 2l2 (x)
=x
2
2
Example:
f (x) = cos(x)5
i 0:5; i = 0; 2;
using 8 points
14
x
= [0; 1; 2; 3; 4; 5; 6; 7] and 14 points
xi
=
A Matlab example
x=[0 1 2 3 4 5 6 7];
y=cos(x).^5;
c = polyfit(x,y,length(x)-1);
xi = 0:0.1:7;
zi = cos(xi).^5;
yi =polyval(c,xi);
subplot(2,1,1)
title('Interpolation')
plot(xi,yi,'-.',xi,zi,x,y,'*');
subplot(2,1,2)
title('Interpolation Error')
plot(xi,zi-yi,x,zeros(1,length(x)),'-*');
Newton form and divided dierences:
We develop a procedure to compute a
tion polynomial has the form
pn (x)
= a + a (x
0
1
x0 ) + a2 (x
0
x0 )(x
; a1 ;
;
x1 ) +
an
such that the interpola-
+ an(x
x0 )
(x
xn
1
)
1.3.
9
LAGRANGE INTERPOLATION
where a = f (x ), a =
0
0
1
f (x1 ) f (x0 )
x1 x0
ak
and such that
= f [x
0
; x1 ;
; xk ]
is called the kth divided dierence. All divided dierences are generated by
the following recurrence formula
f [xi ]
f [xi ; xk ]
f [x0 ; x1 ;
xi
x0
f (xi )
f (x0 )
x1
f (x1 )
x2
f (x2 )
x3
f (x3 )
x4
f (x4 )
; xk
1st DD
f [x0 ; x1 ]
f [x1 ; x2 ]
f [x2 ; x3 ]
f [x3 ; x4 ]
1
; xk ]
=
=
= f (xi )
f [xk ]
xk
f [x1 ;
f [xi ]
xi
; xk ]
f [x0 ;
xk
2nd DD
; xk
f [x1 ; x2 ; x3 ]
f [x2 ; x3 ; x4 ]
]
x0
3rd DD
f [x0 ; x1 ; x2 ]
1
4th DD
f [x0 ; x1 ; x2 ; x3 ]
f [x0 ; x1 ; x2 ; x3 ; x4 ]
f [x1 ; x2 ; x3 ; x4 ]
The forward Newton polynomial can be written as
p4 (x)
= f (x ) + f [x
0
0
; x1 ](x
x0 ) + f [x0 ; x1 ; x2 ](x
f [x0 ; x1 ; x2 ; x3 ](x
+f [x
0
; x1 ; x2 ; x3 ; x4 ](x
x0 )(x
x0 )(x
x1 )(x
x1 )(x
x0 )(x
x1 )+
x2 )
x2 )(x
x3 )
The backward Newton polynomial can be written as
p4 (x)
= f (x ) + f [x
4
3
; x4 ](x
x4 ) + f [x2 ; x3 ; x4 ](x
f [x1 ; x2 ; x3 ; x4 ](x
+f [x
0
; x1 ; x2 ; x3 ; x4 ](x
x4 )(x
x4 )(x
x3 )(x
x3 )(x
x4 )(x
x2 )
x2 )(x
x1 )
x3 )+
10
CHAPTER 1.
POLYNOMIAL INTERPOLATION
Example:
xi
2
f (xi )
16
1
1st DD 2nd DD 3rd DD 4th DD 5th DD
8
8
4
0
4
1
16
2
8
3
2
8
20
10
22
24
40=3
18
12
4
10=3
10=3
35=6
-11/6
The forward Newton polynomial
p5 (x)
= 16
10
(x + 2)(x + 1)x
3
8(x + 2) + 2(x + 2)(x + 1)
10
11
(x + 2)(x + 1)x(x 1)
(x + 2)(x + 1)x(x
3
6
The Backward Newton polynomial is given by
1)(x
+
p5 (x)
+
= 4
35
(x
6
12(x
3)(x
3)18(x
2)(x
1)x
Remarks:
3)(x
11
(x
6
2)
40
(x
3
3)(x
3)(x
2)(x
2)(x
1)x(x
2):
1)
1):
(i) The upper diagonal contains the coeÆcients for the forward Newton polynomials.
(ii) The lower diagonal contains the coeÆcients for the backward Newton
polynomials.
(iii) pk (x) interpolates f at x
0
; x1 ;
; xk and is obtained as
1.4.
11
INTERPOLATION ERROR AND CONVERGENCE
pk (x)
= f (x ) +
k
X
f [x0 ; x1 ;
0
; xj ]
j =1
2
p2 (x)
= f (x ) + f [x
2
2
1
(x
xi ):
i=0
(iv) p (x) that interpolates f at x
2
j
Y
; x3
; x3 ](x
and x is
4
x2 ) + f [x2 ; x3 ; x4 ](x
x2 )(x
x3 ):
(v) If we decide to add an additional point, it should be added at the bottom for forward Newton polynomials and at the top for backward Newton
polynomials.
(vi) f [x
0
; x1 ;
; xk ] = f k ;
(k) ( )
!
2 [a; b]:
Nested mutliplication
An eÆcient algorithm to evaluate Newton polynomial can be obtained by
writing
pn (x)
= a + (a + (an
(x xn ))(x
1
2
1
2
+ (an + (an + an (x
xn ) )(x x )):
1
2
+1
xn ))
1
Matlab program
%input a(i), i=1,2,...,n+1 , x(i),i=1,...,n+1, and x
%
p = a(n+1);
for i=n:-1:1
p = a(i) + p*(x-x(i));
end;
%p = p_n(x)
1.4
Interpolation error and convergence
In this section we study the interpolation error and convergence of interpolation polynomials to the interpolated function.
12
1.4.1
POLYNOMIAL INTERPOLATION
CHAPTER 1.
Interpolation error
Theorem 1.4.1. Let f 2 C [a; b] and x
0
; x1 ; x2 ;
xn ; be n +1 distinct points
in [a; b]. Then there exists a unique polynomial
that pn (xi ) = f (xi ); i = 0; 1; n.
pn
of degree at most
n
such
Proof. Existence: we dene
Qn
Li (x)
=
(x
xj )
(xi
xj )
6
j =0;j =i
n
Q
6
j =0;j =i
(
Li (xj )
1; i = j
0; otherwise
= Æij =
and
pn (x)
=
n
X
f (xi )Li (x)
i=0
One can verify that
pn (xj )
= f (xj ):
Uniqueness:
Assume there are two polynomials qn (x) and pn(x) such that
qn (xj )
= pn (xj ) = f (xj );
j
= 0; 1; 2; ; n
and consider the dierence
dn (x)
= 0; i = 0; 1; ; n so
theorem of Algebra dn (x) = 0.
dn (xj )
= pn (x)
dn (x)
has
qn (x):
n
+ 1 roots. By the fundamental
1.4.
13
INTERPOLATION ERROR AND CONVERGENCE
Theorem 1.4.2. Let
2
(n + 1) dierentiable on (a; b) and let
x ; x ; ; xn ; be (n + 1) distinct points in [a; b]. If pn (x) is such that
pn (xi ) = f (xi ); i = 0; 1; ; n, then for each x 2 [a; b] there exists (x) 2
[a; b] such that
f n ( (x))
f (x) pn (x) =
W (x);
(n + 1)!
0
f
C [a; b]
1
+1
where W (x) =
Qn
xi ).
(x
i=0
Proof. Let x 2 [a; b] and x 6= xi ; i = 0; 1; ; n and dene the function
g (t)
= f (t)
f (x)
pn (t)
pn (x)
W (x)
W (t):
We note that g has (n + 2) roots, i.e., g (xi ) = 0; i = 0; 1; n and g (x) = 0.
Using the generalized Rolle's Theorem there exits (x) 2 (a; b) such that
g (n+1) ( (x))
=0
which leads to
g (n+1) ( (x))
=f
(n+1)
( (x))
We solve (1.1.1) to nd f (x)
proof.
0
pn (x)
f (x)
pn (x)
W (x)
=
(n + 1)! = 0;
f (n+1) ( (x))
W
(n+1)!
(x) which completes the
Corollary 1. Assume that max jf n (x)j = Mn then
2 a;b
x
pn (x)
max jf (x)
x2 a;b
[
(
+1)
+1
]
j (nM+n 1)! jW (x)j; 8 x 2 [a; b]:
jf (x)
and
[
]
+1
jW (x)j:
j (nM+n 1)! xmax
2 a;b
pn (x)
Proof. The proof is straight forward.
+1
[
(1.1.1)
]
14
CHAPTER 1.
POLYNOMIAL INTERPOLATION
Examples:
jj1 M8h
;
[x
; x0
p2
jj1 Mph
;
[x
; x0
+ 2h]:
p3
jj1 M24h
;
[x
; x0
+ 3h]:
jjf
P1
jjf
jjf
2
2
0
3
3
9 3
0
4
4
0
+ h]:
Example: Let us interpolate f (x) = e on [0; 1] at x
derivative is f n (x) = e where
x
3
(
x
0
; x1 ;
3
3n+1
+1)
Mn+1
= max jf
x2 ;
(n+1)
[0 1]
(x)j =
; xn. The n + 1
1
e3
3n
+1
:
The interpolation error can be bounded as
jf (x)
=
(x)j
; x 2 [0; 1]:
j 3en (jW
n + 1)!
1 3
pn (x)
+1
For instance, for n = 4 and x = [0; 1=4; 1=2; 3=4; 1], W (x) = x(x
1=2)(x 3=4)(x 1)
1=4)(x
The error at x = 0:3 can be bounded as
jf (0:3)
=
j e j3W5!(0:3)j 0:45210
1 3
p4 (0:3)
5
7
:
Example: Let us consider f (x) = cos(x) + x on [0; 2] which satises
max jf k (x)j 1.
2
x
( )
[0;2]
The interpolation error can be bounded as
Case 1: Two interpolation points with h = 2,
max jf (x)
x2 ;
[0 2]
j h 8M 4=8 = 0:5:
p1 (x)
2
2
1.4.
15
INTERPOLATION ERROR AND CONVERGENCE
Case 2: Three interpolation points with h = 1,
max jf (x)
x2 ;
[0 2]
p2 (x)
p
j h pM 1=(9
2
3
9 3
3 0:0641:
Case 3: Four interpolation points with h = 2=3,
max jf (x)
x2 ;
p3 (x)
[0 2]
1.4.2
j h 24M (2=3) =24 0:0082:
4
4
4
Convergence
We start by reviewing the convergence of functions and dening simple and
uniform convergence of sequences of functions.
Let fn (x);
= 0; 1; be a sequence of continuous functions on [a; b].
n
Denition 1. (Simple convergence):
only if at every x 2 [a; b] nlim
jf (x)
!1 n
fn (x)
f (x)
Denition 2. (Uniform convergence):
only if nlim
max jfn (x)
!1
j = 0.
f (x)
2 a;b
x
[
]
converges simply to f (x) if and
j = 0:
fn
converges uniformly to
f
if and
Example: Let us consider the sequence
f n ( x)
=
1
; n = 0; 1; ;
1 + nx
x
2 [0; 1]:
(i) The sequence fn converges simply to 0 for all 0 < x 1 while fn (0) = 1.
However, fn does not converge uniformly since jjfnjj1 = 1.
(ii) The sequence fn converges uniformly to 0 on [2; 3] since jjfnjj1 = 1=(1 +
2n).
Next, we will study the uniform convergence of interpolation polynomials
on a xed interval [a; b] as the number of interpolation points approaches
16
CHAPTER 1.
POLYNOMIAL INTERPOLATION
innity. Let h = (b a)=n and xi = a + ih; i = 0; 1; 2; ; n; equidistant interpolation points. Let pn (x) denote the Lagrange interpolation polynomial,
i.e., pn (xi ) = f (xi ); i = 0; ; n and let us study the limit
lim jjf
!1
n
jj1 = nlim
max jf (x)
!1 x2 a;b
pn
[
j
pn (x) :
]
For x 2 [a; b], jx xi j (b a) which leads to jW (x)j (b
the interpolation error is bounded as
jjf
pn
jj1 (nM+n 1)! (b
Mn+1
(n+1)!
(b
Thus,
a)n+1 :
+1
We have uniform convergence when
a)n+1 .
a)n+1
! 0 as n ! 1.
Theorem 1.4.3. Let f be an analytic function on a disk centered at (a + b)=2
with a radius r > 3(b a)=2. Then, the interpolation polynomial pn (x)
satisfying pn (xi ) = f (xi ); i = 0; 1; 2; n; converges to f as n ! 1, i.e.,
lim jjf
!1
n
pn
jj1 = 0:
Proof. A function is analytic at (b + a)=2 if it admits a power series expansion
that converges on a disk of radius r and centered at (a + b)=2.
Applying Cauchy's formula
f
jf
(k )
(k )
(x) =
(x)j k!
I
2i
k!
2
f (z )
Cr
(z
Cr
jf (z)j
j(z x)jk
I
x)k+1
dz;
+1
dz;
x
2 [a; b]:
x
2 [a; b]:
1.4.
17
INTERPOLATION ERROR AND CONVERGENCE
1.5
1
z
+
pole
r
*
0.5
r
y
0
+
a
+
(a+b)/2
0
x
0.5
d
+
b
x
−0.5
C
r
−1
−1.5
−1.5
−1
−0.5
1
1.5
Let z be a point on the circle Cr and x 2 [a; b]. From the triangle with
vertices z , (a + b)=2 and x the following triangle inequality holds
jz
Noting that d (b
a)=2
j + d r:
x
the triangle inequality yields
jz
x
jr
r
( )
b a
2
a)=2:
max jf (z )j
z 2C
(b a)=2j k
jf k (x)j 2k! jr
Assume r >
(b
( +1)
2r:
([a; b] Cr ) to obtain
Mk
r
(b
r
max jf (z )j
a)=2 z 2C
(r
r
(b
k!
a)=2)k
:
Using k = n + 1 the interpolation error may be bounded as
jf (x)
max jf (z )j
z 2C
r
j (nM+n 1)! (b
pn (x)
r (b
r
a)(n+1)
+1
a)
(b
!
a)
r
2
Finally, we have uniform convergence if
establishes the theorem.
b
r
(b
b a
a)=2
(b
a
a)=2
<
n
:
1, i.e., r > (b
3
2
a)
which
18
POLYNOMIAL INTERPOLATION
CHAPTER 1.
Examples of analytic functions are sin(z ), ez , cos(z ).
2
Runge phenomenon:
Let f (x) = x2 is C 1 [ 10; 10] but we do not have uniform convergence
on [ 10; 10] when using the n + 1 equally spaced interpolation points xi =
10 + ih; i = 0; 1; ; n, h = 20=n.
1
4+
The function f (z ) has two poles z = 2i, thus, can't be analytic on disk Cr
with radius r > 3(b a)=2 = 30 and center at (a + b)=2. We cannot apply
the previous theorem and we should expect convergence problems for x far
away from the origin.
The largest interval [ a; a] satisfying r > 3(b a)=2 = 3a corresponds to
a < 2=3. Actually, it may converge on a larger interval because this is a
suÆcient condition.
Interpolation errors and divided dierences:
The Newton form of pn (x) that interpolates f at xi ; i = 0; 1; ; n is
pn (x)
= f [x ] + f [x
0
0 ; x1 ](x
x0 ) +
n
X
f [x0 ;
; xi]
i=2
i
Y
1
(x
xj ):
j =0
We proof a theorem relating the interpolation errors and divided dierences.
Theorem 1.4.4. If f 2 C [a; b] and n + 1 times dierentiable, then for every
x
2 [a; b]
f (x)
pn (x)
= f [x
0
; x1 ;
; xn; x]
n
Y
(x
xi )
i=0
and
f [x0 ; x1 ; x2 ;
; xk ] = f
( )
;
k!
(k )
2 [i min
xi ; max xi ]:
i ; ;n
; ;k
=0
Proof. Let us introduce another point x distinct from
let pn interpolate f at x ; x ; xn and x, thus
+1
0
1
=0
xi ; i
= 0; 1; n and
1.5.
19
INTERPOLATION AT CHEBYSHEV POINTS
pn+1 (x)
= pn (x) + f [x
; xn; x]
; x1 ;
0
n
Y
(x
xi ):
i=0
Combining the equation pn (x) = f (x) and the interpolation error formula
we write
+1
f (x)
pn (x)
= f [x
0
; x1 ;
; xn; x]
n
Y
(x
xi )
=
f (n+1) ( (x))
(n + 1)!
i=0
n
Y
(x
xi ):
i=0
This leads to
f [x0 ; x1 ;
; xk ] = f
( )
;
k!
(k )
2 [i min
xi ; max xi ];
; ;k
i ; ;k
=0
=0
which completes the proof.
Remark:
xi
1.5
lim
!x0 ; i ;k
=1
f [x0 ; x1 ;
; xk ] = f
(x )
k!
(k )
0
Interpolation at Chebyshev points
In the previous section we have shown that uniform convergence does not
occur using uniform interpolation points for some functions.
Now, we study the interpolation error on [ 1; 1] where the (n + 1) interpolation points, xi ; i = 0; 1; ; n; in [ 1; 1] are selected such that
jjW (:)jj1 =
min jjQ(:)jj1
2P +1
Q
~
n
where P~n is the set of the monic polynomials
P~n = [Q 2 PnjQ = xn +
n
X
1
i=1
ci xi ];
20
CHAPTER 1.
Qn
and W (x) =
i
POLYNOMIAL INTERPOLATION
xi ).
(x
Question: Are there interpolation points xi ; i = 0; 1; 2; ; n in [ 1; 1] such
that
jjW jj1 = x 2 a;bmin
jjW jj1
;i ; ; ;n
i
[
]
=0 1
If the above statement is true, the interpolation error can be bounded by
jjEnjj1 Mn+1
(n+1)!
jjW jj1
The Answer : The best interpolation points xi ; i = 0; 1; 2; ; n are the
roots of the Chebyshev polynomial Tn (x) dened as
+1
Tk (x)
= cos(karcos(x));
k
= 0; 1; 2; :
In the following theorem we will prove some properties of Chebyshev polynomials.
Theorem 1.5.1. The Chebyshev polynomials Tk (x);
the following properties:
(i) jTk (x)j 1; for all
1x1
(ii) Tk (x) = 2xTk (x)
Tk
+1
(v) If T~k (x) =
1
Q
k
1
j =0
Tk (x)
2k
1
(x
= 0; 1; 2; , satisfy
1
(iii) Tk (x) has k roots xj = cos(
(iv) Tk (x) = 2k
k
2j +1
2k
); j
= 0; 1; ; k
1; 2 [ 1; 1]
xj )
then max jT~k (x)j =
x
2
[
1;1]
1
2k
1
.
Proof. We obtain (i) by noting that the range of the cosine function is [ 1; 1].
To obtain (ii) we write
Tk+1 (x)
= cos(karcos(x) + arcos(x)) = cos(k + )
1.5.
21
INTERPOLATION AT CHEBYSHEV POINTS
where = arcos(x) and write
Tk+1
= cos(k + )
Tk
= cos(k
1
)
Use the trigonometric identity
obtain
cos(k
and
cos(a
b) = cos(a)cos(b) sin(a)sin(b) to
+ ) = cos(k)cos()
cos(k
)
sin(k )sin( )
= cos(k)cos() + sin(k)sin()
Adding the previous equations to obtain
Tk+1 (x) + Tk
1
(x) = 2cos(k)cos() = 2xTk (x)
This proves (ii).
To obtain the roots we set cos(karcos(x)) = 0 which leads to
karcos(x)
=
If we solve for x, we obtain
(2j + 1)
;
2
j
= 0; 1; 2; :
x
= cos(
(2j + 1)
); j = 0; 1; 2; ;
2k
xj
= cos(
(2j + 1)
); j = 0; 1; ; k
2k
leads to the roots
Use induction to prove (iv) step 1:
for k = 1; 2.
Step 2: Assume
write
Tk
= 2k
Tn+1 (x)
1
xk
+
= 2xTn
T1 (x)
P
k
1
i=0
ci xi
Tn
1
1:
= 2 x, T (x) = 2
, for
0
k
(x) = 2
1
2
x2
1 (iv) is true
= 1; 2; ; n and use (ii) we
n n+1
x
+
n
X
i=0
ai xi
22
POLYNOMIAL INTERPOLATION
CHAPTER 1.
This establishes (iv), i.e., Tk = 2k
1
Q
k
1
j =0
(x
xj ).
Applying (iv) we show that (v) is true.
Corollary 2. If T~n (x) is the monic Chebyshev polynomial of degree n, then
1
max jQ~ n (x)j max jT~n(x)j = n
x
x
2
1
1
1
1
1
;
8Q~ n 2 P~n :
Proof. Assume there is another monic polynomial R~ n (x) such that
1
max jR~ n (x)j < n
x
2
1
1
1
We also note that
T~n (zk )
The (n
=
( 1)k
;
2n
1
zk
= cos(k=n);
k
1)-degree polynomial dn (x) = T~n (x)
= 0; 1; 2; ; n:
~n (x)
R
1
satises
(z ) > 0, dn (z ) < 0, dn (z ) > 0, dn (z ) < 0 So dn (x) changes
sign between each pair zk and zk ; k = 0; 1; 2; ; n and thus has n roots.
Thus dn (x) = 0, identically, i.e., T~(x) and R~ n (x) are identical. This leads
to a contradiction with the assumption above.
dn
1
0
1
1
1
2
1
+1
1
Below are the rst ve Chebyshev polynomials.
T0 (x)
T1 (x)
T2 (x)
T3 (x)
T4 (x)
=
=
=
=
=
1
x
2x2
4x3
8x4
1
3x
8x + 1
2
Example of Chebyshev points:
3
1
1.5.
k
1
2
3
4
23
INTERPOLATION AT CHEBYSHEV POINTS
x0
x1
p0
p2=2
x2
p
2=2
3=2
0
cos(=8) cos(3=8)
x3
p
3=2
cos(5=8)
cos(7=8)
Application to interpolation:
Let
xj ;
as
2P
interpolate f (x) 2 C n [ 1; 1] at the roots of Tn (x),
; n. Thus, we can write the interpolation error formula
pn (x)
n
j = 0; 1; 2;
+1
f (x)
pn (x)
=
f n+1 ( (x))
(n + 1)!
+1
T~n+1 (x)
Using (v) from the previous theorem and assuming
we obtain
max
x2
;
[
1 1]
jjf n jj1;
+1
[
1;1]
Mn
+1
j 2n(Mnn+ 1)!
jf (x)
pn (x)
+1
Remarks:
1. We note that this choice of interpolation points reduces the error signicantly.
2. With Chebyshev points, pn converges uniformly to f when f 2 C [ 1; 1]
only. The function f does not have to be analytic (see Gautschi).
1
Example 1:
Consider f (x) = ex ;
x
2[
1; 1]
Case 1: with three points; n=2:
M
jjE jj1 3!2
3
2
Case 2: with 6 points; n=5:
2
= e=24 = 0:1136:
24
CHAPTER 1.
M
jjE jj1 6!2
6
5
5
POLYNOMIAL INTERPOLATION
= e=(720 32) = 0:11710
3
:
How many Chebyshev points are needed to have jjEnjj1 < 10
jjEnjj1 2n(Mnn+ 1)! = (n +e1)!2n = 0:13110
+1
9
;
8
for n=9:
Thus, 10 Chebyshev points are needed.
Chebyshev points on [a; b]:
Chebyshev points can be used on an arbitrary interval [a; b] using the linear
transformation
a+b
b a
x=
+
t;
1 t 1:
(1.1.2a)
2
2
We also need the inverse mapping
t
=2
x
a
b
a
1;
a
x b:
First, we order the Chebyshev nodes in [ 1; 1] as
tk
= cos(
2k + 1
2n + 2
)
=
cos(
2k + 1
);
2n + 2
k
= 0; 1; 2; ; n:
we dene the interpolation nodes on an arbitrary interval [a; b] as
a+b
b a xk =
+
t ; k = 0; 1; 2; ; n
2
2 k
Remarks:
1. x < x < < xn
0
1
2. xk are symmetric with respect to the center (a + b)=2
3. xk are independent of the interpolated function f
(1.1.2b)
1.5.
25
INTERPOLATION AT CHEBYSHEV POINTS
Theorem 1.5.2. Let
2 Cn
[a; b] and pn interpolate
nodes xk ; k = 0; 1; 2; ; n, in [a,b]. Then
f
max jf (x)
x2 a;b
[
Where Mn
+1
[
j 2Mn
pn (x)
]
= max jf
x2 a;b
f
+1
(n+1)
]
at the Chebyshev
(b a)n
:
4n (n + 1)!
+1
+1
+1
(x)j .
Proof. It suÆces to rewrite
to nd that
W (x)
=
(x
xi )
=
Qn
i=0
b
(x
2
a
xi
(t
) using the mapping (1.1.2)
ti );
and
W (x)
=
n
Y
(x
xi
) = (
b
2
i=0
Finally, using jjT~n
+1
jj1;
[
1;1]
=
1
2n
a
)
n+1
n
Y
(t
ti )
=(
i=0
b
2
a
)n T~n (t):
+1
+1
we complete proof.
Example 2:
Consider f (x) = 3x = eln x ; x 2 [0; 1] whose derivative is f n (x) =
ln(3)n eln x . Noting that f n
is a monotonically increasing function,
Mn = f n (1) = 3ln(3)n . Therefore,
(3)
+1
+1
(3)
(
+1)
(
(
+1)
+1
jjEnjj1 24n 3(lnn (3)
+ 1)!
n+1
+1
=
6 ln(3)n
:
4n (n + 1)!
+1
+1
+1)
26
CHAPTER 1.
POLYNOMIAL INTERPOLATION
# of Chebyshev points Error bound
2
0.226
3
0.0207
4
0.00142
5
0.000078
0.358 10
6
7
0.140 10
8
0.48 10
0.14 10
9
5
6
8
9
1.6
Hermite interpolation
We restate the general Hermite interpolation by Letting x
be m + 1 distinct points such that
0
f (k) (xi )
where
m
P
i=0
ni
= pnk (xi );
( )
k
= 0; 1; ni
1;
i
< x1 < x2
= 0; 1; m;
xm
(1.1.3)
= n + 1 and ni 1. We note that ni =1; i = 0; ; m; leads to
Lagrange interpolation.
1.6.1
Lagrange form of Hermite interpolation polynomials
Theorem 1.6.1. There exists a unique polynomial pn (x) that satises (1.1.3)
with ni = 2 and n = 2m + 1.
Proof. Existence:
Next, we study the special case ni = 2; i = 0; 1; 2; ; where
li;1 (x)
= (x
xi )li (x)2 :
(1.1.4)
1.6.
27
HERMITE INTERPOLATION
and
li;0
= li (x)
2li0 (xi )(x
2
xi )li (x)2 :
(1.1.5)
Now, we can verify that
li;1 (xj )
Thus, li;0 (xj ) = Æij .
li;0 1 (x)
= 0;
j
= 0; 1; 2; ; m
xi )li0 (x)li (x) + li (x)2 :
= 2(x
1
One can easily check that li; (xj ) = Æij .
0
For li;0 (x) we have
0
li;0 0 (x)
= (1
Thus, li;0 (xj ) = 0;
0
j
2li0 (xi )(x
= 0; 1; ; m:
xi ))2li0 (x)li (x)
2li0 (xi )li (x)
2
:
Existence of Hermite interpolation polynomial is established by writing the
Lagrange form of Hermite polynomial as
pn (x)
=
m
X
f (xi )li;0 (x) +
i=0
m
X
f 0 (xi )li;1 (x):
(1.1.6)
i=0
Uniqueness:
Assume there are two polynomials pn (x) and qn (x) that satisfy (1.1.3) and
consider the dierence dn (x) = pn (x) qn (x) which satises
d(ns) (xj )
= 0;
s
= 0; 1;
j
= 0; 1; ; m:
Thus, dn (x) is a polynomial of degree at most n and has (n +1) roots counting
the multiplicity of each root. The fundamental theorem of Algebra shows
that dn (x) is identically zero. With this we establish the uniqueness of pn
and nish the proof of the theorem.
28
POLYNOMIAL INTERPOLATION
CHAPTER 1.
1.6.2
Newton form of Hermite interpolation polynomial
Using the following relation
f [x0 ; x0
+ h; x + 2h; ; x + kh] =
0
f (k) ( )
k!
0
; x0 < < x0
+ kh
(1.1.7)
and taking the limit when h ! 0 we obtain that
f k (x )
f [x ; x ; x ; ; x ] =
:
(1.1.8)
k!
The divided dierence table for the data (xk + ih; f (x + kh)); i = 0; 1; 2; 3; 4
will converge to the table shown below where we recover the Taylor polynomial about xk and with nk = 5.
0
0
0
0
0
0
Using this observation we initialize the table for xk and nk = 5 as follows:
(i) every point xi is repeated ni times
(ii) we set zi = xk ;
zi+1
(iii) we initialize f [zi ; zi
zi
zi+1
zi+2
zi+3
zi+4
xk
xk
xk
xk
xk
;
= xk ;
+1
f (xk )
f (xk )
f (xk )
f (xk )
f (xk )
;
; zi
f 0 (xk )
f 0 (xk )
f 0 (xk )
f 0 (xk )
+s
zi+4
]=
= xk
f (s) (xk )
s!
f 00 (xk )=2!
f 00 (xk )=2!
f 00 (xk )=2!
as shown in the following table
000
f (xk )=3!
000
f (xk )=3!
f (4) (xk )=4!
The general formula for divided dierences with repeated arguments for x
x : : : < xn is given by
1
(f x
[
f [xi ; xi+1 ; : : : ; xi+k ]
=
i+1 ;xi+2 ;::: ;xi+k ]
f (k) ( )
k!
xi+k xi
f [xi ;::: ;xk
1]
; if xi
0
6= xi
+k
Example: Let f (x) = x + 1, f 0 (x) = 4x . We will construct a polynomial
p (x) such that p(xi ) = f (xi ) and p0 (xi ) = f 0 (xi ) with xi = 1; 0; 1. The
Hermite divided dierence table is given as
4
5
3
1.6.
29
HERMITE INTERPOLATION
f (zi )
zi
z0
z1
z2
z3
z4
z5
-1
-1
0
0
1
1
2
2
1
1
2
2
1 DD
2 DD 3 DD 4 DD 5 DD
f 0(
1) = 4
-1
0
f (0) = 0
1
0
f (1) = 4
3
1
1
3
-2
0
2
1
1
0
The forward Hermite polynomial is given as
p5 (x)
=2
4(x + 1) + 3(x + 1)
2
2(x + 1)
2
x + (x + 1)2 x2
=1+x
(1.1.9)
4
The Hermite polynomial that interpolates f and f 0 at x = 1; 0 is given as
p3 (x)
=2
4(x + 1) + 3(x + 1)
2(x + 1)
2
2
(1.1.10)
x:
The backward Hermite polynomial is given as
p5 (x)
=2
4(x
1) + 3(x
1) + 2(x
1)
2
2
x + (x
1)
2
x2
=1+x
(1.1.11)
4
The Hermite polynomial that interpolates f and f 0 at x = 0; 1 is given by
p3 (x)
= 2 + 4(x
1) + 3(x
1) + 2(x
2
1)
2
x:
(1.1.12)
Example:
Consider the data with m = 1;
xi
f (xi )
f 0 (xi )
f 00 (xi )
0
1
0
NA
n0
= 1;
n1
1
2
1
2
We write the divided dierences table as
= 2 given in the following table
30
POLYNOMIAL INTERPOLATION
CHAPTER 1.
f (zi )
zI
0
0
1
1
1
z0
z1
z2
z3
z4
1DD
1
1
2
2
2
f 0 (x0 )
2DD
=0
1
0
f (x ) = 1
f 0 (x ) = 1
3 DD 4DD
1
0
f 00 (x )=2! = 1
1
1
1
-1
1
2
The Hermite polynomial is given as
H4 (x)
= 1 + 0(x
0) + (x
0)
= 1 + 2x
x3
2
1.6.3
(x
2
0) (x
1) + 2(x
2
+ 2x (x
2
1)
2
:
0) (x
2
1)
2
(1.1.13)
Hermite interpolation error
Theorem 1.6.2. Let f (x) 2 C [a; b] be 2m + 2 dierentiable on (a; b) and
consider x < x < x ; ; xm in [a; b] with ni = 2; i = 0; 1; ; m. If p m
is the Hermite polynomial such that p km (xi ) = f k (xi ), i = 0; 1; ; m,
k = 0; 1, then there exists (x) 2 [a; b] such that
0
1
2
2
( )
2
f (x)
p2m+1 (x)
=
+1
( )
+1
f (2m+2) ( (x))
(2m + 2)!
W (x)
(1.1.14a)
where
W (x)
=
m
Y
(x
xi )2 :
(1.1.14b)
i=0
Proof. We consider the special case ni = 2; i.e., n = 2m + 1, select an
arbitrary point x 2 [a; b]; x 6= xi ; i = 0; ; m and dene the function
g (t)
= f (t)
p2m+1 (t)
f (x)
p2m+1 (x)
W (x)
W (t):
(1.1.15)
1.6.
31
HERMITE INTERPOLATION
We note that g has (m +2) roots, i.e., g (xi ) = 0; i = 0; 1; m and g (x) = 0.
Applying the generalized Rolle's Theorem we show that
g 0 (i )
= 0; i = 0; 1; ; m where i 2 [a; b], i 6= xj , i 6= x.
Using (1.1.3) with ni = 2 we have g 0(xi ) = 0;
has 2m + 2 roots in [a; b].
i
= 0; 1; ; m. Thus, g 0 (t)
Applying the generalized Rolle's theorem we show that there exists 2 (a; b)
such that
g (2m+2) ( )
= 0:
Combining this with (1.1.15) yields
0=f
Solving for f (x)
(2m+2)
f (x)
( )
p2m+1 (x)
p2m+1 (x)
W (x)
(2m + 2)!
leads to (1.1.14).
Corollary 3. If f (x) and p m (x) are as in the previous theorem, then
2
jf (x)
j
p2m+1 (x) <
+1
M2m+2
(2m + 2)!
jW (x)j;
x
2 [a; b]
(1.1.16)
and
jjf (x)
jj1; a;b (2Mm m+ 2)! (b
p2m+1 (x)
2
[
+2
]
a)2m+2 :
(1.1.17)
Proof. The proof is straight forward.
At this point we would like to note that we can prove a uniform convergence
result under the same conditions as for Lagrange interpolation.
Example: Let f (x) = sin(x); x 2 [0; =2] and p (x) interpolate f and f 0 at
xi = 0; 0:2; , with ni = 2 and 2m + 2 = 6
5
2
32
CHAPTER 1.
POLYNOMIAL INTERPOLATION
Using the error bound 1.1.16 with M
2m+2
W (x)
= [(x
0)(x
= 1, ni = 2 and
0:2)(x
2
)]
2
;
we obtain
0:46608
:1)j
jE (1:1)j jW (1
3:017 10
6!
6!
2
5
1.7
4
(1.1.18)
:
Spline Interpolation
In this section we will study piecewise polynomial interpolation and write
the interpolation errors in terms of the subdivision size and the degree of
polynomials.
1.7.1
Piecewise Lagrange interpolation
We construct the piecewise linear interpolation for the data (xi ; f (xi ));
0; 1; ; n such that x < x < < xn as
0
=
1
8
x x
>
<p ; (x) = f (x ) xx xx
P (x) = p ;i (x) = f (xi ) x x
>
:i = 0; 1; ; n 1:
(
1 0
0
(
1
i
1
+ f (x ) xx1 xx00 ; x 2 [x ; x ];
+ f (xi ) x x+1 x x ; x 2 [xi ; xi ]:
+1
1)
0
i
(
)
1
1
i+1 )
0
(
+1
i
i
i)
1
+1
i
(1.1.19)
The interpolation error on (xi ; xi ) is bounded as
+1
jjE ;i(x)jj M2 ;i j(x
2
1
where M ;i =
2
max
xi x xi+1
jf
(2)
j
xi )(x
2
The global error is
+1
);
(1.1.20)
(x)j. This can be written as
jjE ;ijj1 M 8;ihi ;
1
2 (xi; xi
xi+1 ) ; x
2
hi
= xi
+1
xi :
(1.1.21)
1.7.
33
SPLINE INTERPOLATION
jjE jj1 M 8H
2
2
1
; H
=
max
;n
i=0;
1
(1.1.22)
hi :
2 C [a; b] be twice dierentiable on (a; b). If P (x)
is the piecewise linear interpolant of f at xi = a + i h; i = 0; 1; ; n,
h = (b a)=n, then P converges uniformly to f as n ! 1.
Theorem 1.7.1. Let
f
0
1
1
Proof. We prove this theorem using the error estimate (1.1.22).
For piecewise quadratic interpolation we select h = (b a)=n and construct
p ;i that interpolates f at xi , (xi + xi )=2 and xi . In this case the interpolation error is bounded as
2
+1
jjE ;ijj1 M ;i(phi=2)
+1
3
3
9 3
2
; hi
= xi
+1
xi :
(1.1.23)
hi :
(1.1.24)
A global bound is
p 2)
jjE jj1 M (H=
3
3
; H
9 3
2
=
max
; n
i=0;
2
1
Theorem 1.7.2. Let f 2 C [a; b] and be m+1 times dierentiable on (a; b)
0
and x < x < < xn with hi = xi
xi and H = max hi . If Pm (x) is
i
the piecewise polynomial of degree m on each subinterval [xi ; xi ] and Pm (x)
interpolates f on [xi ; xi ] at xi;k = xi + k h~ i ; k = 0; 1; ; m, h~ i = hi =m,
then Pm converges uniformly to f as H ! 0.
Proof. Again we prove this theorem using the error bound
0
1
+1
+1
+1
m+1
jjEmjj1 M(mm +H1)!
+1
; H
=
max
;nm
i=0;1;
1
hi :
(1.1.25)
Similarly, we may construct piecewise Hermite interpolation polynomials following the same line of reasoning as for Lagrange interpolation.
34
CHAPTER 1.
1.7.2
POLYNOMIAL INTERPOLATION
Cubic spline interpolation
We use piecewise polynomials of degree three that are C and interpolate the
data such as S (xk ) = f (xk ) = yk ; k = 0; 1; n.
2
Algorithm
(i) Order the points xk ;
a
x
=x
0
= 0; 1; n such that
< x1 < x2 <
xn
1
< xn
= b:
(ii) Let S (x) be a piecewise spline dened by n cubic polynomials such that
S (x)
= Sk (x) = ak + bk (x
(iii) nd ak ;
bk ; ck ; dk ; k
(1) S (xk ) = yk ;
k
xk ) + ck (x
xk )2 + dk (x
= 0; 1; n
1 such that
0
+1
+1
0
(3) Sk (xk ) = Sk (xk );
+1
00
+1
+1
00
(4) Sk (xk ) = Sk (xk );
+1
x xk
+1
= 0; 1; ; n
(2) Sk (xk ) = Sk (xk );
+1
xk )3 ; xk
+1
+1
k
= 0; ; n
2
k
= 0; ; n
2
k
= 0; ; n
2
Theorem 1.7.3. If A is an n n strictly diagonally dominant matrix, i.e.,
n
jakk j > P jak;ij;
k = 1; 2; n, then A is nonsingular.
6
Proof. By contradiction, we assume that A is singular, i.e., there exists a
nonzero vector x such that Ax = 0 and let xk such that jxk j = maxjxi j.
This leads to
i=1;i=k
akk xk
=
n
X
6
aki xi :
(1.1.26)
i=1;i=k
Taking the absolute value and using the triangle inequality we obtain
jakk jjxk j n
X
6
i=1;i=k
jakijjxij:
(1.1.27)
1.7.
35
SPLINE INTERPOLATION
Dividing both terms by jxk j we get
n
X
jakk j n
X
j
xi j
jakij jx j jakij
k
k
i ;i6 k
6
i=1;i=
=1
(1.1.28)
=
This leads to a contradiction since A is strictly diagonally dominant.
Theorem 1.7.4. Let us consider the set of data points (xi ; f (xi ));
0; 1; ; n; such that
i =
00
S (xn ) = 0, then
; xn. If S 00(x ) =
x0 < x1 <
0
there exists a unique piecewise cubic polynomial that satises the conditions
(iii).
Proof. Existence: we assume S (xk ) = mk where
piecewise linear interpolation of S to write
"
hk
=
xk+1
and use
xk
"
00
Sk (x)
mk
=
hk
(x
= mk
x
xk+1
xk
xk+1 ) +
xk+1
mk+1
+ mk
(x
hk
x
+1
xk
xk+1
xk ); xk
xk
x xk
+1
With this denition of S , condition (4) is automatically satised.
"
00
Integrating Sk (x) we obtain
Sk (x)
=
mk
6hk
(x
Need to nd mk ;
qk
xk+1 )3
and pk ;
mk+1
+
(x xk ) + pk (xk
6hk
k = 0; 1; 2; ; n 1:
3
+1
x) + qk (x
xk )
In order to enforce the conditions (1) and (2) we write
Sk (xk )
Sk (xk+1 )
= yk =
= yk
+1
Solve for pk and qk to solve
pk
=
yk
hk
mk
=
6
h2k
+ pk hk
mk+1
6
h2k
mk hk
6
+ qk hk
(1.1.29a)
36
POLYNOMIAL INTERPOLATION
CHAPTER 1.
yk+1
=
qk
mk+1 hk
6
hk
(1.1.29b)
:
We note that if mk ; k = 0; 1; : : : ; n are known, The previous equations may
be used to compute pk and qk .
Now, substitute pk and qk in the equation for Sk to have
Sk (x)
mk
=
6hk
(x
xk+1 )3
(
mk+1
+
(x
xk )3
mk+1 hk
)(x
6hk
yk+1
6
hk
+(
yk
mk hk
6
hk
)(xk
+1
xk )
x)+
(1.1.30)
0
Applying condition (3) to enforce the continuity of S (x)
0
Sk (xk+1 )
0
= Sk (xk );
k
+1
+1
= 0; 1; ; n
1:
(1.1.31)
where
Sk0 (x)
(
yk
mk h k
6
hk
mk
=
2hk
)+(
(x
xk+1 )2
yk+1
+
mk+1 hk
6
hk
mk+1
(x
);
xk
x xk
+
mk+2
2hk
xk )2
+1
(1.1.32)
;
and
Sk0 +1 (x)
(
yk+1
hk+1
=
mk+1 hk+1
6
mk+1
2hk
)+(
(x
mk+2 hk+1
6
hk+1
Sk (xk+1 )
2hk
+1
yk+2
Taking the limit from the left at xk
0
xk+2 )2
=
+1
xk+1 )2
+1
xk+1
x xk
+2
:
(1.1.33)
leads to
mk+1 hk
3
Taking the limit from the right at xk
);
(x
+1
+
mk hk
yields
6
+ dk :
(1.1.34)
1.7.
37
SPLINE INTERPOLATION
0
Sk+1 (xk+1 )
where
dk
3
yk+1
=
mk+2 hk+1
mk+1 hk+1
=
yk
hk
; k
6
= 0; 1; ; n
(I)
+ 2mk (hk + hk ) + mk
k = 0; 1; 2; ; n 2:
mk hk
+1
+1
+2
hk+1
+1
1
Using (1.1.31) we obtain the following system having
n 1 equations.
(
+ dk
n
= 6(dk
+ 1 unknowns and
dk );
+1
(1.1.35)
Now we need to close the system by adding two more equations from S 00 (x ) =
0 and S 00 (xn ) = 0 which leads to
0
m0
= 0;
mn
= 0:
(1.1.36)
This is called the natural spline.
The system (1.1.35) and (1.1.36) lead to
8
>
<(2h + 2h )m + h m = u
(I:N AT ) mk hk + 2mk (hk + hk ) + mk
>
:hn mn + 2(hn + hn )mn
0
1
1
1
2
+1
2
0
+1
2
2
1
+1
1
hk+1
= un
= uk ; 1 k n
2
In matrix form we write
22(h + h )
66 h
66 0
64 ..
.
0
1
1
0
2(h + h )
1
h2
...
0
h1
2
h2
2(h + h )
...
0
2
3
...
hn
32
77 66
77 66
75 64
0
0
0
...
2
2(hn
hn
2
3
2
+ hn )
1
3 2
77 66
77 = 66
75 64
m1
m2
m3
..
.
mn
1
3
77
77
75
u0
u1
u2
..
.
un
The resulting matrix is strictly symmetric positive denite and diagonally
dominant and yields a unique solution.
2
38
POLYNOMIAL INTERPOLATION
CHAPTER 1.
Other splines include:
Not-a-Knot Spline:
We add the following two conditions:
000
S0 (x1 )
000
= S (x ) which leads to
1
1
m1
m0
=
h0
m2
m1
(1.1.37)
h1
and the condition
000
Sn
000
2
(xn ) = Sn (xn ) which leads to
1
1
1
mn
mn
hn
1
=
mn
1
1
mn
hn
2
(1.1.38)
2
Solve (1.1.37) and (1.1.38) for m and mn to obtain
0
mn
m0
= (1 + h
=
hn =hn1 mn
0
=h1 )m1
2
(h
0
=h1 )m2
(1.1.39)
+ (1 + hn =hn )mn
1
(1.1.40)
1
Substitute into the system (1.1.35) to obtain
8
>
<(3h + 2h + h =h )m + (h h =h )m = u
(I:N K ) mk hk + 2mk (hk + hk ) + mk hk = uk ; k = 1; ; n
>
:(hn h =hn )mn + (2hn + 3hn + h =hn )mn
0
2
0
1
1
+1
2
where
2
n
uk = 6(dk+1
m 1 ; m2 ;
mn 1 and
1
1
1
+1
2
2
2
0
+1
2
1
2
0
+1
2
n
1
1
2
3
1
= un
dk ); k = 0; 1; ; n
2. We solve the system for
use (1.1.39) and (1.1.40) to nd m and mn .
Use (1.1.29) to nd pk and qk ; k = 0; 1; n
(1.1.30) that denes Sk (x).
0
1. Finally, we use the formula
2
1.7.
39
SPLINE INTERPOLATION
Clamped Spline:
We close the system (I) using the following conditions
0
S0 (x0 )
0
Sn
0
= f (x )
0
0
1
(xn ) = f (xn )
S00 (x)
m0
=
2h
(x
x1 )2
m1
+
(x
2h
0
x0 )2
y0
(
m0 h0
=
m1 h0
3
6
h0
0
S00 (x0 )
m0 h0
+
6
y1
y0
h0
)+(
y1
m1 h0
6
h0
)
:
The boundary equation S 0 (x ) = f 0 (x ) leads to
0
0
2m
0
h0
0
+m
1
h0
f 0 (x0 ))
= 6(d
0
(1.1.41)
The boundary condition Sn0 (xn ) = f 0 (xn ) yields the equation
1
Sn0
1
(xn ) =
mn hn
1
3
+
mn
1
hn
6
1
+ dn
1
= f 0 (xn );
which leads
2mn hn
1
+ mn
1
hn
1
= 6(f 0(xn )
dn
1
)
(1.1.42)
Now, the system (I) is reduced to
8 h
>
<( + 2h )m + h m = u 3(d f 0(x ))
(I:CL) mk hk + 2mk (hk + hk ) + mk hk = uk ; k = 1; 2; ; n
>
:hn mn + (2hn + h )mn = un 3(f 0(xn) dn )
3
0
1
2
1
1
+1
2
0
+1
3
2
2
2
n
0
+1
1
2
1
0
+1
2
Matrix formulation for the not-a-knot spline
AM
=U
1
3
40
POLYNOMIAL INTERPOLATION
CHAPTER 1.
where
2
663h
66
A=6
66
4
2
+ 2h + hh10
0
h20
h1
h1
1
2(h + h )
h1
1
0
..
.
0
2
h2
2(h + h )
...
0
3
77
77 ;
75
m1
m2
m3
..
.
mn
3
2
66
6
B=6
64
1
0
0
0
...
h2
2
...
2
66
6
M =6
64
0
...
hn
2
3
77
77
75
u0
u1
u2
..
.
un
h2n
hn
hn
1
2
2hn
2
+ 3hn
2
1
2
The system admits a unique solution since the matrix is strictly diagonally
dominant.
Example 1: consider the function f (x) = x=(2 + x) at 1; 1; 2; 3
xi
1
1
1
1=3
2
1=2
3
3=5
h0
f (xi )
1st DD 6*(2nd Di)
2=3
2=5
1=10
= 2, h = 1, h = 1.
1
2
3h + 2h + h
0
12
0
2
0
1
h1
3
1=6
=h1
h2 =h1
2
3
6
m1
m2
=
h1
h20 =h1
2h1 + 3h2 + h22 =h1 )
3
2=5
The solution is m = 4=15, m = 1=15
1
2
m1
m2
=
u0
u1
h2n
1
n
2
+h
3
77
77
77
75
1.7.
41
SPLINE INTERPOLATION
Matrix formulation for the clamped spline
2(
66
66
64
3h0
2
+ 2h )
2(h + h )
h1
1
0
..
.
0
2
66
=6
66
4
h2
...
3(d
u0
un
0
u1
u2
2(h + h )
...
0
3
f 0 (x ))
2
...
hn
2
(2hn
hn
2
+
2
3hn
1
2
)
3
77
77
75
m1
m2
m3
..
.
mn
1
77
77
75
0
dn
3
32
77 66
77 66
75 64
0
0
0
...
h2
2
..
.
0
3(f (xn )
2
0
h1
1
1
)
The system admits a unique solution since the matrix is symmetric diagonally
dominant and positive denite (SPD).
Example 1:
Let us interpolate the function f (x) = x=(2 + x) where f 0 (x) = 2=(2 + x) .
Thus S 0 (x ) = 2 = f 0 ( 1) and Sn0 (x ) = 2=25 = f 0 (3).
2
0
0
1
3
To compute the ui ; i = 0; 1 we use the following table
xi
1
1st DD 6*(2nd Di)
1
1
1=3
2
1=2
3
3=5
h0
f (xi )
2=3
1=6
3
1=10
2=5
= 2, h = 1, h = 1.
1
2
3h =2 + 2h
0
1
h1
h1
2h1 + 3h2 =2)
m1
m2
=
u0
u1
3(d f 0 (x ))
3(f 0 (x ) d )
0
0
3
2
42
POLYNOMIAL INTERPOLATION
CHAPTER 1.
5 1
1 7=2
m1
m2
=
1
17=50
The solution is m = 64=275, m = 9=55
1
m0
= 3 f x0 ;x1h0 f
m3
= 3f
[
0 (x3 )
]
2
0 (x0 )
f [x2 ;x3 ]
h2
m1 =2
= 582=275
m2 =2
= 6=275
On [-1,1] :
p0
=y
0
=h0
(m
0
h0 )=6
S0 (x)
= 113=550, q = y
0
1
=h0
(m
1
h0 )=6
= 49=550
582
64
(x 1) +
(x + 1)
12 275
12 275
49
113
(x + 1)
+ (1 x) +
550
550
=
3
3
On [1; 2]
p1
=y
=h1
(m
q1
=y
=h1
(m
1
2
h1 )=6
= 81=275,
h1 )=6
= 29=55
1
2
S1 (x)
9
64
(x 2)
(x
6 275
6 55
+81(2 x)=275 + 29(x 1)=55
=
1)
3
3
On [2,3]
p2
=y
2
=h2
(m
2
h2 )=6
= 29=55, q = y
S2 (x)
2
=
9
6 55
+29(3
(x
3
=h2
3)
3
x)=55 + 164(x
(m
3
h2 )=6
1
(x
275
2)
2)=275
Examples of natural spline approximations
= 164=275
3
1.7.
43
SPLINE INTERPOLATION
Example 1: Let f (x) = jxj and construct the cubic spline interpolation at
the points xi = 2 + i; i = 0; 1; 2; 3; 4
xi
2
f (xi )
1st DD 6*(2nd Di)
2
1
1
1
0
0
1
1
2
2
0
1
12
1
0
1
We note that hi = h; i = 0; 1; 2; 3, m = m = 0 which leads to the following
system
0
2
4
41
4
32 3 2 3
0
5 = 4125
1 0 m
4 15 4m
0 1 4 m
1
2
0
3
The solution is m = 6=7, m = 24=7, m = 6=7.
1
2
3
On [ 2; 1]
p0
= (y
0
m0 h20
6
)=h = (2
0)=1 = 2 q = (y
0
S0 (x)
0
1
1
(x + 2) + 2( 1
7
=
3
m1 h20
6
x) +
)=h = (1 + 1=7) = 8=7
0
8
(x + 2)
7
On [ 1; 0]
p1
= (y
q1
= (y
1
2
m1 h21
6
m2 h21
6
)=h = (2
0)=1 = 8=7
1
)=h = (1 + 1=7) = 4=7
1
S1 (x)
=
1
4
8
x + (x + 1) + (0
7
7
7
3
3
x)
4
(x + 1)
7
44
CHAPTER 1.
POLYNOMIAL INTERPOLATION
On [0; 1]
p2
= (y
m2 h22
q2
= (y
m3 h22
2
6
3
6
)=h = (0
) = 4=7
24
2
7
6
)=h = (1 + ) = 8=7
4
S (x) =
(x 1) x =7
7
1
2
6
7
3
3
2
4
(1
7
x) +
8
x
7
On [1; 2]
m3 h23
= (y
p3
3
6
)=h = 8=7, q = (y
3
3
S3 (x)
= (2
m4 h23
4
6
x)3 =7 + 2(x
)=h = 2
3
1) + 8(2
x)=7
= (2; 8=7; 4=7; 8=7), q = (8=7; 4=7; 8=7; 2)
p
Example 2:
xi
f (xi )
1
1=3
2
1=2
3
3=5
1
h0
1
1st DD 6*(2nd Di)
2=3
3
1=6
2=5
1=10
= 2, h = 1, h = 1.
1
2
Natural cubic spline leads to m = m = 0. The other coeÆcients satisfy the
system
0
2(h + h )
0
1
h1
6 1
1 4
h1
2(h + h )
1
m1
m2
=
2
3
2=5
m1
m2
=
3
3
2=5
1.7.
45
SPLINE INTERPOLATION
which admits the following solution m =
58
1
115
,m =
2
3
115
On [ 1; 1]
p0
= (y
0
m0 h20
6
m1 h20
)=h = 1=2, q = (y
0
0
1
6
)=h = 77=230
0
On [1; 2]
p1
= (y
1
m1 h21
6
)=h = 48=115, q = (y
m2 h21
)=h = 57=115, q = (y
m3 h22
1
1
2
6
)=h = 57=115
1
On [2; 3]
p2
p
= (y
2
m2 h22
6
2
2
3
6
)=h = 3=5
2
= [ 1=2; 48=115; 57=115], q = [77=230; 57=115; 3=5]
Matlab commands for splines
x=0:1:10;
y=sin(x);
xi=0:0.2:10;
yi = sin(xi);
%piecewise linear interpolation
y1 = interp1(x,y,xi)
plot(x,y,'0',xi,yi) %plot the exact function
hold on;
plot(xi,y1);
%
y2 = interp1(x,y,xi,'spline') % spline interpolation
y3 = interp1(x,y,'cubic') % piecewise cubic interpolation
y4 = spline(x,y,xi) %not-a-knot spline
plot(xi,y4);
plot(xi,y2);
plot(xi,y3);
46
1.7.3
POLYNOMIAL INTERPOLATION
CHAPTER 1.
Convergence of cubic splines
We will study the uniform convergence of the clamped cubic spline for
C [a; b].
We rst write the matrix formulation for the clamped cubic spline as
4
f
2
AM = B
where M = [m
0
; m1 ;
; mn]t, B = [b ; b ; ; bn]t.
0
1
Let us recall that
S00 (x0 )
and
Sn0
=
hn
(xn ) =
h0 m0
3
1
mn
h0 m1
+
6
+
1
=
hn
1
mn
(y
y0 )
1
h0
= f 0 (xn )
f 0 (x0 )
(yn
yn
1
)
:
6
3
hn
We combine (1.1.41), (1.1.42) and (1.1.35) to write the (n + 1) (n + 1)
matrix A as
ai;j
1
1
8
>
2;
>
>
>
>
>
<1;
if i = j
if (i; j ) = (1; 2) or (i; j ) = (n; n 1)
h
= h h 1 ; if j = i + 1; 1 < i < n
>
>
h 1
>
; if j = i 1; 1 i < n 1
>
h h 1
>
>
:0; otherwise;
i
i+ i
:
(1.1.43)
i
i+ i
the n + 1 by n + 1 matrix A can be written as
22
66 . . .
6. .
A=6
66 .
4. . .
1
...
hi 1
hi +hi
...
0
0
1
0
0
2
hi
hi +hi
0
:::
:::
1
:::
1
3
0
.. 7
.7
7
07
7
.. 7
.5
2
(1.1.44)
The right-hand side B is dened by
b0
=
6
h0
(
y1
y0
h0
f 0 (x0 ));
(1.1.45)
1.7.
47
SPLINE INTERPOLATION
bi
=
y
6
( i
hi + hi
yi
+1
yi
hi
1
bn
yi
hi
=
6
hn
1
1
); i = 1; 2; ; n
yn
(f 0(xn )
yn
hn
1
1
1;
):
(1.1.46)
(1.1.47)
1
Lemma 1.7.1. Let A be dened in (1.1.43) such that Az = w. Then,
Proof. Let
leads to
zk
jjzjj1 jjwjj1
be such that jzk j = jjzjj1. The kth
ak;k
1
zk
1
+ 2zk + ak;k
+1
equation from Az = w
= wk
zk+1
(1.1.48)
Applying the triangle inequality we have
jjwjj1 jwk j = jak;k
2jzk j
(2
Using the fact that ak;k
1
1
zk
ak;k
1
jzk j
(ak;k
+ ak;k
+1
+ 2zk + ak;k
1
1
1
+1
zk+1
j
ak;k+1 zk+1
j
(1.1.49)
j
(1.1.50)
+ ak;k )jzk j:
(1.1.51)
+1
= 1 we complete the proof.
In order to state the following lemma we let F = [f 00 (x ); f 00 (x ); ; f 00 (xn )]t ,
R = B AF = A(M F) and H = i max
hi .
;n
0
=0
1
1
Lemma 1.7.2. If f 2 C [a; b] and jjf jj1 M , then
4
(4)
4
jjM Fjj1 jjRjj1 34 M H
4
2
:
(1.1.52)
48
POLYNOMIAL INTERPOLATION
CHAPTER 1.
Proof.
r0
2f 00 (x )
=b
0
f 00 (x1 )
0
6
=
h0
(
y1
y0
f 0 (x0 ))
h0
2f 00 (x )
0
f 00 (x1 ):
(1.1.53)
Using Taylor expansion we write
y1
y0
=
h0
=
1
h0
h
(h f 0 (x ) +
2
0
0
f 00 (x0
f (x0
f (x0 )
0
2
+
h30 f 000 (x0 )
6
0
0
h40 f (4) (1 )
+
h
+ h ) = f 00 (x ) + h f 000 (x ) +
0
(1.1.54)
h0
f 00 (x0 )
0
+h )
24
2
0
)
f (4) (2 )
(1.1.56)
2
0
(1.1.55)
which leads to
r0
=
h20 f (4) (2 )
h20 f (4) (1 )
4
(1.1.57)
2
Thus,
jr j < 3H
2
0
M4 =4:
(1.1.58)
Similarly for
rn
= bn
bn
=
f 00 (xn
6
hn
1
2f 00 (xn ):
)
yn
(f 0 (xn )
yn
hn
1
1
(1.1.59)
)
(1.1.60)
1
Using Taylor series
f (xn )
f (xn
hn
1
hn
1
(
hn
0
1 f (xn ) +
h2n
2
1
)
=
f (xn
f 00 (xn )
)
hn
1
1
1
h3n
6
1
f (xn )
=
1
f 000 (xn ) +
h4n
24
1
f (4) (1 )):
(1.1.61)
1.7.
49
SPLINE INTERPOLATION
f 00 (xn
1
) = f 00 (xn
hn
1
hn
) = f 00 (xn )
2
jrnj < 3H
rj
j f 00 (xj
= bj
1
1
2
h2n
2
1
f (4) (2 )
M4 =4:
2f 00 (xj )
)
f 000 (xn ) +
(1.1.62)
(1.1.63)
j f 00 (xj +1 );
(1.1.64a)
where
=
j
hj
1
;
+ hj
hj
=
j
1
hj
(1.1.64b)
hj
+ hj
1
yj
yj
1
and
=
bj
y
6
( j
+ hj
hj
1
yj
+1
hj
hj
):
(1.1.64c)
1
Using Taylor expansion we write
hj f 000 (xj )
h f ( )
yj
yj
hj f 00 (xj )
0
= [f (xj ) +
+
+ j
];
hj
2
6
24
2
3
(4)
yj
yj
hj
(1.1.64d)
1
+1
1
hj
= [+f 0 (xj )
1
f 00 (xj )
1
f 00 (xj
1
) = f 00 (xj )
f 00 (xj +1 )
Note that i 2 (xj
1
hj
2
1
+
h2j
f 000 (xj ) + h2j
1
f 000 (xj )
6
1
h3j
1
f (4) (2 )
24
(1.1.64e)
f (4) (3 )=2;
(1.1.64f)
= f 00 (xj ) + hj f 000 (xj ) + hj f ( )=2:
2
];
(1.1.64g)
(4)
4
; xj +1 ).
Combining (1.1.64) we obtain
rj
=
h f ( )
h
1
[ j
+ j
hj + hj
4
3
1
(4)
1
3
1
f (4) (2 )
4
h3j
1
f (4) (3 )
2
h3j f (4) (4 )
2
]:
(1.1.65)
50
POLYNOMIAL INTERPOLATION
CHAPTER 1.
This can be bounded as
jrj j 43 M
+ hj
hj + hj
h3j
4
hj
Without loss of generality we assume hj
+ hj
hj + hj
h3j
3
1 + ( hh 1 )
j
3
1
1
= hj
2
3
1
1
and write
hj H
j
1+
(1.1.66)
1
2
hj 1
hj
2
(1.1.67)
:
Thus,
jrj j < 43 M H
4
2
(1.1.68)
:
Finally, using Lemma 1.7.1 we have
jjM Fjj1 jjRjj1 34 M H
2
4
(1.1.69)
;
which completes the proof.
Theorem 1.7.5. Le f (x) 2
xj +1
xj
and H = max
;n
i=0;
such that
H
hj
1
C 4 [a; b], a
hj .
K;
x
0
Assume there
j
< xn b, hj
< x1 <
exits K >
= 0; 1; ; n
=
0 independent of H
1:
(1.1.70)
If S (x) is the clamped cubic spline approximation of f at xi ; i = 0; 1; ; xn ,
then there exists Ck > 0 independent of H such that
jjf k S k jj1; a;b Ck M KH k ; k = 0; 1; 2; 3;
(1.1.71)
where M = jjf jj1.
Proof. For k = 3 and x 2 [xj
xj ] by adding and subtracting few auxiliary
( )
( )
4
[
4
4
]
(4)
1
terms the error can be written
e000 (x)
= f 000 (x)
S 000 (x)
= f 000 (x)
mj
mj
hj
1
1
1.7.
51
SPLINE INTERPOLATION
f 00 (xj )
mj
= f 000 (x)
hj
f 00 (xj )
f 00 (xj
1
hj
1
f 00 (x)
hj
mj
+
+
f 00 (xj
1
hj
1
hj
j
1
j
2
4
;
4hj
1
1
1
hj
(1.1.72)
:
1
Using Lemma 1.7.2 we bound the following terms
mj
f 00 (xj )
3M H mj
f 00 (xj )
j
)
1
f 00 (x)
)
1
j 34Mh H
j
1
2
4
:
(1.1.73)
1
We use Taylor series to obtain
f 00 (xj )
and
f 00 (xj
1
f 00 (x)
f 00 (x)
)
x)f 000 (x) +
= (xj
= (x j
(xj
(xj
x)f 000 (x) +
1
2
x)2
je000(x)j 34Mh H
4
j
(xj
1
2
+
1
1
hj
1
j(xj
(xj
x)f 000 (x)
2
The f 000 terms cancel out to give
je000(x)j 32Mh H
4
j
Using
jj(xj
x)2
2
+
1
+ (xj
x)f 000 (x) + (xj
1
1
2
x)2
M4
2hj
f (4) (2 )
[(xj
x)2
x)2
jj1; x
[
j
x)2
1
we bound the error
f (4) (2 )
x)2 f (4) (1 )
hj
1
j
f 000 (x)
+ (xj
1
= hj
1
1 ;xj ]
f (4) (1 )
2
(1.1.74)
(1.1.75)
x)2 ]:
H
2
;
we write
je000 (x)j 32Mh H
4
j
Since H=hj
K we have
1
2
+
M4 H 2
2hj
1
:
(1.1.76)
52
POLYNOMIAL INTERPOLATION
CHAPTER 1.
jf 000 (x)
S 000 (x)
For k = 2, we note that for each
H=2. Now we rewrite e00 (x) as
e00 (x) = f 00 (x)
Using j
R
j
g <
R
x
S 00 (x) = f 00 (xj )
j 2M KH; 8x:
(1.1.77)
4
2 (a; b), there is xj such that jxj
S 00 (xj ) +
Z
x
xj
(f 000 (t)
S 000 (t))dt
j
x
(1.1.78)
jgjdx and Lemma 1.7.2 we obtain
je00(x)j 3M4H
4
3M4H
4
2
2
+ j(x
+M
4
xj )
KH 2
j xmax
jjf 000
2 a;b
[
S 000
]
7KM4 H
4
2
jj
(1.1.79)
; K > 1:
(1.1.80)
Thus,
jjf 00(x)
jj1 7KM4 H
S 00 (x)
4
2
(1.1.81)
:
For k = 1, we consider e(t) = f (t) S (t), since e(xj ) = 0, by Rolle's theorem
there exist j ; j = 0; 1; ; n 1 such that e0 (i ) = 0 and e0 (x ) = e0 (xn ) = 0.
For every x 2 [a; b] there exists i such that jx i j H and e0 (x) can be
written as
0
f 0 (x)
S 0 (x) =
Z
x
i
(f 00 (t)
S 00 (t))dt
(1.1.82)
Thus,
je0(x)j jx
i
jjje00 jj1 47 M KH
4
3
:
(1.1.83)
1.7.
53
SPLINE INTERPOLATION
For k = 0, for every
write
x
2 [a; b] there is xj such that jx
f (x)
S (x)
je(x)j jx
Z
=
xj
x
xj
(f 0 (t)
xj
j H=2 we also
S 0 (t))dt
jjje0jj1 87 M KH
4
4
We conclude that S k converges uniformly to f
0.
( )
(k )
(1.1.84)
(1.1.85)
:
for k = 0; 1; 2; 3 and H
!
Optimal bounds are proved by Birkho and De Boor (Burden and Faires) as
jjf
S
5
jj1 < 384
M H
4
4
(1.1.86)
:
We recall the Hermite interpolation error
jf
j
H3 <
1
24 16
M4 H 4
M4 H 4
=
384
(1.1.87)
;
Comparing the cubic spline and Hermite interpolation errors, we see that the
ratio between the spline and the Hermite errors is only 5. We also note that
Hermite interpolation requires the derivative at all the interpolation points
while the clamped spline needs the derivatives at the end points only.
Optimality of Splines: The optimality is in the sense that cubic spline
has the smallest curvature. For a curve dened by y = f (x) the curvature is
dened as
=
jf 00(x)jj
:
[1 + (f 0 (x)) ] =
R
Here the curvature is approximated by jf 00 (x)j and ab S 00 (x)
More precisely we state the following theorem.
2 3 2
2
dx
is minimized.
54
POLYNOMIAL INTERPOLATION
CHAPTER 1.
2 C [a; b] and S (x) is the natural cubic spline that
interpolates f at n + 1 points xi ; i = 0; 1; ; n; then
Theorem 1.7.6. If
f
2
Z
b
S 00 (x)
2
a
dx
Z
b
f 00 (x)2 dx:
a
(1.1.88)
Proof. We consider the function e(x) = f (x) S (x) with e(xi ) = 0;
0; 1; ; n; and write the approximate curvature of f = S + e as
Z
b
f 00 (x)
2
a
Z
b
S 00 (x)
2
a
dx +
Z
b
a
dx
=
Z
e00 (x)
b
a
2
(S 00 (x) + e00 (x))
Z
dx + 2
b
a
2
dx
i
=
=
S 00 (x)e00 (x)dx:
(1.1.89)
We complete the proof by showing that the last term in the right-hand side
of (1.1.89) is 0.
Integrating by parts we obtain
Z
xi+1
xi
Z
e00 (x)S 00 (x)dx = S 00 (x)e0 (x)jx
=xi+1
x=xi
xi+1
xi
S 000 (x)e0 (x)dx:
Summing over all intervals, using the fact that e 2 C and S 00 (a) = S 00 (b) = 0.
Noting that S 000 (x) = Ci is a constant on (xi ; xi ) we obtain
2
Z
n
X
1
i=0
+1
xi+1
xi
e00 (x)S 00 (x)dx =
Z
n
X
1
Ci
xi
i=0
n
X
xi+1
e0 (x)dx
1
=
Ci [e(xi+1 )
e(xi )]
=0
i=0
R
We used the fact that e(xi ) = 0 we establish ab S 00 (x)e00 (x)dx = 0.
Combining this with (1.1.89) leads to (1.1.88).
The same result holds for the clamped cubic spline with S 0 (a) = f 0 (a) and
S 0 (b) = f 0 (b). We follow the same line of reasoning to prove it.
Thus, among all C functions interpolating f at x ; : : : ; xn , the natural cubic
spline has the smallest curvature. This includes the clamped spline and nota=knot splines.
2
0
1.7.
55
SPLINE INTERPOLATION
1.7.4
B-splines
We describe a system of B-splines (B stands for basis) from which other
splines can be obtained.
We rst start with B-splines of degree 0, i.e., piecewise constant splines
dened as
(
Bi0 (x)
=
1
0
xi
x < xi
+1
otherwise
;i
2Z
(1.1.90)
Properties of Bi (x):
0
1.
2.
Bi0 (x)
1
P
i=
1
0; for all x and i
Bi0 (x)
= 1, for all x
3. The support of Bi (x) is [xi ; xi )
0
4.
Bi0 (x)
2C
1
+1
.
We show property (2) by noting that for arbitrary x there exists m such that
x 2 [xm ; xm ) then write
1
X
Bi (x) = Bm (x) = 1:
i
1
+1
0
0
=
Use the recurrence formula to generate the next basis functions
Bik (x)
=
x
xi
xi+k
xi
Bik
1
(x) +
xi+k+1
xi+k+1
x
xi+1
Bik+11 (x); f or k > 0:
(1.1.91)
Properties of Bi :
1
1.
Bi1 (x)
2.
Bi1 (x)
3.
are the classical piecewise linear hat functions equal to 1 at xi
and zero all other nodes.
1
P
i=
1
+1
2C
0
Bi1 (x)
= 1 for all x
56
POLYNOMIAL INTERPOLATION
CHAPTER 1.
4. The support of Bi (x) is (xi ; xi )
1
5.
Bi1 (x)
+2
0 for all x and i
In general for arbitrary k one can show that:
1.
Bik (x)
are piecewise polynomials of degree k
2.
Bik (x)
2 Ck
3.
1
P
i=
1
Bik (x)
1
= 1 for all x
4. The support of Bik (x) is (xi ; xi
+k +1
5.
6.
)
0 for all x and i
Bik (x), 1 < i < 1 are linearly independent, i.e., they form a basis.
Bik (x)
See Figure 1.7.4 for plots of the rst four b-splines.
Interpolation using B-splines:
(i) For
writing
k
= 0, we construct a piecewise constant spline interpolation by
f (x)
P (x) =
1
X
0
i=
1
ci Bi0 (x)
(1.1.92)
Using the properties of Bi (x) we show that ci = f (xi ).
0
(ii) For k = 1, we construct a piecewise linear spline interpolation by writing
1
X
f (x) P (x) =
ci Bi (x)
(1.1.93)
i
1
1
1
=
Again using Bi (xj ) = Æij we show that ci = f (xi ).
1
+1
+1
(ii) For k = 3, we construct a piecewise cubic spline interpolation by writing
1
X
f (x) P (x) =
ci Bi (x)
(1.1.94)
i
1
3
3
=
1.7.
57
SPLINE INTERPOLATION
1
1
B01(x)
0.8
0.8
B1(x)
1
0.6
0.6
0.4
0.4
0.2
0.2
0
+
0
x1
+
2
x2
+
4
+
6
8
0.8
0
0
+
x
+
2
1
x
3
+
4
+
6
8
0.7
0.6
2
B1(x)
0.6
B31(x)
0.5
0.4
0.4
0.3
0.2
0.2
0.1
0
0
2
x1
+
4
x4
+
6
+
8
0
0
+
x
1
2
+
4
+
x
5
Figure 1.1: B-splines of degree k = 0; 1; 2; 3, upper left to lower right.
6
+
8
58
POLYNOMIAL INTERPOLATION
CHAPTER 1.
We recall that
(xi ; xi ).
2
Bi3
C2
are piecewise cubic polynomials with support in
+3
In order to interpolate f at xi ; i = 0; ; n, we
P
n
1. Write S (x) =
i=
1
ci Bi3 (x)
3
(include basis functions whose support intersect [x
0
; xn ]).
2. Set n + 1 equations
f (xi )
where c
= ci
3
Bi3
3
;c
2
;c
1
3
(xi ) + ci
; c0 ;
2
Bi3
2
(xi ) + ci
1
Bi3
1
(xi );
; cn are the unknowns.
3. Close the system, for natural Spline, by setting
S 00 (x ) = 0; S 00 (xn ) = 0;
0
i
= 0; 1; ; n;
(1.1.95a)
(1.1.95b)
4. Solve the system (1.1.95).
Remarks:
1. If xi are uniformly distributed we have
Bi (xj ) = 0; j i or j i + 3,
Bi (xi ) = Bi (xi ) = 1=2
Bi (xj ) = 0; j i or j i + 4,
Bi (xi ) = Bi (xi ) = 1=6, Bi (xi ) = 2=3
2
2
2
+1
+2
3
3
+1
3
+3
3
+2
2. The system (1.1.95) has a unique solution
3. B-splines may be used to construct clamped splines
1.8
Interpolation in multiple dimensions
Read section of 6.10 of textbook (Kincaid and Cheney).
1.9
Least-squares Approximations
Read section 6.8 of Textbook (Kincaid and Cheney).
Bibliography
59
© Copyright 2026 Paperzz