The Bessel functions J and Y are analogous to sine and cosine. Bessel functions come up in polar coordinates the way sines and cosines come up in rectangular coordinates. There are J and Y functions of various orders, conventionally written with a subscript ν.
I recently ran across a curious set of relations between these functions and their derivatives. Let’s start with the following terms defined by 2 by 2 determinants.
There are a lot of symmetries in the definitions above. First, every term has a subscript ν, so you can ignore those for now.
Second, every determinant has J‘s on the top row and Y‘s on the bottom.
Third, every determinant has a‘s in the first column and b‘s in the second.
And finally, the primes, indicating derivatives, have the following pattern.
Now that we have all these definitions in place, there are several identities that the p’s, q’s, r’s, and s‘s satisfy. Some of them depend on the orders, and that’s why we included the ν subscripts. You can find various relations in A&S equation 9.1.32, but I wanted to point out one that’s particularly elegant, A&S equation 9.1.34:
This equation, a determinant of terms defined by determinants, reduces to a simple form that depends only on where the Bessel functions are evaluated, i.e. a and b, but not on their order ν.
The Python code below will show how to call Bessel functions and their derivatives and will illustrate the equations above.
from math import pi from scipy.special import jv, yv, jvp, yvp def example(n, a, b): ja = jv(n, a) jb = jv(n, b) ya = yv(n, a) yb = yv(n, b) jap = jvp(n, a) jbp = jvp(n, b) yap = yvp(n, a) ybp = yvp(n, b) p = ja * yb - jb * ya q = ja * ybp - jbp * ya r = jap * yb - jb * yap s = jap * ybp - jbp * yap print(p*s - q*r) print(4/(pi*pi*a*b)) example(3, 16, 21)
The two results differ slightly in the last decimal place due to rounding error.
The order of a Bessel function can be any real number , and the arguments can be any complex number. Here’s another example with more general arguments.
example(3.14, 16-3j, 21+1.2j)
(0.0011738907214344785 + 0.00015140286689885318j) (0.0011738907214345800 + 0.00015140286689880630j)
with the real and imaginary parts agreeing to 15 decimal places.
 You can define Bessel functions with complex order, but SciPy doesn’t support that.