I want to compute the following type of integrals in Matlab.
It is the integral of function e^-(u)*u and the boundaries are zero and infinity. This integral should return 1.
How can I do this in Matlab?
And if you don't have the symbolic toolbox, or want more speed, quadgk
supports infinite limits:
f = @(x) x.*exp(-x);
a = quadgk(f, 0, inf)
a =
1.000000000000000e+00