Legendre economization

Hi,

I have this taylor series expansion:

> taylor(exp(-x)*sin(x), x, 11);

Now I need to do a legendre economization. So I want to write x, x², x³ etc (from the taylor series) as linear combinations of the Legendre polynomials. My idea was to simply write something like:

>solve({aP(0,x)+bP(1,x)+cP(2,x) = x²}, {a,b,c});

This is supposed to give coefficients for the legendre expansion of x². This doesn't work because it gives solutions in terms of x, which is useless to me. Is there any way?

---
The analagous in Chebyshev is to write:
x²=1/2(T0 + T2)
---

I need to find the same, but in terms of legendre polynomials.

Thanks.

 

Axel Vogt's picture

OrthogonalSeries

It is a bit hidden, You can do that for example with the package 'OrthogonalSeries':
Define your polynom from Taylor series:
  taylor(exp(-x)*sin(x), x, 11): 
  myP:=convert(%,polynom);
Convert it to the Legendre base and check it:
  OrthogonalSeries:-ChangeBasis(myP,LegendreP(v, x)):
  OrthogonalSeries:-ConvertToSum(%):
  convert(%,polynom):
  'myP=(%)';
  is(simplify(%));

                                 true
The same for Tschebyscheff:
  OrthogonalSeries:-ChangeBasis(myP,ChebyshevT(n,x)):
  OrthogonalSeries:-ConvertToSum(%):
  convert(%,polynom):
  'myP=(%)';
  is(simplify(%));
                                 true

If it is homework, then give credit to mapleprimes ...

economization?

was not aware of a thing named "Legendre economization". Does it mean that the truncated Taylor series, expressed in terms of these polynomials, is computationally more economical?

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}