Fact-checked by Grok 2 weeks ago

Legendre polynomials

Legendre polynomials, denoted P_n(x) for non-negative integers n, are a classical family of orthogonal polynomials that arise as solutions to Legendre's differential equation (1 - x^2)y'' - 2xy' + n(n+1)y = 0 on the interval [-1, 1]. They are defined explicitly by Rodrigues' formula P_n(x) = \frac{1}{2^n n!} \frac{d^n}{dx^n} (x^2 - 1)^n and satisfy the orthogonality relation \int_{-1}^{1} P_m(x) P_n(x) \, dx = \frac{2}{2n+1} \delta_{mn}, where \delta_{mn} is the Kronecker delta. Named after the French mathematician Adrien-Marie Legendre (1752–1833), these polynomials form a complete basis for the Hilbert space L^2([-1, 1], dx) and are generated by the function \sum_{n=0}^{\infty} P_n(x) t^n = \frac{1}{\sqrt{1 - 2xt + t^2}} for appropriate |t|. Legendre introduced what became known as Legendre polynomials in 1783 as coefficients in a memoir addressing the gravitational attraction of spheroids, building on problems in celestial mechanics and potential theory. His work expanded upon earlier ideas by , focusing on series expansions for potentials, and the polynomials were later recognized for their broader mathematical structure through orthogonal polynomial theory. Over time, they have been generalized to associated Legendre functions and incorporated into frameworks like , enhancing their utility in multidimensional problems. Key properties of Legendre polynomials include their recurrence relation (n+1)P_{n+1}(x) = (2n+1)x P_n(x) - n P_{n-1}(x), which facilitates efficient computation, and the fact that P_n(1) = 1 and P_n(-1) = (-1)^n for all n. They are even or odd functions depending on whether n is even or odd, and their roots lie in (-1, 1), making them ideal for numerical integration via Gaussian quadrature. Additionally, the polynomials can be expressed via the hypergeometric function {}_2F_1(-n, n+1; 1; \frac{1-x}{2}), connecting them to special functions in analysis. In mathematics, Legendre polynomials underpin expansions of functions on [-1, 1] and serve as building blocks for spectral methods in numerical analysis, including approximations of solutions to partial differential equations. In physics, they are essential for solving Laplace's equation in spherical coordinates, appearing in the azimuthal-independent solutions as zonal harmonics for problems in electrostatics, gravitation, and fluid dynamics. They also feature prominently in quantum mechanics, where spherical harmonics—products of Legendre polynomials (or associated versions) and trigonometric functions—describe angular momentum states in central force problems. Further applications include multipole expansions of potentials and approximations in radiative transfer.

Historical Context

Introduction by Adrien-Marie Legendre

Adrien-Marie Legendre, a prominent French mathematician, first introduced what are now known as Legendre polynomials in 1783 while investigating the gravitational attraction exerted by spheroids. This work arose from efforts to model the perturbations in planetary orbits, where precise calculations of gravitational potentials were essential. Legendre developed these polynomials as part of expanding the Newtonian potential in series form, providing a mathematical framework to handle the complex interactions between celestial bodies modeled as slightly deformed spheres. In his seminal memoir titled Recherches sur l'attraction des sphéroïdes homogènes, presented to the Académie Royale des Sciences in January 1783 and published in 1785, Legendre systematically treated these functions for the first time, deriving them in the context of solving in spherical coordinates. Originally, he referred to them as "spherical functions," reflecting their role in describing potentials on spherical surfaces, rather than using the modern term "Legendre polynomials," which emerged later with standardization in mathematical literature. This notation underscored their initial application to zonal harmonics in gravitational theory, distinguishing them from more general associated forms. Legendre's work expanded upon earlier ideas by in . Legendre's contributions in this memoir not only addressed immediate astronomical challenges but also established a foundational tool for potential theory, influencing subsequent work on orthogonal polynomials by mathematicians such as Laplace and Gauss.

Development and early applications

