Re: More about l`Hopital`s rule

*To*: mathgroup at smc.vnet.net*Subject*: [mg24623] Re: More about l`Hopital`s rule*From*: "John D. Hendrickson" <jdh at hend.net>*Date*: Fri, 28 Jul 2000 17:24:01 -0400 (EDT)*References*: <8lgtq8$2i6@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

Question: Why does the following limit yeild the number 0? It obviously does not have the value 0 if 'a' is a constant or 'a' is a variable. (1.) In[]:= Limit[(a^2 - a*x)/(a - Sqrt[a*x]), x -> a] Out[]:= 0 Ah... thank you very much for replying Otto. I much enjoy 'pushing the limits' in Mathematica. Please - send a response to this too. Your point was correct. I was focusing on something else and didn't notice. I have a couple of important points to make yet still. In[]:= 0 / Limit[2] Out[]:= 0 In[]:= Remove[x]; In[]:= 0 / Limit[x] Out[]:= 0 Limit[0, x->a]==0 The relavance of the above to the limit is given in PART I and PART II. ------------------------------------ PART I: WAIT! Limit[x] has a MISSING PARAMETER!! HOW did we get the number 0 as a solution?? * Limit returns unevaluated when it encounters functions about which it has no specific information. Limit therefore makes no explicit assumptions about symbolic functions. * Yup - that's why its left as unevaluated. One good reason is that 'x' itself, when defined, may be the expression of both parameters correctly specified. If Mathematica didn't leave 'x' alone you wouldn't be able to do purely symbolic operations. The 0/x ->0 policy is the SINGLE EXCEPTION to the 'leave it alone' policy: See: "1.5.13 Advanced Topic: Generic and Non-Generic Cases". Mathematica assumes that if YOU place 0/x to be evaluated YOU mean 0. Yes - that rules sticks me too - but I love symbolics and wouldn't trade them for anything. (note - internally Limit.m might find its zero at some other similar expr - my point is WHY the zero was generated - not WHERE) Also, lets recall that Limit[] won't branch out sol'n depending upon variable values like Reduce[] does. Anyway, branching begs the question of the Limit statement and Limit existence; as in the Limit given below. -------------------------------- PART II: Right away, before we begin: The Mathematica function Limit[] does not take the limit from both directions unless you make it. Therefore use one-sided limits properly or specify both directions (for the Newbies). In[]:= Limit[ Abs[x] / x, x -> 0 ] Out[]:= 1 (* Wait - the Limit DNE *) In[]:= Limit[ Abs[x] / x, Direction -> 1] Out[]= -1 In[]:= Limit Abs[x] / x, Direction -> -1] Out[]= 1 Let's see if (1.) really does have a limit of 0 for a general case, but not for all cases. (1.) Limit[(a^2 - a*x)/(a - Sqrt[a*x]), x -> a] == (2.) Limit[(a^2 - a*x), x->a] / Limit[(a - Sqrt[a*x]), x->a] (1.) Seems fine. (3.) Limit[(a - Sqrt[a*x]), x->a] == Limit[ a, x->a ] - Limit[ Sqrt[a*x], x->a ] We'll assume that 'a' is a variable, not a constant, because it was given as a literal term. * The assumption plays into why Joaquin's L==0 in his first equation - so is instructive. * Mathematica creates the symbol 'a' to work on the limit. * This means picking and choosing values for 'a' as if it were 'a' constant is not valid line of reasoning. Lets focus soley on "Limit[ Sqrt[a*x] ), x->a ]" Limit[ Sqrt[ a x ], x->a ] == Limit[ Sqrt[ a^2 ] ] * (Limit existence) Abs[x-a] < d and Abs[ Sqrt[ a x ] - L ] < e, for EVERY e * We see that if 'e' is infinitely close to 0 then, intuitively, 'x' has the SAME SIGN as 'a' (for a!=0). Infact, 'x' can equal 'a'. * Sqrt[a^2] is a smooth function. Limit[ Sqrt[ a^2 ] ] * We are left with 'x->a' and with 'a' not being any particular number. Let us assume the Limit will be taken on all real numbers, for a sequence of results. Table[ Limit[ Sqrt[a^2], a->i, Direction->1], {i, -10, 10}] == Table[ Limit[ Sqrt[a^2], a->i, Direction->-1], {i, -10, 10}] Limit[ Sqrt[ a^2 ], a->a ], for all 'a' exists. Now it is clear that: if 'a>0' Limit[ D[ a^2 - a x, x] / D[a - Sqrt[a x], x], x -> a ] == 2 Sqrt[ a^2 ] (* thanks, Otto *) If 'a<0' Limit[ (a^2 - a*x)/(a - Sqrt[a*x]), x -> a ] == 0 if 'a==0' Limit[ (a^2 - a*x)/(a - Sqrt[a*x]), x -> a ] DNE So the Limit[ (a^2 - a*x)/(a - Sqrt[a*x]), x -> a ] has sol'n for given constants 'a != 0', but DNE for variable 'a'. Choose your answer. Either way - its not the same as L==0. Mathematica doesn't automatically seek out values of 'a' which have a limit and then give the answer as a==0 and toss out the rest of the answers. That should be clear by now. 'a<0' isn't a "general case" sol'n. So let's assume that something else is wrong. In[]:= Remove[y, a, x] In[]:= Limit[ ( a^2 - a x) /y, x -> a ] Out[]:= 0 In[]:= 0/(a - Sqrt[a a]) Out[]:= 0 Any limit with a zero in the numerator and an undefined symbolic expression in the denomenator is 0. Limit[0, x->a]==0. I traced (1.) and confered with Limit.m. Limit performs many many divisions, tests, on exp or just on the numerator or denomenator. If anywhere in that long sequence 0/(a - Sqrt[a a]) is evaluated, it becomes 0, as explained above. The trace of (1.) looked quite clearly like Limit.m came to the conclusion 'x' was replaceable by 'a' directly (that is correct) but that it didn't get past 0/(a - Sqrt[a a]) once that substitution had been done. Infact, { ..., 0/(a-Sqrt[a^2]) , 0 } were the last two things in the trace (answer$102==0). The LHospital test (which is there) was not even tried: the indeterminate test was PERFORMED on 0/(a-Sqrt[a^2], which is 0. I Took my four Calculus courses out of Swokowski's Calculus book (the whole book). And looking back - I don't see a single limit in the book which doesn't approach a number, constant of a definite integration, or infinity. That doesn't mean 'a' can't be a symbol. Symbols do not have to act like variables unless they are restricted. Mathematica will let you do just that. It is left up to us to mix symbols and equations correctly. There - I have shook a proverbial stick at the subject :) jdh -----Original Message----- From: Otto Linsuain <linsuain+ at andrew.cmu.edu> To: mathgroup at smc.vnet.net <jdh at hend.net> Subject: [mg24623] Re: [mg24599] Re: More about l`Hopital`s rule > > Excerpts from mail: 25-Jul-100 [mg24599] Re: More about l`.. by John >Hendrickson at hend.ne >> In[]:=Limit[(a^2 - a x)/(a - PowerExpand[Sqrt[a x] ]), x -> a] >> Out[]:=2a >> >> Hmm.. Why? In the help (3.6.8 Finding Limits) we are told that if Limit has >> no information on a symbol (variable or function) it will leave it >> unevaluated (the Mathematica kernel default). Ahh... so probably: >> 0 / Sqrt[a x] == 0 >> just as >> 0 / x == 0 >> and Limit[] stops there, of course, assuming that 0/x == 0. >> >> Why? "1.5.13 Advanced Topic: Generic and Non-Generic Cases" we are told that >> 0/x ==0 when x is not defined (and the reason is explained). >> >> Ahh... but something else is just as important. Arguements to Mathematica >> functions WILL BE SIMPLIFIED unless you explicitely ask it not to be with >> most Mathematica functions. And that certainly can cause unexpected >> answers. Some Mathematica functions (I think Limit[] is one) hold your >> parameters just so they won't be evaluated. "Limit[ Unevaluated[ expr] ]" >> would ensure that your expr wouldn't be evaluted, per say, before entering >> the function. >> >> In[]:= >> InputForm[Limit[FullSimplify[(a^2 - a*x)/(a - Sqrt[a*x])], x -> a]] >> Out[]= >> a + Sqrt[a^2] >> >> Just out of interest: I unthinkingly tried the following two inputs and >> wondered for a moment how you got your result. Finally, I tried your input, >> of course, and got a 0 just as you did. >> >> In[]:= >> Limit[(a^2 - a x) / (a - (a^(1/2) x^(1/2))), x -> a] >> Out[31]= >> >> 2 a >> >> In[]:= >> InputForm[(D[a^2 - a x, x]) / (D[a - (a^(1/2) x^(1/2)), x])] >> Out[32]//InputForm= >> 2*Sqrt[a]*Sqrt[x] >> In[]:= >> Limit[2*Sqrt[a]*Sqrt[x], x -> a] >> Out[]= >> >> 2 a >> > > John, I think what you are seing here, as well as in the rest of the >posting in this thread, is not the surprising results one can get with >Mathematica, but rather, the unexpected effects of extending the >relations we know to be true for real numbers to the entire complex >plane without stopping to think about branch cuts and Reiman sheets. One >could see the same effects with paper and pencil, if one were careful. > > When you enter a^(1/2) x^(1/2) or PowerExpand[Sqrt[a x]] you are going >to get different results than what you get when you enter Sqrt[a x]. The >reason is simple: > > Sqrt[a x] is not equal to a^(1/2) x^(1/2), but rather it is equal to > > (a x)^(1/2). These two expressions are not the same for arbitrary a and x. > > As for PowerExpand, the Mathematica documentation is clear: > > PowerExpand[(a b)^c] gives a^c b^c, it then explains: > > This expansion is correct only if c is an integer and a and b are >positive reals. PowerExpand always gives the expansion, so it >effectively makes those assumptions. > > I think Mathematica could give answers that are incorrect or incomplete >in this business, since it is rather tricky. But in all the examples I >have seen it is the human part who is being tricked, rather than >Mathematica. Well, it IS tricky. Otto Linsuain. > > -----Original Message----- From: Joaquín González de Echavarri <jge at clientes.euskaltel.es> To: mathgroup at smc.vnet.net Subject: [mg24623] More about l`Hopital`s rule >Different answers: > >In= Limit[(a^2 - a*x)/(a - Sqrt[a*x]), x -> a] > >Out= 0 > >In=Limit[Simplify[(a^2 - a*x)/(a - Sqrt[a*x])], x -> a] > >Out= 0 > >In= Limit[FullSimplify[(a^2 - a*x)/(a - Sqrt[a*x])], x -> a] > > 2 >Out= a + Sqrt[a ] > >Wrong answer: > >In= Limit[(Sqrt[x + a^2] - a)/(Sqrt[x + b^2] - b), x -> 0] > > 2 > a - Sqrt[a ] >Out= ------------ > 2 > b - Sqrt[b ] > >The right answer is b/a. > >Any suggestion? > >Joako > > > >

**Re: Speeding up Replacement Rules**

**running mathematica remotely**

**Re: Re: More about l`Hopital`s rule**

**Re: Re: More about l`Hopital`s rule**