Coefficient function is slow
问题 Please consider: Clear[x] expr = Sum[x^i, {i, 15}]^30; CoefficientList[expr, x]; // Timing Coefficient[Expand@expr, x, 234]; // Timing Coefficient[expr, x, 234]; // Timing {0.047, Null} {0.047, Null} {4.93, Null} Help states: Coefficient works whether or not expr is explicitly given in expanded form. Is there a reason why Coefficient needs to be so slow in the last case? 回答1: Coefficient will not expand unless it deems it absolutely necessary to do so. This does indeed avoid memory explosions