Opened 5 years ago

# Unevaluated integrals to infinity have nonsense numeric value

Reported by: Owned by: pelegm major sage-7.6 calculus integrate kcrisman, rws N/A

Running

```integrate(floor(x), x, 0, infinity, algorithm='sympy')
```

returns

```integrate(floor(x), x, 0, +Infinity)
```

and trying

```integrate(floor(x), x, 0, infinity, algorithm='sympy').n()
```

returns (!!!) `-679.7441466712775`. This is awfully wrong. It shows with any unevaluated integral.

### comment:1 Changed 5 years ago by pelegm

• Description modified (diff)

### comment:3 Changed 5 years ago by rws

• Description modified (diff)
• Summary changed from The integral of floor(x) from 0 to inf is negative to Unevaluated integrals have nonsense numeric value

### comment:4 Changed 5 years ago by pelegm

Note that it doesn't happen without `algorithm='sympy'`.

### comment:5 Changed 5 years ago by rws

I don't think this is correct:

```sage: integrate((1+x+x^2)^(1/3), x, 0, infinity)
integrate((x^2 + x + 1)^(1/3), x, 0, +Infinity)
sage: _.n()
8.835093500042741e+20
```

### comment:6 Changed 5 years ago by kcrisman

• Keywords floor sympy removed
• Summary changed from Unevaluated integrals have nonsense numeric value to Unevaluated integrals to infinity have nonsense numeric value

I want to point out that all these integrals involve infinity. I can't remember any more exactly where to find it (did poke about a bit) but there should be code, and not original code, for how to deal with this situation - I think it just sends it to the GSL algorithm `numerical_integral` which would likely give nonsense for infinity. And indeed that is the case - compare this Sage cell:

```sage: print numerical_integral(floor(x), 0, +Infinity)
sage: print numerical_integral((x^2 + x + 1)^(1/3), 0, +Infinity)
(-679.7441466712775, 632.307547415802)
(8.835093500042741e+20, 1.6991730463958232e+21)
```
Note: See TracTickets for help on using tickets.