Following Adrien-Marie Legendre's introduction of the polynomials in 1783 for modeling gravitational attractions, their development accelerated in the 19th century through contributions by prominent mathematicians who refined their formulation and established foundational properties. Carl Friedrich Gauss played a pivotal role by incorporating associated Legendre functions into the theory of spherical harmonics, standardizing their notation and application in potential theory. In his 1839 treatise Allgemeine Theorie des Erdmagnetismus, Gauss expanded the polynomials to represent the Earth's magnetic potential as a series involving associated Legendre polynomials P_n^m(\cos \theta), introducing the now-standard Gauss coefficients g_n^m and h_n^m to parameterize the expansion up to degree 4, which required fitting 24 coefficients using least-squares methods on observational data from 84 global sites. Other mathematicians, including Pafnuty Chebyshev, further proved key properties such as orthogonality and recurrence relations, building on earlier work to solidify their mathematical structure. These advancements enabled early applications in astronomy and , where the polynomials facilitated precise calculations of planetary perturbations and gravitational fields. In astronomy, they were employed to expand the disturbing function in , aiding the computation of planetary orbits by accounting for mutual gravitational influences through series expansions. In , Gauss's framework modeled the Earth's irregular gravitational and magnetic fields, allowing for accurate determination of shapes and magnetic declinations from surface measurements, which supported navigational and efforts across . These uses marked a shift from computations to systematic theoretical tools, enhancing the reliability of 19th-century astronomical ephemerides and geodetic surveys. By the late 19th century, Legendre polynomials transitioned into the broader framework of orthogonal polynomial theory, largely through Chebyshev's recognition of their general properties as a class of systems suitable for approximation and analysis. Chebyshev generalized the concept, demonstrating their utility in minimizing errors in polynomial approximations and linking them to discrete orthogonality on finite point sets, which influenced subsequent theoretical developments. This evolution was further propelled by investigations into continued fractions and the by Thomas Jan Stieltjes, whose 1894 lectures connected orthogonal polynomials to integral equations, providing a probabilistic interpretation via positive measures and paving the way for applications in . The polynomials' practical importance was underscored by their inclusion in 19th-century tables of , which compiled numerical values to support computational astronomy. These tables, often published in astronomical yearbooks and mathematical handbooks, allowed astronomers to efficiently evaluate series expansions for predictions without deriving coefficients from scratch, thereby streamlining calculations for and production.

Definitions and Explicit Formulas

Generating function representation

The generating function for the Legendre polynomials P_n(x) is defined as G(x, t) = \frac{1}{\sqrt{1 - 2xt + t^2}} = \sum_{n=0}^{\infty} P_n(x) t^n, where the equality holds for |t| < 1 and x \in [-1, 1]. This ordinary encapsulates the entire sequence of polynomials as the coefficients in its Taylor series expansion about t = 0. The representation ensures uniqueness because the Legendre polynomials are precisely these coefficients, satisfying the required normalization P_n(1) = 1 for all n. This generating function originated in Adrien-Marie Legendre's 1782 memoir on the attraction of homogeneous spheroids, where it arose in the context of expanding gravitational potentials. Pierre-Simon Laplace subsequently utilized the same function in his development of potential theory around 1785, applying it to solve boundary-value problems for in spherical coordinates. To obtain the explicit form of P_n(x) from the generating function, one approach employs the generalized binomial theorem. Rewrite G(x, t) = (1 - 2xt + t^2)^{-1/2}, and expand using (1 + u)^{-1/2} = \sum_{k=0}^{\infty} \binom{-1/2}{k} u^k, with u = -2xt + t^2. Substituting and expanding u^k via the standard binomial theorem yields powers of t, from which the coefficient of t^n directly gives P_n(x). An equivalent method extracts the coefficients via repeated partial differentiation: P_n(x) = \frac{1}{n!} \left. \frac{\partial^n G(x, t)}{\partial t^n} \right|_{t=0}. These techniques facilitate straightforward computation of low-degree polynomials, such as P_0(x) = 1 and P_1(x) = x, and underscore the generating function's utility in deriving series expansions for physical applications like multipole potentials.

Rodrigues' formula

The Rodrigues' formula provides an explicit expression for the Legendre polynomial P_n(x) of degree n \geq 0 as P_n(x) = \frac{1}{2^n n!} \frac{d^n}{dx^n} (x^2 - 1)^n. This representation, equivalent to the form P_n(x) = \frac{(-1)^n}{2^n n!} \frac{d^n}{dx^n} (1 - x^2)^n, directly constructs P_n(x) from repeated differentiation of the fixed polynomial (x^2 - 1)^n. The formula is named after , who introduced it in his 1816 dissertation for the specific case of Legendre polynomials and generalized it to a broader class of orthogonal polynomials satisfying certain differential equations. A proof that this expression yields the Legendre polynomials can be sketched by verifying that it satisfies Legendre's differential equation and the normalization P_n(1) = 1. To confirm the normalization, evaluate at x = 1: since (x^2 - 1)^n and its first n-1 derivatives vanish at x = 1, the Leibniz rule applied to the product in the generating function expansion or directly to the boundary terms ensures the leading coefficient aligns correctly./07:_Special_Functions/7.02:_Legendre_Polynomials) This formula demonstrates that P_n(x) is indeed a polynomial of exact degree n, as the nth derivative of the degree-$2n polynomial (x^2 - 1)^n eliminates all terms of degree less than n. It enables direct symbolic or numerical computation of P_n(x) for any n without relying on recursive relations, though for large n alternative methods may be more efficient in practice./07:_Special_Functions/7.02:_Legendre_Polynomials)

Hypergeometric function expression

