Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit d314399

Browse files
committed
Trac #15219: add test for numerical_integral() of symbolic functions.
The switch from fast_float() to fast_callable() in Trac 32234 also happened to fix the issue reported in Trac 15219, namely the inability to integrate symbolic functions by name. Here we add a doctest for the correct behavior.
1 parent 8bae3ff commit d314399

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/sage/calculus/integration.pyx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,14 @@ def numerical_integral(func, a, b=None,
250250
Traceback (most recent call last):
251251
...
252252
ValueError: integral does not converge at -infinity
253+
254+
Symbolic functions can be integrated as conveniently as symbolic
255+
expressions, as in :trac:`15219`::
256+
257+
sage: h(x) = x
258+
sage: numerical_integral(h,0,1)[0] # abs tol 1e-8
259+
0.5
260+
253261
"""
254262
cdef double abs_err # step size
255263
cdef double result

0 commit comments

Comments
 (0)