# Evaluate the defining Integral of the Bessel functions of the first kind

I am trying to evaluate the integrals

$$\int\limits_{-\pi}^{\pi} \mathrm{e}^{\mathrm{i}(x\sin t - nt)} \mathrm{d}t$$

and

$$\int\limits_{-\pi}^{\pi} \mathrm{e}^{\mathrm{i}x\sin t} \mathrm{d}t$$

which, according to Wikipedia, should evaluate to $$J_n(x)$$ and $$J_0(x)$$, where $$J_n(x)$$ is the $$n$$-th order Bessel function of the first kind. However, when using Integrate, these two integrals are returned unevaluated.

Originally, I was trying to evaluate a more complicated expression similar to

$$\int\limits_{-\pi}^{\pi} \mathrm{e}^{\mathrm{i}x(\sin (t+b+c)-\sin (b))} \mathrm{d}t$$

which can first be simplified using

$$\sin(x+b)-\sin(b) = 2 \sin\left(\frac{x}{2}\right) \cos\left(b + \frac{x}{2}\right)$$

and then rewritten to the form required for using the definition of the Bessel functions above by using the periodicity of $$\cos$$ and the fact that $$\sin$$ and $$\cos$$ are shifted relative to each other.

How can I calculate this integral using Mathematica?

As a rule-based, term-rewriting system, Mathematica transforms an input expression using a set of rules yielding an output expression. The integrals we consider can be evaluated if we add appropriate assumptions to Integrate. Symbols x and n can be whatever unless we restrict them somehow. First, we can see what happens if n and x are prescribed, e.g.

1/(2 π) Integrate[Exp[I (8 I Sin[t] - 6 t)], {t, -π, π}]

1/128 (-476 BesselI[0, 8] + 495 BesselI[1, 8])


According to mathematical definitions it is BesselJ[6, 8 I], and in fact we can check this equality with FullSimplify, even though when FullSimplify acts on one expression, it is not transformed to the other one. I guess that the system might return quickly that

1/(2 π) Integrate[Exp[I ((2 + 3 I) Sin[t] - 2 t)], {t, -π, π}]


is simply BesselJ[2, 2 + 3 I] however it does not work this way but taking more than 15 minutes its evaluation is not concluded, although we can check immediately that the both expressions are numerically equal. This is a significant omission of the symbolic capabilities of the system.

However it appears that assuming x as real we can go further by checking this integrals for integer n:

tb = Table[ 1/(2 π)Integrate[Exp[I (x Sin[t] - n t)], {t, -π, π},
Assumptions -> x ∈ Reals], {n, 0, 5}]

 {BesselJ[0, Abs[x]], BesselJ[1, x], BesselJ[2, Abs[x]], BesselJ[3, x],
(x (-24 + x^2) BesselJ[0, x] - 8 (-6 + x^2) BesselJ[1, x])/x^3,
(x (-48 + x^2) BesselJ[1, x] - 12 (-16 + x^2) BesselJ[2, x])/x^3}


and as we could expect

FullSimplify[{tb[] == BesselJ[4, x], tb[] == BesselJ[5, x]}]

{True, True}


Such an integral cannot be evaluated for a general integer n, e.g. this remains unevaluated

1/(2 π) Integrate[ Exp[I (x Sin[t] - n t)], {t, -π, π},
Assumptions -> x ∈ Reals && 0 <= n <= 5 && n ∈ Integers]


This clearly demonstrates that symbolic functionality behind BesselJ and related functions can be improved and why one might encounter some problems with evaluating our integrals.

Edit

The integral $$\; \int\limits_{-\pi}^{\pi} \mathrm{e}^{\mathrm{i}x(\sin (t+b+c)-\sin (b))} \mathrm{d}t \;$$ can be computed as suggested above, i.e.

Integrate[ Exp[I (x Sin[t + b + c] - Sin[b])], {t, -π, π},
Assumptions -> (x | b | c) ∈ Reals]

2 E^(-I Sin[b]) π BesselJ[0, Abs[x]]


The result doesn't depend on c (what is not surprising), we plot it for b == 0, with roots of $$J_0(x)$$ represented by BesselJZero[0, k]:

Plot[ 2π BesselJ[0, Abs[x]], {x, -16, 16},
PlotStyle -> {Darker @ Cyan, Thickness[0.008]},
Epilog -> {Red, PointSize[0.016], Point[ Flatten[
Table[{{BesselJZero[0, k], 0}, {-BesselJZero[0, k], 0}}, {k, 5}],
1]]}] In fact, the integral

$$\int\limits_{-\pi}^{\pi} \exp\left(i(x\sin t - nt)\right) \mathrm{d}t$$

is only equal to the Bessel function $$2\pi \operatorname{\mathit J}_n(x)$$ for integer $$n$$ (an assumption you neglected to mention in the OP). For arbitrary $$n$$, the integral is equal to $$2\pi \operatorname{\mathbf J}_n(x)$$, where $$\operatorname{\mathbf J}_n(x)$$ is the Anger function, which is built into Mathematica as AngerJ[n, x], and does degenerate into the Bessel function of the first kind for integral $$n$$.

For instance,

With[{n = 4/3, x = 11/5},
{NIntegrate[Exp[I (x Sin[t] - n t)], {t, -π, π}, WorkingPrecision -> 25],
N[2 π AngerJ[n, x], 25]} // Chop]
{2.927772818442791700473353, 2.927772818442791700473353}

AngerJ[5, x]
BesselJ[5, x]


Mathematica can do some integrals of this sort e.g.

Assuming[x ∈ Reals, Integrate[Exp[I x Sin[t]], {t, -Pi, Pi}]]
(* 2 π BesselJ[0, Abs[x]] *)


You no doubt recognise some of your expressions as Fourier Coefficients. Mathematica can compute some of these, e.g.

Assuming[x ∈ Reals, FullSimplify[
Table[FourierCoefficient[Exp[I x Sin[t]], t, n], {n, 0, 5}]]]

(* {BesselJ[0, x], BesselJ[1, x], BesselJ[2, x], BesselJ[3, x], (
x (-24 + x^2) BesselJ[0, x] - 8 (-6 + x^2) BesselJ[1, x])/x^3, (
x (-48 + x^2) BesselJ[1, x] - 12 (-16 + x^2) BesselJ[2, x])/x^3} *)


and can recognise that these are equivalent to the expressions you expect

FullSimplify[Thread[% == Table[BesselJ[n, x], {n, 0, 5}]]]
(* {True, True, True, True, True, True} *)


Try

Assuming[Element[x,Reals],Integrate[E^(I x Sin[t]),{t,-Pi,Pi}]]


which returns

2 Pi BesselJ[0,Abs[x]]


and

Assuming[Element[x,Reals]&&n==2,Integrate[E^(I(x Sin[t]-n t)),{t,-Pi,Pi}]]


which returns

2 Pi BesselJ[2,Abs[x]]


Assuming other small plausible values for n also finds your integral, Assuming x>0 will also work and eliminates the Abs in the output.