TransWikia.com

series expansion unpredictably dividing by leading coefficient

Mathematica Asked on November 23, 2021

When expanding the simple expression

expr = y^3

as a series in x, with

expand = y -> Sum[Subscript[y, j] x^j, {j, 1, 20}];

The behaviour of SeriesCoefficient and Series are unpredictable, for instance:

coeff11 = SeriesCoefficient[expr /. expand,{x,0,11}];
coeff12 = SeriesCoefficient[expr /. expand,{x,0,12}];

Then coeff11 is of polynomial form, but coeff12 has an overall Subscript[y, 1]^3 factored out, and many compensating divisions. So the result is correct but unnecessarily complicated:

LeafCount/@{coeff11, coeff12, Simplify[coeff11],Simplify[coeff12]}
(* {103, 409, 92, 111} *)

On the other hand using Series instead, it remains explicitly polynomial up to and including order 12, and from order 13 on it again factors out the leading term, not just at order 13 but starting at order 7.

Is this a bug? is there a way to prevent this? Or a version in which this doesn’t happen?
I’m using

$Version
(* "11.2.0 for Mac OS X x86 (64-bit) (September 11, 2017)" *)

(The reason I ask is that I want to do a series expansion of a more complicated expression to a high order, and want to limit the growth of complexity as much as possible, as this is the bottleneck in a computation.)

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP