Skip to content

Sagemath-Fricas issue: Adding support for exp_integral_e when calling Fricas integrate #37817

@nasser1

Description

@nasser1

Steps To Reproduce

Using sagemath 10.3 with Fricas :

sage --version
SageMath version 10.3, Release Date: 2024-03-19

>fricas --version
FriCAS 1.3.10
based on sbcl 2.3.11
>

Sagemath needs to translate the two argument function exp_integral_e to something that Fricas understands. Currently it does not. Fricas reject this as it does know what exp_integral_e is.

See also discussion here

>sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 10.3, Release Date: 2024-03-19                    │
│ Using Python 3.11.8. Type "help()" for help.                       │
└────────────────────────────────────────────────────────────────────┘

sage: print(fricas.eval(")lisp |$build_version|"))

Value = "FriCAS 1.3.10"

sage: var('x a b c')
(x, a, b, c)

sage: integrate(x*exp_integral_e(1,a*x),x, algorithm="fricas")

RuntimeError                              Traceback (most recent call last)
File ~/TMP/sage-10.3/src/sage/interfaces/expect.py:1520, in ExpectElement.__init__(self, parent, value, is_name, name)
   1519 try:
-> 1520     self._name = parent._create(value, name=name)
   1521 # Convert ValueError and RuntimeError to TypeError for
   1522 # coercion to work properly.

File ~/TMP/sage-10.3/src/sage/interfaces/interface.py:517, in Interface._create(self, value, name)
    516 name = self._next_var_name() if name is None else name
--> 517 self.set(name, value)
    518 return name

File ~/TMP/sage-10.3/src/sage/interfaces/fricas.py:673, in FriCAS.set(self, var, value)
    672 output = self.eval(cmd, reformat=False)
--> 673 self._check_errors(value, output)

File ~/TMP/sage-10.3/src/sage/interfaces/fricas.py:566, in FriCAS._check_errors(self, line, output)
    565         output = output.replace(old, new)
--> 566     raise RuntimeError("An error occurred when FriCAS evaluated '%s':\n%s" % (line, output))
    568 # or even an error

RuntimeError: An error occurred when FriCAS evaluated '(x)*(exp_integral_e(((1)::EXPR INT),(a)*(x)))':
   There are no library operations named exp_integral_e 
      Use HyperDoc Browse or issue
                            )what op exp_integral_e
      to learn if there is any operation containing " exp_integral_e " in 
      its name.

Expected Behavior

Sagemath should translate two argument exp_integral_e() to something Fricas understand. Fricas does not currently support the two argument version of exponential integral.

Actual Behavior

No translation is made resulting in error.

Additional Information

No response

Environment

Linux on Virtual box

lsb_release -a
LSB Version:	n/a
Distributor ID:	ManjaroLinux
Description:	Manjaro Linux
Release:	23.1.4
Codename:	Vulcan


sage --version
SageMath version 10.3, Release Date: 2024-03-19

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions