I am using sagemath 9.6 with latest giac 1.9.0-7
I am not using giac that comes with sagemath 9.6 since that is old. So I points it to use the latest giac outside of sagemath.
Here is an example of such problem
>sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 9.6, Release Date: 2022-05-15 │
│ Using Python 3.10.4. Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
sage: var('x,b')
(x, b)
sage: integrate(x^(3/2)*(b*x+2)^(1/2),x,algorithm="giac")
---------------------------------------------------------------------------
SyntaxError Traceback (most recent call last)
~/DATA/sage-9.6/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/interfaces/giac.py in _sage_(self, locals)
1138 try:
-> 1139 return symbolic_expression_from_string(result, lsymbols,
1140 accept_sequence=True, parser=SR_parser_giac)
~/DATA/sage-9.6/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/calculus/calculus.py in symbolic_expression_from_string(s, syms, accept_sequence, parser)
2568 if _is_function(v)})
-> 2569 return parse_func(s)
2570
~/DATA/sage-9.6/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/misc/parser.pyx in sage.misc.parser.Parser.parse_sequence (build/cythonized/sage/misc/parser.c:6025)()
574
--> 575 cpdef parse_sequence(self, s):
576 """
~/DATA/sage-9.6/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/misc/parser.pyx in sage.misc.parser.Parser.parse_sequence (build/cythonized/sage/misc/parser.c:5912)()
592 if tokens.next() != EOS:
--> 593 self.parse_error(tokens)
594 if len(all) == 1 and isinstance(all, list):
~/DATA/sage-9.6/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/misc/parser.pyx in sage.misc.parser.Parser.parse_error (build/cythonized/sage/misc/parser.c:10396)()
1043 cdef parse_error(self, Tokenizer tokens, msg="Malformed expression"):
-> 1044 raise SyntaxError(msg, tokens.s, tokens.pos)
1045
SyntaxError: Malformed expression
During handling of the above exception, another exception occurred:
NotImplementedError Traceback (most recent call last)
<ipython-input-6-2f599f779b32> in <module>
----> 1 integrate(x**(Integer(3)/Integer(2))*(b*x+Integer(2))**(Integer(1)/Integer(2)),x,algorithm="giac")
~/DATA/sage-9.6/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/misc/functional.py in integral(x, *args, **kwds)
762 """
763 if hasattr(x, 'integral'):
--> 764 return x.integral(*args, **kwds)
765 else:
766 from sage.symbolic.ring import SR
~/DATA/sage-9.6/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/symbolic/expression.pyx in sage.symbolic.expression.Expression.integral (build/cythonized/sage/symbolic/expression.cpp:95445)()
13192 R = SR
13193 return R(integral(f, v, a, b, **kwds))
> 13194 return integral(self, *args, **kwds)
13195
13196 integrate = integral
~/DATA/sage-9.6/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/symbolic/integration/integral.py in integrate(expression, v, a, b, algorithm, hold)
1045 if not integrator:
1046 raise ValueError("Unknown algorithm: %s" % algorithm)
-> 1047 return integrator(expression, v, a, b)
1048 if a is None:
1049 return indefinite_integral(expression, v, hold=hold)
~/DATA/sage-9.6/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/symbolic/integration/external.py in giac_integrator(expression, v, a, b)
256 return expression.integrate(v, a, b, hold=True)
257 else:
--> 258 return result._sage_()
259
260 def libgiac_integrator(expression, v, a=None, b=None):
~/DATA/sage-9.6/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/interfaces/giac.py in _sage_(self, locals)
1141
1142 except Exception:
-> 1143 raise NotImplementedError("Unable to parse Giac output: %s" % result)
1144 else:
1145 return [entry.sage() for entry in self]
NotImplementedError: Unable to parse Giac output: Warning, choosing root of [1,0,%%%{-4,[1,1]%%%}+%%%{-4,[1,0]%%%}+%%%{-4,[0,1]%%%}+%%%{-8,[0,0]%%%},0,%%%{6,[2,2]%%%}+%%%{4,[2,1]%%%}+%%%{6,[2,0]%%%}+%%%{4,[1,2]%%%}+%%%{28,[1,1]%%%}+%%%{8,[1,0]%%%}+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[0,0]%%%},0,%%%{1,[4,4]%%%}+%%%{-4,[4,3]%%%}+%%%{6,[4,2]%%%}+%%%{-4,[4,1]%%%}+%%%{1,[4,0]%%%}+%%%{-4,[3,4]%%%}+%%%{12,[3,3]%%%}+%%%{-20,[3,2]%%%}+%%%{20,[3,1]%%%}+%%%{-8,[3,0]%%%}+%%%{6,[2,4]%%%}+%%%{-20,[2,3]%%%}+%%%{46,[2,2]%%%}+%%%{-40,[2,1]%%%}+%%%{24,[2,0]%%%}+%%%{-4,[1,4]%%%}+%%%{20,[1,3]%%%}+%%%{-40,[1,2]%%%}+%%%{48,[1,1]%%%}+%%%{-32,[1,0]%%%}+%%%{1,[0,4]%%%}+%%%{-8,[0,3]%%%}+%%%{24,[0,2]%%%}+%%%{-32,[0,1]%%%}+%%%{16,[0,0]%%%}] at parameters values [18.4052062202,51.6443148847]
1/sageVARb*(2*sageVARb*abs(sageVARb)/sageVARb^2*(2*((12*sageVARb^5/144/sageVARb^7*sqrt(sageVARb*sageVARx+2)*sqrt(sageVARb*sageVARx+2)-78*sageVARb^5/144/sageVARb^7)*sqrt(sageVARb*sageVARx+2)*sqrt(sageVARb*sageVARx+2)+198*sageVARb^5/144/sageVARb^7)*sqrt(sageVARb*sageVARx+2)*sqrt(sageVARb*(sageVARb*sageVARx+2)-2*sageVARb)+5/2/sageVARb/sqrt(sageVARb)*ln(abs(sqrt(sageVARb*(sageVARb*sageVARx+2)-2*sageVARb)-sqrt(sageVARb)*sqrt(sageVARb*sageVARx+2))))+4*abs(sageVARb)/sageVARb^2/sageVARb*(2*(1/8*sqrt(sageVARb*sageVARx+2)*sqrt(sageVARb*sageVARx+2)-5/8)*sqrt(sageVARb*sageVARx+2)*sqrt(sageVARb*(sageVARb*sageVARx+2)-2*sageVARb)-6*sageVARb/4/sqrt(sageVARb)*ln(abs(sqrt(sageVARb*(sageVARb*sageVARx+2)-2*sageVARb)-sqrt(sageVARb)*sqrt(sageVARb*sageVARx+2)))))
sage:
But when using giac directly, it works with no errors
>giac
// Using locale /usr/local/share/locale/
// C.UTF-8
// /usr/local/share/locale/
// giac
// UTF-8
// Maximum number of parallel threads 24
Added 0 synonyms
Welcome to giac readline interface, version 1.9.0
(c) 2001,2021 B. Parisse & others
Homepage http://www-fourier.ujf-grenoble.fr/~parisse/giac.html
Released under the GPL license 3.0 or above
See http://www.gnu.org for license details
May contain BSD licensed software parts (lapack, atlas, tinymt)
-------------------------------------------------
Press CTRL and D simultaneously to finish session
Type ?commandname for help
0>> integrate( x^(3/2)*(b*x+2)^(1/2),x)
2*(2*((12*b^4*1/144/b^4*sqrt(x)*sqrt(x)+6*b^3*1/144/b^4)*sqrt(x)*sqrt(x)-18*b^2*1/144/b^4)*sqrt(x)*sqrt(b*x+2)-1/2/b^2/sqrt(b)*ln(sqrt(b*x+2)-sqrt(b)*sqrt(x)))
// Time 0.01
1>>
Here are more information
>which sage
/home/me/DATA/sage-9.6/sage
>sage --version
SageMath version 9.6, Release Date: 2022-05-15
>which giac
/usr/local/bin/giac
>giac --version
// Using locale /usr/local/share/locale/
// C.UTF-8
// /usr/local/share/locale/
// giac
// UTF-8
// Maximum number of parallel threads 24
// (c) 2001, 2021 B. Parisse & others
1.9.0
>cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04 LTS"
PRETTY_NAME="Ubuntu 22.04 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
I see many integrals that fail the same way using giac. I was hoping this will be fixed in sage 9.6
Any idea what is going on?