Legendre polynomial .
The Legendre polynomials are orthogonal on with uniform weight, and serve as the angular eigenfunctions of the Laplacian on the sphere (spherical harmonics with ) and as a basis for Gauss-Legendre quadrature.
Parameters
Returns
Tensor element-wise, broadcast over x and n.
Notes
Bonnet recurrence:
On , with boundary values , .
Examples
>>> import lucid
>>> from lucid.special import legendre_polynomial_p
>>> legendre_polynomial_p(lucid.tensor([-1.0, 0.0, 0.5, 1.0]), n=3)
tensor([-1., -0., -0.4375, 1.])