I have an double integral:
Because exp(−^2) is a non-integrable function, I have tried to solve this using the quadgk function in MATLAB, but I don't get a good result. Changing the integral's upper limit from infinity to some exact value may be a good compromise.
I had fitted
with a polynomial fitting, so the whole formula can be analytic. However, sometimes the polynomial fitting is badly conditioned, so I need a better idea to get a better solution.


You can solve this numerically using two calls to
integrallike this:You need to use the
'ArrayValued'option on the outer call tointegralto force the function to run in a non-vectorized mode so the underlying algorithm doesn't try to pass a vector argument in which would be invalid for the upper integration limit of the inner integral.And you can verify this result symbolically using Matlab's Symbolic Math toolbox and either
vpaordoubleto evaluate the integral: