I am trying to evaluate the following integral:
$$I_n=\int\limits_{-1}^1 f(x)P_n(x)dx$$ where $f(x)=1$ for $x\in[-1,0)$ and $f(x)=-1$ for $x\in(0,1]$ and $P_n(x)$ is the Legendre polynomial of degree n.
What I did (which is most probably wrong):
Argue that $I_n=0$ for all even n since $P_{even \,\,\, n}$ is symmetric along $x=0$. But then when I tried to evaluate the odd $n$'s , I get $I_n=2\int\limits_{-1}^0 P_n(x) dx=2\int\limits_{-1}^0 P'_{n+1}(x) -P'_{n-1}(x)dx=0$??
Thanks for helping!