[Maxima] Possible fix for Bug [ 941457 ] integrate(1/x^5,x,1,2^(1/78))
raymond.toy at ericsson.com
Thu Feb 23 17:20:58 CST 2006
For this particular integration bug, maxima converts the finite
integral to an infinite integral using the transformation x =
(b*y+a)/(y+1). This is all done correctly, but the wrong result is
returned because maxima is unable to factor (2^(1/78)*x+1)^5 after it
has been expanded out.
This happens in zmtorat in defint.lisp. We should probably fix
$factor so that it can, but this isn't about that. We should also
probably add a check to zmtorat that $factor actually did something
besides return its argument unchanged. This isn't about that either.
This is about a workaround for this bug. The workaround would be to
modify the function CV in defint.lisp. This function is responsible
for applying the transformation and performing the integration. The
problem is that intcv3 expands out everything. However, if, instead
of substituting the limits right away, we use symbolic values to
perform the transformation, and then substitute the actual limits
later, we get a form that $factor can handle. Thus, the following
resplacement for CV works:
(defun cv (exp)
(if (not (or (real-infinityp ll) (real-infinityp ul)))
(let ((trans (intcv3 (m// (m+t 'll (m*t 'ul var))
(m+t 1. var))
(setf trans (subst ll 'll trans))
(setf trans (subst ul 'ul trans))
(method-by-limits trans var 0. '$inf))
Yes, I know this is not the best solution, but I don't feel like
hacking on $factor right now. The testsuite passes with this change.
What do people think about this workaround?
More information about the Maxima