On Mar 18, 2011, at 4:18 AM, Alexey U. Gudchenko wrote: > 18.03.2011 12:42, Chris Smith пишет: >> Hector wrote: >>>> On Fri, Mar 18, 2011 at 4:57 AM, Aaron S. Meurer >>>> <asmeu...@gmail.com> wrote: >>>> >>>>> For issue 2200, we didn't decide if limit(sin(x), x, oo) should >>>>> raise an error or should return nan (or something else). >>>>> >>>> >>>> Hello everyone, >>>> >>>> Hi Aaron, I was wondering why limit(sin(x),x,oo) should have any >>>> other value >>>> than 0 ? >>>> Is it not equal to k/oo where k is some finite number in [-1,1], >>>> which >>>> clearly tends to zero ? >> >> It is sin(x), not sin(x)/x that has the problem. This continues to oscillate >> between `+/-1` regardless of how large x becomes. >> > > > According strict mathematical definition of limits at infinity limit in this > case is not exists. > > But, the nature aim of "limit" is the answer what is the behavior of function > in infinity. > So the question is only to determine the way how to tell to the user that > sin(x) has arbitary value in range [-1, 1]. > > I offer split into steps of realization: > > 1. If limit is not exist then return Non or something else > It is requirement. > > 2. If it is possible to known range ([-1, 1]) as in the sin(x) at oo example, > then return it. > But it is enchantment. > > > > > -- > Alexey U.
I agree that returning nan is better than raising an error. As to returning the range, I think it requires some more thought. If limit() return a Set object instead of an expression, then that might break a lot of things that expect an expression. Also, there are some other questions: - How exactly are we defining the set returned. Is it a tight bound set as the function goes to infinity, or is it just the closed set [lim inf f(x), lim sup f(x)]? The two are the same if the function is continuous, but for a counterexample, consider a combination of two of the functions discussed in this thread, abs(sin(x))/sin(x). This function takes on values of 1 and −1 forever to infinity. Would limit(abs(sin(x))/sin(x)) return [-1, 1] or set([-1, 1])? - Are there any algorithms to compute these things? - What does the interface look like? Aaron Meurer -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sympy@googlegroups.com. To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.