call to integrate with Fricas hangs but works inside Fricas

asked 2022-02-14 20:26:19 +0200

Nasser gravatar image

updated 2022-02-14 21:18:55 +0200

tmonteil gravatar image

I noticed some calls to integrate using "fricas" algorithm (but possibly others also) hang when run from sagemath but the same integrate command works fast when run directly from Fricas on same computer.

I am running sagemath 9.5 on ArchLinux inside VBox machine. Here is an example.

>which sage
>which fricas
>fricas --version
FriCAS 1.3.7
based on sbcl 2.2.1
>sage --version
SageMath version 9.5, Release Date: 2022-01-30


│ SageMath version 9.5, Release Date: 2022-01-30                     │
│ Using Python 3.10.2. Type "help()" for help.                       │
sage: var("a b x d c e")
(a, b, x, d, c, e)
sage: integrand = x*(e *x^3 + d)/(c*x^6 + b*x^3 + a)
sage: fricas.setSimplifyDenomsFlag(fricas.true)
sage: anti = integrate(integrand, x, algorithm="fricas")

And the above hangs. I waited for more than 30 minutes. Now I run the same integrate inside Fricas itself, and it completes in less than 10-20 seconds. The output is very large, so I am wondering may be this is why sagemath hangs?

Checking for foreign routines
foreign routines found
openServer result 0
                       FriCAS Computer Algebra System 
                            Version: FriCAS 1.3.7
                 Timestamp: Fri Feb  4 01:39:20 AM CST 2022

(1) -> setSimplifyDenomsFlag(true)
(3) -> integrand := x*(e *x^3 + d)/(c*x^6 + b*x^3 + a);
(4) -> integrate(integrand, x);
                                     Type: Union(Expression(Integer),...)
(5) ->

Is there a limit on the output from integrate command and that is why it hangs?
In sagemath 9.3 this same command worked OK and did not hang. I have few others like this that now hang in 9.5

Any idea what is going on? Just in case this is a new bug, created a ticket

Thanks --Nasser

edit retag flag offensive close merge delete



I confirm the bug, thanks for reporting.

tmonteil gravatar imagetmonteil ( 2022-02-14 21:18:48 +0200 )edit