The Legendre polynomial P_n(x) admits an explicit representation in terms of the Gauss hypergeometric function {}_2F_1(a,b;c;z), given by P_n(x) = {}_2F_1\left(-n, n+1; 1; \frac{1-x}{2}\right). This formula, known as Murphy's representation, expresses P_n(x) as a special case of the generalized hypergeometric series with parameters derived from the polynomial degree n. Since one of the upper parameters is the negative integer -n, the series terminates after n+1 terms, yielding a polynomial of exact degree n in x. This terminating nature aligns with the polynomial character of Legendre functions and can be derived briefly from the Rodrigues formula through series expansion of the involved factorials and powers. The representation highlights the connection to the broader family of classical orthogonal polynomials, particularly as a limiting case. Legendre polynomials correspond to the Jacobi polynomials P_n^{(\alpha,\beta)}(x) with \alpha = \beta = 0, where the general hypergeometric form is P_n^{(\alpha,\beta)}(x) = \frac{(\alpha+1)_n}{n!} {}_2F_1\left(-n, n+\alpha+\beta+1; \alpha+1; \frac{1-x}{2}\right); substituting the parameters simplifies directly to the Legendre case. This embedding within the Jacobi family underscores the Legendre polynomials' role in the , a hierarchical classification of hypergeometric orthogonal polynomials that reveals limiting relationships to other systems like , , and . The hypergeometric expression proves particularly useful for theoretical analysis and computation. It enables seamless integration with transformation identities and contiguous relations of the hypergeometric function, facilitating derivations of recurrence relations and integral representations shared across orthogonal polynomial families. Additionally, for large n, asymptotic approximations can be obtained by applying known large-parameter expansions of the {}_2F_1 function, providing insights into the oscillatory and decay behavior of P_n(x) on [-1,1].

Solution to Legendre's differential equation

Legendre's differential equation is given by (1 - x^2) y'' - 2x y' + n(n+1) y = 0, where x \in (-1, 1) and n is a parameter. This is a second-order linear homogeneous ordinary differential equation with variable coefficients, classified as a Sturm-Liouville equation in the context of self-adjoint operators on the interval [-1, 1]. The equation has regular singular points at x = \pm 1, as determined by the Fuchsian analysis of its singularities, where the coefficients exhibit poles of order at most one and two, respectively. The general solution consists of two linearly independent functions, but polynomial solutions of degree exactly n exist only when n is a non-negative integer. In this case, one solution is the Legendre polynomial P_n(x), which is finite and bounded on the closed interval [-1, 1], while the second solution, the Legendre function of the second kind Q_n(x), exhibits logarithmic singularities at x = \pm 1 and is unbounded there. These polynomial solutions P_n(x) are uniquely determined up to a scalar multiple by requiring them to be regular at the endpoints and normalized such that P_n(1) = 1. As the bounded eigenfunctions corresponding to the eigenvalues n(n+1) for integer n \geq 0, the Legendre polynomials P_n(x) form a complete orthogonal basis for the space of square-integrable functions on [-1, 1] with respect to the weight function 1, enabling their use in series expansions for functions in this space. This foundational role stems directly from the spectral theory of the associated . Explicit constructions, such as , verify that these polynomials satisfy the differential equation.

Fundamental Properties

Orthogonality on the interval [-1, 1]

Legendre polynomials \{ P_n(x) \} form an orthogonal set with respect to the L^2 inner product on the interval [-1, 1], defined as \langle f, g \rangle = \int_{-1}^{1} f(x) g(x) \, dx. Specifically, they satisfy the orthogonality relation \int_{-1}^{1} P_m(x) P_n(x) \, dx = \frac{2}{2n + 1} \delta_{mn}, where \delta_{mn} is the , which equals 1 if m = n and 0 otherwise. This holds under the standard normalization where P_n(1) = 1. The orthogonality is with respect to the uniform weight function w(x) = 1 on [-1, 1], which distinguishes Legendre polynomials from other classical orthogonal polynomials that employ non-constant weights, such as Laguerre or Hermite polynomials. This uniform weighting aligns with their role in approximating square-integrable functions without additional density factors. To establish the orthogonality for m \neq n, consider the Legendre differential equation satisfied by each polynomial: \frac{d}{dx} \left[ (1 - x^2) \frac{d P_k}{dx} \right] + k(k + 1) P_k(x) = 0, \quad k = m, n. Multiplying the equation for P_n by P_m and integrating over [-1, 1] yields \int_{-1}^{1} P_m(x) \frac{d}{dx} \left[ (1 - x^2) P_n'(x) \right] dx + n(n + 1) \int_{-1}^{1} P_m(x) P_n(x) \, dx = 0. Integration by parts on the first term, noting that the boundary terms vanish due to the behavior of Legendre polynomials at the endpoints, gives - \int_{-1}^{1} (1 - x^2) P_m'(x) P_n'(x) \, dx + n(n + 1) \int_{-1}^{1} P_m(x) P_n(x) \, dx = 0. Repeating the process for the equation of P_m multiplied by P_n and subtracting the two results in [n(n + 1) - m(m + 1)] \int_{-1}^{1} P_m(x) P_n(x) \, dx = 0. Since m \neq n, the coefficient is nonzero, implying the integral is zero. This self-adjoint form of the Sturm-Liouville problem underscores the orthogonality. The orthogonality relation equips the Legendre polynomials with the structure of an orthogonal basis for the space of square-integrable functions on [-1, 1].

Normalization conventions

The standard normalization for Legendre polynomials P_n(x) sets P_n(1) = 1 for all nonnegative integers n. This convention originates from Adrien-Marie Legendre's 1783 work on the expansion of the Newtonian potential, where the polynomials appear as coefficients in the series \frac{1}{|\mathbf{r} - \mathbf{r}'|} = \sum_{n=0}^\infty P_n(\cos \gamma) \frac{r_<^n}{r_>^{n+1}}, with P_n(1) = 1 ensuring unity at \cos \gamma = 1. Alternative normalizations adapt the polynomials for specific applications. Monic Legendre polynomials scale the standard form so the leading coefficient is 1, dividing by the standard leading coefficient \frac{1}{2^n} \binom{2n}{n}. In contrast, the unit L² version on [-1, 1] uses the scaling factor \sqrt{\frac{2n+1}{2}}, yielding orthonormal polynomials \tilde{P}_n(x) = \sqrt{\frac{2n+1}{2}} P_n(x). This arises from the providing the squared \frac{2}{2n+1} for the standard polynomials. These variations affect coefficients: the standard form eases boundary evaluations in , while orthonormal scaling avoids normalization factors in projections onto the basis.

