-- test m to eliminate denominators P(l,m) = test(m < 0, (-1)^m (l + m)! / (l - m)! P(l,-m), 1/(2^l l!) (1 - x^2)^(m/2) d((x^2 - 1)^l,x,l + m)) "Legendre polynomials" P(0,0) P(1,0) P(1,1) P(1,-1) P(2,0) P(2,1) P(2,2) P(2,-1) P(2,-2) "Verify Legendre polynomials" check(P(0,0) == 1) check(P(1,0) == x) check(P(1,1) == sqrt(1 - x^2)) check(P(1,-1) == -1/2 sqrt(1 - x^2)) check(P(2,0) == 1/2 (3 x^2 - 1)) check(P(2,1) == 3 x sqrt(1 - x^2)) check(P(2,-1) == -1/2 x sqrt(1 - x^2)) check(P(2,2) == 3 (1 - x^2)) check(P(2,-2) == 1/8 (1 - x^2)) "ok"
Run