MATLAB: Help on Explicit integral could not be found

explicitintegrationMATLABnumericalnumerical integration

Hi all,
I am getting a well-known error of "Explicit integral could not be found" if I try to evaluate following integral
>> syms z;
>> funz=1./(1+exp((z*z-0.5)/0.1));
>> Integ2=int(funz,z,0,inf)
Warning: Explicit integral could not be found.
Integ2 =
int(1/(exp(10*z^2 - 5) + 1), z == 0..Inf)
Mathematica evaluates this integral to 0.693.
I have tried replacing lower integration limit to some small finite number (0.001) but that doesn't help. Please help in identifying the fix for this problem. Any help is appreciated. Thanks a lot !

Best Answer

MuPAD is going to convert those floating point numbers into rationals and then attempt to find a closed form solution. There is no apparent closed form solution, so the unevaluated integral is returned. You can double(Integ2) to get the numeric value.
Alternately you can do numeric integration either in MATLAB directly or in MuPAD
integral(@(z) 1./(1+exp((z*z-0.5)/0.1)), 0, Inf)
or
feval(symengine, 'numeric::int', funz, 0, Inf)
Related Question