## #1748 hgfred([3/2,-b],[5/2],-1) bogus

closed
nobody
5
2009-10-10
2009-08-30
No

The general result for the definite integral

integrate(sqrt(t)*(t+1)^b,t,0,1)

is

2/3*hypergeometric([3/2,-b],[5/2],-1).

The new hypergeometric code gives correct answers for b a positive integer:

(%i128) 2/3*hypergeometric([3/2,-1],[5/2],-1);
(%o128) 16/15
(%i129) 2/3*hypergeometric([3/2,-2],[5/2],-1);
(%o129) 184/105
(%i130) 2/3*hypergeometric([3/2,-3],[5/2],-1);
(%o130) 928/315

For negative integers I have tried hgfred. This is an example for b=-3:

(%i112) 2/3*hgfred([3/2,3],[5/2],-1);
(%o112) (12*((-1/(2*(1-(-"*"()))^3*(-1))+5/(8*(1-(-"*"()))^2*(-1)^2)
-15/(16*(1-(-"*"()))*(-1)^3)
+15*atanh(sqrt(-1))/(16*(-1)^(7/2))
-3/(1-(-"*"()))^4)
*sqrt(1-(-"*"()))
-2*(-1/(4*(1-(-"*"()))^2*(-1))+3/(8*(1-(-"*"()))*(-1)^2)
-3*atanh(sqrt(-1))/(8*(-1)^(5/2))
-1/(1-(-"*"()))^3)
/sqrt(1-(-"*"()))
-3*(-1/(4*(1-(-"*"()))*(-1))+atanh(sqrt(-1))/(4*(2*sqrt(-1)))
-1/(2*(1-(-"*"()))^2))
/(2*(2*sqrt(1-(-"*"()))))
-3*(-atanh(sqrt(-1))/(2*sqrt(-1))-1/(2*(1-(-"*"()))))
/(2*(1-(-"*"()))^(5/2))
-15*(1-atanh(sqrt(-1))*sqrt(-1))/(16*(1-(-"*"()))^(7/2)))
*(2*sqrt(1-(-"*"())))*(-1)^2
-36*((-1/(4*(1-(-"*"()))^2*(-1))+3/(8*(1-(-"*"()))*(-1)^2)
-3*atanh(sqrt(-1))/(8*(-1)^(5/2))
-1/(1-(-"*"()))^3)
*sqrt(1-(-"*"()))
-3*(-1/(4*(1-(-"*"()))*(-1))+atanh(sqrt(-1))/(4*(2*sqrt(-1)))
-1/(2*(1-(-"*"()))^2))
/(2*sqrt(1-(-"*"())))
-3*(-atanh(sqrt(-1))/(2*sqrt(-1))-1/(2*(1-(-"*"()))))
/(4*(2*sqrt(1-(-"*"()))))
-3*(1-atanh(sqrt(-1))*sqrt(-1))/(8*(1-(-"*"()))^(5/2)))
*sqrt(1-(-"*"()))*(-1)^2
+9*((-1/(4*(1-(-"*"()))*(-1))+atanh(sqrt(-1))/(4*(2*sqrt(-1)))
-1/(2*(1-(-"*"()))^2))
*sqrt(1-(-"*"()))
-(-atanh(sqrt(-1))/(2*sqrt(-1))-1/(2*(1-(-"*"()))))
/sqrt(1-(-"*"()))
-(1-atanh(sqrt(-1))*sqrt(-1))/(4*(2*sqrt(1-(-"*"())))))*(-1)^2
/sqrt(1-(-"*"()))
-48*((-1/(4*(1-(-"*"()))^2*(-1))+3/(8*(1-(-"*"()))*(-1)^2)
-3*atanh(sqrt(-1))/(8*(-1)^(5/2))
-1/(1-(-"*"()))^3)
*sqrt(1-(-"*"()))
-3*(-1/(4*(1-(-"*"()))*(-1))+atanh(sqrt(-1))/(4*(2*sqrt(-1)))
-1/(2*(1-(-"*"()))^2))
/(2*sqrt(1-(-"*"())))
-3*(-atanh(sqrt(-1))/(2*sqrt(-1))-1/(2*(1-(-"*"()))))
/(4*(2*sqrt(1-(-"*"()))))
-3*(1-atanh(sqrt(-1))*sqrt(-1))/(8*(1-(-"*"()))^(5/2)))
*(2*sqrt(1-(-"*"())))*1
+72*((-1/(4*(1-(-"*"()))*(-1))+atanh(sqrt(-1))/(4*(2*sqrt(-1)))
-1/(2*(1-(-"*"()))^2))
*sqrt(1-(-"*"()))
-(-atanh(sqrt(-1))/(2*sqrt(-1))-1/(2*(1-(-"*"()))))
/sqrt(1-(-"*"()))
-(1-atanh(sqrt(-1))*sqrt(-1))/(4*(2*sqrt(1-(-"*"())))))
*sqrt(1-(-"*"()))*1
+24*((-1/(4*(1-(-"*"()))*(-1))+atanh(sqrt(-1))/(4*(2*sqrt(-1)))
-1/(2*(1-(-"*"()))^2))
*sqrt(1-(-"*"()))
-(-atanh(sqrt(-1))/(2*sqrt(-1))-1/(2*(1-(-"*"()))))
/sqrt(1-(-"*"()))
-(1-atanh(sqrt(-1))*sqrt(-1))/(4*(2*sqrt(1-(-"*"())))))
*(2*sqrt(1-(-"*"()))))
/3

The answer is not simplified and contains bad subexpressions. But if we do an extra expand we get the correct solution:

(%i113) expand(%);
(%o113) %pi/16

We have the same problem with other negative integers for b too.

For a positive integer we get an answer in terms of the jacobi_p function which does not simplify to a rational number.

There is a problem with b=2:

(%i124) 2/3*hgfred([3/2,-2],[5/2],-1);
(%o124) 16*jacobi_p(2,3/2,2*false-5/2,3)/105

The answer contains the boolean value false.

Dieter Kaiser

## Discussion

• Raymond Toy - 2009-09-03

I think the fundamental issue is that hgfred is meant for symbolic work with symbolic argument.

Now, for the first problem, hgfred([3/2,2],[5/2],-1) does something bad probably from the call to subst at the end of hyp-atanh. Perhaps it should use \$subst.

The second problem with jacobi_p is another example of where maxima is assuming the argument is symbolic, not numeric.

Since people use hgfred all the time with numeric argument, perhaps hgfred should either warn/error about that, or it should replace the argument with a gensym, do the simplification, and then subst/limit the result with the numeric argument.

• Dieter Kaiser - 2009-10-10

Both problems of this bug report are fixed in hyp.lisp revision 1.108.
Closing this bug report as fixed.
Dieter Kaiser

• Dieter Kaiser - 2009-10-10
• status: open --> closed