Recurrence relations

Legendre polynomials satisfy several s that facilitate their sequential computation and analysis. The fundamental three-term is (n+1) P_{n+1}(x) = (2n+1) x P_n(x) - n P_{n-1}(x), with initial conditions P_0(x) = 1 and P_1(x) = x. This relation enables the generation of higher-degree polynomials from lower ones in a computationally efficient manner. The three-term recurrence can be derived from the generating function g(t, x) = (1 - 2xt + t^2)^{-1/2} = \sum_{n=0}^\infty P_n(x) t^n. By taking partial derivatives with respect to x and t, and manipulating the resulting series expansions, the emerges through coefficient comparison. A useful relation for the derivatives of Legendre polynomials is P_n'(x) = \frac{n}{x^2 - 1} \left( x P_n(x) - P_{n-1}(x) \right). This follows from differentiating the three-term recurrence or directly from the differential equation satisfied by the polynomials. Forward recursion using the three-term relation is numerically stable for computing Legendre polynomials up to moderate degrees n, typically on the order of hundreds, due to the bounded nature of the polynomials on [-1, 1]. These recurrences are also employed in algorithms for locating the zeros of Legendre polynomials.

Advanced Properties

Zeros and their interlacing

The Legendre polynomial P_n(x) of degree n has exactly n distinct real zeros, all lying in the open interval (-1, 1). These zeros are all simple, meaning no multiple roots occur. A key property of these zeros is their interlacing behavior between consecutive degrees. Specifically, the zeros of P_{n+1}(x) those of P_n(x): between any two consecutive zeros of P_n(x), there lies exactly one zero of P_{n+1}(x), and the zeros near the endpoints -1 and $1 alternate in position. This interlacing follows from the theory of orthogonal polynomials and ensures a systematic distribution as the degree increases. The zeros of P_n(x) play a central role in numerical . They serve as the nodes for the Gauss-Legendre quadrature rule, which exactly integrates polynomials of degree up to $2n-1 over [-1, 1] with weight function w(x) = 1. For the Gauss-Lobatto variant, the interior nodes are the zeros of the derivative P_n'(x), combined with the endpoints \pm 1, enabling exact integration of polynomials up to degree $2n-1 while incorporating boundary evaluations. There is no for the individual zeros of P_n(x) in terms of elementary functions. However, they can be approximated effectively, particularly for large n. The largest zero x_{n,1} (closest to 1) admits the asymptotic approximation x_{n,1} \approx 1 - \frac{j_{0,1}^2}{2n^2}, where j_{0,1} \approx 2.4048 is the first positive zero of the J_0(z). This edge behavior arises from the connection between Legendre polynomials and near the interval endpoints.

Asymptotic approximations for large degree

