Opened 13 years ago

Closed 13 years ago

# Can't evaluate numerically symbolic expression resulting from integral().

Reported by: Owned by: Laurent Fousse Burcin Erocal major sage-duplicate/invalid/wontfix calculus integral, numerical conversion N/A

### Description

Consider the following (in sage 4.3.5):

```sage: integral(exp(-x^2), x, 17, 42)
-1/2*sqrt(pi)*erf(17) + 1/2*sqrt(pi)*erf(42)
sage: N(-1/2*sqrt(pi)*erf(17) + 1/2*sqrt(pi)*erf(42))
0.000000000000000
```

But:

```sage: N(integral(exp(-x^2), x, 17, 42))
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/opt/sage-4.3.5/<ipython console> in <module>()

/opt/sage-4.3.5/local/lib/python2.6/site-packages/sage/misc/functional.pyc in numerical_approx(x, prec, digits)
1161             prec = int((digits+1) * 3.32192) + 1
1162     try:
-> 1163         return x.numerical_approx(prec)
1164     except AttributeError:
1165         from sage.rings.complex_double import is_ComplexDoubleElement

/opt/sage-4.3.5/local/lib/python2.6/site-packages/sage/symbolic/expression.so in sage.symbolic.expression.Expression.n (sage/symbolic/expression.cpp:17043)()

TypeError: cannot evaluate symbolic expression numerically
```

### comment:1 Changed 13 years ago by Jason Grout

Resolution: → duplicate new → closed

In 4.4.alpha1:

```sage: N(integral(exp(-x^2), x, 17, 42))
0.000000000000000
```

I believe this was taken care of in #3863.

### comment:2 Changed 13 years ago by Jason Grout

Milestone: → sage-duplicate/invalid/wontfix

### comment:3 Changed 13 years ago by Laurent Fousse

Indeed, it is fixed. Thanks for the prompt reply, sorry for the duplicate.

Note: See TracTickets for help on using tickets.