# Integral giving a Dirac delta

I have the following type of integral

Integrate[ r BesselJ[n, a r] BesselJ[n, b r], {r, 0, Infinity}


(where a and b are real and $$n$$ are integers) which Mathematica tells me it diverges.

We know that the result is actually

$$\int_0^{\infty} J_\mu (a r) J_\mu (b r) \quad r \quad dr = \frac{\delta(a-b)}{a}$$

The problem is the Integrate function is unable to recognize a delta function. I have tried a few options that were suggested as using FourierTransform (which does not work because the expression seems to complicated to Fourier transform it) and also the TagSetDelayed option (Teaching Mathematica more about DiracDelta and KroneckerDelta ).

In any case I did not manage to solve that. Is there any form of doing it?

• The integral doesn't depend on n? Commented Nov 4, 2020 at 10:30
• I corrected the expression, there was a mistake. Commented Nov 4, 2020 at 10:36
• @ MarcBorrell Still the righthandside of your equation doesn't depend on \[Mu]. Where did you find this formula? Commented Nov 4, 2020 at 10:41
• @user64494 Why do you think the series can be integrated here? What you are doing is not mathematically rigorous. Moreover, you comments discourage other people (me including) to provide answers! Commented Nov 5, 2020 at 6:46
• @yarchik No need to break integrand into an infinite series and then have to worry about swapping integral with summation. Just split into two (or possibly three) lead terms and all the rest. The "all the rest" part can be shown to converge. The lead term part can be shown to not converge due to oscillatory behavior. Ergo, divergence for the integral in the classical sense. Commented Dec 5, 2020 at 15:33

I didn't succeed in making Mathematica "understand" your integral.

The wellknown simpler case Integrate[Exp[I \[Omega] t], {t, -Infinity, Infinity}] == 2 Pi DiracDelta[\[Omega]] isn't understood by Mathematica too:

Integrate[Exp[I ω t], {t, -Infinity, Infinity}]
(*Integrate::idiv: Integral of E^(I t ω) does not converge on {-∞,∞}.*)


But workaround AsymptoticIntegrate evaluates to

AsymptoticIntegrate[Exp[I ω t], {t, -m, m}, {m, Infinity, 1}]
(*(2 Sin[m ω])/ω*)


which is a limit definition of DiracDelta[\[Omega]

• What do you mean by "a limit definition"? Commented Nov 4, 2020 at 11:44
• Something like DiracDelta[x]=Limit[Sin[x/eps]/(Pi x),eps->0](see Wikipedia). Commented Nov 4, 2020 at 11:53
• @user64494 The limit is wellknown in mathematics, physics, signal theory,... Sorry I' m not interested in refreshing this neverending story concerning DiracDelta Commented Nov 4, 2020 at 12:27
• I think this is quite a fine answer (and, apparently, I negated a downvote). It's a nice use of AsymptoticIntegrate to generalized functions. And a reminder (to me) that the cardinal sine gives a way to approximate the Dirac delta as an actual function. (I usually think about that in terms of Gaussians. Maybe because my head is bell-shaped...) Commented Dec 4, 2020 at 14:59
• @DanielLichtblau Thanks for your support. It's difficult for me to get used of "downvoting" as a feedback. By the way a very useful limit for Dirac Delta is gaussian ;-) : dirac[x]~ Limit[ Exp[-(x/eps)^2]/(eps Sqrt[Pi]),eps->0] Commented Dec 4, 2020 at 15:22

A workaround and under certain assumptions we have:

func= r*BesselJ[n, a r]*BesselJ[n, b r];

InverseMellinTransform[Integrate[MellinTransform[func, a, s], {r, 0, Infinity},
Assumptions -> {s > 1, b > 0, n \[Element] Integers, n >= 0, 2 + n > s}], s, a]

(*DiracDelta[a - b]/b*)


Maple 2020.2 Can deal:

• @MariushIwaniuk: However, the calculations in Mathematica (see my comments to the question) show that the integral Integrate[BesselJ[1, 2*r]*BesselJ[1, 3*r]*r, {r, 0, Infinity}] diverges. Commented Dec 4, 2020 at 14:31
• @user64494 .In this book: elsevier.com/books/table-of-integrals-series-and-products/… on page:669 example:8 answer is with Dirac Delta. Commented Dec 4, 2020 at 14:49
• PS: Using: HankelTransform[BesselJ[n, a*r], r, b, n] :) Commented Dec 4, 2020 at 14:58
• @MariushIwaniuk: Can you indicate a number (e.g. 6.643.8 )since I don't find it in the seventh edition? Commented Dec 4, 2020 at 15:14
• @user64494: 6.513.8. Commented Dec 4, 2020 at 15:16