For large degrees n, the Legendre polynomials P_n(x) exhibit distinct asymptotic behaviors depending on the location of x within or near the interval [-1, 1]. In the interior of the interval, where x = \cos \theta with \theta fixed away from 0 and \pi, the polynomials oscillate rapidly with an amplitude that decays like n^{-1/2}. This behavior is captured by the leading term of the Mehler-Dirichlet asymptotic approximation, derived from the integral representation P_n(\cos \theta) = \frac{1}{\pi} \int_0^\pi \left( \cos \theta + i \sin \theta \cos \phi \right)^n \, d\phi. Using the method of stationary phase or Darboux analysis on this integral, the approximation simplifies to P_n(\cos \theta) \sim \sqrt{\frac{2}{\pi n \sin \theta}} \cos\left( \left(n + \frac{1}{2}\right)\theta - \frac{\pi}{4} \right) as n \to \infty, uniformly for \theta \in [\delta, \pi - \delta] where $0 < \delta < \pi/2. This formula highlights the rapid oscillations governed by the cosine term, whose zeros interlace and concentrate near the endpoints for large n, consistent with the distribution of roots. The Darboux method provides a systematic way to obtain this asymptotic by expanding the generating function \sum_{n=0}^\infty P_n(x) t^n = (1 - 2xt + t^2)^{-1/2} around its dominant singularities on the circle of convergence |t| = 1 / \sqrt{1 - x^2}. For fixed x \in (-1,1), the contributions from the two nearest singularities yield the oscillatory form above, with the prefactor arising from the local behavior near those points. Higher-order terms in the expansion can be included for improved accuracy, with error O(n^{-3/2}). Near the endpoints x = \pm 1, the oscillatory approximation breaks down, and the behavior transitions to a non-oscillatory regime described by Bessel functions. Specifically, as \theta \to 0^+ with n \theta fixed, P_n(\cos \theta) \sim J_0\left( \left(n + \frac{1}{2}\right) \theta \right), where J_0 is the Bessel function of the first kind of order zero; a similar form holds near \theta = \pi with alternating sign (-1)^n. This uniform asymptotic justifies the concentration of oscillations and roots near the boundaries, avoiding exponential growth or decay within [-1,1], though outside the interval for |x| > 1, P_n(x) grows exponentially as \left( x + \sqrt{x^2 - 1} \right)^n / \sqrt{2\pi n (x^2 - 1)^{1/4}}. These large-degree approximations are essential in applications such as high-degree multipole expansions in and physics, where they enable efficient truncation and estimation of errors in series representations of potentials or wave functions.

Completeness in L²[-1, 1]

The completeness of the Legendre polynomials in the space L^2[-1, 1] follows from the density of polynomials in this and the fact that the Legendre polynomials form an spanning the space of all polynomials. By the Weierstrass approximation theorem, polynomials are dense in the C[-1, 1] under the , and since continuous functions are dense in L^2[-1, 1] with respect to the L^2 norm, polynomials are dense in L^2[-1, 1]. The Stone-Weierstrass theorem provides a general framework for this density, confirming that the algebra of polynomials separates points and vanishes nowhere on the compact interval [-1, 1], thus approximating any continuous function arbitrarily well. As the Legendre polynomials \{P_n(x)\}_{n=0}^\infty are a complete orthogonal system that generates all polynomials via linear combinations, they form a complete basis for L^2[-1, 1]. Any function f \in L^2[-1, 1] can thus be expanded in the Fourier-Legendre series f(x) = \sum_{n=0}^\infty c_n P_n(x), where the coefficients are given by c_n = \frac{2n+1}{2} \int_{-1}^1 f(x) P_n(x) \, dx. This expansion converges to f in the L^2 norm, leveraging the orthogonality of the Legendre polynomials \int_{-1}^1 P_m(x) P_n(x) \, dx = \frac{2}{2n+1} \delta_{mn}, which enables the explicit computation of the coefficients. The partial sums s_N(x) = \sum_{n=0}^N c_n P_n(x) satisfy \|f - s_N\|_{L^2} \to 0 as N \to \infty. A key consequence is , which equates the L^2 norm of f to the sum of the weighted squared coefficients: \int_{-1}^1 |f(x)|^2 \, dx = \sum_{n=0}^\infty c_n^2 \cdot \frac{2}{2n+1}. This identity holds for any f \in L^2[-1, 1] and underscores the energy preservation in the expansion, directly arising from the completeness and properties. For analytic functions on [-1, 1], the Legendre series exhibits faster convergence compared to , as the latter is optimized for periodic functions and may suffer from slower rates or Gibbs phenomena near endpoints for non-periodic data, whereas Legendre expansions achieve geometric convergence rates determined by the Bernstein ellipse of analyticity.

Applications

Expansions in potential theory

