Skip to main content

Legendre and Bessel Functions

Legendre and Bessel functions are special functions because they solve recurring differential equations from geometry. Legendre functions appear with spherical symmetry, angular variables, and expansions on [1,1][-1,1]. Bessel functions appear with cylindrical symmetry, radial vibration, heat flow in disks, and wave propagation in circular domains.

The important lesson is that special functions are not arbitrary new objects. They are named solution families with well-studied series, orthogonality, recurrence relations, and zeros. In engineering mathematics they play the same role that sine and cosine play for rectangular domains: they provide modes adapted to the geometry and boundary conditions.

Definitions

Legendre's differential equation is

(1x2)y2xy+n(n+1)y=0.(1-x^2)y''-2xy'+n(n+1)y=0.

For nonnegative integer nn, the polynomial solution is the Legendre polynomial Pn(x)P_n(x). The first few are

P0(x)=1,P1(x)=x,P2(x)=12(3x21).\begin{aligned} P_0(x)&=1,\\ P_1(x)&=x,\\ P_2(x)&=\frac{1}{2}(3x^2-1). \end{aligned}

Bessel's equation of order ν\nu is

x2y+xy+(x2ν2)y=0.x^2y''+xy'+(x^2-\nu^2)y=0.

The standard solution that is finite at x=0x=0 for ν0\nu\ge 0 is the Bessel function of the first kind Jν(x)J_\nu(x). For integer order nn,

Jn(x)=m=0(1)mm!(m+n)!(x2)2m+n.J_n(x)=\sum_{m=0}^{\infty}\frac{(-1)^m}{m!(m+n)!}\left(\frac{x}{2}\right)^{2m+n}.

Orthogonality means that different modes have zero inner product with respect to the correct weight. For Legendre polynomials,

11Pm(x)Pn(x)dx=0,mn.\int_{-1}^{1}P_m(x)P_n(x)\,dx=0,\qquad m\ne n.

For Bessel functions in radial problems, orthogonality usually involves the weight rr on 0rR0\le r\le R.

Key results

Legendre polynomials satisfy Rodrigues' formula:

Pn(x)=12nn!dndxn(x21)n.P_n(x)=\frac{1}{2^n n!}\frac{d^n}{dx^n}(x^2-1)^n.

They also satisfy

Pn(1)=1,Pn(1)=(1)n.P_n(1)=1,\qquad P_n(-1)=(-1)^n.

The parity is simple: PnP_n is even when nn is even and odd when nn is odd. This parity helps simplify expansions of even or odd functions on [1,1][-1,1].

Legendre expansion coefficients are computed by projection:

f(x)n=0anPn(x),an=2n+1211f(x)Pn(x)dx.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.

Bessel functions arise from the Frobenius method at the regular singular point x=0x=0. The indicial roots are ±ν\pm\nu, and the JνJ_\nu branch corresponds to the +ν+\nu behavior. When boundary conditions require finiteness at the origin, the more singular branch is often rejected.

Zeros of Bessel functions determine radial eigenvalues. If a circular membrane of radius RR is fixed at the boundary, radial modes satisfy Jn(αR)=0J_n(\alpha R)=0. The allowed values of α\alpha are therefore zeros of JnJ_n. This is the circular-domain analog of nπ/Ln\pi/L for sine modes on an interval.

Recurrence relations make computation and analysis practical. For Bessel functions,

Jn1(x)+Jn+1(x)=2nxJn(x),J_{n-1}(x)+J_{n+1}(x)=\frac{2n}{x}J_n(x),

and

Jn1(x)Jn+1(x)=2Jn(x).J_{n-1}(x)-J_{n+1}(x)=2J_n'(x).

These formulas connect neighboring orders and derivatives. They are used in numerical libraries and in applying derivative boundary conditions.

Special functions should be treated as precise mathematical objects, not as black boxes. Their normalization, weight function, and boundary behavior matter. Two sources may use different conventions for associated Legendre functions or spherical Bessel functions, so always check the definition before using a table.

