Numerical integration in log-space

819 Views Asked by At

I have an integral for which the differential is defined in log-space: \begin{equation} f(k; R, a, b) = \int_a^bA(k)\left(\frac{3j_1(kR)}{kR}\right)^2d\text{ln}k \end{equation} Where $j_1(kR)$ is the spherical Bessel function of the first kind (this is probably irrelevant to my question, though it may be of use to know that a numerical ringing/oscillating artifact can be injected into the solution for $kR>1$, which needs to be avoided).

Anyway, I need to solve this thing. And I was unsure how to numerically implement it because of the presence of $d\text{ln}k$.

If we change the differential as

\begin{equation} d\text{ln}k \rightarrow \frac{1}{k}dk, \end{equation} then we can go ahead and initiate any integration scheme we'd like in $k$-space. But, I worry that doing that may have unintended consequences; the integrand is known to have it's features of interest manifest on a log-scale, and thus the integration should proceed uniformly in $\text{ln}k$ if possible.

So, instead, I can simply note that if the integration is completed in $N$ steps in $k$-space, then the differential turns out to be just the log of the ratio of the bounds of the chosen $k$-range, over the number of steps $N$ taken in ln$k$: \begin{align} \text{ln}k_\text{min} - \text{ln}k_\text{max} &= Nd\text{ln}k\\ &\implies d\text{ln}k = \frac{\text{ln}(k_\text{max}/k_\text{min})}{N} \end{align}

So good, I can do the substitution and then sample the integrand logarithmically. The only downside here is, since $d\text{ln}k$ explicitly depends on $N$, that makes any packaged adaptive numerical solution difficult to use (as the user generally allows such an algorithm to choose $N$ on it's own).

What is a suggested way forward in this situation, preferably one that allows the straightforward use of an adaptive method of integration?