In potential theory, Legendre polynomials play a central role in expanding the reciprocal distance between two points, which is fundamental for solving Laplace's equation in gravitational and electrostatic contexts. The expansion expresses the scalar potential due to a point source as an infinite series involving these polynomials, allowing for the decomposition of the interaction into multipolar contributions along the axis joining the points. Specifically, for two position vectors \mathbf{r} and \mathbf{r}' with magnitudes r = |\mathbf{r}| and r' = |\mathbf{r}'|, and angle \gamma between them, the inverse distance is given by \frac{1}{|\mathbf{r} - \mathbf{r}'|} = \sum_{n=0}^{\infty} \frac{r_<^n}{r_>^{n+1}} P_n(\cos \gamma), where r_< = \min(r, r') and r_> = \max(r, r'). This series converges absolutely for all \gamma when r \neq r', providing a powerful tool for approximating potentials in regions separated by spherical boundaries. The derivation of this expansion follows directly from the for Legendre polynomials, g(t, x) = (1 - 2xt + t^2)^{-1/2} = \sum_{n=0}^{\infty} P_n(x) t^n, which holds for |t| < 1 and x \in [-1, 1]. Substituting x = \cos \gamma and t = r_</r_> yields the series, as the generating function corresponds to the expansion of the distance formula in spherical coordinates. This approach leverages the and of the polynomials to ensure the expansion is unique and efficient for axisymmetric problems. This expansion leads naturally to zonal harmonics in , where the axisymmetric terms (with azimuthal independence) model deviations in Earth's , such as the oblateness captured by low-degree Legendre polynomials like P_2(\cos \theta). These zonal components are essential for refining orbits and understanding undulations.

Multipole expansions in physics

In electrostatics, the potential \Phi(\mathbf{r}) generated by a localized charge distribution \rho(\mathbf{r}') at an observation point \mathbf{r} where |\mathbf{r}| > |\mathbf{r}'| admits a involving Legendre polynomials: \Phi(\mathbf{r}) = \sum_{n=0}^{\infty} \frac{1}{r^{n+1}} \int (r')^n P_n(\cos \alpha) \rho(\mathbf{r}') \, dV', where \alpha is the angle between the position vectors \mathbf{r} and \mathbf{r}', and the integral is over the volume containing the charges (with the constant $1/(4\pi\epsilon_0) often omitted for simplicity in such expansions). This series arises from the for Legendre polynomials applied to the expansion of $1/|\mathbf{r} - \mathbf{r}'|. The terms in this expansion can be expressed using multipole moments Q_n = \int \rho(\mathbf{r}') (r')^n P_n(\cos \theta') \, dV', where the z-axis is aligned with \mathbf{r} and \theta' is the polar angle of \mathbf{r}'; the potential then becomes \Phi(r, \theta) = \sum_{n=0}^{\infty} \frac{Q_n}{r^{n+1}} P_n(\cos \theta). The zeroth-order term (n=0) reduces to the monopole potential proportional to the total charge over the distance r. An analogous expansion holds in Newtonian gravitation for the potential due to a mass distribution \mu(\mathbf{r}'), where \Phi_g(\mathbf{r}) = -G \sum_{n=0}^{\infty} \frac{1}{r^{n+1}} \int (r')^n P_n(\cos \alpha) \mu(\mathbf{r}') \, dV', with G the and multipole moments defined similarly using \mu in place of \rho. This form applies to planetary or distributions, capturing deviations from spherical through higher-order terms. In applications to atomic physics, such as modeling the electrostatic fields of neutral atoms or molecules, the monopole term vanishes due to overall charge neutrality, leaving the dipole (n=1) and quadrupole (n=2) terms as the typically dominant contributions at distances beyond the atomic scale.

Connections to spherical harmonics

