Orthogonal Polynomials and Least-Squares Approximations to Functions

Similar documents
Discrete Least-squares Approximations

Best Approximation. Chapter The General Case

Chapter 3 Polynomials

1 The Lagrange interpolation formula

Numerical Methods I Orthogonal Polynomials

Lecture 19: Continuous Least Squares Approximation

Best Approximation in the 2-norm

Lecture 6: Singular Integrals, Open Quadrature rules, and Gauss Quadrature

Orthogonal Polynomials

Theoretical foundations of Gaussian quadrature

Lecture 14: Quadrature

Abstract inner product spaces

Numerical Integration

Numerical Analysis. Doron Levy. Department of Mathematics Stanford University

Review of Calculus, cont d

Numerical Analysis: Trapezoidal and Simpson s Rule

1. Gauss-Jacobi quadrature and Legendre polynomials. p(t)w(t)dt, p {p(x 0 ),...p(x n )} p(t)w(t)dt = w k p(x k ),

63. Representation of functions as power series Consider a power series. ( 1) n x 2n for all 1 < x < 1

NUMERICAL INTEGRATION. The inverse process to differentiation in calculus is integration. Mathematically, integration is represented by.

Lecture 4: Piecewise Cubic Interpolation

CAAM 453 NUMERICAL ANALYSIS I Examination There are four questions, plus a bonus. Do not look at them until you begin the exam.

Partial Derivatives. Limits. For a single variable function f (x), the limit lim

Math& 152 Section Integration by Parts

Lecture 17. Integration: Gauss Quadrature. David Semeraro. University of Illinois at Urbana-Champaign. March 20, 2014

Numerical quadrature based on interpolating functions: A MATLAB implementation

Physics 116C Solution of inhomogeneous ordinary differential equations using Green s functions

CMDA 4604: Intermediate Topics in Mathematical Modeling Lecture 19: Interpolation and Quadrature

Properties of Integrals, Indefinite Integrals. Goals: Definition of the Definite Integral Integral Calculations using Antiderivatives

The Regulated and Riemann Integrals

Numerical integration

Section 7.1 Integration by Substitution

Lecture Note 4: Numerical differentiation and integration. Xiaoqun Zhang Shanghai Jiao Tong University

III. Lecture on Numerical Integration. File faclib/dattab/lecture-notes/numerical-inter03.tex /by EC, 3/14/2008 at 15:11, version 9

Euler-Maclaurin Summation Formula 1

Unit #9 : Definite Integral Properties; Fundamental Theorem of Calculus

Chapter 3 Solving Nonlinear Equations

Sturm-Liouville Eigenvalue problem: Let p(x) > 0, q(x) 0, r(x) 0 in I = (a, b). Here we assume b > a. Let X C 2 1

Math 473: Practice Problems for the Material after Test 2, Fall 2011

UNIFORM CONVERGENCE MA 403: REAL ANALYSIS, INSTRUCTOR: B. V. LIMAYE

Chapter 6. Infinite series

The Riemann Integral

Math 270A: Numerical Linear Algebra

MORE FUNCTION GRAPHING; OPTIMIZATION. (Last edited October 28, 2013 at 11:09pm.)

Math 1B, lecture 4: Error bounds for numerical methods

3.4 Numerical integration

Euler, Ioachimescu and the trapezium rule. G.J.O. Jameson (Math. Gazette 96 (2012), )

Convex Sets and Functions

Part IB Numerical Analysis

Week 10: Riemann integral and its properties

Numerical Analysis. Chassidy Bozeman. May 30, 2016

1 Linear Least Squares

New Expansion and Infinite Series

Chapters 4 & 5 Integrals & Applications

NUMERICAL INTEGRATION

20 MATHEMATICS POLYNOMIALS

Numerical Integration. 1 Introduction. 2 Midpoint Rule, Trapezoid Rule, Simpson Rule. AMSC/CMSC 460/466 T. von Petersdorff 1

Z b. f(x)dx. Yet in the above two cases we know what f(x) is. Sometimes, engineers want to calculate an area by computing I, but...

1 The Riemann Integral

P 3 (x) = f(0) + f (0)x + f (0) 2. x 2 + f (0) . In the problem set, you are asked to show, in general, the n th order term is a n = f (n) (0)

Overview of Calculus I

Exam 2, Mathematics 4701, Section ETY6 6:05 pm 7:40 pm, March 31, 2016, IH-1105 Instructor: Attila Máté 1

Techniques of Integration

