This very simple limit:
(%i1) limit((z^(2*n)-1)/(z^2-1),z,-1);
(%o1) infinity
goes catastrophically wrong. We can think that a reasonable solution will be
(%i1) declare(n,integer);
(%o1) done
(%i2) limit((z^(2*n)-1)/(z^2-1),z,-1);
(%o2) 0
And wrong again! BTW all (well, actually I haven't checked all, :-)) the particular cases are correct:
(%i1) limit((z^(2*99)-1)/(z^2-1),z,-1);
(%o1) 99
More mystery: the function is even and the other limit
(%i1) limit((z^(2*n)-1)/(z^2-1),z,1);
(%o1) n
Is OK! (even without the declare) Why?
Diff:
I see the same behavior, working with Maxima 5.43.0.
Possible fix: When the limit point isn't
inf,applysratsimpto the first two arguments oflhospital.What happens, I think, is that when
nis an integer, the vanishing expression((-1) ^n - 1)*((-1)^n + 1)doesn't simplify to zero and that confuses the functionlhospital.Why only apply
sratsimpwhen the limit point isn't an infinity? That's a mystery, but doing so results inlimit((-x)*log(%e^x+1)-li[2](-%e^x)+x^2/2,x,inf)returning a nounform, not the correct value of%pi^2/6.Maybe there is a more logical criteria for applying
sratsimp?Fixed by Commit [37f222], not by the patch I first suggested. This patch fixes the function lhsimp.
Related
Commit: [37f222]