Q: 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?

A: 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]

A: 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:

