I need to use the Bessel functions of the first kind to solve some initial value problem. For this I need the closure equation
$$ \int_0^\infty J_m(au)J_m(bu)u\,\text{d}u = \frac{\delta(a-b)}{a} \quad\quad \text{for}\quad a, b, m \in \mathbb{R}\quad \wedge \quad a, b >0 , $$ which can also be found on the Wolfram functions webpage (see also Arfken and Weber, p.696, Morse and Feshbach, Section 6.3). However Mathematica (12.3.1.0) does some weird things:
In[12]:= Refine[Integrate[u*BesselJ[1, b u]* BesselJ[1, a u], {u, 0, Infinity}], a > 0 && b > 0 && a != b]
Out[12]= ConditionalExpression[0, a > b]
In[13]:= Integrate[u*BesselJ[1, 2 u]* BesselJ[1, 3 u], {u, 0, Infinity}]
During evaluation of In[13]:= Integrate::idiv: Integral of u BesselJ[1,2 u] BesselJ[1,3 u] does not converge on {0,\[Infinity]}.
So according to the first expression AND the closure equation the second integral should evaluate to 0. However the integral diverges. Since the closure relation is on the wolfram functions page I assume Mathematica should be able to apply it.
Some colleagues tried evaluating the expression in Mathematica 12.0 and get the correct result.
Is there something wrong in my code?
Edit:
As @yarchik has pointed out, the two results do not necessarily contradict each other. Since the the Dirac delta is a generalized function we cannot assign a specific value to $$\delta(a-b) \quad \text{for} \quad a \neq b.$$ In particular the delta distribution is defined to act on test functions $f$, that is we have to consider integrals of the form $$\int \delta(a-b) f(b) db$$ to assign some sort of value to it.
Of course in initial value problems integrals of this type are usually encountered. In my case I actually have the integral $$\int_0^\infty dk k \int_0^\infty du u J_m(ku)J_m(k'u) = \int_0^\infty dk k \frac{\delta(k-k')}{k} = 1,$$ which is well defined.
The problem was, that I tried to solve the inner integral on its own and expected it to be zero for $a\neq b$ which is a wrong assumption.
NIntegrate[u*BesselJ[1, u]*BesselJ[1, 2 u], {u, 0, Infinity}]
which is-0.283769
contradicts the statement of the question. – $\endgroup$