The geometry explains the weight functions. In spherical coordinates, angular integrals lead to weights such as 11 or sinθ\sin\theta after a change of variables. In polar coordinates, the area element is rdrdθr\,dr\,d\theta, which is why radial Bessel orthogonality contains the factor rr. Forgetting the weight changes the coefficients and destroys orthogonality.

Legendre polynomials are also eigenfunctions of a Sturm-Liouville problem:

ddx((1x2)y)=n(n+1)y.-\frac{d}{dx}\left((1-x^2)y'\right)=n(n+1)y.

The endpoint coefficient 1x21-x^2 vanishes at x=±1x=\pm 1, which is why the natural interval is [1,1][-1,1]. The eigenvalue parameter n(n+1)n(n+1) becomes discrete when regularity at both endpoints is required. This is typical of separated boundary-value problems: geometry and endpoint conditions select a countable set of admissible modes.

Bessel functions play a parallel role in polar coordinates. When the Laplacian is written in polar form, separation with an angular factor cosnθ\cos n\theta or sinnθ\sin n\theta leaves a radial equation. After scaling the radial variable, that equation becomes Bessel's equation. The order nn comes from angular periodicity, while the allowed radial wavenumbers come from boundary conditions at r=Rr=R.

Zeros deserve special attention because they become eigenvalues after scaling. If jn,kj_{n,k} is the kkth positive zero of JnJ_n, then Jn(jn,kr/R)J_n(j_{n,k}r/R) vanishes at r=Rr=R. The index nn counts angular variation, and kk counts radial nodes. A mode with larger kk oscillates more rapidly in the radial direction. A mode with larger nn has more angular nodal lines.

The normalization of modes is often chosen for convenience. Legendre polynomials are usually normalized by Pn(1)=1P_n(1)=1, not by unit length in the inner product. Bessel radial modes are often left unnormalized until coefficients are computed. When expanding a function, the denominator of the projection coefficient must use the actual norm of the selected mode, not an assumed value of 11.

In numerical work, recurrence relations can be stable in one direction and unstable in another. Computing high-order Bessel functions by forward recurrence may lose accuracy for some ranges of xx and nn. Scientific libraries choose algorithms depending on the order and argument. This is another reason to use tested implementations for production computation while learning the series and recurrence formulas for interpretation.

Legendre and Bessel functions also encode qualitative information. The number and location of zeros determine nodal lines, which are places where a vibrating membrane or standing wave is motionless. Orthogonality means that energy or squared error can be decomposed by mode. Smooth data usually produce rapidly decaying expansion coefficients, while discontinuities or sharp boundary layers require many modes.

Visual

Function familyTypical domainWeightCommon boundary role
Pn(x)P_n(x)1x1-1\le x\le 111Angular modes in spherical problems
Jn(αr)J_n(\alpha r)0rR0\le r\le RrrRadial modes in disks and cylinders
cos(nπx/L)\cos(n\pi x/L)0xL0\le x\le L11Rectangular Neumann modes
sin(nπx/L)\sin(n\pi x/L)0xL0\le x\le L11Rectangular Dirichlet modes

Worked example 1: Legendre projection

Problem. Approximate f(x)=x2f(x)=x^2 on [1,1][-1,1] using Legendre polynomials.

Method.

  1. Use
P0=1,P2=12(3x21).P_0=1,\qquad P_2=\frac{1}{2}(3x^2-1).
  1. Solve the formula for x2x^2 in terms of P0P_0 and P2P_2:
2P2=3x21.2P_2=3x^2-1.
  1. Rearrange:
3x2=2P2+1.3x^2=2P_2+1.
  1. Since P0=1P_0=1,
x2=13P0+23P2.x^2=\frac{1}{3}P_0+\frac{2}{3}P_2.

Answer.

x2=13P0(x)+23P2(x).x^2=\frac{1}{3}P_0(x)+\frac{2}{3}P_2(x).

Check. Substitute P2=(3x21)/2P_2=(3x^2-1)/2:

13+233x212=13+x213=x2.\frac{1}{3}+\frac{2}{3}\cdot\frac{3x^2-1}{2} =\frac{1}{3}+x^2-\frac{1}{3}=x^2.

This example is exact because x2x^2 is already a polynomial of degree two. A more complicated function would have infinitely many Legendre coefficients. Orthogonality guarantees that the coefficient of PnP_n can be found independently by projection, without solving a coupled linear system for all coefficients at once.

Worked example 2: First terms of a Bessel function

Problem. Write the first three nonzero terms of J0(x)J_0(x).

Method.

  1. Use the series for n=0n=0:
J0(x)=m=0(1)m(m!)2(x2)2m.J_0(x)=\sum_{m=0}^{\infty}\frac{(-1)^m}{(m!)^2}\left(\frac{x}{2}\right)^{2m}.
  1. For m=0m=0:
(1)0(0!)2(x2)0=1.\frac{(-1)^0}{(0!)^2}\left(\frac{x}{2}\right)^0=1.
  1. For m=1m=1:
1(1!)2(x2)2=x24.\frac{-1}{(1!)^2}\left(\frac{x}{2}\right)^2=-\frac{x^2}{4}.
  1. For m=2m=2:
1(2!)2(x2)4=14x416=x464.\frac{1}{(2!)^2}\left(\frac{x}{2}\right)^4 =\frac{1}{4}\cdot\frac{x^4}{16} =\frac{x^4}{64}.

Answer.

J0(x)=1x24+x464+.J_0(x)=1-\frac{x^2}{4}+\frac{x^4}{64}+\cdots.

Check. The derivative at 00 is 00, consistent with the evenness of J0J_0.

The approximation is most accurate near the origin because it was derived from a series centered there. For larger xx, more terms are needed, and oscillatory asymptotic formulas may be more efficient. This local-versus-global issue is one reason special-function libraries combine several methods internally.

Code

import numpy as np
from scipy.special import eval_legendre, jn_zeros, jv

x = np.linspace(-1.0, 1.0, 5)
print(eval_legendre(2, x))

zeros = jn_zeros(0, 3)
print("first zeros of J0:", zeros)
print("J0 at first zero:", jv(0, zeros[0]))

The code evaluates P2P_2 and the first zeros of J0J_0. In a circular membrane problem with radius R=1R=1, those zeros are the first radial wavenumbers for axisymmetric modes with a fixed boundary. For a different radius, the wavenumbers scale as zero divided by RR.

For coefficient calculations, software can evaluate the functions but the mathematical normalization still has to come from the model. A radial expansion on a disk integrates with rdrr\,dr, while a one-dimensional Legendre expansion integrates with dxdx. Using the wrong inner product may still produce numbers, but they will not be the expansion coefficients for the intended problem.

Common pitfalls

  • Forgetting the weight function in orthogonality integrals, especially the radial weight rr for Bessel modes.
  • Assuming every solution of Legendre's equation is a polynomial. Polynomial behavior occurs for special integer parameters.
  • Using Bessel zeros for the wrong boundary condition; derivative conditions use zeros of JnJ_n' instead of JnJ_n.
  • Mixing ordinary Bessel functions with spherical Bessel functions without changing definitions.
  • Dropping the singular solution without checking whether the domain includes the origin.
  • Expecting special functions to simplify to elementary functions in general.
  • Ignoring normalization conventions when comparing tables, software, and textbooks.
  • Treating zeros as interchangeable across orders. A zero of J0J_0 is generally not a zero of J1J_1.
  • Forgetting that physical boundary conditions determine whether JnJ_n, JnJ_n', or another combination supplies the eigenvalue equation.
  • Assuming a finite polynomial expansion when the target function is not itself a polynomial of bounded degree.
  • Expanding a radial function without checking behavior at the origin. Regularity at r=0r=0 often removes one formal solution branch.
  • Comparing modal amplitudes without accounting for the norm of each mode under the correct weighted inner product.
  • Rounding roots too early in downstream eigenvalue calculations.

Connections