The Legendre Polynomials satisfy the following orthogonality condition:
The definite integral of $P(n,x) \cdot P(m,x)$ from $-1$ to $1$ equals $0$, if $m$ is not equal to $n$: $$\int_{-1}^1 P(n,x) \cdot P(m,x) dx = 0. \qquad (m \neq n)$$
Based on this, I am trying to evaluate the integral from $-1$ to $1$ of $x \cdot P(n-1,x) \cdot P(n,x)$ for some given $n$: $$\int_{-1}^1 x \cdot P(n-1,\;x) \cdot P(n,x) dx.$$ If I integrate this by parts, letting $x$ be one function and $P(n-1,x) \cdot P(n,x)$ be the other function, then I get zero, but according to my textbook, its value is non-zero. What am I doing wrong?
Integration by parts is $\int f'g+\int fg'=fg\ (+C)$, so for the definite integral, it is $$\int_a^b f'g+\int_a^b fg'=[fg]_a^b=f(b)g(b)-f(a)g(a)\,.$$ Now we have $f=x$ and $g'=P_{n-1}(x)\cdot P_n(x)$. That is, $g$ is the antiderivative of $P_{n-1}\cdot P_n$. By the definite integral of this, it only allows us to conclude that $g(1)-g(-1)=[g]^1_{-1}=0$. Not less and not more. In particular, $g\ne 0$. So, now it yields: $$\int_{-1}^1 g+\int_{-1}^1 x\cdot P_{n-1}(x)\cdot P_n(x)=1\cdot g(1)-(-1)\cdot g(-1)=2\cdot g(1)\,.$$ This can be evaluated, knowing the explicit form of the $P_n$'s, but then probably it's not simpler than simply writing these in the original integral...