# MATLAB - Numerical integration

1. Jun 16, 2010

### vlajchek

hello,

I have a problem with the use of quad function in Matlab for numerical integration. Let me try to explain on an example. When I want to find the integral of expression exp(-x^2/2) from 0 to infinity, where for the higher bound I use some very large number:

I get the correct result sqrt(pi/2)=1.2533.
If I try to use the same logic for the expression x*exp(-x^2/2) for the same bounds: