Polynomial approximation: Chebyshev and Legendre

Click For Summary
SUMMARY

Chebyshev polynomials and Legendre polynomials serve as orthogonal polynomials for least square approximation of functions, but they do not yield identical results due to differing weight functions and inner products. The discussion highlights that while both can provide exact fits for "nice" functions expressed as infinite series, discrepancies arise when approximating functions as finite series. The Mathematica code provided by the user attempts to compute these approximations but may not be correctly structured, leading to confusion regarding the results.

PREREQUISITES
  • Understanding of orthogonal polynomials
  • Familiarity with least squares approximation
  • Knowledge of Mathematica syntax and functions
  • Basic concepts of infinite series and convergence
NEXT STEPS
  • Study the differences between Chebyshev and Legendre polynomials in detail
  • Learn how to implement least squares approximation using both polynomial families in Mathematica
  • Explore the concept of weight functions in orthogonal polynomial theory
  • Investigate the implications of finite vs. infinite series approximations
USEFUL FOR

Mathematicians, data scientists, and engineers involved in numerical analysis, approximation theory, or those utilizing Mathematica for polynomial computations.

ch3cooh
Messages
4
Reaction score
0
Chebyshev polynomials and Legendre polynomials are both orthogonal polynomials for determining the least square approximation of a function. Aren't they supposed to give the same result for a given function?
I tried mathematica but the I didn't get the same answer :( Is this precision problem or something else?
Code:
In[79]:= Collect[
  Sum[Integrate[LegendreP[i, x]*Sin[2 x], {x, -1, 1}]/
    Integrate[LegendreP[i, x]^2, {x, -1, 1}]*LegendreP[i, x], {i, 0,
    3}], x] // N

Out[79]= 1.94378 x - 1.06264 x^3

In[80]:= Collect[
  Sum[Integrate[
     1/Sqrt[1 - x^2] ChebyshevT[i, x]*Sin[2 x], {x, -1, 1}]/
    Integrate[1/Sqrt[1 - x^2] ChebyshevT[i, x]^2, {x, -1, 1}]*
    ChebyshevT[i, x], {i, 0, 3}], x] // N

Out[80]= 1.92711 x - 1.03155 x^3
 
Physics news on Phys.org
ch3cooh said:
Aren't they supposed to give the same result for a given function?

You'll probably get more help if you explain what result you are talking about in standard mathematical notation.
 
ch3cooh said:
Chebyshev polynomials and Legendre polynomials are both orthogonal polynomials for determining the least square approximation of a function. Aren't they supposed to give the same result for a given function?

I haven't looked at that stuff in years, but I think the answer is "no". They have different weight functions which give different inner products and consequently different norms in which to measure the least squares fit.
 
I think "least squares fit" makes it clear what norm is used to measure the fit. For a "nice" function (one that can be expressed as an infinite power series) , if you express it as an infinite series of Chebyshev polynomials you get an exact fit. You also get an exact fit if you express it as an infinite series of some other family of othrogonal polynomials. So perhaps the question has to do with approximating the function as a finite series.

I find the Mathematica code in the original post puzzling. It looks like its computing a ratio between a function and the approximating function.
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
2K
Replies
6
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 16 ·
Replies
16
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 2 ·
Replies
2
Views
1K