# Hankel Transform integrals won't work in Mathematica

I'm trying to do this integral, which is shown on the Wikipedia page on the Hankel transformation:

$$\int_0^{2\pi}\mathrm d\varphi\;e^{\mathrm im\varphi}e^{\mathrm ikr\cos(\varphi)}$$

The answer is supposed to be

$$2\pi\mathrm i^m J_m(kr)$$

Mathematica cannot seem to do this integral; it simply gives me the input back:

Integrate[
Exp[I m phi] Exp[I k r Cos[phi]],
{phi, 0, 2 Pi},
Assumptions -> Element[m, Integers]
]


Why can't this be done? It can do it for explicit values of m = 0 and m = 1, but after that it begins reporting the answer in terms of polynomials times a zero-order Bessel function or something similar. Perhaps I'm expecting too much of the software, but I'd expect it to be able to verify integrals listed on Wikipedia pages. Is there something I'm overlooking?

-

## migrated from stackoverflow.comFeb 18 '12 at 21:49

This question came from our site for professional and enthusiast programmers.

I've had problems like this. If you only want to verify the known result, have you tried evaluating "Integral minus solution", to see if it simplifies to zero? – Jonas Heidelberg Feb 18 '12 at 13:23
I will wager that the reluctance of Mathematica to evaluate your integral generically is due to the differing behavior of the integral of the components Cos[m phi + k r Cos[phi]] and Sin[m phi + k r Cos[phi]], depending on whether m is odd or even. Try executing Assuming[k > 0 && r > 0, Table[Integrate[{Cos[m phi + k r Cos[phi]], Sin[m phi + k r Cos[phi]]}, {phi, 0, 2 Pi}], {m, 0, 5}]], for instance. – J. M. Feb 19 '12 at 0:08
"...after that it begins reporting the answer in terms of polynomials times a zero-order Bessel function or something similar." - yes, because it seems that Mathematica internally uses the recursion formulae for Bessel function within Integrate[] to simplify things. Unfortunately, it looks as if FullSimplify[] is ignorant of this very recursion formula, so... – J. M. Feb 19 '12 at 0:10

The answer is simply that integrating with the assumption that a variable comes from the class of integers is really difficult. What Integrate does with Assumptions -> Element[m, Integers] is try to generically integrate without the assumption and then apply the assumption to the result to try and simplify it. I've asked around about this before and there doesn't seem to be a good way to make a generic algorithm that actually handles assumptions like Element[m, Integers].

You can find many cases where Assumptions -> Element[something, Integers] doesn't produce the expected simplification. Most of the cases I've seen of integrals where a variable is assumed to be an integer are where the integrand is the product of two orthogonal functions. In these cases,the way these are solved on paper doesn't generalize easily.

-