# I want to integrate spherical bessel function but it is not coverging

L = (1/.197)10; p = Table[i, {i, 1, 50}];

Roots of spherical bessel function

ap = Table[N[BesselJZero[3/2, i]], {i, Length[p]}];

Integration of spherical bessel function

NP = Table[ Integrate[SphericalBesselJ[1, (ap[[i]] x)/L]^2x^2, {x, 0, L}], {i, Length[p]}];

• Use NIntegrate ?
– Syed
Feb 26 at 6:44
• OK now it works but why? Feb 26 at 7:11
• Related post on Math SE regarding integration of Bessel functions. There will be other posts like this for sure. If an expression/integral etc fails to return an analytical solution, a numerical solution is the next thing to try.
– Syed
Feb 26 at 7:28

I am using

"12.0.0 for Linux x86 (64-bit) (April 7, 2019)"


We have:

L = (1/.197) 10;
p = Table[i, {i, 1, 50}];
ap = Table[N[BesselJZero[3/2, i]], {i, Length[p]}]


First we do the numerical integration

NP = Table[
NIntegrate[
SphericalBesselJ[1, (ap[[i]] x)/L]^2 x^2, {x, 0, L}], {i,
Length[p]}];


Now we integrate analytically

analytics =
Table[Integrate[SphericalBesselJ[1, (ap[[i]] x)/L]^2 x^2, {x, 0, L},
PrincipalValue -> True], {i, Length[p]}];


Finally we compare the results

NP - analytics // Chop


and we get

{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0}

• I understood. Thank you very much for your help Feb 26 at 8:36