{
  "id": "legendre-polynomials",
  "title": "Legendre Polynomials",
  "lang": "en",
  "source_lang": "en",
  "summary": "Legendre polynomials are orthogonal polynomials on a finite interval, fundamental to spherical harmonic analysis, Gaussian quadrature, and spectral approximation.",
  "category": "mathematics",
  "subcategory": "analysis",
  "type": "concept",
  "aliases": [
    "Legendre polynomial sequence",
    "Ordinary Legendre polynomials"
  ],
  "generated_at": "2026-11-05",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/legendre-polynomials/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/legendre-polynomials/",
      "json": "https://aiwiki.page/zh/legendre-polynomials.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "The Legendre polynomials are a sequence of polynomials \\(P_0(x),P_1(x),P_2(x),\\ldots\\) that are mutually orthogonal on the interval \\([-1,1]\\) with respect to ordinary integration. Under the standard normalization \\(P_n(1)=1\\), each \\(P_n\\) has degree \\(n\\) and satisfies\n\n\\[\\frac{d}{dx}\\left[(1-x^2)\\frac{dP_n}{dx}\\right]+n(n+1)P_n(x)=0.\\]\n\nThey form one of the principal classical families of orthogonal polynomials, distinguished by a constant weight function and a close connection with the geometry of the sphere.\n\nNamed after Adrien-Marie Legendre, the polynomials entered mathematics through eighteenth-century investigations of gravitational attraction and potential theory. Their importance extends well beyond their original setting: they provide angular components of solutions to Laplace’s equation, determine the nodes of highly accurate numerical integration rules, and serve as basis functions for approximating functions and solving differential equations. Their differential equation, orthogonality, recurrence relations, and generating function are complementary descriptions of the same structure."
    },
    {
      "heading": "Definition, normalization, and historical setting",
      "text": "For nonnegative integers \\(m\\) and \\(n\\), the defining orthogonality relation is\n\n\\[\\int_{-1}^{1}P_n(x)P_m(x)\\,dx = \\begin{cases} 0,&m\\ne n,\\\\[2mm] \\dfrac{2}{2n+1},&m=n. \\end{cases}\\]\n\nThe integration weight is \\(1\\): no additional factor modifies the contribution of different points in the interval. Consequently, \\(P_n\\) is orthogonal not only to the other Legendre polynomials of lower degree but to every polynomial of degree less than \\(n\\). Orthogonality together with \\(P_n(1)=1\\) uniquely determines the sequence.\n\nThe first six members are\n\n\\[\\begin{aligned} P_0(x)&=1,\\\\ P_1(x)&=x,\\\\ P_2(x)&=\\tfrac12(3x^2-1),\\\\ P_3(x)&=\\tfrac12(5x^3-3x),\\\\ P_4(x)&=\\tfrac18(35x^4-30x^2+3),\\\\ P_5(x)&=\\tfrac18(63x^5-70x^3+15x). \\end{aligned}\\]\n\nThese examples exhibit the parity relation\n\n\\[P_n(-x)=(-1)^nP_n(x).\\]\n\nThus even-degree members are even functions and odd-degree members are odd functions. At the endpoints,\n\n\\[P_n(1)=1,\\qquad P_n(-1)=(-1)^n.\\]\n\nThe coefficient of \\(x^n\\) is\n\n\\[\\kappa_n=\\frac{(2n)!}{2^n(n!)^2} =2^{-n}\\binom{2n}{n}.\\]\n\nThe standard polynomials are therefore not monic, except in degrees zero and one.\n\nAlternative normalizations are common and must be distinguished. The monic polynomial is \\(P_n/\\kappa_n\\), whereas the orthonormal polynomial is\n\n\\[\\phi_n(x)=\\sqrt{\\frac{2n+1}{2}}\\,P_n(x).\\]\n\nThe latter has squared integral equal to one. In probabilistic applications involving a uniform distribution on \\([-1,1]\\), the integration measure is instead \\(dx/2\\); the orthonormal functions are then \\(\\sqrt{2n+1}\\,P_n(x)\\). These changes alter numerical coefficients but not the roots or the underlying orthogonality.\n\nLegendre’s work in the 1780s on the attraction of spheroids helped establish the polynomials in mathematical physics. Related investigations by Pierre-Simon Laplace placed such functions within the broader study of potentials and spherical expansions. In the nineteenth century, Rodrigues-type differentiation formulas, Gaussian quadrature, and Sturm–Liouville theory revealed their algebraic, numerical, and spectral roles.\n\nA useful abstract construction starts with \\(1,x,x^2,\\ldots\\) and applies the Gram–Schmidt process using the inner product\n\n\\[\\langle f,g\\rangle=\\int_{-1}^{1}f(x)g(x)\\,dx.\\]\n\nNormalizing each result to equal one at \\(x=1\\) produces the Legendre sequence. This construction explains why Legendre polynomials provide a natural replacement for monomials when orthogonality is more useful than direct access to powers of \\(x\\)."
    },
    {
      "heading": "Generating functions, Rodrigues’ formula, and recurrence relations",
      "text": "The principal generating function is\n\n\\[\\frac{1}{\\sqrt{1-2xt+t^2}} =\\sum_{n=0}^{\\infty}P_n(x)t^n.\\]\n\nFor real \\(x\\in[-1,1]\\), this expansion converges for \\(|t|<1\\). Expanding the left-hand side in powers of \\(t\\) gives all degrees simultaneously, while differentiation with respect to \\(x\\) or \\(t\\) produces identities connecting neighboring degrees. The square root is chosen to equal one at \\(t=0\\), which fixes the relevant analytic branch.\n\nA second explicit construction is Rodrigues’ formula:\n\n\\[P_n(x)=\\frac{1}{2^n n!} \\frac{d^n}{dx^n}(x^2-1)^n.\\]\n\nIt immediately shows that the result is a polynomial of degree \\(n\\). More importantly, it proves orthogonality directly. If \\(q\\) has degree less than \\(n\\), repeated integration by parts gives\n\n\\[\\int_{-1}^{1}q(x)P_n(x)\\,dx = \\frac{(-1)^n}{2^n n!} \\int_{-1}^{1}q^{(n)}(x)(x^2-1)^n\\,dx=0.\\]\n\nAll boundary terms vanish because \\((x^2-1)^n\\) has zeros of order \\(n\\) at both endpoints. The remaining integral vanishes because \\(q^{(n)}=0\\).\n\nExpanding Rodrigues’ formula yields the finite expression\n\n\\[P_n(x)= \\sum_{k=0}^{\\lfloor n/2\\rfloor} (-1)^k \\frac{(2n-2k)!} {2^n k!(n-k)!(n-2k)!} x^{n-2k}.\\]\n\nAlthough exact, this formula is usually less suitable for numerical evaluation than a recurrence: the individual terms can become large and cancel strongly. Its main uses include symbolic manipulation, extraction of coefficients, and proofs of parity and leading-term formulas.\n\nThe standard three-term recurrence relation, often called Bonnet’s recurrence, is\n\n\\[(n+1)P_{n+1}(x) =(2n+1)xP_n(x)-nP_{n-1}(x), \\qquad n\\ge1.\\]\n\nTogether with \\(P_0=1\\) and \\(P_1=x\\), it generates the entire sequence. Rearranging it shows that multiplication by \\(x\\) only couples neighboring degrees:\n\n\\[xP_n(x)= \\frac{n+1}{2n+1}P_{n+1}(x) +\\frac{n}{2n+1}P_{n-1}(x).\\]\n\nThis sparse algebraic structure is central to quadrature algorithms and spectral discretizations.\n\nUseful derivative identities include\n\n\\[(1-x^2)P_n'(x) =n\\bigl(P_{n-1}(x)-xP_n(x)\\bigr)\\]\n\nand\n\n\\[P_{n+1}'(x)-P_{n-1}'(x)=(2n+1)P_n(x), \\qquad n\\ge1.\\]\n\nThe second identity also gives an antiderivative:\n\n\\[\\int P_n(x)\\,dx =\\frac{P_{n+1}(x)-P_{n-1}(x)}{2n+1}+C.\\]\n\nThese relations allow differentiation, integration, and multiplication to be performed directly on Legendre expansions rather than by first converting them to monomials."
    },
    {
      "heading": "Differential equation and Sturm–Liouville structure",
      "text": "The Legendre equation is the second-order ordinary differential equation\n\n\\[(1-x^2)y''-2xy'+\\lambda y=0.\\]\n\nWhen \\(\\lambda=n(n+1)\\) for a nonnegative integer \\(n\\), it has the polynomial solution \\(P_n\\). A power-series calculation explains the discrete parameter values. Substitution of \\(y=\\sum_{k\\ge0}a_kx^k\\) gives\n\n\\[a_{k+2} =\\frac{k(k+1)-\\lambda}{(k+2)(k+1)}a_k.\\]\n\nThe even and odd coefficients evolve independently. If \\(\\lambda=n(n+1)\\), the chain with the parity of \\(n\\) terminates at degree \\(n\\), producing the polynomial solution.\n\nThe equation is naturally written in the self-adjoint form\n\n\\[-\\frac{d}{dx}\\left[(1-x^2)y'\\right]=\\lambda y.\\]\n\nThis places the polynomials within Sturm–Liouville theory, where orthogonal functions arise as eigenfunctions of differential operators. Unlike a regular problem on a closed interval, the coefficient \\(1-x^2\\) vanishes at the endpoints. Endpoint behavior must therefore be included in the operator’s definition. The standard Legendre realization selects the nonsingular endpoint behavior; its eigenfunctions are the \\(P_n\\), with eigenvalues \\(n(n+1)\\).\n\nThe mechanism behind orthogonality can be seen without the full operator theory. Multiply the equations for \\(P_n\\) and \\(P_m\\) by \\(P_m\\) and \\(P_n\\), respectively, subtract them, and integrate. This gives\n\n\\[\\bigl[n(n+1)-m(m+1)\\bigr] \\int_{-1}^{1}P_nP_m\\,dx = -\\left[(1-x^2)(P_mP_n'-P_nP_m')\\right]_{-1}^{1}.\\]\n\nThe boundary expression is zero because the functions and their derivatives are finite while \\(1-x^2\\) vanishes. Distinct eigenvalues then force the integral to vanish.\n\nThe same structure gives an energy identity:\n\n\\[\\int_{-1}^{1}(1-x^2)\\bigl(P_n'(x)\\bigr)^2\\,dx = n(n+1)\\int_{-1}^{1}P_n(x)^2\\,dx = \\frac{2n(n+1)}{2n+1}.\\]\n\nIt describes how the oscillatory complexity of the eigenfunction increases with degree. The constant function corresponds to eigenvalue zero, while every higher mode has positive energy.\n\nA second linearly independent solution, conventionally denoted \\(Q_n(x)\\), is a Legendre function of the second kind, not a polynomial. For example, on \\(-1<x<1\\),\n\n\\[Q_0(x)=\\frac12\\log\\frac{1+x}{1-x}, \\qquad Q_1(x)=xQ_0(x)-1.\\]\n\nThese functions have logarithmic endpoint singularities. Both \\(P_n\\) and \\(Q_n\\) are needed for general local solutions, but only \\(P_n\\) has the regularity appropriate to the usual angular problem on the whole sphere. Thus polynomial termination and endpoint regularity are two closely related ways of identifying the physically relevant discrete family."
    },
    {
      "heading": "Zeros, interlacing, and large-degree behavior",
      "text": "For every \\(n\\ge1\\), \\(P_n\\) has exactly \\(n\\) distinct real zeros, all strictly inside \\((-1,1)\\). This is a general consequence of orthogonality with a positive weight. To see the essential argument, suppose that \\(P_n\\) had fewer than \\(n\\) sign-changing zeros in the interval. Multiplying it by the product of the corresponding linear factors would produce a function of constant sign, apart from its zeros. Its integral could not vanish, contradicting orthogonality to all polynomials of degree less than \\(n\\).\n\nParity makes the zeros symmetric about the origin. An odd-degree polynomial has a zero at \\(x=0\\), whereas an even-degree one does not. The zeros of consecutive degrees interlace: between any two neighboring zeros of \\(P_n\\) lies exactly one zero of \\(P_{n-1}\\). Interlacing follows from the three-term recurrence or the oscillation theory of the differential equation. It supplies useful brackets for root-finding algorithms and explains why successive Gaussian quadrature rules distribute their nodes in a highly organized way.\n\nOn the whole interval,\n\n\\[|P_n(x)|\\le1.\\]\n\nOne route to this bound uses the integral representation\n\n\\[P_n(x)=\\frac1\\pi \\int_0^\\pi \\left(x+i\\sqrt{1-x^2}\\cos\\varphi\\right)^n\\,d\\varphi, \\qquad -1\\le x\\le1.\\]\n\nThe complex quantity inside the power has modulus at most one. Although the integrand is complex, its imaginary part cancels under integration, leaving the real polynomial. The bound is attained at the endpoints.\n\nFor large \\(n\\), behavior in the interior differs sharply from behavior near the endpoints. Writing \\(x=\\cos\\theta\\), the leading interior asymptotic expansion is\n\n\\[P_n(\\cos\\theta) = \\sqrt{\\frac{2}{\\pi(n+\\tfrac12)\\sin\\theta}} \\cos\\left((n+\\tfrac12)\\theta-\\frac{\\pi}{4}\\right) +O(n^{-3/2}),\\]\n\nuniformly when \\(\\theta\\) stays in a closed subinterval of \\((0,\\pi)\\). It shows oscillations that are approximately equally spaced in the angular coordinate \\(\\theta\\), with amplitude of order \\(n^{-1/2}\\) away from the endpoints.\n\nThe empirical distribution of the zeros approaches the density\n\n\\[\\frac{1}{\\pi\\sqrt{1-x^2}}, \\qquad -1<x<1.\\]\n\nConsequently, zeros crowd near \\(x=\\pm1\\) rather than being uniformly spaced in \\(x\\). The closest zeros lie at distances of order \\(n^{-2}\\) from the endpoints.\n\nThe interior cosine approximation does not remain uniform as \\(\\theta\\to0\\). In an endpoint scaling, the limiting form instead involves Bessel functions:\n\n\\[\\lim_{n\\to\\infty}P_n\\!\\left(\\cos\\frac{z}{n}\\right)=J_0(z).\\]\n\nThis Mehler–Heine limit connects the smallest angular zeros to the positive zeros of \\(J_0\\). It also explains why accurate high-degree algorithms often use different approximations in the interior and in narrow endpoint regions."
    },
    {
      "heading": "Legendre series, completeness, and projection kernels",
      "text": "A square-integrable function on \\([-1,1]\\) has a Legendre expansion\n\n\\[f(x)\\sim\\sum_{n=0}^{\\infty}a_nP_n(x), \\qquad a_n=\\frac{2n+1}{2}\\int_{-1}^{1}f(x)P_n(x)\\,dx.\\]\n\nThe coefficients are determined by orthogonality, in the same general manner as the coefficients of a Fourier series. The essential difference is that the basis functions are algebraic polynomials rather than sines and cosines. No periodic extension of the function is built into the basis.\n\nThe sequence is complete in the Hilbert space \\(L^2([-1,1])\\): if a square-integrable function is orthogonal to every \\(P_n\\), it is zero almost everywhere. One explanation combines the fact that \\(P_0,\\ldots,P_N\\) span all polynomials of degree at most \\(N\\) with the density of polynomials in \\(L^2([-1,1])\\). Completeness implies convergence of the partial sums\n\n\\[S_Nf=\\sum_{n=0}^{N}a_nP_n\\]\n\nto \\(f\\) in the \\(L^2\\) norm.\n\nEach partial sum is the orthogonal projection onto the polynomial subspace of degree at most \\(N\\). It therefore uniquely minimizes\n\n\\[\\int_{-1}^{1}|f(x)-q(x)|^2\\,dx\\]\n\nover all polynomials \\(q\\) of that degree. Orthogonality also gives Parseval’s identity,\n\n\\[\\int_{-1}^{1}|f(x)|^2\\,dx = \\sum_{n=0}^{\\infty}\\frac{2|a_n|^2}{2n+1},\\]\n\nand the exact truncation-error formula\n\n\\[\\|f-S_Nf\\|_2^2 = \\sum_{n>N}\\frac{2|a_n|^2}{2n+1}.\\]\n\nThese identities distinguish convergence in mean square from stronger claims about values at individual points.\n\nProjection can also be written as an integral:\n\n\\[S_Nf(x)=\\int_{-1}^{1}K_N(x,y)f(y)\\,dy,\\]\n\nwhere\n\n\\[K_N(x,y)=\\sum_{n=0}^{N}\\frac{2n+1}{2}P_n(x)P_n(y).\\]\n\nThe Christoffel–Darboux identity compresses this sum to\n\n\\[K_N(x,y)=\\frac{N+1}{2} \\frac{P_{N+1}(x)P_N(y)-P_N(x)P_{N+1}(y)} {x-y}, \\qquad x\\ne y.\\]\n\nThe value on the diagonal follows by a limit. This kernel reproduces every polynomial of degree at most \\(N\\), making it useful in interpolation theory and estimates for polynomial approximation.\n\nPointwise and uniform convergence require additional hypotheses. Mean-square convergence alone does not imply convergence at every point. Smoothness generally produces faster coefficient decay, while analyticity in a complex neighborhood of the interval gives geometric decay and correspondingly rapid approximation. Discontinuities can produce local oscillations analogous to the Gibbs phenomenon in Fourier analysis. Endpoint behavior also matters because the magnitude of individual basis functions and of the projection kernel is not spatially uniform. Legendre series are therefore best understood through both function-space convergence and local regularity, rather than through a single universal convergence rule."
    },
    {
      "heading": "Gauss–Legendre quadrature",
      "text": "The zeros of \\(P_n\\) are the nodes of Gauss–Legendre quadrature, a central instance of Gaussian quadrature. If these zeros are \\(x_1,\\ldots,x_n\\), the rule is\n\n\\[\\int_{-1}^{1}f(x)\\,dx \\approx\\sum_{i=1}^{n}w_i f(x_i),\\]\n\nwith\n\n\\[w_i=\\frac{2} {(1-x_i^2)\\,[P_n'(x_i)]^2}.\\]\n\nEvery weight is positive, and the weights sum to \\(2\\). The remarkable property is exactness for every polynomial of degree at most \\(2n-1\\), even though the rule uses only \\(n\\) function values.\n\nOrthogonality explains this degree of exactness. Given a polynomial \\(p\\) of degree at most \\(2n-1\\), polynomial division gives\n\n\\[p=qP_n+r, \\qquad \\deg q\\le n-1,\\quad \\deg r\\le n-1.\\]\n\nThe integral of \\(qP_n\\) is zero by orthogonality, while \\(p(x_i)=r(x_i)\\) at every node. Integrating the degree-\\((n-1)\\) interpolant of \\(r\\) therefore integrates \\(p\\) exactly. No rule with \\(n\\) distinct real nodes can integrate every polynomial of degree \\(2n\\): the square of the product of the node factors vanishes at all nodes but has strictly positive integral.\n\nFor example, the two-point rule has nodes \\(\\pm1/\\sqrt3\\), each with weight \\(1\\):\n\n\\[\\int_{-1}^{1}f(x)\\,dx \\approx f(-1/\\sqrt3)+f(1/\\sqrt3).\\]\n\nIt is exact through degree three. The three-point rule uses nodes \\(0,\\pm\\sqrt{3/5}\\), with weights \\(8/9,5/9,5/9\\), respectively, and is exact through degree five.\n\nIf \\(f\\) has a continuous derivative of order \\(2n\\), the error has the form\n\n\\[\\int_{-1}^{1}f(x)\\,dx-\\sum_{i=1}^{n}w_if(x_i) = \\frac{2^{2n+1}(n!)^4} {(2n+1)[(2n)!]^3}\\,f^{(2n)}(\\xi)\\]\n\nfor some \\(\\xi\\in(-1,1)\\). This expression is a theoretical error statement rather than an automatic practical estimator, since the relevant derivative may be difficult to bound.\n\nRules on a finite interval \\([a,b]\\) follow from\n\n\\[x=\\frac{a+b}{2}+\\frac{b-a}{2}t.\\]\n\nThe transformed nodes are \\((a+b)/2+(b-a)x_i/2\\), and each weight is multiplied by \\((b-a)/2\\). Endpoint-inclusive alternatives include Gauss–Lobatto–Legendre rules: with \\(n\\) total nodes, they use both endpoints and the zeros of \\(P_{n-1}'\\), and are exact through degree \\(2n-3\\).\n\nA powerful computational interpretation comes from the orthonormal recurrence\n\n\\[x\\phi_k=a_{k+1}\\phi_{k+1}+a_k\\phi_{k-1}, \\qquad a_k=\\frac{k}{\\sqrt{4k^2-1}}.\\]\n\nThe eigenvalues of the resulting \\(n\\times n\\) symmetric tridiagonal matrix are the Gaussian nodes. The weights are twice the squared first components of its normalized eigenvectors. This is the Legendre instance of the Golub–Welsch algorithm, connecting numerical integration directly with matrix eigenvalue problems."
    },
    {
      "heading": "Spherical geometry and potential theory",
      "text": "Legendre polynomials arise from separating Laplace’s equation in spherical coordinates. For an axisymmetric potential \\(u(r,\\theta)\\), independent of the azimuthal angle, write\n\n\\[u(r,\\theta)=R(r)\\Theta(\\theta).\\]\n\nSeparation leads to the angular equation\n\n\\[\\frac{1}{\\sin\\theta} \\frac{d}{d\\theta} \\left(\\sin\\theta\\frac{d\\Theta}{d\\theta}\\right) +\\lambda\\Theta=0.\\]\n\nThe substitution \\(x=\\cos\\theta\\) turns it into the Legendre equation. Regularity at both poles selects \\(\\lambda=\\ell(\\ell+1)\\) and \\(\\Theta=P_\\ell(\\cos\\theta)\\), where \\(\\ell\\) is a nonnegative integer.\n\nThe radial equation is\n\n\\[\\frac{d}{dr}\\left(r^2R'\\right)-\\ell(\\ell+1)R=0,\\]\n\nwith solutions \\(r^\\ell\\) and \\(r^{-\\ell-1}\\). Consequently, an axisymmetric harmonic potential can be expanded in terms of\n\n\\[\\left(A_\\ell r^\\ell+B_\\ell r^{-\\ell-1}\\right) P_\\ell(\\cos\\theta).\\]\n\nRegularity at the origin eliminates the negative powers in an interior problem, while decay at infinity eliminates the growing powers in an exterior problem. Boundary data on a sphere determine the remaining coefficients through Legendre orthogonality.\n\nThe generating function has an immediate physical interpretation. Let \\(\\gamma\\) be the angle between vectors \\(\\mathbf r\\) and \\(\\mathbf r'\\), and put \\(r_< =\\min(r,r')\\), \\(r_>=\\max(r,r')\\). For \\(r_<<r_>\\),\n\n\\[\\frac{1}{|\\mathbf r-\\mathbf r'|} = \\frac{1}{r_>} \\sum_{\\ell=0}^{\\infty} \\left(\\frac{r_<}{r_>}\\right)^\\ell P_\\ell(\\cos\\gamma).\\]\n\nThis expands the inverse-distance kernel governing Newtonian gravitational and electrostatic potentials. The terms of degree zero, one, and two give the monopole, dipole, and quadrupole angular structures. Higher terms describe progressively finer spatial organization of the source.\n\nFor non-axisymmetric functions, the natural objects are spherical harmonics, denoted \\(Y_{\\ell m}\\). Their connection to the ordinary Legendre polynomials is expressed by the addition theorem:\n\n\\[P_\\ell(\\cos\\gamma) = \\frac{4\\pi}{2\\ell+1} \\sum_{m=-\\ell}^{\\ell} Y_{\\ell m}(\\Omega)\\, \\overline{Y_{\\ell m}(\\Omega')},\\]\n\nassuming the spherical harmonics are orthonormal on the unit sphere. The left side depends only on the angle between the directions, whereas the right side resolves that rotationally invariant quantity into coordinate-dependent components.\n\nLegendre expansions also describe rotationally symmetric integral kernels on the sphere. For example, an isotropic covariance function can be expanded in \\(P_\\ell(\\cos\\gamma)\\), with angular power assigned to each degree. In scattering theory, an amplitude depending only on scattering angle is often decomposed into Legendre modes, called partial waves in the appropriate physical setting. In each case, degree \\(\\ell\\) labels an angular scale, while spherical symmetry prevents different degrees from mixing under rotationally invariant operations."
    },
    {
      "heading": "Associated functions and related polynomial families",
      "text": "When azimuthal dependence is retained in spherical separation, the angular equation acquires an additional term:\n\n\\[(1-x^2)y''-2xy' +\\left[\\ell(\\ell+1)-\\frac{m^2}{1-x^2}\\right]y=0.\\]\n\nFor integers \\(0\\le m\\le\\ell\\), a standard solution is\n\n\\[P_\\ell^m(x) =(-1)^m(1-x^2)^{m/2} \\frac{d^m}{dx^m}P_\\ell(x).\\]\n\nThese are the associated Legendre functions. The factor \\((-1)^m\\) is the Condon–Shortley phase; some conventions omit it. For odd \\(m\\), the factor \\((1-x^2)^{m/2}\\) means that the function is not an ordinary polynomial in \\(x\\), despite the traditional expression “associated Legendre polynomial.”\n\nFor fixed \\(m\\), their orthogonality is\n\n\\[\\int_{-1}^{1}P_\\ell^m(x)P_k^m(x)\\,dx = \\frac{2(\\ell+m)!}{(2\\ell+1)(\\ell-m)!}\\, \\delta_{\\ell k}.\\]\n\nCombining \\(P_\\ell^m(\\cos\\theta)\\) with \\(e^{im\\varphi}\\) gives the angular dependence of spherical harmonics. Negative integer orders are related by\n\n\\[P_\\ell^{-m}(x) =(-1)^m\\frac{(\\ell-m)!}{(\\ell+m)!}P_\\ell^m(x).\\]\n\nNormalization and phase conventions are especially important when comparing mathematical tables, geophysical models, and quantum-mechanical formulas.\n\nOrdinary Legendre polynomials are also special cases of larger orthogonal families. In the standard normalization of the Jacobi polynomials,\n\n\\[P_n(x)=P_n^{(0,0)}(x).\\]\n\nJacobi polynomials are orthogonal with weight \\((1-x)^\\alpha(1+x)^\\beta\\), for \\(\\alpha,\\beta>-1\\); setting both parameters to zero produces the constant Legendre weight. Similarly,\n\n\\[P_n(x)=C_n^{1/2}(x),\\]\n\nwhere \\(C_n^\\lambda\\) denotes a Gegenbauer polynomial. The Gegenbauer family extends the spherical setting to angular problems in other dimensions.\n\nA hypergeometric representation is\n\n\\[P_n(x) ={}_2F_1\\left(-n,n+1;1;\\frac{1-x}{2}\\right).\\]\n\nThe hypergeometric series terminates because one upper parameter is the nonpositive integer \\(-n\\). Replacing \\(n\\) by a general degree leads to Legendre functions that need not be polynomials. Such extensions require attention to branches and singularities, particularly for complex arguments or for arguments outside \\([-1,1]\\).\n\nA frequently used interval transformation defines the shifted Legendre polynomials\n\n\\[\\widetilde P_n(t)=P_n(2t-1),\\qquad 0\\le t\\le1.\\]\n\nTheir orthogonality is\n\n\\[\\int_0^1\\widetilde P_n(t)\\widetilde P_m(t)\\,dt =\\frac{\\delta_{nm}}{2n+1}.\\]\n\nThey are convenient when the natural domain is a probability interval, a finite time segment, or a standard finite element. This shift changes the argument and integration scale, not the essential polynomial family."
    },
    {
      "heading": "Numerical evaluation and spectral approximation",
      "text": "For moderate degree and \\(x\\in[-1,1]\\), the three-term recurrence is the standard way to compute Legendre polynomials. It avoids the factorials and large alternating terms in explicit coefficient formulas. Starting with \\(P_0=1\\) and \\(P_1=x\\), it computes all values through degree \\(N\\) using a number of arithmetic operations proportional to \\(N\\). Nevertheless, relative errors can be large near a zero because the exact value is small, even when absolute errors remain modest. This distinction is important in discussions of numerical stability.\n\nA whole Legendre series can be evaluated without storing every polynomial by Clenshaw’s algorithm, a backward recurrence adapted to the three-term relation. Derivatives can likewise be computed by differentiating the recurrence. The identity\n\n\\[P_n'(x)=\\frac{n(P_{n-1}(x)-xP_n(x))}{1-x^2}\\]\n\nis useful away from the endpoints but can suffer cancellation close to \\(x=\\pm1\\). At the endpoints, exact formulas are preferable:\n\n\\[P_n'(1)=\\frac{n(n+1)}2, \\qquad P_n'(-1)=(-1)^{n+1}\\frac{n(n+1)}2.\\]\n\nLegendre polynomials are fundamental basis functions in a spectral method for differential equations. A solution is approximated as\n\n\\[u_N(x)=\\sum_{n=0}^{N}c_nP_n(x),\\]\n\nand the differential equation is enforced either weakly, through weighted integrals, or at selected collocation points. Orthogonality makes the unweighted mass matrix diagonal:\n\n\\[M_{mn}=\\int_{-1}^{1}P_mP_n\\,dx =\\frac{2}{2n+1}\\delta_{mn}.\\]\n\nThis contrasts with a monomial basis, whose integral matrix becomes badly conditioned as degree increases.\n\nBoundary conditions can be built into modified bases. For a homogeneous Dirichlet problem, the functions\n\n\\[\\psi_k=P_k-P_{k+2}\\]\n\nvanish at both endpoints. Their derivatives satisfy\n\n\\[\\psi_k'=-(2k+3)P_{k+1},\\]\n\nso the stiffness matrix for the operator \\(-d^2/dx^2\\) is diagonal:\n\n\\[\\int_{-1}^{1}\\psi_k'(x)\\psi_j'(x)\\,dx =2(2k+3)\\delta_{kj}.\\]\n\nThis illustrates how identities specific to the polynomial family can simplify a differential-equation solver.\n\nLegendre bases also appear in high-order versions of the finite element method, where each mesh element carries a local polynomial expansion. Gauss–Lobatto points provide endpoint degrees of freedom, making it convenient to connect neighboring elements. Their quadrature does not integrate every product of degree-\\((n-1)\\) basis functions exactly, since such products can have degree \\(2n-2\\), one above the rule’s exactness threshold. The resulting distinction between exact and quadrature-based mass matrices matters in spectral-element implementations.\n\nIn uncertainty quantification, Legendre polynomials form the natural polynomial-chaos basis for uniformly distributed inputs. Products of one-dimensional orthonormal Legendre polynomials provide bases for several independent uniform variables. Expansion coefficients then encode means and variances through orthogonality, while truncating the basis gives a finite surrogate model. The number of multivariate terms grows rapidly with dimension, so sparse truncation and adaptive selection are often as important as the efficiency of the underlying one-dimensional recurrences."
    }
  ],
  "links": [
    "polynomial",
    "orthogonal-polynomials",
    "laplace-equation",
    "pierre-simon-laplace",
    "gram-schmidt-process",
    "inner-product",
    "generating-function",
    "integration-by-parts",
    "recurrence-relation",
    "ordinary-differential-equation",
    "sturm-liouville-theory",
    "asymptotic-expansion",
    "fourier-series",
    "hilbert-space",
    "orthogonal-projection",
    "matrix",
    "eigenvalues-and-eigenvectors",
    "spherical-harmonics",
    "hypergeometric-function",
    "numerical-stability",
    "finite-element-method"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}