Integrate[Log[a]+...+O[a]^n,x]

*To*: mathgroup at smc.vnet.net*Subject*: [mg76250] Integrate[Log[a]+...+O[a]^n,x]*From*: "Lev Bishop" <lev.bishop at gmail.com>*Date*: Fri, 18 May 2007 06:20:43 -0400 (EDT)

I just spent some time tracking down a strange problem in my code. I wonder if anyone has seen something like this. It seems that Integrate[] gets confused about which variable it is integrating over, when you give it a series to integrate: In[827]:= Integrate[Log[a]+2q a x^2+3w a^2x+O[a]^4+x,x] Integrate[Log[a]+2q a x^2+3w a^2x+O[a]^4+x,a] Out[827]= (-1+x+Log[a]) a+q x^2 a^2+w x a^3+O[a]^5 Out[828]= (-1+x+Log[a]) a+q x^2 a^2+w x a^3+O[a]^5 It seems that in both cases Integrate actually used a as the variable, even though I asked for x in the first case. I see this with version 5.2 and 6.0. Without the Log[a] term it all works as expected: In[829]:= Integrate[2q a x^2+3w a^2x+O[a]^4+x,x] Integrate[2q a x^2+3w a^2x+O[a]^4+x,a] Out[829]= x^2/2+2/3 q x^3 a+3/2 w x^2 a^2+O[a]^4 Out[830]= x a+q x^2 a^2+w x a^3+O[a]^5 Or am I misunderstanding the use of O[] in mathematica, or is this a bug? After all, the strict mathematical interpretation of O[] as big-O notation has that "O(x^4) is f(x) + O(x^5) as x->inf" from which point of view, mathematica is strictly correct there, just not giving the tightest bound it could, and throwing some misleading terms in as well. On the other hand, I don't get the idea that the O[n] is supposed to be interpreted as mathematical 'big-O' O(n), but rather as the lowest order missing term in a truncated Taylor/Laurent/Puiseux/etc series expansion. Lev