How this calculation works
Evaluate integer-degree associated Legendre Ferrers functions on the unit interval with a visible phase convention and optional orthonormal output.
P_l^m(x)=(-1)^m(1−x²)^(m/2) d^mP_l(x)/dx^m; normalized value uses √[(2l+1)(l−m)!/(2(l+m)!)].A worked example
For l = 4, m = 2 and x = 0.3, the Condon–Shortley value is −2.52525. The orthonormal value is approximately −0.2823315330 and the derivative is 30.33.
Good to know
Integer 0≤m≤l≤30 and real x in [−1,1]. First-kind Ferrers function, Condon–Shortley phase selectable, fixed-order orthonormal value returned. Endpoint derivatives have separate finite or unbounded statuses. No negative/complex order, outside-interval branch or fitted harmonic expansion.
Reference: Official definition and method reference (opens in a new tab) ↗
Choose the interval-specific function
Associated Legendre notation can conceal an important distinction between values inside and outside the real unit interval. This page evaluates the first-kind Ferrers function on −1≤x≤1 for nonnegative integer degree and order. It does not extend the same recurrence output into a different branch domain without changing the definition.
The degree l and order m are separate integers, with m no larger than l. They determine a polynomial multiplied by a power of 1−x². The output is therefore not the value of an arbitrary spherical harmonic: a spherical harmonic also includes an azimuthal factor and a convention connecting x with polar angle.
Compare this with the Real spherical harmonic expansion calculator from weighted samples. Evaluate P_l^m(x) on the real unit interval, not fit a spherical-harmonic expansion to weighted directional samples.
Make the phase visible
The Condon–Shortley convention includes a factor (−1)^m in the derivative definition. Omitting it reverses the sign for odd m and leaves even orders unchanged. The selector keeps both conventions on one calculator so comparisons do not require another page with the same calculation under a different name.
The orthonormal value multiplies the selected-phase result by √[(2l+1)(l−m)!/(2(l+m)!)]. For fixed m, this normalizes the integral of its square over x∈[−1,1] to one. It is not a complete spherical-harmonic normalization over both polar and azimuthal coordinates, and no extra 2π factor is silently included.
Compute the default explicitly
For l = 4 and m = 2, differentiate P₄(x) twice and multiply by 1−x². This gives P₄²(x) = (15/2)(1−x²)(7x²−1). At x = 0.3, its factors are 0.91 and −0.37, giving exactly −2.52525 in ordinary decimal arithmetic for that input.
The normalization factor is approximately 0.1118033989, so the normalized value is approximately −0.2823315330. Differentiating the same expression gives 30.33 at the default argument. These three values provide a transparent algebraic reference before relying on a recurrence at larger degrees or orders.
Use recurrences with defined starting values
The computation begins with P_m^m(x), whose magnitude contains the odd double factorial and the factor (1−x²)^(m/2). The next degree is x(2m+1)P_m^m. A three-term degree recurrence then reaches l while m stays fixed, so every step follows the same phase convention as the starting value.
Large unnormalized values are expected when m and l increase. A value much larger than one is not an invalid probability or an overflow by itself. The normalized output is useful for comparing amplitudes across orders, but normalization does not make a poorly scaled outside-domain calculation valid; the input bounds still apply.
Handle endpoint derivatives separately
At x = ±1, direct use of the ordinary derivative recurrence produces a zero denominator. That expression cannot be evaluated literally, even when the derivative has a finite one-sided limit. The implementation returns explicit endpoint limits for orders zero and two and zero limits for sufficiently high orders.
For order one, the square-root factor creates an unbounded one-sided derivative at the endpoints. The page reports that status as text rather than an infinite numeric measurement. A finite function value and an infinite limiting slope are compatible, so users should not interpret the derivative status as a failure of the function value itself.
Interpret zeros and symmetry
The illustration plots a selected degree and order across the interval and marks its zeros. For integer parameters, P_l^m(−x) = (−1)^(l+m)P_l^m(x), giving either even or odd symmetry. This identity is another useful validation check and helps identify a sign or phase mismatch in an external comparison.
A zero of the function need not be a zero of its derivative. In numerical tests near those crossings, absolute tolerance is required because relative error divides by a value close to zero. The derivative and normalization outputs should always be compared under the same phase choice and the same argument convention.
Connect to a harmonic calculation carefully
If the intended use is a spherical expansion, first establish whether x means cos(θ), where θ is measured from the positive axis. Then supply the azimuthal sine, cosine or complex exponential factor separately under the chosen real or complex basis. This page computes the Ferrers factor and does not estimate expansion coefficients from samples.
Keep l, m, x and the phase label with an exported value. These small metadata fields often explain discrepancies that otherwise look like numerical inaccuracies. Using the same degree with a different order or silently removing the Condon–Shortley sign changes the mathematical object, even if both values come from reputable software.
A few questions, answered
Why do two packages disagree by a minus sign?
For odd order, including or omitting the Condon–Shortley factor changes the sign. Check the phase convention before judging numerical accuracy.
Is the normalized value a spherical harmonic?
No. It is orthonormal over x for a fixed order. A spherical harmonic also needs an azimuthal factor and its associated normalization.
Why is the order-one endpoint derivative unbounded?
The associated function contains a square-root endpoint factor whose derivative diverges even though the function value remains finite.
Can the degree or order be fractional?
Not on this page. It supports only nonnegative integer parameters with 0≤m≤l≤30 on the real unit interval.