# Integrating the Associated Legendre Polynomials

I know the following identity:

$\qquad \int_{-1}^1 P_l^m(t)^2dt=\frac{2(m+n)!}{(2n+1)(n-m)!}$

I would like to verify this result using Mathematica. This is what I entered:

Integrate[LegendreP[l, m, t]^2, {t, -1, 1},
Assumptions -> (m | l) ∈ Integers && l >= 0 && -l <= m <= l]


However it did not give the result I wanted. Any tips or advice would be appreciated!

• There are problems with your formulation. In your statement of the identity you have m and l on the lhs and m and n on the rhs. In your code you call LegendreP with 4 arguments, but it at most takes 3. You put constraints on m but none on l. Commented Jul 17, 2017 at 6:58
• @m_goldberg I have made the necessary amendments but I still did not get the result. Am I missing out some important constraints?
– Soby
Commented Jul 17, 2017 at 7:04
• It is entirely possible that Mathematica can not carry out the integration. Commented Jul 17, 2017 at 7:44
• Your equation has $m$ and $l$ on the lhs but $m$ and $n$ on the rhs. Commented Jul 17, 2017 at 15:33
• Numerically, With[{nmax = 25}, And @@ (Table[ Integrate[LegendreP[n, m, t]^2, {t, -1, 1}] == 2 (m + n)!/((2 n + 1) (n - m)!), {n, 0, nmax}, {m, -n, n}] // Flatten)] evaluates to True. Increase nmax until you lose patience. Commented Jul 17, 2017 at 15:49