# Quadrature methods for peaky integrands

Consider $$I = \int_{-L}^L f(x)dx,$$ where $$f(x)$$ is real-valued and analytic on $$[-L,L]$$, but it has a pole in the complex plane whose real part lies in $$[-L,L]$$. Call it $$z_0$$, and assume it is a simple pole. If the imaginary part of $$z_0$$ is small compared to the real part, then $$f(x)$$ is sharply peaked in the vicinity of $$x_0=\mathrm{Re}\{z_0\}$$. If this peak is sufficiently sharp and $$f(x)$$ is slowly varying elsewhere, then basic adaptive quadrature methods (e.g., recursive Simpson or Gauss-Legendre) will spend considerable effort attempting to resolve the peak.

An obvious thing to try is to approximate the value of $$x_0$$ and break the integral up $$I = I_-+I_+ = \int_{-L}^{x_0}f(x)dx+\int_{x_0}^Lf(x)dx$$ But doing so only pushes the problem to the endpoints of the integration domain instead of the interior. I wonder if there is a standard change of variables to alleviate this behavior, though?

Another option could be to try to evaluate $$I$$ by means of contour integration in the complex plane and use of the residue theorem. However, this will not fly if the software implementation of $$f$$ is only defined for real arguments.

Are there other specialized quadrature methods for these kinds of "peaky" integrands? Ideally I'd like to make no further assumptions on $$f$$ execpt that it's real, analytic, and slowly varying away from $$x_0$$. But I am also open to answers that require more assumptions on $$f$$ if there is no general answer.

• Is your pole fixed? This paper titled "Quadrature Formulas for Functions with Poles Near the Interval of Integration" may be of interest: ams.org/journals/mcom/1986-47-175/S0025-5718-1986-0842137-X/… – smh Jan 10 at 19:34
• The error in double-exponential quadrature depends on the location of the poles of $f(\phi(u))\phi'(u)\,\mathrm{d}u$ in the complex plane near the real line, so if you know where those poles are you can choose parameters optimally. Furthermore, in my understanding, adaptive quadrature is already designed to handle peaky integrands, so what you're saying about $f$ does not contribute any truly meaningful new information. E.g., you could subtract the leading terms from the pole to make for a better integrand, but the question only assumes the pole exists. – Kirill Jan 10 at 22:40
• If you know the position of the pole, I would split up the integral and use double-exponential quadrature as @Kirill mentions. See implementations in C and Fortran here: kurims.kyoto-u.ac.jp/~ooura/intde.html – GertVdE Jan 11 at 19:51