Re: Re: how to explain this weird effect? Integrate
- To: mathgroup at smc.vnet.net
- Subject: [mg46346] Re: [mg46337] Re: how to explain this weird effect? Integrate
- From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
- Date: Mon, 16 Feb 2004 08:59:48 -0500 (EST)
- References: <200402121216.HAA12039@smc.vnet.net> <email@example.com> <200402140256.VAA08500@smc.vnet.net> <firstname.lastname@example.org> <200402150319.WAA06274@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
On 15 Feb 2004, at 04:19, steve_H wrote: > Andrzej Kozlowski <akoz at mimuw.edu.pl> wrote in message > news:<c0kr0g$fo8$1 at smc.vnet.net>... >> On 14 Feb 2004, at 03:56, steve_H wrote: >> >>> >>> mathematically speaking, 1/a when a=0, is the same as Limit[1/a , >>> a->0] >>> So, the final answer should not be different. >>> >>> > >> Really? If so then for over 20 years I have teaching it all wrong, and >> so have all other professional mathematicians for much longer. If the >> limit of a function at a point is just the value of that function then >> why do we need to concept of limit at all? > > > hi, > > No need to take things personally. I am sure you are a good teacher. > > But we study limits to know how a function *behaves* as it approaches > the limit. > > We would like to know for example if the function have the same values > as it approaches the limit from above or below. We also study limits > to find things like if a series converges or not. These are the main > reasons for needing the limit function. This is of course not quite true. For example limits are needed to define the derivative of a function, or even the concept of continuity. It was the lack of the concept of limit that caused all the confusion about the original approach to derivatives by Leibniz and Newton. It is precisely the fact that Limit[(f[x+h]-f[x])/h, h->0] is not obtained by "substituting" 0 for h, that is the key point here. What you wrote, that is that 1/x at 0 is the same as Limit[1/x, x->0] is entirely wrong mathematically. It is the kind of thing that is used when people speak informally, or perhaps by engineers who do not care about mathematical correctness but only if things work in practice, but it was you who wrote "mathematically".Mathematically, the real valued function written as 1/x has no value at all at 0. There is no real or complex number called Infinity or ComplexInfinity. On the other hand Limit[1/x,x->0] = Infinity has a well defined sense: it means that for all x which are small enough 1/x will exceed any chosen number, however large. Or consider the functions Sin[x]/x^2 and Sin[x]/x and their behaviour at 0? Again, it does not make mathematical sense to speak of a "value" at 0. Both of them are undefined for x=0. Both of them can be extended to x=0 in an arbitrary way, for example for specifying that the value at 0 should be 3. If you do that, you will get functions defined on the whole real line (or if you prefer complex plane) but this function will be discontinuous at 0. However, the function Sin[x]/x can be "extended" to the whole real line by defining it's value at 0 to be exactly Limit[Sin[x]/x,x->0] , that is 1. On the other hand, there is no way to extend Sin[x]/x^2 to a continuous real valued function defined on the whole real line, whatever value you choose to assign at 0 you will get a discontinuous function. Yet the behaviour near 0 of this function has a certain regularity, which is captured by the statement Limit[Sin[x]/x^2,x->0]=Infinity. This certainly does not mean that there is any real or complex number denoted by Infinity, it is just a way to express the behaviour of the function in the neighbourhood of 0. To say that the function is Infinity at 0 is being very informal indeed (and a source of a lot of wrong ideas that students who never studied math properly have about these things). In fact the situation is exactly the opposite of what you wrote, this kind of thing may be acceptable in a practically oriented mathematical program like Mathematica, would not be in a serious mathematics book (or at least the author would make excuses about the informality assuming that everybody knows the true state of affairs). > Do you know of a function that is well behaved and smooth at a point > 'a', > where the limit of f(x) as x approaches 'a' will not be f(a) ? if so, > please tell us about this function. Were you joking? This is the definiton of continuous at a. 1/x is not defined at 0 and there is not way to define it so as to make it continuous at 0. > >> >> Quite apart from that, the order of evaluation is a key issue in >> functional programming languages and there are lots of cases where >> Mathematica will produce different answers if you change the order of >> evaluation even if "mathematically" you are computing the same thing. >> >> > > Ok, that is my main point then. All what I was saying is that we are > looking > at results that are artifacts of artificial programming side-effects, > and > are not results due to mathematics proper. > No, not at all. As I explained above, the more "mathematically" we look at the issue the more wrong what you wrote is. Only when we look at it from the point of view of computer languages and practical computations the issues you raised get some justification. For example, David Cantrell's suggestion that Mathematica should use the function SinC, which is the unique continuous extension of Sin[x]/x to 0 instead of Sin[x]/x when returning the answer to an integral is reasonable in a program like Mathematica because it is unlikely we would want to consider a function that is Sin[x]/x everywhere but is, for example, 2 at 0. But in mathematics such a function has it's place. Finally, I should clarify what I wrote about the effect of the order of evaluation of the output. In Mathematica you can see it in lots of ways. One is for example: x/x/.x->0 1 while Unevaluated[x/x]/.x->0 Infinite expression encountered. Indeterminate Other cases that are frequently seen on this list involve Simplifying a symbolic expression and then substituting inexact values vs. doing it in reverse order. You can sometimes get very different answers. Of course when I wrote that the mathematical meaning was the same but Mathematica's answers can be different I was also speaking loosely. If you analyse what is happening in the second case (with inexact numbers) carefully then you can certainly give a mathematical correct justification for the answers being different (unless there is a bug involved). The point is however that we get the impression that there is a discrepancy between Mathematica's answer and Mathematics because we confuse our own intentions with what what we are actually doing. The reason is that computer algorithms and computations sometimes do not and even cannot correspond to the way we do things "by hand", but usually they are made to resemble them in order to make working with computers more intuitive. This is particularly true of numerical computations, or even more so, mixed numerical-symbolic computations which most people have little experience of doing by hand carefully. The result is that they assume that doing some transformations and substituting in values should be the same as substituting values and then doing transformations, but careful thinking will actually show that when the numbers are non exact this is not so. The same sort of argument applies to the first example, in fact Mathematica's behaviour is quite reasonable mathematically in both cases. So actually I do not accept your claim that > we are looking > at results that are artifacts of artificial programming side-effects in such situations, including your original exmaple, we are looking at results of misunderstanding mathematics (in claiming that 1/0 *is* Infinity or Sin/0 is 1) as well as misunderstanding how Mathematica works.