# Jacobi-Anger expansion for non-integer power

One way of writing the Jacobi-Anger expansion is $$\frac{1}{2\pi} \int_0^{2\pi} e^{i (n \theta - a \sin \theta)} d \theta = J_n(a)$$

for real $$a$$ and integer $$n$$. Is there a corresponding formula when $$n$$ is not an integer? Numerically, it doesn't seem like the Bessel function of the first kind with non-integer order is the right answer

from scipy.special import jv
from scipy import integrate
import numpy as np

n = 3.1
a = 0.4

def integrand(x):
return np.exp(1j * (n*x - a * np.sin(x)))

integral, _ = integrate.quad(integrand, 0, 2*np.pi)

print(f"By integration: {integral/(2*np.pi)}")
print(f"Bessel function: {jv(n, a)}")

• It is the Anger function $\mathbf{J}_\nu (a)$: dlmf.nist.gov/11.10.E1
– Gary
Commented Jun 11 at 9:03

Thanks to Gary's comment, the answer involves the Anger and Weber functions. Since the integrand is no longer periodic, I need to be careful when considering the interval of integration. $$\frac{1}{2\pi} \int_0^{2\pi} e^{i (n\theta - a \sin \theta)} d\theta = \frac{1+e^{2i\pi n}}{2} J_n(a) + i \frac{1-e^{2i\pi n}}{2} E_n(a)$$

Below is some Python code for verification.

from mpmath import angerj, webere
from scipy import integrate
import numpy as np

n = 3.1
a = 0.4

def integrand_real(x):
return np.exp(1j*(n*x - a * np.sin(x))).real

def integrand_imag(x):
return np.exp(1j*(n*x - a * np.sin(x))).imag

integral_real, _ = integrate.quad(integrand_real, 0, 2*np.pi)
integral_imag, _ = integrate.quad(integrand_imag, 0, 2*np.pi)
formula = (1+np.exp(2j*n*np.pi))/2 * angerj(n, a) + 1j * (1-np.exp(2j*n*np.pi))/2 * webere(n, a)

print("Real part:")
print(f"By integration: {integral_real/(2*np.pi)}")
print(f"From formula: {formula.real}")
print("Imaginary part:")
print(f"By integration: {integral_imag/(2*np.pi)}")
print(f"From formula: {formula.imag}")