SphericalHarmonicY[l,m,θ,ϕ]
gives the spherical harmonic
.
SphericalHarmonicY
SphericalHarmonicY[l,m,θ,ϕ]
gives the spherical harmonic
.
Details
- Mathematical function, suitable for both symbolic and numerical manipulation.
- The spherical harmonics are orthonormal with respect to integration over the surface of the unit sphere.
- For
,
where
is the associated Legendre function. - For
,
. - For certain special arguments, SphericalHarmonicY automatically evaluates to exact values.
- SphericalHarmonicY can be evaluated to arbitrary numerical precision.
- SphericalHarmonicY automatically threads over lists.
Examples
open all close allBasic Examples (5)
SphericalHarmonicY[3, 1, θ, ϕ]Plot over a subset of the reals:
Plot[SphericalHarmonicY[2, 1, x, π], {x, -5, 5}]Plot over a subset of the complexes:
ComplexPlot3D[SphericalHarmonicY[2, 1, z, π], {z, -1 - I, 1 + I}, PlotLegends -> Automatic]Series expansion at the origin:
Series[SphericalHarmonicY[3, 1, x, π], {x, 0, 3}]Series expansion at Infinity:
Series[SphericalHarmonicY[3, 1, x, π], {x, ∞, 3}]//NormalScope (36)
Numerical Evaluation (6)
SphericalHarmonicY[5, 1, 0, .3]SphericalHarmonicY[1, 0.5, -5, Pi / 3]N[SphericalHarmonicY[27, 5, Pi / 4, 0], 50]N[SphericalHarmonicY[2, 1, Pi / 3, Pi], 20]The precision of the output tracks the precision of the input:
SphericalHarmonicY[2, 2, Pi / 6, Pi / 4.211111111111111111]N[SphericalHarmonicY[23, 5 - I, Pi / 3, I + Pi]]Evaluate efficiently at high precision:
SphericalHarmonicY[31, 5, Pi / 6, 2`100]//TimingSphericalHarmonicY[15, 5, 1, Pi / 6`10000];//TimingCompute average-case statistical intervals using Around:
SphericalHarmonicY[2, 1, Around[2, 0.01], π]Compute the elementwise values of an array:
SphericalHarmonicY[2, 1, {{1 / 2, 1}, {1, 1 / 2}}, π]Or compute the matrix SphericalHarmonicY function using MatrixFunction:
MatrixFunction[SphericalHarmonicY[2, 1, #, π]&, {{1 / 2, 1}, {1, 1 / 2}}]//FullSimplifySpecific Values (4)
Evaluate SphericalHarmonicY symbolically for integer orders:
SphericalHarmonicY[3, 1, θ, ϕ]Evaluate SphericalHarmonicY symbolically for noninteger orders:
SphericalHarmonicY[1 / 2, 1 / 3, θ, ϕ]//FunctionExpandEvaluate SphericalHarmonicY symbolically for
:
SphericalHarmonicY[l, 0, θ, ϕ]//FunctionExpandSphericalHarmonicY for symbolic l and m:
SphericalHarmonicY[l, m, Pi / 2, Pi / 2]//FunctionExpandFind the first positive maximum of SphericalHarmonicY[2,2,θ,Pi/2]:
θmax = θ /. FindRoot[Abs[D[SphericalHarmonicY[2, 2, θ, Pi / 2], θ]] == 0, {θ, 1}]Plot[Abs[SphericalHarmonicY[2, 2, θ, Pi / 2]], {θ, -Pi, 2Pi}, Epilog -> Style[Point[{θmax, Abs[SphericalHarmonicY[2, 2, θmax, Pi / 2]]}], PointSize[Large], Red]]Visualization (3)
Plot the SphericalHarmonicY function for various orders:
Plot[{SphericalHarmonicY[2, 2, x, π], SphericalHarmonicY[2, 2, x, π / 2], SphericalHarmonicY[3, 2, x, π], SphericalHarmonicY[4, 2, x, π / 2]}, {x, -2, 2}]ComplexContourPlot[Re[SphericalHarmonicY[2, 2, z, π]], {z, -1 - I, 1 + I}, Contours -> 24]ComplexContourPlot[Im[SphericalHarmonicY[2, 2, z, π]], {z, -1 - I, 1 + I}, Contours -> 24]Plot the absolute value of the SphericalHarmonicY function in three dimensions:
Plot3D[(Abs[SphericalHarmonicY[1, 1, x + I y, π]]) ^ 2, {x, -4, 4}, {y, -2, 2}, ColorFunction -> "BlueGreenYellow"]Function Properties (13)
For integer
and
,
is defined for all complex
and
:
FunctionDomain[SphericalHarmonicY[3, 1, θ, ϕ], {θ, ϕ}, Complexes]For
, it is defined as a real function for all real
and
:
FunctionDomain[SphericalHarmonicY[3, 0, θ, ϕ], {θ, ϕ}]For other values of
, it is typically not defined as a real function:
FunctionAnalytic[SphericalHarmonicY[3, 1, θ, ϕ], {θ, ϕ}]FunctionRange[SphericalHarmonicY[2, 0, θ, ϕ], {θ, ϕ}, y]FunctionRange[SphericalHarmonicY[2, 0, θ, ϕ], {θ, φ}, y, Complexes]
is an even function with respect to
for even-order
:
SphericalHarmonicY[3, 2, -θ, ϕ] == SphericalHarmonicY[3, 2, θ, ϕ]It is an odd function with respect to
for odd-order
:
SphericalHarmonicY[3, 1, -θ, ϕ] == -SphericalHarmonicY[3, 1, θ, ϕ]SphericalHarmonicY is a periodic function with respect to θ and ϕ:
FunctionPeriod[SphericalHarmonicY[n, m, θ, ϕ], {θ, ϕ}]SphericalHarmonicY threads elementwise over lists:
SphericalHarmonicY[{0, 1, 2}, 0, θ, ϕ]
is an analytic function of
and
for integer
and
:
FunctionAnalytic[SphericalHarmonicY[2, 2, θ, ϕ], {θ, ϕ}, Complexes]For
, it is analytic over the reals:
FunctionAnalytic[SphericalHarmonicY[2, 0, θ, ϕ], {θ, ϕ}]
is neither non-decreasing nor non-increasing as a function of
:
FunctionMonotonicity[SphericalHarmonicY[2, 0, θ, ϕ], θ ]FunctionInjective[SphericalHarmonicY[2, 0, θ, ϕ], θ ]Plot[{SphericalHarmonicY[2, 0, θ, ϕ], .3}, {θ, -5, 5}]FunctionSurjective[SphericalHarmonicY[2, 0, θ, ϕ], θ]Plot[{SphericalHarmonicY[2, 0, θ, ϕ], 1}, {θ, -5, 5}]
is neither non-positive nor non-negative:
FunctionSign[SphericalHarmonicY[2, 0, θ, ϕ], θ]
does not have either a singularity or a discontinuity over the complexes for integer
and
:
FunctionSingularities[SphericalHarmonicY[2, 2, θ, θ], {θ, φ}, Complexes]FunctionDiscontinuities[SphericalHarmonicY[2, 2, θ, θ], {θ, φ}, Complexes]For
, it is nonsingular over the reals as well:
FunctionSingularities[SphericalHarmonicY[2, 0, θ, θ], {θ, φ}]
is neither convex nor concave:
FunctionConvexity[SphericalHarmonicY[2, 0, θ, ϕ], θ]TraditionalForm formatting:
SphericalHarmonicY[n, m, θ, ϕ]// TraditionalFormDifferentiation (3)
First derivative with respect to ϕ:
D[SphericalHarmonicY[l, m, θ, ϕ], ϕ]First derivative with respect to θ:
D[SphericalHarmonicY[l, m, θ, ϕ], θ]Higher derivatives with respect to θ:
Table[D[SphericalHarmonicY[l, m, θ, ϕ], {θ, k}], {k, 1, 3}]//FullSimplifyPlot the absolute values of the higher derivatives of
with respect to
:
Plot[Evaluate [Abs[%] /. {l -> 3, m -> 1, ϕ -> Pi / 3}], {θ, -Pi, Pi}, PlotLegends -> {"First Derivative", "Second Derivative", "Third Derivative"}]Formula for the ![]()
derivative with respect to
:
D[SphericalHarmonicY[l, m, θ, ϕ], {ϕ, k}]// FullSimplifyIntegration (3)
Compute the indefinite integral using Integrate:
Integrate[SphericalHarmonicY[l, m, θ, ϕ], ϕ]FullSimplify[D[%, ϕ]]Integrate[SphericalHarmonicY[l, m, θ, ϕ], {ϕ, -Pi / 2, Pi / 2}]Integrate[Exp[-I ϕ^2]SphericalHarmonicY[3, 3, Pi / 3, ϕ], ϕ]Integrate[ Sin[ϕ] SphericalHarmonicY[2, 2, Pi / 3, ϕ], {ϕ, 0, Pi / 4}]//FullSimplifySeries Expansions (4)
Find the Taylor expansion using Series:
Series[SphericalHarmonicY[l, m, θ, ϕ], {ϕ, 0, 3}]//Normal//FullSimplifyGeneral term in the series expansion using SeriesCoefficient:
SeriesCoefficient[SphericalHarmonicY[l, m, θ, ϕ], {ϕ, 1, k}]FourierSeries[SphericalHarmonicY[l, m, θ, ϕ], ϕ, 1]// FullSimplifyTaylor expansion at a generic point:
Series[SphericalHarmonicY[l, m, θ, ϕ], {ϕ, ϕ0, 2}]// Normal//FullSimplifyGeneralizations & Extensions (1)
SphericalHarmonicY can be applied to a power series:
SphericalHarmonicY[n, 0, θ + O[θ] ^ 3, ϕ]Applications (2)
The spherical harmonics
are eigenfunctions of the Laplacian on the sphere:
Table[(Laplacian[#1, {θ, φ}, {"Standard", {"Sphere", 1}}]/#1)&[SphericalHarmonicY[l, 0, θ, φ]], {l, 10}]//SimplifyTable[-l(l + 1), {l, 10}]Plot hydrogen orbital densities for quantum numbers
,
,
:
a0 = Quantity["BohrRadius"] / Quantity["Meters"]ψ[{n_, l_, m_}, {r_, θ_, ϕ_}] := With[{ρ = 2r / (n a0)}, Sqrt[((2/n a0))^3((n - l - 1)!/2n(n + l)!)]Exp[-ρ / 2]ρ^lLaguerreL[n - l - 1, 2l + 1, ρ]SphericalHarmonicY[l, m, θ, ϕ]]DensityPlot3D[(Abs@ψ[{2, 1, 0}, {Sqrt[x^2 + y^2 + z^2], ArcTan[z, Sqrt[x^2 + y^2]], ArcTan[x, y]}])^2, {x, -5 a0, 5 a0}, {y, -5 a0, 5 a0}, {z, -5 a0, 5 a0}, PlotLegends -> Automatic]Properties & Relations (2)
Use FunctionExpand to expand SphericalHarmonicY[n,m,θ,ϕ] for half-integers
and
:
FunctionExpand[ SphericalHarmonicY[(3/2), (1/2), θ, ϕ]]Simplify[%]Re-express spherical harmonics in Cartesian coordinates:
SphericalHarmonicY[3, 1, θ, ϕ]FullSimplify[TransformedField["Spherical" -> "Cartesian", SphericalHarmonicY[3, 1, θ, ϕ], {r, θ, ϕ} -> {x, y, z}]]See Also
LegendreP ClebschGordan SphericalBesselJ ZernikeR
Function Repository: SolidHarmonicI SolidHarmonicR
Tech Notes
Related Links
History
Introduced in 1988 (1.0)
Text
Wolfram Research (1988), SphericalHarmonicY, Wolfram Language function, https://reference.wolfram.com/language/ref/SphericalHarmonicY.html.
CMS
Wolfram Language. 1988. "SphericalHarmonicY." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SphericalHarmonicY.html.
APA
Wolfram Language. (1988). SphericalHarmonicY. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SphericalHarmonicY.html
BibTeX
@misc{reference.wolfram_2026_sphericalharmonicy, author="Wolfram Research", title="{SphericalHarmonicY}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/SphericalHarmonicY.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_sphericalharmonicy, organization={Wolfram Research}, title={SphericalHarmonicY}, year={1988}, url={https://reference.wolfram.com/language/ref/SphericalHarmonicY.html}, note=[Accessed: 13-June-2026]}