Bug ID: 2968174 - Integration of hypergeometric bug
Subject: Bug ID: 2968174 - Integration of hypergeometric bug
From: Dieter Kaiser
Date: Fri, 12 Mar 2010 23:18:30 +0100
We have the bug report ID: 2968174 - "Integration of hypergeometric
bug". I think this bug report arises in rat10. It is interesting that
the algorithm of rat10 was extended with revision 1.4 of sin.lisp to
handle functions with more than one argument more correct.
This is the added piece of code in revision 1.4:
(let ((examine (margs ex)))
(if (atom (first examine))
(do* ((element examine (rest element))
(result (rat10 (first examine))
(and result (rat10 (first element)))))
((or (null result) (null element)) result))
(rat10 (first examine)))))))
The problem is that the code only inspect the argument list of the
function completely if the first argument is an atom. That works for
e.g.
integrate(gamma_incomplete(a,x^2)*x^2,x)
but not for
integrate(gamma_incomplete(2*a,x^2)*x^2,x)
I think the correct code is simply the following:
(let ((examine (margs ex)))
(do* ((element examine (rest element))
(result (rat10 (first examine))
(and result (rat10 (first element)))))
((or (null result) (null element)) result)))
That is we delete the if-clause and go in all cases through the list of
the arguments.
With this change the reported errors vanish and we get the correct noun
forms:
(%i4) integrate(gamma_incomplete(2*a,x^2)*x^2,x);
(%o4) 'integrate(gamma_incomplete(2*a,x^2)*x^2,x)
(%i5) integrate(hypergeometric([a,b],[c],x^2)*x^2,x);
(%o5) 'integrate(hypergeometric([a,b],[c],x^2)*x^2,x)
The examples of the original problem which causes the revision 1.4 are
still working as expected too:
(%i6) h(x,y):=x*y*diff(f(x,y),x,1,y,1)$
(%i7) integrate(h(x,y),x);
(%o7) ('integrate(x*'diff(f(x,y),x,1,y,1),x))*y
(%i8) integrate(h(x,y),y);
(%o8) x*'integrate('diff(f(x,y),x,1,y,1)*y,y)
The testsuite and the share_testsuite have no problems.
Dieter Kaiser