MathGroup Archive 2006

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

Search the Archive

Re: Re: A mistake by Mathematica?


On 11 Jul 2006, at 11:59, Bruce Miller wrote:

> On Jul 8, 2006, at 3:55 AM, LordBeotian wrote:
>
>> I have defined a function f[x,e] that is continuous in both  
>> variables.
>> Then I ask Mathematica to do this 2 operations:
>> 1) produce the series of f[x,0] up to 4th order
>> 2) produce the series of f[x,e] and then compute the limit of the
>> coefficient
>> for e->0
>> I think the results of both operation should be the same. Instead  
>> just
>> the
>> first coefficient is the same, the coefficient of x^3 different and
>> higher
>> order coefficient become infinity in the second computation!
>>
>> Is it a problem with the program itself or am I missing something?
>> Thank you.
>>
>> PS:
>> I don't think if it is relevant but the function is the following:
>> \!\(2*\((\(3\ e\^4\)\/2 + \ e\^5 + \ e\^6 - \(e\^2\ x\^2\)\/2 +
>> 1\/3\ e\^2\ x\^3 + x\^4\/24 + \(e\^2\ x\^4\)\/24 -
>> 1\/15\ e\^2\ x\^5 - x\^6\/720 - \(e\^2\ x\^6\)\/720)\)^\((1/2)\)\)
>> it is continuous but there is a square root.
>>
>
>
> There is something odd, probably in the Mathematics rather than
> Mathematica.  I hope one of the Mathematicians in the audience
> will contribute.
>
> In[1]:= $VersionNumber
>
> Out[1]=
> 5.2
>
> In[2]:= f[x_,e_] := 2*((3*e^4)/2 + e^5 + e^6 - (e^2*x^2)/2 +
>        (1/3)*e^2*x^3 + x^4/24 +
>        (e^2*x^4)/24 - (1/15)*e^2*x^5 - x^6/720 - (e^2*x^6)/720)^(1/2);
>
> In[3]:= f[0,0]
>
> Out[3]=
> 0
>
> In[4]:= ?Series
>
> Series[f, {x, x0, n}] generates a power series expansion for f
> about the point x = x0 to order (x - x0)^n.
> Series[f, {x, x0, nx}, {y, y0, ny}] successively finds series  
> expansions
> with respect to y, then x.
>
>
> In[5]:= s1 = Series[f[x,0],{x,0,4}]
>
> Out[5]=
>     2           4
>    x           x            5
> ------- - ---------- + O[x]
> Sqrt[6]   60 Sqrt[6]
>
>
>
> When the series is taken in e before x, the result has a term in 1/e.
>
> In[6]:= s2 = Series[f[x,e],{x,0,4},{e,0,4}]
>
> Out[6]=
>                                  4
>            2        2   3     5 e           5
> (Sqrt[6] e  + Sqrt[-] e  + --------- + O[e] ) +
>                     3       3 Sqrt[6]
>
>                                  2             3             4
>          1           e          e          13 e          37 e
> 5   2
>    (-(-------) + --------- + --------- - ---------- + ----------- +  
> O[e]
> ) x  +
>       Sqrt[6]    3 Sqrt[6]   6 Sqrt[6]   54 Sqrt[6]   648 Sqrt[6]
>
>          2         2
>     Sqrt[-]   Sqrt[-] e       2             3             4
>          3         3         e          13 e          37 e           5
> 3
>    (------- - --------- - --------- + ---------- - ----------- + O 
> [e] )
> x  +
>        3          9       9 Sqrt[6]   81 Sqrt[6]   972 Sqrt[6]
>
>                                                     2               3
>          1             1           5 e          65 e           163 e
>    (------------ + ---------- - ---------- + ------------ +  
> ------------
> -
>     18 Sqrt[6] e   12 Sqrt[6]   54 Sqrt[6]   1944 Sqrt[6]   3888  
> Sqrt[6]
>
>               4
>          461 e           5   4       5
>       ------------ + O[e] ) x  + O[x]
>       7776 Sqrt[6]
>
>
> In[7]:= ?Limit
>
> Limit[expr, x->x0] finds the limiting value of expr when x approaches
> x0.
>
> In[8]:= ls2 = Limit[Normal[s2],e->0]
>
> Out[8]=
>                  4
> Infinity Sign[x]
>
>
>
> Do the series expansion in x first.   No 1/e term.
>
> In[9]:= s3 = Series[f[x,e],{e,0,4},{x,0,4}]
>
> Out[9]=
>                                                                  2   2
>      2           4                                          Sqrt[-] x
>        3
>     x           x            5                       2           3
>    11 x
> (------- - ---------- + O[x] ) + (-Sqrt[6] + 2 Sqrt[-] x +  
> ---------- -
> ---------- -
>   Sqrt[6]   60 Sqrt[6]                               3          5
> 15 Sqrt[6]
>
>                                                       2            2
>              4                                14 Sqrt[-]   14 Sqrt 
> [-] x
>          2
>          13 x            5   2    4 Sqrt[6]           3            3
>     539 x
>       ------------ + O[x] ) e  + (--------- - ---------- -  
> ------------
> + ----------- +
>       1200 Sqrt[6]                    x           5             5
>   200 Sqrt[6]
>
>              3              4
>          53 x          419 x           5   4       5
>       ----------- - ------------ + O[x] ) e  + O[e]
>       300 Sqrt[6]   2400 Sqrt[6]
>
>
>
> THIS gives the expected limit.
>
> In[10]:= ls3 = Limit[Normal[s3],e->0]//Expand
>
> Out[10]=
>     2           4
>    x           x
> ------- - ----------
> Sqrt[6]   60 Sqrt[6]
>
>
> In[11]:= % - Normal[s1]
>
> Out[11]=
> 0
>
>
> Bruce Miller
> Technical Support
> Wolfram Research, Inc.
> support at wolfram.com
> http://support.wolfram.com/
>
>


Mathematica's Series function computes three kinds of series: Taylor  
Series, Laurent Series and Puiseux Series. The last type appear in  
expansions around branch points and other kinds of singular points.  
Puiseux series expansions can contain radicals, terms like 1/x or log 
[x] and other types. For example:

Series[Sqrt[x], {x, 0, 3}]

or

Series[x^(x^2), {x, 0, 3}]

are examples of Puiseux Series. (For more about  Puiseux Series see,  
for example, Basu, Pollack, Roy, "Algorithms in Real Algebraic  
Geometry", Springer 2003 page 64)
When you expand a function of several variables with singular points  
of the above type Puiseux series may appear, with one order of  
variables but not with the other. This seems to be what happens in  
the above case.

In general when expanding  non-meromorphic functions around branch  
points one can get complicated results and there is no reason to  
expect the same behaviour as in the case of holomorphic (or  
meromorphic) ones.
Also, often one can obtain better behaved series by using the method  
I used in my first response to this question than the method used above.

Andrzej Kozlowski


  • Prev by Date: Re: Defining operators containing derivatives
  • Next by Date: Re: Q Legendre orthogonal polynomials mistake
  • Previous by thread: Re: A mistake by Mathematica?
  • Next by thread: Redundant numerical input