1
$\begingroup$

I am performing a convolution between two functions, and then I want to numerically integrate the result.

If I go:

Result1[y_] = Integrate[F[x - y] * G[y],{y,-Infinity,Infinity}]

I can then easily numerically integrate the result to whatever integration limit I want as;

NIntegrate[Result1[y],{y,-Infinity,UpplerLimit}]

And I get a result which is consistent. However If I now use the Mathematica function Convolve[...] Which I want to use for programmatic reasons, as,

Result1[y_] = Convolve[F[x],G[x],x,y]

this also returns nicely and if I plot Result1[y] and Result2[y] they are identical, BUT, if I then numerically integrated Result2[y] (produced with Mathematica's Convolve[...]) I get the error:

NIntegrate::slwcon: Numerical integration converging too slowly; suspect one of the following: singularity, value of the integration is 0, highly oscillatory integrand, or WorkingPrecision too small.

And

NIntegrate::ncvb: NIntegrate failed to converge to prescribed accuracy after 9 recursive bisections in x near {x} = {-1.30639}. NIntegrate obtained -1.90282 and 0.8427893482198415` for the integral and error estimates.

Can anyone explain this?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.