the following example (it needs domain: complex) yields a LISP error:
(%i1) domain: complex $
(%i2) F : (log((x + 1)^p) + 1)^n $
(%i3) integrate(F,x);
Maxima encountered a Lisp error:
In function CAR, the value of the first argument is
0
which is not of the expected type LIST
The behaviour has been observed in 5.45.0/ECL, 5.45.1/SBCL, 5.46.0/ECL, 5.47.0/ECL so it's likely been around for a while. Given that it looks like a blatant type error on a return value, it may be very quick to fix!
(reference: https://github.com/sagemath/sage/issues/35960)
This is happening in the function
rischexplogin this bit of code:YYis 0 at this point.This appears to be a very old bug. If the domain is not set to complex, maxima returns
Don't know if this is right or not.
Looking at src/risch.lisp, I see that
(equal (cdr yy) 1)occurs in three places in RISCHEXPLOG, and in one place it's protected by a preceding(not (atom yy))and in the other two it is not. So if execution goes down a path without(not (atom yy)), it will run into an error with(equal (cdr yy) 1).I find that pasting in
(not (atom yy))in the two places it's needed makes the error go away;integrate(F, x)returns a noun expression (whendomain: complexas specified in the bug report). That's disappointing, but not incorrect.I'll try
run_testsuiteand commit that as a bug fix if it doesn't break anything else.Fixed by commit [ 182b5c1 ]. Closing this report.
With domain = complex,
integrate((log((x + 1)^p) + 1)^n, x)returns a noun expression, which is disappointing but not incorrect. Even when p, n, and x are all declared real (and domain = complex), it still returns a noun. I didn't investigate that. I suppose the first thing to look at is how domain is used in the Risch code.Incidentally the result for domain = real appears to be correct from what I can tell in some brief testing.