# Incorrect truncation of a series expansion

What is wrong here?

fExp = f0 + f1 Sqrt[s] + f2 s + O[s]^(3/2);
{s fExp + O[s]^(3/2),s f + O[s]^(3/2)/.f->fExp}


Returns

{SeriesData[s, 0, {f0}, 2, 3, 2], SeriesData[s, 0, {}, 3, 3, 2]}


or f0 s+O(s^(3/2)) and O(s^(3/2))} in a traditional form. The latter result is incorrect.

• In version 12.1 the second result is SeriesData[s, 0, {f0, f1}, 2, 4, 2]. – Daniel Lichtblau Sep 15 '20 at 0:15
• @DanielLichtblau your result is better but still not the answer I would expect. I'm on version 11.0 currently. So this could be a bug in that older version? – Weather Report Sep 15 '20 at 7:17
• (1) 11.0 shows the empty series. 11.1 has three terms, and that persists until version 12.1. – Daniel Lichtblau Sep 15 '20 at 14:34
• (2) Placing a SeriesData inside another that has the same variable is a recipe for trouble. Internal operations to unwind this may raise an order term to the nearest larger integer, for example. – Daniel Lichtblau Sep 15 '20 at 14:36
• I do not recommend composing by substituting a SeriesData object into a coefficient of a different SeriesData object. ComposeSeries might be more along the lines of what you need, maybe. – Daniel Lichtblau Sep 15 '20 at 20:00