Thanks for fixing this!!
Sorry, there is a typo in the title, but I don't know how to edit it. Instead of two right parentheses at the end of the expression, one of them should be immediately after 10.
limit(floor( 1/2 + sin(1/x)/10, x, 0)) returns ind but should be 0
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