Skip to content
Tutorials Center
My learning

Topics

Lesson 25 of 39 · Series and Special Functions

Bessel and Legendre Functions

Meet the two most famous special-function ODEs: Bessel's equation for circular problems and Legendre's equation for spheres, with series, orthogonality and SciPy checks.

Some differential equations are so useful that their solutions get names, tables and entire library modules. Bessel functions describe the vibrations of a circular drum, the heat flow in a cylinder and the diffraction of light. Legendre polynomials appear whenever a problem has spherical symmetry: gravity, electrostatics, the hydrogen atom.

Both arise from the same recipe. A partial differential equation in cylindrical or spherical coordinates is split by separation of variables, and one of the resulting ordinary equations is Bessel's or Legendre's. The Frobenius method then produces the solutions as series.

Bessel's equation

TEXT
x^2 y'' + x y' + (x^2 - ν^2) y = 0

The parameter ν >= 0 is the order. Here p0 = 1 and q0 = -ν^2, so the indicial equation is r^2 - ν^2 = 0 with roots r = ±ν. The larger root gives the Bessel function of the first kind:

TEXT
J_ν(x) = Σ_{k>=0} (-1)^k / (k! Γ(k+ν+1)) (x/2)^(2k+ν)

For integer ν = n, the second root gives J_(-n) = (-1)^n J_n, which is not independent. The second solution is instead the Bessel function of the second kind Y_n(x), which contains a logarithm and blows up at x = 0. The general solution is c1 J_n(x) + c2 Y_n(x).

Shapes to remember:

  • J_0(0) = 1 and J_n(0) = 0 for n >= 1.
  • J_n oscillates like a damped cosine: J_n(x) ≈ sqrt(2/(π x)) cos(x - nπ/2 - π/4) for large x.
  • J_n has infinitely many zeros. The k-th zero j_(n,k) decides the allowed vibration frequencies of a drum.
  • Half-integer orders are elementary: J_(1/2)(x) = sqrt(2/(π x)) sin x.
Python Bessel series versus SciPy

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The zeros of J_0 are about 2.405, 5.520, 8.654, 11.792: they become evenly spaced by roughly π, as the large-x formula predicts.

Check that the function solves the equation

A good habit with special functions is to verify the ODE numerically using a derivative approximation. Here the residual of Bessel's equation is evaluated at a few points.

Python Residual of Bessel's equation

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The residuals are at rounding-error size, confirming J_2 satisfies the equation.

Legendre's equation

TEXT
(1 - x^2) y'' - 2x y' + n(n+1) y = 0

The points x = ±1 are regular singular points. For general n the solutions are series that blow up at x = ±1. But when n is a non-negative integer, one series terminates after finitely many terms and gives a polynomial: the Legendre polynomial P_n(x), normalized so P_n(1) = 1.

The first few are P_0 = 1, P_1 = x, P_2 = (3x^2 - 1)/2, P_3 = (5x^3 - 3x)/2. They are generated by Bonnet's recurrence:

TEXT
(n + 1) P_{n+1}(x) = (2n + 1) x P_n(x) - n P_{n-1}(x)

Key properties: P_n has parity (-1)^n, has n zeros inside (-1, 1), and is bounded by 1 on that interval.

Orthogonality

Both families are orthogonal, a property that makes them the basis for expansions of functions, just like sines and cosines in a Fourier series:

TEXT
∫_{-1}^{1} P_m(x) P_n(x) dx = 0 for m ≠ n,    = 2/(2n+1) for m = n

For Bessel functions the orthogonality involves a weight x and the zeros: ∫_0^1 x J_n(j_(n,a) x) J_n(j_(n,b) x) dx = 0 for different zeros a ≠ b.

Python Legendre recurrence and orthogonality

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Two families, two geometries

Bessel Circles, cylinders, drums, waves.
Legendre Spheres, gravity, electrostatics.
Orthogonal Expand any function in them.

Both come from the Frobenius method.

1 / 2

A first use: expanding a function

Because the polynomials are orthogonal, the coefficients of f(x) = Σ c_n P_n(x) come from an integral: c_n = (2n+1)/2 ∫ f P_n dx. This is a least-squares approximation in disguise, and it converges quickly for smooth functions.

Python Approximating exp(x) by Legendre polynomials

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The error shrinks rapidly with the degree, which is why such expansions are used in numerical analysis.

Common mistakes

  • Using Y_n coefficients for problems that must stay finite at the origin: pick J_n only.
  • Forgetting that n in Legendre's equation must be an integer for polynomial solutions.
  • Applying orthogonality without the weight function (x for Bessel).
  • Confusing the order ν with the index of a zero.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. Which Bessel solution stays finite at x = 0 for integer order?

    J_n is finite at 0, while Y_n contains a logarithm and diverges there.
  2. 2. What are the indicial roots of Bessel's equation of order ν?

    With p0 = 1 and q0 = -ν^2, the indicial equation r^2 - ν^2 = 0 gives r = ±ν.
  3. 3. P_2(x) is:

    Bonnet's recurrence with P_0 = 1 and P_1 = x gives 2 P_2 = 3x·x - 1.
  4. 4. The integral of P_2(x) P_3(x) over [-1, 1] is:

    Legendre polynomials of different degree are orthogonal, so the integral is zero.

Summary

  • Bessel: x^2 y'' + x y' + (x^2 - ν^2) y = 0; J_ν is finite at 0, Y_ν is not.
  • Legendre: (1 - x^2) y'' - 2xy' + n(n+1) y = 0; integer n gives the polynomials P_n.
  • Both families are orthogonal and used to expand functions.
  • Bonnet's recurrence makes Legendre polynomials easy to compute.
  • SciPy's scipy.special holds all of these functions and lets you verify the equations.

Next: The Euler Method from Scratch