The result of hgfred([-n,1+n],[1],x) is not correct. This is what Maxima gives:
(%i1) res:hgfred([-n,n+1],[1],x);
Is x positive, negative, or zero?
p;
Is x-1 positive, negative, or zero?
n;
(%o1) legendre_p(-n-1,1-2*x)
The correct result is legendre_p(n, 1-2*x). For the special values n=1, n=2, n=3, ... Maxima gives the correct results:
(%i2) hgfred([-1,1+1],[1],x);
(%o2) 1-2*x
(%i3) hgfred([-2,2+1],[1],x);
(%o3) 6*x^2-6*x+1
(%i4) hgfred([-3,3+1],[1],x);
(%o4) -20*x^3+30*x^2-12*x+1
We can not reproduce the correct results, when we insert the special values in the result from above:
(%i5) res,n=1;
(%o5) 0
(%i6) res,n=2;
(%o6) 0
(%i7) res,n=3;
(%o7) 0
Furthermore, I think the question for the sign of the argument x is not necessary. The problem is in the algorithm of the routine legf14.
Dieter Kaiser
Sorry, I have overseen the identity legendre_p(-n-1,x) = legendre_p(n,x). With this identity the result of hgfred might be not nice, but it is correct.
Unfortunately, legendre_p(-n-1,x) does not simplify to correct values. Perhaps this might be called a bug.
Setting the status to pending and the resolution to invalid.
Dieter Kaiser
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).