-
-
Notifications
You must be signed in to change notification settings - Fork 660
Open
Description
Source : this ask.sagemath question.
sage: g(x)=gamma_inc(2,11/5)*x
sage: g(x).integrate(x,2,5).n() ## For reference
3.72298612097441
So far, so good. But :
sage: gamma_inc(2,11/5).n()*numerical_integral(x,2,5)[0]
3.72298612097441
sage: numerical_integral(g(x),2,5)
---------------------------------------------------------------------------
SystemError Traceback (most recent call last)
<ipython-input-105-c9c90f4afa7c> in <module>
----> 1 numerical_integral(g(x),Integer(2),Integer(5))
/usr/local/sage-9/local/lib/python3.7/site-packages/sage/calculus/integration.pyx in sage.calculus.integration.numerical_integral (build/cythonized/sage/calculus/integration.c:4479)()
380 _b = b
381 W = <gsl_integration_workspace*> gsl_integration_workspace_alloc(n)
--> 382 sig_on()
383 gsl_integration_qag(&F,_a,_b,eps_abs,eps_rel,n,rule,W,&result,&abs_err)
384 sig_off()
SystemError: calling remove_from_pari_stack() inside sig_on()
Ouch... The problem seems to come from the ((unpurposeful) repeated) computation of gamma(2,11/5)
inside the integrated function.
FWIW:
sage: numerical_integral(x*arctan(sqrt(3)),2,5)
(10.995574287564278, 1.2207539743030213e-13)
Component: numerical
Keywords: integral
Issue created by migration from https://trac.sagemath.org/ticket/30379