I don't think it's sufficient to try to fix the problem at the point where RATLIM currently thinks the limit is 0 (although it would certainly be an improvement). For example, this limit should be 2 when a is 0, but RATLIM currently says that the limit is 1, whether there is an assumption or not (and will not ask any questions if you omit the assume): (%i1) assume(equal(a, 0)); (%o1) [equal(a, 0)] (%i2) limit((2*x + a)/(x + a), x, 0); (%o2) 1 So it seems to me that it would be better to fix loco...
Thanks! I know very little lisp, but I am able to understand the gist of the RATLIM function: to calculate a limit x -> 0 (or x ->zeroa) of a rational function, we just need to know the coefficient of the lowest-order term in the numerator and denominator. I think the best option would be to modify the locoef function to check whether the result is actually nonzero, and continue looking if it is not. Another alternative would be for RATLIM to check whether (locoef n g) and (locoef d g) are zero....
Thanks for looking at this. Based on your last message, I found a much simpler example: (%i1) assume(equal(a, 0)); (%o1) [equal(a,0)] (%i2) limit(a/x + 1, x, 0); (%o2) 0
a cosine of arcsin limit that is evaluated incorrectly
In case it helps, the problem (surprisingly!) does not seem to arise when the constant is negative: (%i1) load("simplify_sum"); for k: -5 while k <= 5 do print(simplify_sum(sum(binomial(n,s) * (x + k)^s * x^(n-s), s, 0, n))); (%o1) (2*x-5)^n (2*x-4)^n (2*x-3)^n (2*x-2)^n (2*x-1)^n 2^n*x^n 2^n*x^n 2^n*x^n 2^n*x^n 2^n*x^n 2^n*x^n
simplify_sum (Zeilberger method) computes incorrect answer
crash from taking limit of factorial(x) + 1
I think the verbose output that is copied below shows that the problem is a wrong initial condition for Zeilberger's method. Maxima says the initial condition is sm[0] = 0, but I think this needs to be sm[1] = 1, because the recurrence relation sm[n]*(t+1) - sm[n+1] = 0 is not valid for n = 0. (%i15) verbose_level: 100; (verbose_level) 100 (%i16) load("simplify_sum"); (%o16) /Applications/Maxima.app/Contents/Resources/opt/share/maxima/5.43.0/share/solve_rec/simplify_sum.mac (%i17) simplify_sum(sum(t^(k-1)*binomial(n-1,...