I was doing some integration into a loop using integrate and I come up with an error I can't understand neither get rid of. Here is a MWE I could extract:
b=1/1.230219e-07
f=function(x)
{exp(-x/b)}
integrate(f,0, Inf)
this returns an error "Error in integrate(f, 0, Inf) : the integral is probably divergent" which is obviously false
Error in integrate(f, 0, Inf) : the integral is probably divergent
i tried to change the upper and lower and it work
b=1/1.230219e-07
f=function(x)
{exp(-x/b)}
integrate(f,0, 2)
and the reslut
2 with absolute error < 2.2e-14
i think the problem comes from the infinity, but i dont know how to solve it?