I have a two-dimensional integral that I'd like to evaluate numerically. I would like to be able to do this as quickly as possible (as I have to calculate many similar integrals). It takes the form $$ \int_{0}^{1}\int_{0}^{1}f(x,y)H_{0}^{(1)}(\sqrt{4(cos(x)-cos(y))^{2}+(sin(x)-sin(y))^{2}})dxdy $$ where $H_{0}^{(1)}(z)$ is the zero order Hankel function of the first kind and $f(x,y)$ is bounded, but is quite complicated itself: $$ f(x,y)=\left(-i\sqrt{4sin^{2}(x)+cos^{2}(x)}+\frac{3cos(x)sin(x)}{\sqrt{4sin^{2}(x)+cos^{2}(x)}}\right)\left(i\sqrt{4sin^{2}(y)+cos^{2}(y)}+\frac{3cos(y)sin(y)}{\sqrt{4sin^{2}(y)+cos^{2}(y)}}\right)e^{-ix}e^{iy} $$ The Hankel function has a logarithmic singularity for small values of its argument. The singularity lies along the line $y=x$ of the integrand. I start from the NIntegrate command as follows:
NIntegrate[f[x,y] HankelH1[0,Sqrt[4(Cos[x]-Cos[y])^2+(Sin[x]-Sin[y])^2]],{x,0,1},{y,0,1}]
How should I modify this to evaluate the integral most efficiently? i.e. what settings associated with NIntegrate should I use? All the examples I've read about online apply to slightly different problems. As it stands the integral takes too long and complains of errors about convergence being too slow. Thanks in advance for any help.
Mathematica
code noLaTex
? Where is:f[x,y]
?.It's impolite of you to expect an answer without providing the code to reproduce. $\endgroup$