Polynomial approximation: Chebyshev and Legendre

Click For Summary

Discussion Overview

The discussion revolves around the comparison of Chebyshev and Legendre polynomials in the context of least square approximation of functions. Participants explore whether these two sets of orthogonal polynomials yield the same results for approximating a given function, particularly when using numerical methods in Mathematica.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • Some participants assert that Chebyshev and Legendre polynomials are both used for least square approximation but question whether they should yield the same results for a given function.
  • One participant suggests that the discrepancy in results may be due to differences in weight functions used by the two polynomial families, which affect the inner products and norms for least squares fitting.
  • Another participant proposes that for a "nice" function, an infinite series expansion using either polynomial family would yield an exact fit, but the issue may arise when approximating with finite series.
  • Concerns are raised regarding the Mathematica code provided, with one participant finding it puzzling and suggesting it computes a ratio between a function and the approximating function.

Areas of Agreement / Disagreement

Participants express differing views on whether Chebyshev and Legendre polynomials should provide the same results, indicating a lack of consensus on this issue. Some agree on the importance of weight functions, while others question the clarity of the original query.

Contextual Notes

The discussion highlights potential limitations in understanding the implications of using different polynomial families for approximation, particularly regarding the definitions of norms and the nature of the functions being approximated.

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
2
Views
2K
Replies
6
Views
2K
  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 19 ·
Replies
19
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K