1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Polynomial approximation: Chebyshev and Legendre

  1. Oct 30, 2014 #1
    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 (Text):
    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
     
  2. jcsd
  3. Oct 31, 2014 #2

    Stephen Tashi

    User Avatar
    Science Advisor

    You'll probably get more help if you explain what result you are talking about in standard mathematical notation.
     
  4. Nov 3, 2014 #3

    LCKurtz

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member



    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.
     
  5. Nov 4, 2014 #4

    Stephen Tashi

    User Avatar
    Science Advisor

    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.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Polynomial approximation: Chebyshev and Legendre
Loading...