Re: A mistake by Mathematica?
- To: mathgroup at smc.vnet.net
- Subject: [mg67887] Re: [mg67796] A mistake by Mathematica?
- From: Bruce Miller <brucem at wolfram.com>
- Date: Tue, 11 Jul 2006 05:59:16 -0400 (EDT)
- References: <200607080855.EAA20385@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
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/
- Follow-Ups:
- Re: Re: A mistake by Mathematica?
- From: Andrzej Kozlowski <akoz@mimuw.edu.pl>
- Re: Re: A mistake by Mathematica?
- References:
- A mistake by Mathematica?
- From: "LordBeotian" <pokipsy76@ANTISPAMyahoo.it>
- A mistake by Mathematica?