I have a function defined as
tail <- function(x) {585.1961*x^-2.592484}
When I tried to get the integral of it from 5000 to Inf, it returns an error:
> integrate(tail, 5000, Inf)
Error in integrate(tail, 5000, Inf) : the integral is probably divergent
However, integrating from 1000 to Inf and from 1000 to 5000 both worked fine:
> integrate(tail, 1000, Inf)
0.006134318 with absolute error < 2.5e-05
> integrate(tail, 1000, 5000)
0.005661634 with absolute error < 4.9e-09
Isn't integrate(tail, 5000, Inf)
simply equal to integrate(tail, 1000, Inf) - integrate(tail, 1000, 5000)
? Why that resulted in a divergent integral?