definite integral solution for $\int^{\pi}_{\alpha} P_{n}(\cos\theta)\:P_{m}(\cos\theta)\sin\theta\:d\theta$ I'm trying to verify the result of  $\int^{\pi}_{\alpha} P_{n}(\cos\theta) P_{m}(\cos\theta)\sin\theta\:d\theta$ in a publication which gives:
$$\tfrac{\sin \alpha}{m(m+1) - n(n+1)}\biggl( P_{m}(\cos\alpha)P'_{n}(\cos\alpha) - P_{n}(\cos\alpha)P'_{m}(\cos\alpha)\biggr)\\\text{ when }m\neq n \tag{eqn.1}$$
(the $m=n$ solution is not of interest here).
Where:

*

*$P_{m}(cos \:\alpha)$ is the Legendre polynomial of order $m$, where $m,n$ are whole numbers

*$P^{\prime}_{m}(cos \:\alpha) = \frac{\partial}{\partial \alpha}P_{m}(cos \:\alpha) =  \frac{m(m+1)}{(2m+1)sin \:\alpha}(P_{m+1}(cos \:\alpha) - P_{m-1}(cos \:\alpha))$
However, the computational implementation of the integral solution uses the equivalent of:
$$\frac{\sin\:\alpha}{m(m+1) - n(n+1)}\biggl( P_{n}(\cos\alpha)P'_{m}(cos\:\alpha) - P_{m}(\cos\alpha)P'_{n}(\cos \alpha) \biggr) \tag{eqn.2}$$
The m and n indices have been switched in the $P_{m/n}$ and $P^{\prime}_{m/n}$ terms - and this leads to different numerical results.
I've tried looking through the source of the solution [1] (and other integral tables books [2,3]) but am unable to see a matching integral form.
Could someone please answer which solution is correct (eqn.1 or eqn.2) OR point me to a solution for this integral?
References

*

*Gradshteyn IS, Ryzhik IM. Table of Integrals, Series, and Products 6th edn.

*Erdélyi, A. et al., Tables of Integral Transforms, vols. I and II. McGraw Hill, New York, 1954.

*Magnus, W. and Oberhettinger, F., Formeln und Sätze für die speziellen Funktionen der mathematischen Physik, Springer–Verlag, Berlin, 1948.


I wrote to the author, who clarified that the published solution has a typo. The code implementation is correct - and it's correctness has been verified by numerical simulations by the author. (I was not successful in tracking down the solutions used to derive the presented integral solution).
The result for  $\int^{\pi}_{\alpha} P_{n}(\cos\theta) P_{m}(\cos\theta)\sin\theta\:d\theta$ should have been
$\tfrac{\sin \alpha}{n(n+1) - m(m+1)}\biggl( P_{m}(\cos\alpha)P'_{n}(\cos\alpha) - P_{n}(\cos\alpha)P'_{m}(\cos\alpha)\biggr)\\\text{ when }m\neq n $