Spherical harmonics Y_\ell^m(\theta, \phi) are defined as the product of a normalized associated Legendre function and a complex exponential in the azimuthal angle, specifically Y_\ell^m(\theta, \phi) = (-1)^m \sqrt{ \frac{(2\ell + 1)( \ell - m )! }{ 4\pi ( \ell + m )! } } P_\ell^m ( \cos \theta ) e^{i m \phi } for m \geq 0, with Y_\ell^{-m} = (-1)^m (Y_\ell^m)^*, where P_\ell^m are the associated Legendre functions and the Legendre polynomials P_\ell correspond to the case m = 0, so P_\ell^0 (x) = P_\ell (x) and thus Y_\ell^0 (\theta, \phi) = \sqrt{ \frac{2\ell + 1}{4\pi} } P_\ell ( \cos \theta ). This connection arises naturally from the applied to \nabla^2 \psi = 0 in spherical coordinates, where the solution is assumed to factor as \psi(r, \theta, \phi) = R(r) \Theta(\theta) \Phi(\phi); the azimuthal part \Phi(\phi) yields e^{i m \phi } with integer m for single-valuedness, while the polar part \Theta(\theta) satisfies the associated Legendre equation, whose solutions are P_\ell^m ( \cos \theta ) for separation constant \ell(\ell + 1), reducing to the Legendre equation and polynomials P_\ell ( \cos \theta ) when m = 0. In , the serve as the angular eigenfunctions for the , forming the basis for the wavefunction \psi_{n \ell m} (r, \theta, \phi) = R_{n \ell} (r) Y_\ell^m (\theta, \phi), where the \hat{L}^2 (squared ) has eigenvalues \hbar^2 \ell (\ell + 1) derived from the same separation constant in the angular , analogous to the Laplace case but within the full time-independent equation. A key relation linking Legendre polynomials directly to the full set of is the addition theorem, which expresses the zonal harmonic (m=0 case) in terms of a sum over all m: P_n (\cos \gamma) = \frac{4\pi}{2n + 1} \sum_{m = -n}^n Y_n^{m *} (\theta', \phi') Y_n^m (\theta, \phi), where \cos \gamma = \cos \theta \cos \theta' + \sin \theta \sin \theta' \cos (\phi - \phi'), facilitating expansions of rotationally invariant functions on the sphere.

Use in numerical analysis and approximation theory

Legendre polynomials play a central role in , a method for over the interval [-1, 1] with uniform weight. The nodes of the n-point Gauss-Legendre quadrature rule are the roots of the nth-degree Legendre polynomial P_n(x), denoted as x_k for k = 1, \dots, n, which are symmetrically distributed within [-1, 1]. The corresponding weights w_k are given by w_k = \frac{2}{(1 - x_k^2) [P_n'(x_k)]^2}, ensuring the rule approximates \int_{-1}^1 f(x) \, dx \approx \sum_{k=1}^n w_k f(x_k). This formulation achieves exact integration for any f(x) of degree at most $2n-1, maximizing the degree of precision for a given number of nodes compared to other interpolatory quadratures like Newton-Cotes. In approximation theory, Legendre polynomials form an for expanding smooth functions on [-1, 1] via Legendre series. A function f(x) can be represented as f(x) = \sum_{k=0}^\infty \hat{f}_k P_k(x), where the coefficients \hat{f}_k = \frac{2k+1}{2} \int_{-1}^1 f(x) P_k(x) \, dx. For differentiable functions, the truncation error of the Nth partial sum S_N(f)(x) = \sum_{k=0}^N \hat{f}_k P_k(x) satisfies bounds that decay with the smoothness of f; specifically, for functions with r continuous derivatives, the error \|f - S_N\|_{L^2[-1,1]} = O(N^{-r}), with faster algebraic rates for higher r and exponential convergence for analytic functions. Sharper estimates, such as |\hat{f}_k| \leq C k^{-m-1} for functions in the H^{m+1}[-1,1], lead to truncation errors bounded by O(N^{-m}) in the , enabling efficient approximations for problems requiring high accuracy with moderate N. Spectral methods leverage Legendre polynomials for solving partial differential equations (PDEs) through , particularly at Legendre-Gauss-Lobatto (LGL) points, which include the endpoints -[1](/page/1) and [1](/page/1) along with the roots of the P_n'(x). In this approach, an approximate solution u_N(x) is sought as a of degree at most N interpolating the PDE at the N+1 LGL nodes, enforcing boundary conditions naturally at the endpoints. For time-dependent PDEs like the or , spatial discretization via LGL yields spectral accuracy—error decaying faster than any rate for smooth solutions—while pseudospectral matrices derived from Legendre polynomials facilitate efficient evolution in time. This method is particularly effective for problems on finite domains without singularities, as demonstrated in analyses for singularly perturbed reaction-diffusion PDEs, where the scheme achieves uniform high-order accuracy across the domain. Compared to Chebyshev polynomials, Legendre polynomials offer advantages in on [-1, 1] due to their with respect to the uniform w(x) = 1, aligning directly with unweighted L^2 norms and standard integrals without requiring transformation. Chebyshev expansions, orthogonal under w(x) = (1 - x^2)^{-1/2}, introduce endpoint clustering that suits but complicates uniform-weight problems, making Legendre bases preferable for and series expansions in this setting.

Role in machine learning models

Legendre polynomials have found applications in , particularly in enhancing the stability and efficiency of models dealing with sequential data and . One prominent use is in recurrent neural networks (RNNs), where they facilitate the design of memory units that preserve long-term dependencies. The Legendre Memory Unit (LMU), introduced by Voelker et al., employs a linear transformation of input history using Legendre polynomials up to degree d-1 to orthogonalize continuous-time representations within the network. This approach solves coupled ordinary differential equations derived from the polynomials' properties, enabling the LMU to maintain information over extended time windows with minimal parameters. Empirical evaluations demonstrate that LMUs outperform (LSTM) units in tasks like chaotic time-series prediction, achieving up to 100 times greater memory capacity while reducing training time by factors of 2-10. In kernel-based methods, Legendre polynomials serve as the foundation for constructing orthogonal kernels that improve the conditioning and interpretability of models like support vector machines (SVMs) and Gaussian processes. The , defined as k(x, y) = \sum_{n=0}^{m} L_n(x) L_n(y) where L_n are normalized Legendre polynomials, leverages their on [-1, 1] to map data into a high-dimensional feature space with reduced between basis functions. This kernel has been shown to enhance accuracy on nonlinearly separable datasets compared to standard or Gaussian kernels, particularly by minimizing the number of support vectors and improving . For Gaussian processes, approximations using Gauss-Legendre quadrature rules—rooted in the zeros of Legendre polynomials—enable scalable regression by low-rank kernel approximations, achieving near-exact performance on large datasets with reduced from O(n^3) to O(n^2). Legendre polynomials also play a role in feature expansions for and architectures, capitalizing on their completeness in the L^2[-1, 1] space to represent high-dimensional data efficiently. In Legendre Deep (LDNNs), inputs are expanded into a basis of Legendre polynomials, which act as functions in layers to approximate complex functions, such as solutions to equations. This expansion promotes and faster during due to the minimizing among features. Studies report approximation errors on the order of $10^{-9} for nonlinear problems, outperforming traditional polynomial bases. More recently, as of 2024, Legendre polynomial transformations have been integrated into ensemble methods like the Legendre Energy-Weighted (LEW-RF) for improved classification of sequential data.

Variants and Generalizations

Shifted Legendre polynomials

Shifted Legendre polynomials, denoted \tilde{P}_n(x), are defined as \tilde{P}_n(x) = P_n(2x - 1) for x \in [0, 1], where P_n denotes the standard Legendre polynomial of degree n. This linear transformation maps the interval [0, 1] onto [-1, 1], adapting the classical basis to problems defined on the unit interval. These polynomials satisfy on [0, 1] with respect to the constant weight function 1: \int_0^1 \tilde{P}_m(x) \tilde{P}_n(x) \, dx = \frac{1}{2n + 1} \delta_{mn}, where \delta_{mn} is the Kronecker delta. This relation derives directly from the standard Legendre orthogonality via the substitution u = 2x - 1 and the Jacobian factor of $1/2. Shifted Legendre polynomials are employed in expansions of functions supported on [0, 1], such as probability density functions, enabling efficient computation of statistical moments through orthogonal projections. For example, they facilitate the recovery of a probability density from a finite set of its moments by solving systems in the orthogonal basis. In numerical integration over [0, 1], they underpin adapted schemes and spectral methods, providing accurate approximations for definite integrals without endpoint singularities. Their role extends to , where operational matrices of shifted Legendre polynomials convert fractional differential equations into algebraic systems for numerical solution. Furthermore, they are used in approximations involving hat functions, serving as basis elements in hybrid schemes for boundary value problems and integro-differential equations on [0, 1].

Associated Legendre functions

The associated Legendre functions of the first kind, P_n^m(x), for nonnegative integers n and m with m \leq n, generalize the Legendre polynomials and are defined by the Rodrigues-type formula P_n^m(x) = (-1)^m (1 - x^2)^{m/2} \frac{d^m}{dx^m} P_n(x), where P_n(x) denotes the Legendre polynomial of degree n. This expression arises from differentiating the Legendre polynomial and incorporating a factor that ensures regularity on the interval [-1, 1]. When m = 0, the formula reduces to the standard Legendre polynomial P_n(x). These functions satisfy the associated Legendre differential equation, a modification of the Legendre that incorporates the order m: (1 - x^2) \frac{d^2 y}{dx^2} - 2x \frac{dy}{dx} + \left[ n(n+1) - \frac{m^2}{1 - x^2} \right] y = 0. The additional term -\frac{m^2}{1 - x^2} reflects the azimuthal separation constant m^2 in applications involving in spherical coordinates. For integer orders $0 \leq m \leq n, P_n^m(x) consists of a polynomial of degree n - m multiplied by the factor (1 - x^2)^{m/2}, making it a solution that is finite and single-valued on [-1, 1]. The associated Legendre functions play a crucial role in the complete set of spherical harmonics, providing the latitudinal dependence P_n^m(\cos \theta) for the angular part of solutions to in . For fixed m, the functions P_n^m(x) for varying n \geq m exhibit n - m zeros in the open interval (-1, 1), which supports their use in orthogonal expansions over the sphere. They satisfy the orthogonality relation \int_{-1}^1 P_n^m(x) P_k^m(x) \, dx = \frac{2 (n + m)!}{(2n + 1) (n - m)!} \delta_{nk}, with respect to the weight function 1 on [-1, 1].

Legendre rational functions

Legendre rational functions are a sequence of orthogonal functions on the interval [0, \infty), obtained by applying the inverse of the Cayley transform to Legendre polynomials, which maps the positive real line to the interval [-1, 1]. They are defined explicitly as R_n(t) = \frac{1}{\sqrt{\pi}} (t + i)^{-n-1/2} P_n\left( \frac{t - i}{t + i} \right), or equivalently through other normalizations, where i is the imaginary unit and P_n is the Legendre polynomial. This construction ensures that the functions are real-valued for t \geq 0 and decay appropriately at infinity. These functions form an on [0, \infty) with respect to the weight function w(t) = \frac{1}{\pi (t+1)^2}, satisfying \int_0^\infty R_m(t) R_n(t) \, w(t) \, dt = \delta_{mn}. The orthogonality follows from the substitution via the x = \frac{t - i}{t + i}, which preserves the inner product up to the of the transformation. Legendre rational functions are particularly useful in spectral methods for solving differential equations on unbounded domains, such as the half-line or quarter-plane, where traditional bases fail due to lack of completeness. They enable efficient approximations for problems in , , and involving semi-infinite geometries. Modified versions, such as shifted or weighted variants, further adapt them for specific boundary conditions or non-uniform weights. For instance, they are applied in collocation methods for or fractional differential equations on [0, \infty), providing sparse systems and high accuracy.