Skip to content

Weird error in exponential integral #14821

Closed
@ppurka

Description

@ppurka
integral(exp(-300.0/(-0.064*x+14.0)),x,0.0,120.0)
...
RuntimeError: ECL says: In function GCD, the value of the second argument is
  1.0
which is not of the expected type INTEGER

The original ticket description whose case does work now:

This is so trivial that I am surprised this bug even exists. :) Present since at least sage-5.2 till present versions.

The following integral works

H = exp(-x)
H.integral(x, 0, 1)

-e^(-1) + 1

But the following integral errors out

H = exp(-1.0 * x)
H.integral(x, 0, 1)

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_19.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("SCA9IGV4cCgtMS4wKjEwXi0xKngpCkguaW50ZWdyYWwoeCwgMCwgMSk="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmpE7_LAK/___code___.py", line 4, in <module>
    exec compile(u'H.integral(x, _sage_const_0 , _sage_const_1 )
  File "", line 1, in <module>
    
  File "expression.pyx", line 9058, in sage.symbolic.expression.Expression.integral (sage/symbolic/expression.cpp:37991)
  File "/usr/local/src/sage/sage-5.2.server/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.py", line 683, in integrate
    return definite_integral(expression, v, a, b)
  File "function.pyx", line 432, in sage.symbolic.function.Function.__call__ (sage/symbolic/function.cpp:4941)
  File "/usr/local/src/sage/sage-5.2.server/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.py", line 173, in _eval_
    return integrator(*args)
  File "/usr/local/src/sage/sage-5.2.server/local/lib/python2.7/site-packages/sage/symbolic/integration/external.py", line 21, in maxima_integrator
    result = maxima.sr_integral(expression, v, a, b)
  File "/usr/local/src/sage/sage-5.2.server/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.py", line 746, in sr_integral
    raise error
RuntimeError: ECL says: In function GCD, the value of the second argument is
  1.0
which is not of the expected type INTEGER

CC: @nbruin @rwst

Component: calculus

Keywords: integration, maxima

Author: Paul Masson, Dave Morris

Branch/Commit: 5101846

Reviewer: Ralf Stephan, Travis Scrimshaw

Issue created by migration from https://trac.sagemath.org/ticket/14821

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions