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

• To: mathgroup at smc.vnet.net
• Subject: [mg76325] Re: Integrate[Log[a]+...+O[a]^n,x]
• From: dimitris <dimmechan at yahoo.com>
• Date: Sat, 19 May 2007 04:52:59 -0400 (EDT)
• References: <f2jvri\$dov\$1@smc.vnet.net>

```I think it is a wierd bug.
Well down for discovering it!

Try something like the following

In:=
(Integrate[Normal[Log[a] + 2*q*a*x^2 + 3*w*a^2*x + O[a]^4 + x], #1]
& ) /@ {x, a}
(Integrate[O[a]^4, #1] & ) /@ {x, a}
{D[%[], x], D[%[], a]}

Out=
{x^2/2 + (3/2)*a^2*w*x^2 + (2/3)*a*q*x^3 + x*Log[a], -a + a*x +
a^3*w*x + a^2*q*x^2 + a*Log[a]}

Out=
{SeriesData[a, 0, {}, 4, 4, 1], SeriesData[a, 0, {}, 5, 5, 1]}

Out=
{SeriesData[a, 0, {x^2/2 + x*Log[a], (2*q*x^3)/3, (3*w*x^2)/2}, 0, 4,
1], SeriesData[a, 0, {-1 + x + Log[a], q*x^2, w*x}, 1, 5, 1]}

Out=
{SeriesData[a, 0, {x + Log[a], 2*q*x^2, 3*w*x}, 0, 4, 1],
SeriesData[a, 0, {x + Log[a], 2*q*x^2, 3*w*x}, 0, 4, 1]}

Dimitris

/  Lev Bishop       :
> 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:= 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= (-1+x+Log[a]) a+q x^2 a^2+w x a^3+O[a]^5
> Out= (-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:= 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= x^2/2+2/3 q x^3 a+3/2 w x^2 a^2+O[a]^4
> Out= 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

```

• Prev by Date: Re: A harmless and amusing bug
• Next by Date: Re: Re: Mouse movement speeds up and CityData