MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Limit computed incorrectly

  • To: mathgroup at smc.vnet.net
  • Subject: [mg103345] Re: Limit computed incorrectly
  • From: ADL <alberto.dilullo at tiscali.it>
  • Date: Wed, 16 Sep 2009 05:48:11 -0400 (EDT)
  • References: <h8g0fp$bqa$1@smc.vnet.net>

Adam, I did this test:

ClearAll[f];
f[k_?NumericQ, j_?NumericQ] := Limit[1 - k Sqrt[j x] + k x, x -> 3.1]

ClearAll[g];
g[k_?NumericQ, j_?NumericQ] := (1 + k Sqrt[j x] + k x) /. x -> 3.1

and g and f turn out to be numerically equal  (note the minus in f
before k) !

To appreciate they are equal, look at:
Plot3D[Chop[f[k, j] - g[k, j]], {k, -10, 10}, {j, 0, 10}, PlotRange ->
All]

So, Limit is changing the sign of the Sqrt function!
The value of x has no relevance at all.
Moreover, this only happens with Sqrt: other functions (e.g. Log) or a
generic power (Power[ j x, a ]) show no anomalous sign change.

It must be a sort of algebraic bug in Limit internals.

ADL

On Sep 12, 1:25 pm, Adam Weyhaupt <awey... at siue.edu> wrote:
> A colleague recently pointed out the following incorrect calculation  
> of a limit in Mathematica 7.0.1 on Mac OS X 10.4.11 (this occurs on  
> Windows as well, but this limit is calculated correctly in  
> Mathematica 6).
>
> In[1]:= Clear[k, x]
> (* the next two limits should be equal *)
> In[2]:= Limit[1 + k Sqrt[2 x ] + k x, x -> 3.1]
> Out[2]= 1. + 0.61002 k
> In[3]:= 1 + Limit[ k Sqrt[2 x ] + k x, x -> 3.1]
> Out[3]= 1 + 5.58998 k
>
> In[4]:= Limit[1 + k Sqrt[2 x ] + k x, x -> 31/10]
> Out[4]= 1 + (31/10 + Sqrt[31/5]) k
> In[5]:= 1 + Limit[ k Sqrt[2 x ] + k x, x -> 31/10]
> Out[5]= 1 + 1/10 (31 + 2 Sqrt[155]) k
> In[6]:= Simplify[% - %%]
> Out[6]= 0
>
> What's going on?  Is this a case of "don't mix symbolic and numeric  
> computation"?  I'm surprised to get a problem near 3.1, since we  
> don't seem to be near any obvious singularities.
>
> Thanks,
>
> Adam



  • Prev by Date: Mathematica Special Interest Group (Washington DC Area)
  • Next by Date: Re: LogLogPlot evaluates argument outside given range
  • Previous by thread: Limit computed incorrectly
  • Next by thread: Offline use of Paclets