Trapezoidal Rule, n = 1, x 0 = a, x 1 = b, h = b a. f (x)dx = h 2 (f (x 0) + f (x 1 )) h3

Integrals - Motivation

Math 520 Final Exam Topic Outline Sections 1 3 (Xiao/Dumas/Liaw) Spring 2008

Continuous Random Variables

The Fundamental Theorem of Calculus. The Total Change Theorem and the Area Under a Curve.

ODE: Existence and Uniqueness of a Solution

Construction of Gauss Quadrature Rules

Advanced Computational Fluid Dynamics AA215A Lecture 3 Polynomial Interpolation: Numerical Differentiation and Integration.

Chapter 1. Basic Concepts

A REVIEW OF CALCULUS CONCEPTS FOR JDEP 384H. Thomas Shores Department of Mathematics University of Nebraska Spring 2007

MA 124 January 18, Derivatives are. Integrals are.

Review of Riemann Integral

Review of basic calculus

p(x) = 3x 3 + x n 3 k=0 so the right hand side of the equality we have to show is obtained for r = b 0, s = b 1 and 2n 3 b k x k, q 2n 3 (x) =

B.Sc. in Mathematics (Ordinary)

Numerical Integration

AM1 Mathematical Analysis 1 Oct Feb Exercises Lecture 3. sin(x + h) sin x h cos(x + h) cos x h

Lecture 12: Numerical Quadrature

DEFINITION The inner product of two functions f 1 and f 2 on an interval [a, b] is the number. ( f 1, f 2 ) b DEFINITION 11.1.

Cambridge International Examinations Cambridge International Advanced Subsidiary and Advanced Level. Published

x = b a n x 2 e x dx. cdx = c(b a), where c is any constant. a b

MATH34032: Green s Functions, Integral Equations and the Calculus of Variations 1

Indefinite Integral. Chapter Integration - reverse of differentiation

THE EXISTENCE-UNIQUENESS THEOREM FOR FIRST-ORDER DIFFERENTIAL EQUATIONS.

8 Laplace s Method and Local Limit Theorems

Chapter 5 : Continuous Random Variables

c n φ n (x), 0 < x < L, (1) n=1

Sections 5.2: The Definite Integral

Lecture 1. Functional series. Pointwise and uniform convergence.

x = b a N. (13-1) The set of points used to subdivide the range [a, b] (see Fig. 13.1) is

Definition of Continuity: The function f(x) is continuous at x = a if f(a) exists and lim

Calculus and linear algebra for biomedical engineering Week 11: The Riemann integral and its properties

Numerical Integration

How can we approximate the area of a region in the plane? What is an interpretation of the area under the graph of a velocity function?

Chapter 28. Fourier Series An Eigenvalue Problem.

TABLE OF CONTENTS 3 CHAPTER 1

Integral equations, eigenvalue, function interpolation

Matrices, Moments and Quadrature, cont d

Transcription:

Chpter Orthogonl Polynomils nd Lest-Squres Approximtions to Functions **4/5/3 ET. Discrete Lest-Squres Approximtions Given set of dt points (x,y ), (x,y ),..., (x m,y m ), norml nd useful prctice in mny pplictions in sttistics, engineering nd other pplied sciences is to construct curve tht is considered to be the best fit for the dt, in some sense. Severl types of fits cn be considered. But the one tht is used most in pplictions is the lest-squres fit. Mthemticlly, the problem is the following: Discrete Lest-Squres Approximtion Problem Given set of n discrete dt points (x i,y i ), i =,,...,m. Find the lgebric polynomil P n (x) = + x+ x + + n x n (n < m) such tht the error E(,,..., n ) in the lest-squres sense in minimized; tht is, m E(,,..., n ) = (y i x i x i nx n i ) 465

466CHAPTER. ORTHOGONAL POLYNOMIALS AND LEAST-SQUARES APPROXIMATIONS TO FUNCT is minimum. Here E(,,..., n ) is function of (n+) vribles:,,..., n. Since E(,,..., n ) is function of the vribles,,,..., n, for this function to be minimum, we must hve: E j =, j =,,...,n. Now, simple computtions of these prtil derivtives yield: E = E =. E n = m (y i x i n x n i ) m x i (y i x i n x n i ) m x n i (y i x i n x n i ) Setting these equtions to be zero, we hve m m m m + x i + x i + + n x n i = m m m x i + x i + + n x n+ i = m x i y i m y i. m m x n i + x n+ i + + n m x n i = m x n i y i. Set s k = b k = m x k i, k =,,...,n m x k i y i, k =,,...,n Using these nottions, the bove equtions cn be written s:

