I am trying to integrate a spherical Bessel function. I have used both the Integrate
and NIntegrate
functions in Mathematica but the values given by each do not match. Any reason why this happens?
NIntegrate[((BesselJ[15/2, BesselJZero[15/2, 1]*r]))^2*r, {r, 0, a}]
NIntegrate::ncvb: "NIntegrate failed to converge to prescribed accuracy after 9 recursive bisections in r near {r} = {3.13053*10^-59}. NIntegrate obtained 1.81126695652224073244637134881619178279603605269044825189376376942`65.954589770191*^2647 and 1.7853272819936654408129572054378095060361571646917142221312888537`65.954589770191*^2647 for the integral and error estimates."
1.811266956522241*10^2647
Integrate[((BesselJ[15/2, BesselJZero[15/2, 1]*r]))^2*r, {r, 0, a}]
0.
Edit: I forgot to mention $a=0.02$. I also noticed that the below integral should converge as I do not see any singularities but I'm not too familiar with spherical Bessel functions.
Integrate[((BesselJ[15/2, 0.0000001*r]))^2*r, {r, 0, a}]
Integrate::idiv: "Integral of ((-1.35135*10^47\r+1.7325*10^32\r^3-<<22>>\<<1>>+r^7)\<<1>>+<<1>>)^2/r^14 does not converge on {0,0.02`}."
6 -7
Integrate[6.3662 10 Power[Cos[12.5664 - 1. 10 r] -
47 -7 32 -7
1.35135 10 Cos[12.5664 - 1. 10 r] 1.7325 10 Cos[12.5664 - 1. 10 r]
------------------------------------- + ------------------------------------ -
6 4
r r
16 -7 54 -7
3.78 10 Cos[12.5664 - 1. 10 r] 1.35135 10 Sin[12.5664 - 1. 10 r]
---------------------------------- - ------------------------------------- +
2 7
r r
39 -7 24 -7
6.237 10 Sin[12.5664 - 1. 10 r] 3.15 10 Sin[12.5664 - 1. 10 r]
----------------------------------- - ---------------------------------- +
5 3
r r
8 -7
2.8 10 Sin[12.5664 - 1. 10 r]
--------------------------------, 2], {r, 0, 0.02}]
r
InputForm
(in the context menu). $\endgroup$