Numerical Integration from -Inf to Inf
36 views (last 30 days)
Problem: I have the following integral which i need to evaluate numerically.
Now i have to do this for different values of c and γ, but for now let us say c=0.1 and
My attempt: After reading few already available answers and documentation, i tried the following
fun = @(x) (x.*exp(-x.^2)).*(((x+0.1).^2) .* (exp(2.*(x+0.1).^2 .*gamma.^2)));
q1 = integral(fun,-Inf,Inf,'RelTol',1e-8,'AbsTol',1e-13)
Result: The output i get is Nan
Any help or advice will be helpful to me.
Birdman on 5 Dec 2019
Try the symbolic approach and consider the problem as follows:
After this point, you need to break it down to two pieces while calculating integral:
The sum of these two will give the correct result.