.. DISCRETE LEAST-SQUARES APPROXIMATIONS 467 s +s + +s n n = b (Note tht s +s + +s n+ n = b. s n +s n+ + +s n n = b n m = m x i = s.). This is system of (n+) equtions in (n+) unknowns,,..., n. These equtions re clled Norml Equtions. This system now cn be solved to obtin these (n+) unknowns, provided solution to thesystem exists. We will not show tht this system hs unique solution if x i s re distinct. The system cn be written in the following mtrix form: s s s n b s s s n+.... = b.. s n s n+ s n n b n or where Define S = b s s s n b s S = s s n+..., =., b = b.. s n s n+ s n n x x x n x x x n V = x 3 x 3 x n 3.... b n x m x m xn m Then the bove system hs the form: V T V = b. The mtrix V is known s the Vndermonde mtrix, nd we hve seen in Chpter 6 tht this mtrix hs full rnk if x i s re distinct. In this cse, the mtrix S = V T V is symmetric nd positive definite [Exercise] nd is therefore nonsingulr. Thus, if x i s re distinct, the eqution S = b hs unique solution.

468CHAPTER. ORTHOGONAL POLYNOMIALS AND LEAST-SQUARES APPROXIMATIONS TO FUNCT Theorem. (Existence nd uniqueness of Discrete Lest-Squres Solutions). Let (x,y ), (x,y ),..., (x n,y n ) bendistinctpoints. Thenthediscrete lest-squre pproximtion problem hs unique solution... Lest-Squres Approximtion of Function We hve described lest-squres pproximtion to fit set of discrete dt. Here we describe continuous lest-squre pproximtions of function f(x) by using polynomils. First, consider pproximtion by polynomil with monomil bsis: {,x,x,...,x n }. Lest-Squre Approximtions of Function Using Monomil Polynomils Given function f(x), continuous on [,b], find polynomil P n (x) of degree t most n: P n (x) = + x+ x + + n x n such tht the integrl of the squre of the error is minimized. Tht is, E = is minimized. [f(x) P n (x)] dx The polynomil P n (x) is clled the Lest-Squres Polynomil. Since E is function of,,..., n, we denote this by E(,,..., n ). For minimiztion, we must hve E i =, i =,,...,n. As before, these conditions will give rise to system of (n +) norml equtions in (n +) unknowns:,,..., n. Solution of these equtions will yield the unknowns:,,..., n.

.. DISCRETE LEAST-SQUARES APPROXIMATIONS 469.. Setting up the Norml Equtions Since So, Similrly, E = E i = E = E = E =. E n = [f(x) ( + x+ x + + n x n )] dx, [f(x) x x n x n ]dx x[f(x) x x n x n ]dx x n [f(x) x x n x n ]dx dx+ xdx+ x dx+ + n x n dx = x i dx+ x i+ dx+ x i+ dx+ + n x i+n dx = i =,,3,...,n. So, the (n+) norml equtions in this cse re: i = : dx+ xdx+ x dx+ + n x n dx = i = : xdx+ x dx+ 3 x 3 dx+ + n x n+ dx =. f(x)dx i = n: x n dx+ x n+ dx+ x n+ dx+ + n x n dx = Denote x i dx = s i, i =,,,3,...,n, nd b i = Then the bove (n+) equtions cn be written s s + s + s + + n s n = b s + s + s 3 + + n s n+ = b s n + s n+ + s n+ + + n s n = b n. f(x)dx xf(x)dx x i f(x)dx, i =,,...,n.. x i f(x)dx, x n f(x)dx

47CHAPTER. ORTHOGONAL POLYNOMIALS AND LEAST-SQUARES APPROXIMATIONS TO FUNCT or in mtrix nottion s s s s n b s s s 3 s n+..... = b. s n s n+ s n+ s n n b n Denote Then we hve the system of norml equtions: S = (s i ), =., b = b.. n S = b The solution of these equtions will yield the coefficients,,..., n of the lest-squres polynomil P n (x). b b n A Specil Cse: Let the intervl be [,]. Then s i = x i dx = i+, i =,,...,n. Thus, in this cse the mtrix of the norml equtions n S = 3 n+... n n+ n which is Hilbert Mtrix. It is well-known to be ill-conditioned (see Chpter 3).

