I need to numerically evaluate the integral below:
$$\int_0^\infty \mathrm{sinc}'(xr) r \sqrt{E(r)} dr$$
where $E(r) = r^4 (\lambda\sqrt{\kappa^2+r^2})^{-\nu-5/2} K_{-\nu-5/2}(\lambda\sqrt{\kappa^2+r^2})$, $x \in \mathbb{R}_+$ and $\lambda, \kappa, \nu >0$. Here $K$ is the modified Bessel function of the second kind. In my particular case I have $\lambda = 0.00313$, $\kappa = 0.00825$ and $\nu = 0.33$.
I am using MATLAB, and I have tried the built-in functions integral
and quadgk
, which gives me a lot of errors (see below). I have naturally tried numerous other things as well, such as integrating by parts, and summing integrals from $kx\pi$ to $(k+1)x\pi$.
So, do you have any suggestions as to which method I should try next?
UPDATE (added questions)
I read the paper @Pedro linked to, and I don't think it was too hard to understand. However, I have a few questions:
- Would it be okay to use $x^k$ as the basis-elements $\psi_k$, in the univariate Levin method described?
- Could I instead just use a Filon method, since the frequency of the oscillations is fixed?
Example code
>> integral(@(r) sin(x*r).*sqrt(E(r)),0,Inf)
Warning: Reached the limit on the maximum number of intervals in use. Approximate
bound on error is 1.6e+07. The integral may not exist, or it may be difficult to
approximate numerically to the requested accuracy.
> In funfun\private\integralCalc>iterateScalarValued at 372
In funfun\private\integralCalc>vadapt at 133
In funfun\private\integralCalc at 84
In integral at 89
ans =
3.3197e+06