Integration of Legendre Polynomial I need to evaluate the following integral
\begin{equation} \int_{-1}^1 \frac{d^4P_l(x)}{dx^4}P_n(x)dx\end{equation}. Of course the answer I need is in terms of $l$ and $n$. Does anyone have any idea how to proceed?
 A: The facts below should allow you to compute the integral in question in terms of $l$ and $n$: 


*

*The Legendre polynomials $P_0, \dots, P_n$ form a basis for the space of polynomials of degree at most $n$.

*The Legendre polynomials are orthogonal:
$$
\int_{-1}^{1} P_m(x) P_n(x)\,dx = {2 \over {2n + 1}} \delta_{mn}
$$

*$\dfrac{d^4P_l(x)}{dx^4}$ is a polynomial of degree $l-4$ if $l\ge 4$ or the zero polynomial otherwise.
A: Let us denote
$$\mathcal{I}_{l,n}:=\int_{-1}^1P_l^{(4)}(x)P_n(x)\,dx.$$
If $l\leq n+3$, then $P_l^{(4)}(x)$ is a polynomial of degree at most $n-1$ and $\mathcal{I}_{l,n}$ vanishes because of orthogonality of Legendre polynomials. It also vanishes when $n$ and $l$ have different parity. Hence in the following it will be assumed that $l\geq n+4$ and $l=n\;\operatorname{mod}\;2$.
Integrating by parts, we can rewrite the integral as
$$\int_{-1}^1P_l(x)P_n^{(4)}(x)\,dx+\text{boundary terms}.$$
The same argument as above shows that the integral in this expression vanishes for $l\ge n+5$, and therefore the answer is completely determined by boundary terms:
\begin{align}
\nonumber\mathcal{I_{l,n}}&=\left[\color{red}{P_l^{(3)}(x)P_n(x)}-\color{blue}{P_l^{(2)}(x)P_n^{(1)}(x)}+\color{green}{P_l^{(1)}(x)P_n^{(2)}(x)}-\color{magenta}{P_l(x)P_n^{(3)}(x)}\right]\biggl|_{-1}^{\;1}=\\
\nonumber&=\color{red}{\frac{l(l+3)\left(l^2-1\right)\left(l^2-4\right)}{24}}-
\color{blue}{\frac{l(l+2)\left(l^2-1\right)n(n+1)}{8}}+\\
\nonumber&\;+\color{green}{\frac{l(l+1)n(n+2)\left(n^2-1\right)}{8}}-
\color{magenta}{\frac{n(n+3)\left(n^2-1\right)\left(n^2-4\right)}{24}}=\\
&=\frac{\left(l-n\right)\left(\left(l+n\right)^2-1\right)
\left(\left(l-n\right)^2-4\right)(l+n+3)}{24}.\tag{$\spadesuit$}
\end{align}
Therefore the only remaining case to consider is $l=n+4$. Here the answer may be computed using Rodrigues formula. Replacing expressions for Legendre polynomials into the initial integral and integrating by parts, we get 
$$\mathcal{I}_{n+4,n}=2(2n+3)(2n+5)(2n+7).$$
But this is compatible with the previous result ($\spadesuit$), which may therefore be used for all $l\ge n+4$.
A: Let me see if I can give a solution. The orthogonality relation for the Gegenbauer polynomials is
$$
\int_{-1}^{1} P_m(x) P_n(x) dx = \frac{2}{2n+1} \delta_{m,n}.
$$
The forward shift operator for the Jacobi polynomials, e.g. http://homepage.tudelft.nl/11r49/askey/ch1/par8/par8.html, is given by
$$
\frac{d}{dx} P_m^{(\alpha,\beta)}(x) = \frac{n+\alpha+\beta+1}{2} P_{m-1}^{(\alpha+1,\beta+1)}(x).
$$
Note that the Gegenbauer polynomials are Jacobi polynomial where $\alpha = \beta = 0$.
The connection coefficients for the Jacobi polynomials are
$$
P_n^{(\gamma,\delta)}(x) = \sum_{k=0}^n c_{n,k}(\gamma,\delta;\alpha,\beta) P_k^{(\alpha,\beta)}(x),
$$
where
\begin{equation*}
\begin{split}
c_{n,k}(\gamma,\delta;\alpha,\beta) &= \frac{
  (\gamma+k+1)_{n-k} (n+\gamma+\delta+1)_k
}{
  (n-k)! \Gamma(\alpha+\beta+2k+1)
} \Gamma(\alpha+\beta+k+1) \\
&\times {}_3 F_2(-n+k, n+k+\gamma+\delta+1, \alpha+k+1; \gamma+k+1, \alpha+\beta+2k+2; 1).
\end{split}
\end{equation*}
Hence
\begin{equation*}
\begin{split}
\frac{d^4}{dx^4} P_{\ell}^{(0,0)}
  &= \frac{(\ell-2)_4}{2^4} P_{\ell-4}^{(4,4)}(x)
  = \frac{(\ell-2)_4}{2^4} \sum_{k=0}^{\ell-4} c_{\ell-4,k}(4,4;0,0) P_k^{(0,0)}(x).
\end{split}
\end{equation*}
By the orthogonality relation we have
\begin{equation*}
\int_{-1}^{1} \frac{d^4}{dx^4} P_{\ell}(x) P_n(x) dx = \frac{(\ell-2)_4}{2^3 (2n+1)} c_{\ell-4,n}(4,4;0,0).
\end{equation*}
Note that the connection coefficient can be found in Ismail, Classical and Quantum Orthogonal polynomials and that the connection coefficients probably can be simplified a lot. I hope I don't divide by zero somewhere so that you have to intrepid it formally. So the last part is homework. ;)
