Prev: inconsistent synatx for FillingStyle and PlotStyle? or How to make vertical lines in ListPlot have diffenent colors?
Next: MathematicaMark7: slow core i7/xeon matrix multiplication
From: kostka on 8 Sep 2009 05:58 Okay it took me an hour to track this down, and the only explanation I can see is that there is a bug in Mathematica v7 with Integral[] with multiple bounds. In v7.0 (answers should both be 512/27, only one of them is): In[1]:= f = (x - 1)^2*(y - 1)^2*(z - 1)^2; Integrate[f, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}] Integrate[Integrate[Integrate[f, {x, -1, 1}], {y, -1, 1}], {z, -1, 1}] Out[2]= 0 Out[3]= 512/27 In v6.0 (correct behavior): In[1]:= f = (x - 1)^2*(y - 1)^2*(z - 1)^2; Integrate[f, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}] Integrate[ Integrate[Integrate[f, {x, -1, 1}], {y, -1, 1}], {z, -1, 1}] Out[2]= 512/27 Out[3]= 512/27 Serious bug, right? Or am I missing something obvious? Tim
From: dh on 9 Sep 2009 04:33 Hi, you are right: serious bug. Would send a note to Wolfram. Daniel kostka wrote: > Okay it took me an hour to track this down, and the only explanation I > can see is that there is a bug in Mathematica v7 with Integral[] with > multiple bounds. > > In v7.0 (answers should both be 512/27, only one of them is): > > In[1]:= f = (x - 1)^2*(y - 1)^2*(z - 1)^2; > Integrate[f, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}] > Integrate[Integrate[Integrate[f, {x, -1, 1}], {y, -1, 1}], {z, -1, 1}] > > Out[2]= 0 > > Out[3]= 512/27 > > > In v6.0 (correct behavior): > > In[1]:= f = (x - 1)^2*(y - 1)^2*(z - 1)^2; > Integrate[f, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}] > Integrate[ > Integrate[Integrate[f, {x, -1, 1}], {y, -1, 1}], {z, -1, 1}] > > Out[2]= 512/27 > > Out[3]= 512/27 > > > Serious bug, right? Or am I missing something obvious? > > Tim >
From: Bob Hanlon on 9 Sep 2009 04:34 I see the same result on my system $Version 7.0 for Mac OS X x86 (64-bit) (February 19, 2009) For other cases where the order of integration is important, you should note that the two cases that you gave have different orders of integration. The iterator for the outer most integration comes first inside a multiple integration. However, in this case the order is not the cause of the problem. Bob Hanlon ---- kostka <kostka(a)gmail.com> wrote: ============= Okay it took me an hour to track this down, and the only explanation I can see is that there is a bug in Mathematica v7 with Integral[] with multiple bounds. In v7.0 (answers should both be 512/27, only one of them is): In[1]:= f = (x - 1)^2*(y - 1)^2*(z - 1)^2; Integrate[f, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}] Integrate[Integrate[Integrate[f, {x, -1, 1}], {y, -1, 1}], {z, -1, 1}] Out[2]= 0 Out[3]= 512/27 In v6.0 (correct behavior): In[1]:= f = (x - 1)^2*(y - 1)^2*(z - 1)^2; Integrate[f, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}] Integrate[ Integrate[Integrate[f, {x, -1, 1}], {y, -1, 1}], {z, -1, 1}] Out[2]= 512/27 Out[3]= 512/27 Serious bug, right? Or am I missing something obvious? Tim
From: guerom00 on 9 Sep 2009 04:34 Yeah, funny. In[12]:= f=(x-1)^2 (y-1)^2 (z-1)^2; Integrate[f,{x,-1,1},{y,-1,1},{z,-1,1}] NIntegrate[f,{x,-1,1},{y,-1,1},{z,-1,1}] Out[13]= 0 Out[14]= 18.962962945415
From: Sjoerd C. de Vries on 9 Sep 2009 04:35
Looks like a bug to me. I'd suggest submitting this to support(a)wolfram.com. Please note that Integrate[f, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}] equals Integrate[Integrate[Integrate[f, {z, -1, 1}], {y, -1, 1}], {x, -1, 1}] and not Integrate[Integrate[Integrate[f, {x, -1, 1}], {y, -1, 1}], {z, -1, 1}] (outermost integrand is given first). This should not make a difference in this case though. Cheers -- Sjoerd On Sep 8, 11:58 am, kostka <kos...(a)gmail.com> wrote: > Okay it took me an hour to track this down, and the only explanation I > can see is that there is a bug in Mathematica v7 with Integral[] with > multiple bounds. > > In v7.0 (answers should both be 512/27, only one of them is): > > In[1]:= f = (x - 1)^2*(y - 1)^2*(z - 1)^2; > Integrate[f, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}] > Integrate[Integrate[Integrate[f, {x, -1, 1}], {y, -1, 1}], {z, -1, 1}] > > Out[2]= 0 > > Out[3]= 512/27 > > In v6.0 (correct behavior): > > In[1]:= f = (x - 1)^2*(y - 1)^2*(z - 1)^2; > Integrate[f, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}] > Integrate[ > Integrate[Integrate[f, {x, -1, 1}], {y, -1, 1}], {z, -1, 1}] > > Out[2]= 512/27 > > Out[3]= 512/27 > > Serious bug, right? Or am I missing something obvious? > > Tim |