Lesson 5 of 15

Bessel Functions

Bessel Functions

Bessel functions Jn(x)J_n(x) are solutions to Bessel's differential equation:

x2y+xy+(x2n2)y=0x^2 y'' + x y' + (x^2 - n^2) y = 0

They arise in problems with cylindrical symmetry: heat conduction in cylinders, electromagnetic waveguides, and quantum mechanics in cylindrical potentials.

Series Definition

The Bessel function of the first kind of order nn is defined by the convergent series:

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

For integer nn, Γ(m+n+1)=(m+n)!\Gamma(m+n+1) = (m+n)!, so the series simplifies.

The first few values:

  • J0(0)=1J_0(0) = 1, J0(2.4048)0J_0(2.4048) \approx 0 (first zero)
  • J1(0)=0J_1(0) = 0, J1(1)0.4401J_1(1) \approx 0.4401

Recurrence Relation

Given J0J_0 and J1J_1, higher orders are computed by the forward recurrence:

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

This recurrence is numerically stable for computing JnJ_n when going upward in nn at fixed x>0x > 0.

Important Zeros

FunctionFirst zeroSecond zero
J0(x)J_0(x)2.40485.5201
J1(x)J_1(x)3.83177.0156

These zeros determine the resonant frequencies in cylindrical cavities.

Wronskian

The Wronskian of J0J_0 and J1J_1 satisfies:

J0(x)J1(x)J1(x)J0(x)=1xJ_0(x) J_1'(x) - J_1(x) J_0'(x) = -\frac{1}{x}

This identity is a consequence of Bessel's equation and can be used to check numerical accuracy.

Your Task

Implement the three Bessel function routines. Use 20-term series for J0J_0 and J1J_1. For Γ(m+n+1)\Gamma(m+n+1) with integer nn, you may use the factorial (m+n)!(m+n)!. Use only Python's math module.

Python runtime loading...
Loading...
Click "Run" to execute your code.