After some struggle, build sagemath with maxima 5.47 upstream.
Could someone see if they get same error I see on this one example?
>sage
│ SageMath version 10.1.beta6, Release Date: 2023-07-09 │
│ Using Python 3.11.3. Type "help()" for help. │
┃ Warning: this is a prerelease version, and it may be unstable. ┃
age: ver = installed_packages()
sage: ver['maxima']
'5.47.0'
sage: var('f x e n a p h g b c d q')
sage: integrate(sin(x),x,algorithm="maxima")
-cos(x)
sage: integrate((a+b*log(c*(d*(f*x+e)^p)^q))^n/(h*x+g),x,algorithm="maxima")
RuntimeError Traceback (most recent call last)
Cell In [2], line 1
----> 1 integrate((a+b*log(c*(d*(f*x+e)**p)**q))**n/(h*x+g),x,algorithm="maxima")
File ~/TMP/sage-10.1.beta6/src/sage/misc/functional.py:773, in integral(x, *args, **kwds)
648 """
649 Return an indefinite or definite integral of an object ``x``.
650
(...)
770
771 """
772 if hasattr(x, 'integral'):
--> 773 return x.integral(*args, **kwds)
774 else:
775 from sage.symbolic.ring import SR
File ~/TMP/sage-10.1.beta6/src/sage/symbolic/expression.pyx:13283, in sage.symbolic.expression.Expression.integral()
13281 R = SR
13282 return R(integral(f, v, a, b, **kwds))
> 13283 return integral(self, *args, **kwds)
13284
13285 integrate = integral
File ~/TMP/sage-10.1.beta6/src/sage/symbolic/integration/integral.py:1062, in integrate(expression, v, a, b, algorithm, hold)
1060 if not integrator:
1061 raise ValueError("Unknown algorithm: %s" % algorithm)
-> 1062 return integrator(expression, v, a, b)
1063 if a is None:
1064 return indefinite_integral(expression, v, hold=hold)
File ~/TMP/sage-10.1.beta6/src/sage/symbolic/integration/external.py:44, in maxima_integrator(expression, v, a, b)
42 expression = SR(expression)
43 if a is None:
---> 44 result = maxima.sr_integral(expression, v)
45 else:
46 result = maxima.sr_integral(expression, v, a, b)
File ~/TMP/sage-10.1.beta6/src/sage/interfaces/maxima_lib.py:806, in MaximaLib.sr_integral(self, *args)
700 """
701 Helper function to wrap calculus use of Maxima's integration.
702
(...)
803
804 """
805 try:
--> 806 return max_to_sr(maxima_eval(([max_integrate],[sr_to_max(SR(a)) for a in args])))
807 except RuntimeError as error:
808 s = str(error)
File ~/TMP/sage-10.1.beta6/src/sage/libs/ecl.pyx:830, in sage.libs.ecl.EclObject.__call__()
828 """
829 lispargs = EclObject(list(args))
--> 830 return ecl_wrap(ecl_safe_apply(self.obj,(<EclObject>lispargs).obj))
831
832 def __richcmp__(left, right, int op):
File ~/TMP/sage-10.1.beta6/src/sage/libs/ecl.pyx:353, in sage.libs.ecl.ecl_safe_apply()
351 raise KeyboardInterrupt("ECL says: {}".format(message))
352 else:
--> 353 raise RuntimeError("ECL says: {}".format(message))
354 else:
355 return ret
RuntimeError: ECL says: In function CAR, the value of the first argument is
0
which is not of the expected type LIST
sage:
The same integrate command does not give this error the system maxima (also version 5.47) (but it does not evaluate, but no exception):
>which maxima
/usr/bin/maxima
>maxima --version
;;; Loading #P"/usr/lib/ecl-21.2.1/sb-bsd-sockets.fas"
;;; Loading #P"/usr/lib/ecl-21.2.1/sockets.fas"
Maxima 5.47.0
>
>maxima
;;; Loading #P"/usr/lib/ecl-21.2.1/sb-bsd-sockets.fas"
;;; Loading #P"/usr/lib/ecl-21.2.1/sockets.fas"
Maxima 5.47.0
https://maxima.sourceforge.iousing Lisp ECL 21.2.1
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) integrate((a+b*log(c*(d*(f*x+e)^p)^q))^n/(h*x+g),x);
/ p q n
[ (b log(c (d (f x + e) ) ) + a)
(%o1) I ------------------------------- dx
] h x + g
/
(%i2)
All on Linux,
Why this gives exception when calling maxima from sage but not when calling maxima directly? Is there something I can do to verify that maxima build by sagemath internally is build correct? I saw no errors at all during the build: Here is the maxima build by sagemath:
>pwd
/home/me/TMP/sage-10.1.beta6/local/bin
>ls -lrt maxima
-rwxr-xr-x 1 me me 9563 Jul 16 06:16 maxima
>./maxima --version
;;; Loading #P"/home/me/TMP/sage-10.1.beta6/local/lib/ecl-21.2.1/sb-bsd-sockets.fas"
;;; Loading #P"/home/me/TMP/sage-10.1.beta6/local/lib/ecl-21.2.1/sockets.fas"
Maxima 5.47.0
>
--Nasser