Legendre Polynomials Triple Product I have to solve the following integral:
\begin{align}
\int_{-1}^{1} \left(x^2 -1\right)^3 P_k(x)\,P_l(x)\, P_m(x) \;dx
\end{align}
where $P_{k,l,m}$ are Legendre Polynomials
The triple product
\begin{align}
\int_{-1}^{1} P_k(x)\,P_l(x)\, P_m(x) \;dx = 2 \begin{pmatrix} k & l & m \\ 0 & 0 & 0 \end{pmatrix}^2
\end{align}
using the special case of $3j$ symbol form
\begin{align}
\begin{pmatrix} k & l & m \\ 0 & 0 & 0 \end{pmatrix}
    &= (-1)^s \sqrt{(2s-2k)! (2s-2l)! (2s-2m)! \over (2s+1)!}
        {s! \over (s-k)! (s-l)! (s-m)!}
        \\ & \mbox{for $2s=k+l+m$ even} \\[3pt]
\begin{pmatrix} k & l & m \\ 0 & 0 & 0 \end{pmatrix}
    &= 0
        \quad\mbox{for $2s=k+l+m$ odd} \\
\end{align} 
I'm sure you should be able to solve this by doing integration by parts but can't seem to get it to work. Any tips?
So using the answer below I think you get the following for step 1 of 3
\begin{multline}
 \int_{-1}^{1}(x^2-1)^3 P_k P_l P_m 
 = \overbrace{(x^2-1)^3\frac{(P_{k+1} - P_{k-1})}{2k+1} P_l P_m \Big]_{-1}^1}^\text{ = 0}\\
-\int_{-1}^{1} \frac{(P_{k+1} - P_{k-1})}{2k+1}(x^2-1)^2\Big( 
6xP_l P_m \\
+  (1+l) P_m(P_{l+1} - P_{l-1})  + 
(1+m) P_l(P_{m+1} - P_{m-1}) \Big) \; dx\\ 
\end{multline}
Not sure if the formula for integration works as I think the $6xP_lP_m$ term might cause problems?

You could integrate one of the $P_k(x)$ and take the derivative of the rest. The power of $(1-x^2)$ gets reduce by the fact that
$$\partial_x P_l(x) = \frac{(1+l) [ P_{l+1}(x)-x P_l(x) ]}{x^2-1}.$$
You have to apply partial integration a few times and you will generate a bunch of Legendre triple product.
