In[]:=
$Version
Out[]=
14.1.0 for Microsoft Windows (64-bit) (July 16, 2024)
In[]:=
f=(Sum[BesselJ[n,r],{n,0,2}])
Out[]=
BesselJ[0,r]+BesselJ[1,r]+BesselJ[2,r]
In[]:=
Integrate[f^2*r,{r,0,Infinity}](*OK*)
Integrate
:Integral of r
2
(BesselJ[0,r]+BesselJ[1,r]+BesselJ[2,r])
does not converge on {0,∞}.
Out[]=
∞
∫
0
r
2
(BesselJ[0,r]+BesselJ[1,r]+BesselJ[2,r])
r
In[]:=
NIntegrate[f^2*r,{r,0,Infinity}](*OK*)
NIntegrate
:NIntegrate failed to converge to prescribed accuracy after 9 recursive bisections in r near {r} = {4.81037×
7
10
}. NIntegrate obtained 183000. and 153497. for the integral and error estimates.
Out[]=
183000.
(*---------------------------------------------------------------------------------------*)
In[]:=
HoldFormSum[BesselJ[n,r],{n,0,Infinity}]==
1
4
(2+πrBesselJ[1,r]StruveH[0,r]+BesselJ[0,r](2+2r-πrStruveH[1,r]))//TraditionalForm
Out[]//TraditionalForm=
∞
∑
n=0
J
n
(r)
1
4
(2+πr
J
1
(r)
H
0
(r)+
J
0
(r)(2+2r-πr
H
1
(r)))
In[]:=
func[r_]:=
1
4
(2+πrBesselJ[1,r]StruveH[0,r]+BesselJ[0,r](2+2r-πrStruveH[1,r]));
{Sum[BesselJ[n,r]/.r->1,{n,0,10}]//N,func[1]//N}(*OK*)
Out[]=
{1.34246,1.34246}
In[]:=
Plot[func[r]^2*r,{r,0,30}]
Out[]=
In[]:=
Integrate[func[r]^2*r,{r,0,∞}](*Can'tcompute!*)
Out[]=
∞
∫
0
1
16
r
2
(2+πrBesselJ[1,r]StruveH[0,r]+BesselJ[0,r](2+2r-πrStruveH[1,r]))
r
In[]:=
NIntegrate[func[r]^2*r,{r,0,∞}](*"Integral does not converge on {0,∞}"isdivergent!!*)
NIntegrate
:NIntegrate failed to converge to prescribed accuracy after 9 recursive bisections in r near {r} = {6.3887×
56
10
}. NIntegrate obtained 1.304678941278253×
310
10
and 1.304672945617797×
310
10
for the integral and error estimates.
Out[]=
1.304678941278253×
310
10