# Writing $x^3$ in Legendre base

1. Nov 10, 2015

### Msilva

Hello friends. I need help to write the function $x^3$ as a somatory using the Legendre polinomials as base. Something like:
$f(x)=\sum^{\infty}_{n=0}c_{n}P_{n}(x)$

Basically is to find the terms $c_{n}$.
But, the problem is that Legendre polinomials does't form a orthonormal base: $$\langle P_{m}|P_{n}\rangle=\delta_{mn}\frac{2}{2n+1}$$, and I don't know how exactly to use this information.

May I use $c_n=\frac{2n+1}{2}\int_{-1}^{-1}P_n(x)x^3\,dx$? Is that right?

2. Nov 10, 2015

### Chandra Prayaga

You can do this problem without doing all the integrals. I am writing the first three Legendre polynomials below:

P0 = 1
P1 = x
P2 = (3x2 - 1)/2
P3 = (5x3 - 3x)/2

You want to write:

x3 = a0P0 + a1P1 + a2P2 + a3P3

I took only up to P3 because I have x3 on the left.

Now just look at the Legendre polynomials listed above, and keep adjusting the coefficients a0 .. etc. until you get what you want. For example, since I want x3, and there is a coefficient of 5/2 in front of x3 in P3, I can choose a3 = 2/5, so that a3 P3 yields x3. But this also gives me an extra term in x. So now adjust the coefficient a1 so that a1 P1 cancels out that extra term in x, and you are left with exactly what you want. The rest of the coefficients a0, a2, and then a4, a5.... are all zeroes.[/SUB][/SUB]

If you are fond of doing integrals, you can also use the result that you wrote for each cn. It is correct.

3. Nov 10, 2015

### Msilva

Actualy $x^3$ is an aleatory function that I wrote here just to ilustrate my question, but you helped me a lot.

With these integrals the coefficients are exactly those expected by your arguments. This is a hint that the logic of the integral is right.

Thank you for your suport, Prayaga.