Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Problem/bug with constant incomplete gamma inside numerical integration?

HI there,

straightforward one, in Sage v9.0 on Ubuntu Linux the following code:

g(x)=gamma_inc(2,11/5)*x
numerical_integral(g,2,5)

results in the following error:

---------------------------------------------------------------------------
SystemError                               Traceback (most recent call last)
/usr/lib/python3/dist-packages/sage/all_cmdline.py in <module>
      1 __tmp__=var("x"); g = symbolic_expression(gamma_inc(Integer(2),Integer(11)/Integer(5))*x).function(x)
      2 show(g)
----> 3 numerical_integral(g,Integer(2),Integer(5))

/usr/lib/python3/dist-packages/sage/calculus/integration.pyx in sage.calculus.integration.numerical_integral (build/cythonized/sage/calculus/integration.c:4042)()
    353          _b = b
    354          W = <gsl_integration_workspace*> gsl_integration_workspace_alloc(n)
--> 355          sig_on()
    356          gsl_integration_qag(&F,_a,_b,eps_abs,eps_rel,n,rule,W,&result,&abs_err)
    357          sig_off()

SystemError: calling remove_from_pari_stack() inside sig_on()

This integral does work fine if gamma_inc is replaced by a constant involving the gamma function, and n(gamma_inc(2,11/5)) works fine as well. A bug?