Skip to content

use libgiac instead of giac for integration #31873

@mwageringel

Description

@mwageringel

Now that giacpy_sage has been included into Sage by #29171, we can use it for integration instead of the Pexpect interface. This ticket adds a libgiac_integrator which replaces the giac_integrator in the default integrator (which uses Maxima, Giac, and Sympy).

This will resolve issues like #28913 or this ask-sage question where the Pexpect output cannot be parsed by Sage because Giac prints warning messages to the output.

The libgiac_integrator behaves slightly different than the Pexpect-based integrator, in that warning messages issued by Giac are not stripped away anymore.

sage: integrate(abs(cos(x)), x, 0, 2*pi)
Warning, integration of abs or sign assumes constant sign by intervals (correct if the argument is real):
Check [abs(cos(x))]
Discontinuities at zeroes of cos(x) were not checked
4

These messages are generally useful in interactive use. For doctests, the current branch adjusts most of the tests so that they do not depend on the presence of these messages.

Due to the problem at #31655, the first doctest in a file that uses libgiac results in some additional messages, but again the tests are written so that this does not matter. If that ticket is resolved, the second commit could be mostly reverted, but this is not strictly necessary. With the default integrator, these Giac loading messages will appear on the first integral that Maxima cannot solve.

Part of meta-ticket #16688.

CC: @slel

Component: interfaces

Keywords: giac, integration

Author: Markus Wageringel

Branch/Commit: bb15f0f

Reviewer: Matthias Koeppe

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions