Mar. 20 Math 2335 sec 001 Spring 2014 Chebyshev Polynomials Definition: For an integer n 0 define the function ( ) T n (x) = cos n cos 1 (x), 1 x 1. It can be shown that T n is a polynomial of degree n. It s called the Chebyshev Polynomial of degree n. () March 19, 2014 1 / 54
A Few Chebyshev Polynomials We determined a few in class: T 0 (x) = 1, T 1 (x) = x, T 2 (x) = 2x 2 1 T 3 (x) = 4x 3 3x A couple more are T 4 (x) = 8x 4 8x 2 1, T 5 (x) = 16x 5 20x 3 + 5x It can be shown that for n 1, they have the recurrence relation T n+1 (x) = 2xT n (x) T n 1 (x). () March 19, 2014 2 / 54
Figure: Plot of the first five Chebyshev Polynomials (of the first kind). () March 19, 2014 3 / 54
Some Properties of Chebyshev Polynomials T n is an even function if n is even and an odd function if n is odd. T n (1) = 1 and T n ( 1) = ( 1) n for every n They have an orthogonality relation 1 1 T n (x)t m (x) dx = 0 n m. 1 x 2 And the main property we re interested in T n (x) 1 for all 1 x 1 () March 19, 2014 4 / 54
Minimum Size Property We can note that T n (x) = 2 n 1 x n + terms with lower powers. We define the modified Chebyshev polynomials by T n (x) = 1 2 n 1 T n(x). Remark: The modified Chebyshev polynomials are monic polynomials. That is T n (x) = x n + terms with lower powers. () March 19, 2014 5 / 54
Minimum Size Property Theorem: Let n 1 be an integer. Of all monic polynomials on the interval [ 1, 1], the one with the smallest maximum value is the modified Chebyshev polynomial T n (x). Moreover T n (x) 1 2 n 1 for all 1 x 1. This result suggests that whenever possible, we choose the polynomial Ψ n (x) in our error theorem to be the modified Chebyshev polynomial T n+1 (x). () March 19, 2014 6 / 54
Chebyshev Nodes Since T n+1 (x) is monic, it can be written as T n+1 (x) = (x r 0 )(x r 1 ) (x r n ) where r 0,..., r n are the roots of T n+1 (x). We had the polynomial in our error formula Ψ n (x) = (x x 0 )(x x 1 ) (x x n ). So to minimize the error i.e. make Ψ n (x) = T n+1 (x) we would have to choose the nodes x j to be the roots r j of the Chebyshev polynomial T n+1. () March 19, 2014 7 / 54
Example: Chebyshev Nodes Use the change of variables x = cos θ to find the roots of T 4 (x). ( ) T 4 (x) = cos 4 cos 1 (x) We determined the four roots to be ( π ) x 0 = cos, x 1 = cos 8 x 2 = cos ( 3π 8 ( ) 5π, 8 and x 3 = cos ), ( ) 7π. 8 () March 19, 2014 8 / 54
Chebyshev Nodes Find a formula for the roots of T k (x) = cos ( k cos 1 (x) ). () March 19, 2014 9 / 54
() March 19, 2014 10 / 54
Chebyshev Nodes To interpolate f (x) on the interval [ 1, 1] by P n (x), the error is minimized by choosing the Chebyshev nodes (roots of T n+1 (x)) ( ) (2j + 1)π x j = cos, j = 0, 1,... n. 2(n + 1) The resulting error bound is f (x) P n (x) L f (n+1) (x), where L = max 2n 1 x 1 (n + 1)! () March 19, 2014 11 / 54
Example Let f (x) = e 2x on [ 1, 1]. Determine the Chebyshev nodes if P 3 (x) is being used to approximate f (x), and determine the resulting error bound. () March 19, 2014 12 / 54
() March 19, 2014 13 / 54
() March 19, 2014 14 / 54
Intervals Other than [ 1, 1] The Chebyshev nodes are in the interval [ 1, 1]. What if a function f (x) is to be approximated on an interval [a, b] different from [ 1, 1]? Let a x b. Find a formula in the form of a line for a new variable t such that 1 t 1. (That is, write something like t = mx + b.) () March 19, 2014 15 / 54
() March 19, 2014 16 / 54
Figure: Line through points (a, 1) and (b, 1). () March 19, 2014 17 / 54
Intervals Other than [ 1, 1] For f (x) defined on [a, b], set t = 2 (x a) 1 b a Then 1 t 1, and we can use the Chebyshev nodes for t. We perform the interpolation for ( ) b a g(t) = f (t + 1) + a 2 () March 19, 2014 18 / 54
Intervals Other than [ 1, 1] Solve for x in terms of t from t = 2 b a (x a) 1. () March 19, 2014 19 / 54
Intervals Other than [ 1, 1] ( ) b a Show that g (t) = f (x). 2 () March 19, 2014 20 / 54
Error Formula for Intervals Other than [ 1, 1] If (translated) Chebyshev nodes are used to approximate f (x) on [a, b] by the interpolating polynomial P n (x), then the error ( ) b a n+1 L f (x) P n (x) 2 2 n, where f (n+1) (x) L = max a x b (n + 1)! () March 19, 2014 21 / 54
Example Let f (x) = tan 1 (x) on the interval [0, 1]. Suppose we wish to interpolate f (x) using P 2 (x). Determine the translated Chebyshev nodes. And find a bound on the error when these nodes are used. () March 19, 2014 22 / 54
Example Continued... 1 1 It s helpful to note that d 3 dx 3 tan 1 x = 6x 2 2 (x 2 + 1) 3 (see slide after next for figure) () March 19, 2014 23 / 54
() March 19, 2014 24 / 54
Figure () March 19, 2014 25 / 54
Section 4.3: Interpolating Using Spline Functions We ve seen that when we can choose our nodes, we may be able to use a high degree polynomial interpolation and reduce the wiggly effect near the ends. But we don t always have an option to pick our nodes. 2 An alternative is to fit data with a piece-wise defined function that interpolates. We ll consider building a function whose pieces are polynomial. 2 That s nodes with a d. () March 19, 2014 26 / 54
Motivating Example Consider the data set x 0 1 2 1 2 5 2 4 y 1 1 1 1 3 2 2 A simple way to interpolate is to plot the points and connect each adjacent pair with a straight line segment. An alternative is to fit the six points with a polynomial interpolation of degree 5, P 5 (x). () March 19, 2014 27 / 54
Piece-wise Linear Interpolation Figure: It does interpolate, but the graph is not very smooth looking. () March 19, 2014 28 / 54
Interpolation of the Same Data with P 5 (x) Figure: The graph of P 5 (x) is significantly smoother, but how does the overall shape compare? () March 19, 2014 29 / 54
Comparison: Piece-wise Linear -vs- P 5 (x) Figure: Both pass through the data, but the curves are very different between the data points. () March 19, 2014 30 / 54
Piece-wise Cubic Interpolation An alternative is to take each successive pair of points and fit them with a piece of (polynomial) curve s(x) that passes through each data point, is continuous on the entire interval (the pieces are connected), and such that s (x) and s (x) are continuous on the entire interval (they connect without kinks or corners). The last condition suggests we will need the pieces to be cubic, or up to degree three. () March 19, 2014 31 / 54
Piece-wise Cubic Interpolation Figure: The data is interpolated by five pieces of cubic function. () March 19, 2014 32 / 54
Comparison: Piece-wise Linear -vs- Piece-wise Cubic Figure: The overall shape is preserved with piecewise cubic and the kinks are smoothed out. () March 19, 2014 33 / 54
Natural Cubic Spline Suppose that the n data points (x i, y i ), j = 1, 2,..., n are given. Assume x 1 = a, x j 1 < x j and x n = b. There exists a function s(x) that interpolates these points i.e. satisfying the following properties: s(x j ) = y j, for j = 1,..., n S1. s(x) is a polynomial of degree 3 on each interval [x j, x j+1 ], j = 1,... n 1. S2. s(x), s (x), and s (x) are continuous on [a, b]. S3. s (x 1 ) = 0 and s (x n ) = 0 3 The curve s(x) is called the natural cubic spline that interpolates the data. 3 This condition may be changed leading to other cubic splines. () March 19, 2014 34 / 54