# Using Integrate and then Series seem to produce a wrong result

Run this:

ClearAll["Global*"];
b[x_] := (a + e)^c[x];
v1 = Normal[Series[Integrate[b[x], x], {e, 0, 1}]]
v2 = Integrate[Normal[Series[b[x], {e, 0, 1}]], x]


to get this:

The first one is clearly wrong but the second one seems correct.

What am I missing or this is a bug in Mathematica?

I would not ask here but I need to perform some complicated transformations of integrals and this seems killing what I need to do. I am running 11.1.0.0 version of Mathematica. Does this work correctly in the most recent version?

• I can't follow what you are trying to do. For a start, what would you expect the Integrate[b[x], x] expression to return? Jan 20 at 3:02
• Obviously, I expect Integrate[b[x], x] to return, well, Integrate[b[x], x]. The transformations above are "trivial" for a human. Mathematica seems to fail in a Taylor expansion there. Jan 20 at 3:23
• I think you should report this case to Wolfram Jan 20 at 12:21
• @AlexeiBoulbitch I did. See my comment below in the accepted answer. Jan 20 at 12:42

I get the same in V13. It looks like a bug to me. However, if I request order 11, I get order 1:

ClearAll[a, b, c, e, x];
b[x_] := (a + e)^c[x];
v1 = Normal[Series[Integrate[b[x], x], {e, 0, 11}]]
v2 = Integrate[Normal[Series[b[x], {e, 0, 1}]], x]


I do not understand why.

• Yeah, it does look like a bug. Apparently 11 is a new 1 when doing a Taylor expansion over Integrate. Anything less than 11 results in not doing any Taylor expansion at all. 11 result in the first term, 12 in two terms and so on. Using 11 is a very unobvious workaround. I filed this as a bug with Wolfram. Jan 20 at 11:42
• @KonstantinKonstantinov Unsurprisingly, Asymptotic[Integrate[b[x], x], {e, 0, 1}] and Asymptotic[Integrate[b[x], x], {e, 0, 11}] behave like Series. Jan 21 at 17:13
• That's even more weird. Anyway, I went ahead with writing my own versions of integrate, derivative (instead of D), simplify and series. I need to do a mix of Taylor and variational calculus expansion at the same time and there seems to be nothing in Mathematica that can handle that nicely (not to mention the bug with Integrate`). Jan 21 at 20:43