Hi Leslaw,
I try to do what I can to respond to your questions...
4) Isn't it perhaps that Evaluate@Integrate[] uses NIntegrate rather than symbolic formula evaluation?
NIntegrate[] doesn't permit Assumptions:
In[4]:= NIntegrate[
BesselJ[2 n + 1/2, L] BesselJ[2*m + 1/2, L]/Sqrt[L^2 + K], {L,
0, \[Infinity]},
Assumptions ->
n \[Element] Integers && n >= 0 && m \[Element] Integers && m >= 0 &&
K \[Element] Reals && K > 0]
During evaluation of In[4]:= NIntegrate::optx: Unknown option Assumptions in NIntegrate[(BesselJ[2 n+1/2,L] BesselJ[2 m+1/2,L])/Sqrt[L^2+K],{L,0,\[Infinity]},Assumptions->n\[Element]Integers&&n>=0&&m\[Element]Integers&&m>=0&&K\[Element]Reals&&K>0].
Out[4]= NIntegrate[(BesselJ[2 n + 1/2, L] BesselJ[2 m + 1/2, L])/Sqrt[
L^2 + K], {L, 0, \[Infinity]},
Assumptions ->
n \[Element] Integers && n >= 0 && m \[Element] Integers && m >= 0 &&
K \[Element] Reals && K > 0]
So, we can exclude at this point that result is gratia NIntegrate[]
More the more, I exposed both the results as for your initial formula and for the modified:
In[1]:= Integrate[
BesselJ[2 n + 1/2, L] BesselJ[2*m + 1/2, L]/Sqrt[L^2 + K], {L,
0, \[Infinity]},
Assumptions ->
n \[Element] Integers && n >= 0 && m \[Element] Integers && m >= 0 &&
K \[Element] Reals && K > 0]
Out[1]= (2^(-2 (1 + m + n)) K^(1/2 + m + n)
Gamma[-(1/2) - m - n] Gamma[
1 + m + n] HypergeometricPFQ[{1 + m + n, 1 + m + n}, {3/2 + 2 m,
3/2 + 2 n, 2 + 2 m + 2 n}, K])/(
Sqrt[\[Pi]] Gamma[3/2 + 2 m] Gamma[3/2 + 2 n]) + (
HypergeometricPFQ[{1/2, 1/2, 1}, {1/2 - m - n, 1 + m - n, 1 - m + n,
3/2 + m + n},
K] Sin[(m - n) \[Pi]])/((m - n) (1 + 2 m + 2 n) \[Pi])
In[3]:= Integrate[
BesselJ[2.*n + 1/2, L]*BesselJ[2.*m + 1/2, L]/Sqrt[L^2 + K], {L,
0, \[Infinity]},
Assumptions ->
n \[Element] Integers && n >= 0 && m \[Element] Integers && m >= 0 &&
K \[Element] Reals && K > 0]
Out[3]= 1/2 ((
Gamma[1/2 + 1. m + 1. n] HypergeometricPFQ[{1/2, 1, 1/
2}, {1/2 - 1. m - 1. n, 3/2 + 1. m + 1. n, 1 - 1. m + 1. n,
1 + 1. m - 1. n}, K])/(
Gamma[1 + 1. m - 1. n] Gamma[1 - 1. m + 1. n] Gamma[
3/2 + 1. m + 1. n]) + (K^(1/2 + 1. m + 1. n)
Gamma[-(1/2) - 1. m - 1. n] Gamma[1 + 1. m + 1. n]^2 Gamma[
3/2 + 1. m + 1. n] HypergeometricPFQ[{1 + 1. m + 1. n,
3/2 + 1. m + 1. n, 1 + 1. m + 1. n}, {3/2 + 1. m + 1. n,
2 + 2. m + 2. n, 1.5 + 2. n, 1.5 + 2. m}, K])/(\[Pi] Gamma[
1.5 + 2. m] Gamma[1.5 + 2. n] Gamma[2 + 2. m + 2. n]))
1) I can see that your instruction:
f[m, n, K_] := Evaluate@Integrate[ BesselJ[2.n + 1/2, L]BesselJ[2.*m +
1/2, L]/Sqrt[L^2 + K], {L, 0, [Infinity]}, Assumptions -> n [Element]
Integers && n >= 0 && m [Element] Integers && m >= 0 && K [Element]
Reals && K > 0]
allows me to generate correct values, but only with an accuracy of
several digits, whereas I need to obtain a prescribed number of
accurate digits, typically 32 or more. How should I modify the
instruction to obtain such results?
Wolfram Language permits calculations with arbitrary precision. In the last formula displayed above, the result is with MachinePrecision.
Remark, that the correct form for the function definition is:
f[m_, n_, K_] :=
Evaluate@Integrate[
BesselJ[2.*n + 1/2, L]*BesselJ[2.*m + 1/2, L]/Sqrt[L^2 + K], {L,
0, \[Infinity]},
Assumptions ->
n \[Element] Integers && n >= 0 && m \[Element] Integers &&
m >= 0 && K \[Element] Reals && K > 0]
2) I completely don't understand what happens here. Is the actual
formula returned by Integrate[] correct or not? Why there are factors
0*infinity detected when the formula is used in symbolically derived
form, but not detected in your approach?
I think both the formulas are in the symbolical form, but numeric computing of numerical sub-expressions is done with MachinePrecision.
3) Actually I'd be more happy to first have a fully correct formula
that does not cause errors, and next just evaluate its value. Is there
no way to do this?
I tried to Integrate symbolically the first formula (to apply differentiation on the result), but Mma didn't return the result:
In[8]:= Integrate[
BesselJ[2 n + 1/2, L] BesselJ[2*m + 1/2, L]/Sqrt[L^2 + K], L]
Out[8]= \[Integral](BesselJ[1/2 + 2 m, L] BesselJ[1/2 + 2 n, L])/Sqrt[
K + L^2] \[DifferentialD]L
5) Isn't the multiplication of integers n, m by real coefficients a
sort of violation of the initial assumptions? Why this helps?
I explained my understanding above in the context of exact calculus, calculus with arbitrary precision and with MachinePrecision.