#29966 closed defect (fixed)
integrate(sqrt(x + sqrt(x)), x, algorithm='giac') raises RuntimeError
Reported by:  slabbe  Owned by:  

Priority:  major  Milestone:  sage9.5 
Component:  symbolics  Keywords:  integral, giac, pari 
Cc:  chapoton, dimpase, frederichan, parisse, slabbe, slelievre  Merged in:  
Authors:  Frédéric Chapoton  Reviewers:  Samuel Lelièvre 
Report Upstream:  Fixed upstream, in a later stable release.  Work issues:  
Branch:  8e99321 (Commits, GitHub, GitLab)  Commit:  
Dependencies:  Stopgaps: 
Description
From https://ask.sagemath.org/question/50885/isthereawaytointegratesqrtxsqrtxinsage/, the command
sage: integrate(sqrt(x + sqrt(x)), x, algorithm='giac')
returns
Traceback (most recent call last): ... AttributeError: ... During handling of the above exception, another exception occurred: ... RuntimeError: An error occurred running a Giac command: INPUT: sage2 OUTPUT: Warning, choosing root of [1,0,0,%%%{4,[1]%%%},%%%{4,[2]%%%}+%%%{1,[1]%%%}] at parameters values [97] Warning, need to choose a branch for the root of a polynomial with parameters. This might be wrong. The choice was done assuming [x]=[9] Warning, need to choose a branch for the root of a polynomial with parameters. This might be wrong. The choice was done assuming [x]=[54] *** bug in PARI/GP (Bus Error), please report.sym2poly exception caught Error in PARI subsystem Error: Bad Argument Value Warning, need to choose a branch for the root of a polynomial with parameters. This might be wrong. The choice was done assuming [x]=[64] *** bug in PARI/GP (Segmentation Fault), please report.sym2poly exception caught Error in PARI subsystem Error: Bad Argument Value *** bug in PARI/GP (Segmentation Fault), please report.sym2poly exception caught Error in PARI subsystem Error: Bad Argument Value *** Warning: normalizing a polynomial with 0 leading term. *** Warning: normalizing a polynomial with 0 leading term. Warning, choosing root of [1,0,0,%%%{4,[1]%%%},%%%{4,[2]%%%}+%%%{1,[1]%%%}] at parameters values [6.38357630698] *** Warning: normalizing a polynomial with 0 leading term. *** Warning: normalizing a polynomial with 0 leading term. Warning, choosing root of [1,0,0,%%%{4,[1]%%%},%%%{4,[2]%%%}+%%%{1,[1]%%%}] at parameters values [82.1195442914] 2*(2*((1/6*sqrt(x)+1/24)*sqrt(x)1/16)*sqrt(x+sqrt(x))1/16*ln(sqrt(4*sqrt(x)+14*sqrt(x)*cos((pi*sign(im(sqrt(x)))*sign(x+re(sqrt(x)))pi*sign(im(sqrt(x)))2*atan(im(sqrt(x))/(x+re(sqrt(x)))))/2)+rootof([[4,4,0],[1,0,0,4*x,4*x^2x]])*cos(1/2*(atan(im(sqrt(x))/(x+re(sqrt(x))))+(1sign(x+re(sqrt(x))))*sign(im(sqrt(x)))*pi/2)))))
This was not fixed by #28913.
Change History (15)
comment:1 Changed 16 months ago by
 Keywords integral added
comment:2 Changed 15 months ago by
 Milestone changed from sage9.2 to sage9.3
comment:3 Changed 13 months ago by
 Cc chapoton dimpase frederichan parisse slabbe slelievre added
 Keywords giac pari added
comment:4 Changed 13 months ago by
comment:5 Changed 13 months ago by
dans quelle version de giac ?
comment:7 Changed 13 months ago by
 Report Upstream changed from N/A to Fixed upstream, but not in a stable release.
Do we know the version of some release of giac which will solve the bug?
The current version with the bug is:
$ sage standard  grep giac giac....................................1.5.0.87p2.p1 (1.5.0.87p2.p1)
comment:8 Changed 9 months ago by
 Milestone changed from sage9.3 to sage9.4
Moving to 9.4, as 9.3 has been released.
comment:9 Changed 9 months ago by
Parsing warnings from giac would make sense. Do they always are of the form
Warning, {msg}\n
comment:10 Changed 5 months ago by
 Milestone changed from sage9.4 to sage9.5
comment:11 Changed 5 months ago by
 Branch set to u/chapoton/29966
 Commit set to 8e9932138a3f8273e07fc65c65ff1cb5fdc7bd38
 Status changed from new to needs_review
New commits:
8e99321  add doctest for trac 29966

comment:12 Changed 5 months ago by
 Report Upstream changed from Fixed upstream, but not in a stable release. to Fixed upstream, in a later stable release.
 Reviewers set to Samuel Lelièvre
 Status changed from needs_review to positive_review
Thanks for adding this doctest.
comment:13 Changed 5 months ago by
 Branch changed from u/chapoton/29966 to 8e9932138a3f8273e07fc65c65ff1cb5fdc7bd38
 Resolution set to fixed
 Status changed from positive_review to closed
comment:14 Changed 5 months ago by
 Commit 8e9932138a3f8273e07fc65c65ff1cb5fdc7bd38 deleted
This fails with giac 1.7:
File "/usr/lib/python3.9/sitepackages/sage/symbolic/integration/external.py", line 247, in sage.symbolic.integration.external.giac_integrator Failed example: giac_integrator(sqrt(x + sqrt(x)), x) Expected: 1/12*(2*sqrt(x)*(4*sqrt(x) + 1)  3)*sqrt(x + sqrt(x))  1/8*log(abs(2*sqrt(x + sqrt(x))  2*sqrt(x)  1)) Got: 1/12*(2*sqrt(x)*(4*sqrt(x) + 1)  3)*sqrt(x + sqrt(x))  1/8*log(2*sqrt(x + sqrt(x)) + 2*sqrt(x) + 1)
comment:15 Changed 5 months ago by
I've opened #32449 for this
Note: See
TracTickets for help on using
tickets.
Now returns
abs inside the ln was ineffective