Chebyshev Polynomials: Example

Example:
Let’s compare how well a 3rd order polynomial interpolation does when the data points are chosen
to be at the Chebyshev nodes, compared to when they are equally spaced as previous.
f (x) = sin x,
x ∈ [0, π].
Using n = 3 gives 4 equally-spaced points x0 = 0, x1 = π/3, x2 = 2π/3 and x4 = π, with
√
f (0) = f (π) = 0, f (π/3) = f (2π/3) = 3/2. We have previously found p3 (x) that passes through
these four points:
p3 (x)
:
0
:0
= L0
(x)f
(x0 ) + L1 (x)f (x1 ) + L2 (x)f (x2 ) + L3
(x)f
(x3 )
√
√
3
3
x(x − π/3)(x − π)
x(x − 2π/3)(x − π)
·
+
·
=
(π/3)(−π/3)(−2π/3) 2
(2π/3)(π/3)(−π/3) 2
We would like to compare this with the approximation p∗3 (x) based on the “Chebyshev zeros” of
Tn+1 (x) = T4 (x).
We can find the zeros immediately, as they are given by property 2 of Chebyshev polynomials:
xCk = cos
(2k + 1)π
2(n + 1)
k = 0, 1, 2, 3.
It’s clear that Tn+1 (xCk ) = 0, since by definition Tn+1 (x) = cos((n + 1) cos−1 x).
Evaluating the zeros:
xC0 = cos
xC2 = cos
π
∼ 0.9239,
8
3π
∼ 0.3827
8
7π
= cos
∼ −0.9239
8
xC1 = cos
5π
∼ −0.3827,
8
xC3
These points lie between [−1, 1]. To map them onto the range [a, b] = [0, π], we use the formula:
xk =
1
1
π π
(a + b) + (b − a)xCk = + xCk .
2
2
2
2
Hence, the Chebyshev nodes for our particular problem are
x0
=
x1
=
x2
=
x3
=
π
2
π
2
π
2
π
2
π
2
π
+
2
π
+
2
π
+
2
+
· 0.9239 ∼ 3.0220 ∼ 0.9619π
· 0.3827 ∼ 2.1719 ∼ 0.6913π
· −0.3827 ∼ 0.9697 ∼ 0.3087π
· −0.9239 ∼ 0.1196 ∼ 0.0381π
Using these nodes imply we should use the data points
(x0 , f (x0 )) = (0.961π, 0.1192),
(x1 , f (x1 )) = (0.6913π, 0.8247)
(x2 , f (x2 )) = (0.3087π, 0.8247),
(x3 , f (x3 )) = (0.0381π, 0.1192)
Substituting these values into the Lagrange interpolation formula gives
p∗3 (x) = −1.3663 × 10−8 x3 − 0.3948x2 + 1.2405x − 0.0000.
1
Let’s see how well these do compared to each other:
1.0
0.02
0.8
0.00
f(x)
f(x) - p(x)
0.6
0.4
-0.02
0.2
-0.04
0.0
0
pi/3
2pi/3
pi
0
x
pi/3
2pi/3
pi
x
Figure 3.1: (a) f (x) = sin x between [0, π] (thick solid line) ; 3rd order interpolation polynomial (p3 (x)) with equally spaced interpolation points (thin solid line, interpolation points shown
as crosses); 3rd order polynomial interpolation with Chebyshev nodes (p∗3 (x)) (dash-dotted line,
Chebyshev nodes shown as diamonds). (b) Error in the interpolation: f (x) − p3 (x) (solid line) and
f (x) − p∗3 (x). We see that overall, using the Chebyshev nodes achieves a more accurate fit, even
though in places, the other interpolation polynomial does better.
2