.. DISCRETE LEAST-SQUARES APPROXIMATIONS 47 Algorithm. (Lest-Squres Approximtion using Monomil Polynomils). Inputs: (i) f(x) - A continuous function on [, b]. (ii) n - The degree of the desired lest-squres polynomil Output:The coefficients,,..., n of the desired lest-squres polynomil: P n (x) = + x+ + n x n. Step. Compute s,s,...,s n : For i =,,...,n do s i = xi dx End Step. Compute b,b,...,b n : For i =,,...,n do b i = xi f(x)dx End Step 3. Form the mtrix S from the numbers s,s,...,s n nd the vector b from the numbers b,b,...,b n. s s... s n b s S = s... s n+..., b = b.. s n s n+... s n Step 4. Solve the (n+) (n+) system of equtions for,,... n : S = b, where =.. n b n Exmple.3 Find Liner nd Qudrtic lest-squres pproximtions to f(x) = e x on [,].

47CHAPTER. ORTHOGONAL POLYNOMIALS AND LEAST-SQUARES APPROXIMATIONS TO FUNCT Liner Approximtion: n = ; P (x) = + x s = s = s = dx = [ ] x xdx = = ) ( = [ ] x x 3 dx = = ( ) 3 3 = 3 3 Thus, ( ) ( ) s s S = = s s 3 b = b = e x dx = e e =.354 e x xdx = e =.7358 The norml system is: ( )( ) ( ) b = 3 b This gives =.75, =.37 The liner lest-squres polynomil P (x) =.75+.37x. Accurcy Check: P (.5) =.77, e.5 =.6487 Reltive Error: =.453. e.5 P (.5) e.5 =.6487.77.6487 =.475. Qudrtic Fitting: n = ; P (x) = + x+ x s =, s =, s = 3 [ x s 3 = x 3 4] dx = = 4 [ ] x s 4 = x 4 5 dx = = 5 5

.. DISCRETE LEAST-SQUARES APPROXIMATIONS 473 b = b = b = e x dx = e e =.354 xe x dx = e =.7358 x e x dx = e 5 e =.8789. The system of norml equtions is: 3 3 3 5.354 =.7358.8789 The solution of this system is: =.9963, =.37, =.5368. The qudrtic lest-squres polynomil P (x) =.9963+.37x +.5368x. Accurcy Check: P (.5) =.6889 e.5 =.6487 Reltive error: P (.5) e.5 e.5 =.684.6487.6487 =.4. Exmple.4 Find liner nd qudrtic lest-squres polynomil pproximtion to f(x) = x + 5x + 6 in [,]. Liner Fit: P (x) = + x s = s = s = dx = xdx = x dx = 3

474CHAPTER. ORTHOGONAL POLYNOMIALS AND LEAST-SQUARES APPROXIMATIONS TO FUNCT b = b = = 53 6 The norml equtions re: ( (x +5x+6)dx = 3 + 5 +6 x(x +5x+6)dx = = 4 + 5 3 + 6 = 59 3 )( ) = ( 53 6 59 ) The liner lest squres polynomil P (x) = 5.8333+6x. (x 3 +5x +6x)dx = 5.8333 = 6 Accurcy Check: Exct Vlue: f(.5) = 8.75; P (.5) = 8.833 Reltive error: 8.833 8.75 8.75 =.95. Qudrtic Lest-Squre Approximtion: P (x) = + x+ x S = 3 3 4 3 4 5 b = 53 6, b = 59, b = x (x +5x+6)dx = The solution of the liner system is: = 6, = 5, =, (x 4 +5x 3 +6x )dx = 5 + 5 4 + 6 3 = 69. P (x) = 6+5x+x (Exct)..3 Use of Orthogonl Polynomils in Lest-squres Approximtions The lest-squres pproximtion using monomil polynomils, s described bove, is not numericlly effective; since the system mtrix S of norml equtions is very often ill-conditioned.

.. DISCRETE LEAST-SQUARES APPROXIMATIONS 475 For exmple, when the intervl is [,], we hve seen tht S is Hilbert mtrix, which is notoriously ill-conditioned for even modest vlues of n. When n = 5, the condition number of this mtrix = cond(s) = O( 5 ). Such computtions cn, however, be mde computtionlly effective by using specil type of polynomils, clled orthogonl polynomils. Definition.5. The set of functions {φ,φ,...,φ n } in [,b] is clled set of orthogonl functions, with respect to weight function w(x), if where C j is rel positive number. if i j w(x)φ j (x)φ i (x)dx = C j if i = j Furthermore, if C j =, j =,,...,n, then the orthogonl set is clled n orthonorml set. Using this interesting property, lest-squres computtions cn be more numericlly effective, s shown below. Without ny loss of generlity, let s ssume tht w(x) =. Ide: The ide is to find lest-squres pproximtion of f(x) on [,b] by mens of polynomil of the form P n (x) = φ (x)+ φ (x)+ + n φ n (x), where {φ n } n k= is set of orthogonl polynomils. Tht is, the bsis for generting P n(x) in this cse is set of orthogonl polynomils. The question now rises: Is it possible to write P n (x) s liner combintion of the orthogonl polynomils? The nswer is yes nd provided in the following. It cn be shown [Exercise]: Given the set of orthogonl polynomils {Q i (x)} n i=, polynomil P n(x) of degree n, cn be written s: P n (x) = Q (x)+ Q (x)+ + n Q n (x) for some,,..., n. Finding the lest-squres pproximtion of f(x) on [, b] using orthogonl polynomils, then cn be stted s follows:

476CHAPTER. ORTHOGONAL POLYNOMIALS AND LEAST-SQUARES APPROXIMATIONS TO FUNCT Lest-squres Approximtion of Function Using Orthogonl Polynomils Given f(x), continuous on [,b], find,,..., n using polynomil of the form: P n (x) = φ (x)+ φ (x)+ + n φ n (x), where {φ k (x)} n k= is given set of orthogonl polynomils on [,b], such tht the error function: is minimized. E(,,..., n ) = [f(x) ( φ (x)+ n φ n (x))] dx As before, we set Now E = Setting this equl to zero, we get E i =, i =,,...,n. φ (x)[f(x) φ (x) φ (x) n φ n (x)]dx. Since, {φ k (x)} n k= nd φ (x)f(x)dx = is n orthogonl set, we hve, ( φ (x)+ + n φ n (x))φ (x)dx. φ (x)dx = C, φ (x)φ i(x) dx =, i. Applying the bove orthogonl property, we see from bove tht Tht is, Similrly, E = φ (x)f(x)dx = C. = φ (x)f(x)dx. C φ (x)[f(x) φ (x) φ (x) n φ n (x)]dx.

.. DISCRETE LEAST-SQUARES APPROXIMATIONS 477 Agin from the orthogonl property of {φ j (x)} n j= we hve φ (x)dx = C nd φ (x)φ i (x)dx =, i, so, setting E =, we get = φ (x)f(x)dx C In generl, we hve where k = φ k (x)f(x)dx, k =,,...,n, C k C k = φ k (x)dx...4 Expressions for k with Weight Function w(x). If the weight function w(x) is included, then k is modified to k = w(x)f(x)φ k (x)dx, k =,,...,n C k Where C k = = w(x)φ k (x)dx Algorithm.6 (Lest-Squres Approximtion Using Orthogonl Polynomils). Inputs:f(x) - A continuous function f(x) on [,b] w(x) - A weight function (n integrble function on [,b]). {φ k (x)} n k= - A set of n orthogonl functions on [,b]. Output:The coefficients,,..., n such tht is minimized. Step. Compute C k, k =,,...,n s follows: For k =,,,...,n do C k = w(x)φ k (x)dx End w(x)[f(x) φ (x) φ (x) n φ n (x)] dx

478CHAPTER. ORTHOGONAL POLYNOMIALS AND LEAST-SQUARES APPROXIMATIONS TO FUNCT Step. Compute k, k =,...,n s follows: For k =,,,...,n do k = C k w(x)f(x)φ k(x)dx End Generting Set of Orthogonl Polynomils The next question is: How to generte set of orthogonl polynomils on [,b], with respect to weight function w(x)? The clssicl Grm-Schmidt process (see Chpter 7), cn be used for this purpose. Strting with the set of monomils {,x,...,x n }, we cn generte the orthonorml set of polynomils {Q k (x)}.. Lest-Squres Approximtion Using Legendre s Polynomils Recll from the lst chpter tht the first few Legendre polynomils re given by: φ (x) = φ (x) = x φ (x) = x 3 φ 3 (x) = x 3 3 5 x etc. To use the Legendre polynomils to pproximte lest-squres solution of function f(x), we set w(x) =, nd [,b] = [,] nd compute C k, k =,,...,n by Step of Algorithm.6: C k = nd k, k =,,...,n by Step of Algorithm.6: φ k (x)dx k = f(x)φ k (x)dx. C k

.. LEAST-SQUARES APPROXIMATION USING LEGENDRE S POLYNOMIALS 479 The lest-squres polynomil will then be given by P n (x) = Q (x)+ Q (x)+ + n Q n (x). A few C k s re now listed below: nd so on. C = φ (x)dx = dx = C = φ (x)dx = x dx = 3 C = φ (x)dx = ( x ) 3 dx = 8 45. Exmple.7 Find liner nd qudrtic lest-squres pproximtion to f(x) = e x using Legendre polynomils. Liner Approximtion: P (x) = φ (x)+ φ (x) φ (x) =, φ (x) = x Step. Compute C nd C : C = φ (x)dx = dx = [x] = C = Step. Compute nd : φ (x)dx = [ x x 3 dx = 3 ] = 3 + 3 = 3. = (x)e C φ x dx e x dx = = f(x)φ (x)dx C = 3 e x xdx = 3 e. The liner lest-squres polynomil: P (x) = φ (x)+ φ (x) = [ e ] + 3 e e x ( e ) e

48CHAPTER. ORTHOGONAL POLYNOMIALS AND LEAST-SQUARES APPROXIMATIONS TO FUNCT Accurcy Check: P (.5) = [ e ] + 3.5 =.77 e e e.5 =.6487 Reltive error:.77.6487.6487 =.475. Qudrtic Approximtion: P (x) = φ (x)+ φ (x)+ φ (x) = ( e ), = 3 e e (Alredy computed bove) Step. Compute C = ( x 5 = φ (x)dx = ) 5 3 x3 3 + x ( x 3) dx = 8 45 Step. Compute = e x φ (x)dx C = 45 8 ( e x x ) dx 3 = e 7 e The qudrtic lest-squres polynomil: P (x) = ( e )+ 3e ( e x+ e 7 )( x ) e 3 Accurcy Check: P (.5) =.75 e.5 =.6487 Reltive error:.75.6487.6487 =.43. Compre this reltive error with tht obtined erlier with n non-orthogonl polynomil of degree.

.3. CHEBYSHEV POLYNOMIALS: ANOTHER WONDERFUL FAMILY OF ORTHOGONAL POLYNOMIAL.3 Chebyshev polynomils: Another wonderful fmily of orthogonl polynomils Definition.8. The set of polynomils defined by T n (x) = cos[nrccosx], n on [, ] re clled the Chebyshev polynomils. To see tht T n (x) is polynomil of degree n in our fmilir form, we derive recursive reltion by noting tht T (x) = (the Chebyshev polynomil of degree zero). T (x) = x (the Chebyshev polynomil of degree )..3. A Recursive Reltion for Generting Chebyshev Polynomils Substitute θ = rccosx. Then, T n (x) = cos(nθ), θ π. T n+ (x) = cos(n+)θ = cosnθcosθ sinnθsinθ T n (x) = cos(n)θ = cosnθcosθ +sinnθsinθ Adding the lst two equtions, we obtin T n+ (x)+t n (x) = cosnθcosθ The right-hnd side still does not look like polynomil in x. But note tht cosθ = x So, T n+ (x) = cosnθcosθ T n (x) = xt n (x) T n (x). This bove is three-term recurrence reltion to generte the Chebyshev Polynomils. Three-Term Recurrence Formul for Chebyshev Polynomils T (x) =, T (x) = x T n+ (x) = xt n (x) T n (x), n.

48CHAPTER. ORTHOGONAL POLYNOMIALS AND LEAST-SQUARES APPROXIMATIONS TO FUNCT Using this recursive reltion, the Chebyshev polynomils of the successive degrees cn be generted: n = : T (x) = xt (x) T (x) = x, n = : T 3 (x) = xt (x) T (x) = x(x ) x = 4x 3 3x nd so on..3. The orthogonl property of the Chebyshev polynomils We now show tht Chebyshev polynomils re orthogonl with respect to the weight function w(x) = x in the intervl [,]. To demonstrte the orthogonl property of these polynomils, we show tht Orthogonl Property of the Chebyshev Polynomils T m (x)t n (x) x if m n dx = π if m = n. First, T m (x)t n (x) x = dx, m n. cos(m rccos x) cos(n rccos x) x dx Since θ = rccosx dθ = dx, x

.4. THE LEAST-SQUARE APPROXIMATION USING CHEBYSHEV POLYNOMIALS483 The bove integrl becomes: = π π cosmθcosnθdθ cosmθcosnθdθ Now, cosmθcosnθ cn be written s [cos(m+n)θ +cos(m n)θ] So, π cosmθcosnθdθ π π = cos(m+n)θdθ + cos(m n)θdθ = [ ] π (m+n) sin(m+n)θ + [ (m n) sin(m n)θ =. ] π Similrly, it cn be shown [Exercise] tht T n (x)dx x = π for n..4 The Lest-Squre Approximtion using Chebyshev Polynomils As before, the Chebyshev polynomils cn be used to find lest-squres pproximtions to function f(x) s stted below. In Algorithm.6, set w(x) = x, [,b] = [,], nd φ k (x) = T k (x), Then, it is esy to see tht using the orthogonl property of Chebyshev polynomils:

484CHAPTER. ORTHOGONAL POLYNOMIALS AND LEAST-SQUARES APPROXIMATIONS TO FUNCT C = C k = T (x) x dx = π T k (x) x dx = π, k =,...,n Thus, from Step of Algorithm.6, we hve = π nd i = π f(x)dx x f(x)dx x. The lest-squres pproximting polynomil P n (x) of f(x) using Chebyshev polynomils is given by: P n (x) = T (x)+ T (x)+ + n T n (x) where nd i = π f(x)t i (x)dx, i =,,n x = π f(x)dx x Exmple.9 Find liner lest-squres pproximtion of f(x) = e x using Chebyshev polynomils. Here where P (x) = φ (x)+ φ i (x) = T (x)+ T (x) = + x, = π = π e x dx x.66 xe x dx.33 x Thus, P (x) =.66+.33x Accurcy Check: P (.5) =.83; e.5 =.6487

.5. MONIC CHEBYSHEV POLYNOMIALS 485 Reltive error:.6487.83.6487 =.6..5 Monic Chebyshev Polynomils Note tht T k (x) is Chebyshev polynomil of degree k with the leding coefficient k, k. Thus we cn generte set of monic Chebyshev polynomils from the polynomils T k (x) s follows: The Monic Chebyshev Polynomils, T k (x), re then given by T (x) =, Tk (x) = kt k(x), k. The k zeros of T k (x) re esily clculted [Exercise]: ( ) j x j = cos k π, j =,,...,k. The mximum or minimum vlues of T k (x) [Exercise] occur t ( ) jπ x j = cos, k nd T k ( x j ) = ()j, j =,,...,k. k.6 Minimx Polynomil Approximtions with Chebyshev Polynomils As seen bove the Chebyshev polynomils cn, of course, be used to find lest-squres polynomil pproximtions. However, these polynomils hve severl other wonderful polynomil pproximtion properties. First, we stte the minimx property of the Chebyshev polynomils. Minimx Property of the Chebyshev Polynomils If P n (x) is ny monic polynomil of degree n, then = mx n T n (x) mx P n(x). x [,] x [,] Moreover, this hppens when P n (x) T n (x).

486CHAPTER. ORTHOGONAL POLYNOMIALS AND LEAST-SQUARES APPROXIMATIONS TO FUNCT Interprettion: The bove results sy tht the bsolute mximum of the monic Chebyshev polynomil of degree n, T n (x), over [,] is less thn or equl to tht of ny polynomil P n (x) over the sme intervl. Proof. By contrdiction [Exercise]..6. Choosing the interpolting nodes with the Chebyshev Zeros Recll from Chpter 6 tht error in polynomil interpoltion of function f(x) with the nodes, x,x,...,x n by polynomil P n (x) of degree t most n is given by where Ψ(x) = (x x )(x x ) (x x n ). E = f(x) P(x) = fn+ (ξ) (n+)! Ψ(x), The question is: How to choose these (n+) nodes x,x,...,x n so tht Ψ(x) is minimized in [,]? The nswer cn be given from the bove minimx property of the monic Chebyshev polynomils. Note tht Ψ(x) is monic polynomil of degree (n+). So, by the minimx property of the Chebyshev polynomils, we hve Thus, mx T n+ (x) mx Ψ(x). x [,] x [,] The mximum vlue of Ψ(x) = (x x )(x x ) (x x n ) in [,] is smllest when x,x,...,x n rechosensthe(n+) zerosofthe(n+)thdegreemonicchebyshevpolynomils T n+ (x). Tht is, when x,x,...,x n re chosen s: x k+ = cos (k +) π,k =,,,...,n. (n+) The smllest bsolute mximum vlue of Ψ(x) with x,x,...,x n s chosen bove, is: n..6. Working with n Arbitrry Intervl If the intervl is [,b], different from [,], then, the zeros of T n+ (x) need to be shifted by using the trnsformtion: x = [(b )x+(+b)]

.6. MINIMAX POLYNOMIAL APPROXIMATIONS WITH CHEBYSHEV POLYNOMIALS487 Exmple. Let the interpolting polynomil be of degree t most nd the intervl be [.5,]. The three zeros of T 3 (x) in [,] re given by x = cos π 6, x = cos π 6, nd x = cos pi. These zeros re to be shifted using trnsformtion: x new i = [(.5) x i +(+.5)], i =,,..6.3 Use of Chebyshev Polynomils to Economize Power Series Power Series Economiztion Let P n (x) = + x+ + n x n be polynomil of degree n obtined by truncting power series expnsion of continuous function on [,b]. The problem is to find polynomil P r (x) of degree r (< n) such tht mx x [,] P n(x) P r (x), is s smll s possible. We first consider r = n ; tht is, the problem of pproximting P n (x) by polynomil P n (x) of degree n. If the totl error (sum of trunction error nd error of pproximtion) is still within n cceptble tolernce, then we consider pproximtion by polynomil of P n (x) nd the process is continued until the ccumulted error exceeds the tolernce. We will show below how minimx property of the Chebyshev polynomils cn be ginfully used. First note tht n P n (x) P n (x) is monic polynomil. So, by the minimx property, we hve mx P n (x) P n (x) mx x [,] T n (x) = n x [,] n. Thus, if we choose P n (x) = P n (x) n Tn (x), Then the minimum vlue of the mximum error of pproximting P n (x) by P n (x) over [,] is given by: mx P n(x) P n (x) = n x n. If this quntity, n, plus error due to the trunction of the power series is within the permissible tolernce ǫ, we cn then repet the process by constructing P n (x) from P n (x) s n bove. The process cn be continued until the ccumulted error exceeds the error tolernce ǫ.

488CHAPTER. ORTHOGONAL POLYNOMIALS AND LEAST-SQUARES APPROXIMATIONS TO FUNCT So, the process cn be summrized s follows: Power Series Economiztion Process by Chebyshev Polynomils Inputs: (i) f(x) - (n+) times differentible function on [,b] (ii) n = positive integer Outputs: An economized power series of f(x). Step. Obtin P n (x) = + x n + + n x n by truncting the power series expnsion of f(x). Step. Find the trunction error. E TR (x) = Reminder fter n terms = f(n+) (ξ(x)) x n+ (n+)! nd compute the upper bound of E TR (x) for x. Step 3. Compute P n (x): P n (x) = P n (x) n Tn (x) Step 4. Check if the mximum vlue of the totl error pproximte P n (x) by P n (x). Compute P n (x) s: P n (x) = P n (x) n Tn (x) ( ) E TR + n is less thn ǫ. If so, n Step 5. Compute the error of the current pproximtion: P n (x) P n (x) = n n. Step 6. Compute the ccumulted error: ( ) n E TR + n + n n If this error is still less thn ǫ, continue until the ccumulted error exceeds ǫ. Exmple. Find the economized power series for cosx = x + x4 4! for x with tolernce ǫ =.5.

.6. MINIMAX POLYNOMIAL APPROXIMATIONS WITH CHEBYSHEV POLYNOMIALS489 Step. Let s first try with n = 4. P 4 (x) = x + x 3 + x4 4! Step. Trunction Error. T R (x) = f5 (ξ(x)) x 5 5! since f (5) (x) = sinx nd sinx for ll x, we hve T R (x) ()()5 =.83. Step 3. Compute P 3 (x): P 3 (x) = P 4 (x) 4 T4 (x) = x + x4 4! 4! =.4583x +.9948 ( x 4 x + ) 8 Step 4. Mximum bsolute ccumulted error = Mximum bsolute trunction error + mximum bsolute Chebyshev error =.83+ 4 8 =.35 which is greter thn ǫ =.5. Thus, the economized power series of f(x) = cosx for x with n error tolernce of ǫ =.5 is the 3 rd degree polynomil: P 3 (x) =.4583x +.9948. Accurcy Check: We will check below how ccurte this pproximtion is for three vlues of x in x : two extreme vlues x = nd x =, nd one intermedite vlue x =.5. For x=.5. cos(.5) =.8776 P 3 (.5) =.88 Error = cos(.5) P 3 (.5) =.6 =.6. For x=. cos() = ; P 3 () =.9948 Error = cos() P 3 () =.5.

49CHAPTER. ORTHOGONAL POLYNOMIALS AND LEAST-SQUARES APPROXIMATIONS TO FUNCT For x=. cos() =.543; P 3 () =.5365 Error = cos() P 3 () =.38. Remrk: These errors re ll much less thn.5 even though theoreticl error-bound,.35, exceeded it.