Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#8752 closed defect (duplicate)

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

Reported by: lfousse Owned by: burcin
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: calculus Keywords: integral, numerical conversion
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

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

Change History (3)

comment:1 Changed 11 years ago by jason

  • Resolution set to duplicate
  • Status changed from new to 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 11 years ago by jason

  • Milestone set to sage-duplicate/invalid/wontfix

comment:3 Changed 11 years ago by lfousse

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

Note: See TracTickets for help on using tickets.