# Question on orthogonal Legendre series expansion.

1. Jun 6, 2010

### yungman

This start out as homework but my question is not about helping me solving the problem but instead I get conflicting answers depend on what way I approach the problem and no way to resolve. I know the answer. I am not going to even present the original question, instead just the part that I have issue with. The difference is by using:

A) $\int_{-1}^1 f(x)P_n(x)dx = \frac{1}{2^n n!}\int_{-1}^{1} f^n(x)(x^2-1)^n dx$

And

B) $$(n+1)P_{n+1}(x) + nP_{n-1}(x) = (2n+1)xP_n(x)$$

The function $f(\theta) = cos(\theta)$ and I want to compute:

$$\int_0^{\pi} f(\theta) sin(\theta) P_n(cos(\theta)d\theta$$

$$= \int_0^{\pi} cos(\theta) sin(\theta) P_n(cos(\theta)d\theta \hbox { we let }x=cos(\theta) \Rightarrow dx=-sin(\theta) d \theta$$

$$\Rightarrow \int_0^{\pi} cos(\theta) sin(\theta) P_n(cos(\theta)d\theta = \int_{-1}^{1} x P_n(x)dx$$ (1)

Using A) This imply $f(x)$ is only first degree and $\int_{-1}^{1} x P_n(cos(x)dx = 0$ for n larger than 1. The answer is 0 for n=0 and 2/3 for n=1 and the rest is 0 for n>1.

But using B)

$$\int_{-1}^{1} x P_n(x)dx = \frac{n+1}{2n+1}\int_{-1}^{1} P_{n+1}(x)dx + \frac{n}{2n+1}\int_{-1}^{1} P_{n-1}(x)dx$$

Recall $$\int_{-1}^{1} P_{n}(x)dx = 0 \;\Rightarrow\; \int_{-1}^{1} P_{n+1}(x)dx = \int_{-1}^{1} P_{n-1}(x)dx = 0$$

$$\Rightarrow \int_{-1}^{1} x P_n(x)dx = 0$$

So you see you get two different answers using A) and B). I double and triple check this and I cannot see where I did wrong.

Last edited: Jun 6, 2010
2. Jun 6, 2010

### Mute

This is not true for all n. $P_n(-x) = (-1)^nP_n(x)$, from which you can show that your identity is only valid if n is odd.

3. Jun 7, 2010

### yungman

I was wrong on this:

$$\int_{-1}^{1} P_{n}(x)dx = 0 \hbox { only if n not equal to 0, equal to 2 if n=0 }$$

I just post the question to confirm n cannot be negative. I am still waiting for the answer. If n cannot be negative, then one cannot use B) because $\int_{-1}^{1} P_{n-1}(x)dx$ is not legal for n=0. This will clarify my question that there is only one way I can get the answer.

And I was wrong on n=1. It is not zero. for n=1, I do get 2/3 as the answer, so it agree in both ways of calculation.

4. Jun 7, 2010

### Mute

That's still not correct. I'm not sure if you are just stating that it was wrong and you realize it now or if you think this is the corrected statement, so I will clarify: the correct statement is

$$\int_{-1}^{1} P_{n}(x)dx = \left\{\begin{array}{c c} 0~\mbox{if n is odd}\\2~\mbox{if n is even}\end{array}\right.$$

As for your other question, n cannot be negative but you case still use n = 0 in the identity you labeled B): the $P_{n-1}(x)$ term vanishes in this case because it is multiplied by n, and indeed, you find that the identity tells you $P_1(x) = xP_0(x)$, which is true.

5. Jun 7, 2010

### yungman

Thanks for your help. If n=0,1,2..........and $P_{n-1}(x)$ term disappeared for n=0, then that answer all my question.

Regarding the formula, it is correct and written in the book. To proof it is correct, we use the identity:

$$P'_{n+1}(x) = P'_{n-1}(x) +(2n+1)P_n(x) \hbox { and } P_{n+1}(1) = P_{n-1}(1) = 1 \hbox { and } P_{n+1}(-1) = P_{n-1}(-1) = (-1)^{n+1}P_{n-1}(1)$$

$$\Rightarrow \int_{-1}^{1} P_{n}(x)dx = \frac{1}{2n+1} [P_{n+1}(x) - P_{n-1}(x)]_{-1}^1 = \frac{1}{2n+1}[P_{n+1}(1) - P_{n-1}(1) - P_{n+1}(-1) + P_{n-1}(-1)] = 0$$

This is actually the bases of orthogonal relation of Legendre polynomial.

Thanks for your help.

Alan

Last edited: Jun 7, 2010