Opened 6 years ago

Last modified 5 weeks ago

#22069 new defect

Coefficients of truncated series bug

Reported by: pluschny Owned by:
Priority: major Milestone:
Component: symbolics Keywords: coefficients
Cc: slelievre Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

This has been reported on AskSM.

At least in some cases coefficients() does not return the leading coefficient.

Example:

g = lambda x, n: (1 + x2)n + n*x*(1 + x2)(n - 1)

g(x,4).series(x,12).coefficients()

Returns:

[ [1, 0], [4, 1], [4, 2], [12, 3], [6, 4], [12, 5], [4, 6], [4, 7] ]

Compare with the deprecated coeffs() which returns correct values:

[ [1, 0], [4, 1], [4, 2], [12, 3], [6, 4], [12, 5], [4, 6], [4, 7], [1, 8] ]

Change History (4)

comment:1 Changed 6 years ago by rws

Just a hint, to expand expressions as g(x,4) you better use expand instead of series. The bug seems associated with truncated series so this is also a workaround.

comment:2 Changed 6 years ago by rws

Component: algebrasymbolics

comment:3 Changed 6 years ago by rws

Summary: CoefficientsCoefficients of truncated series bug

comment:4 Changed 5 weeks ago by mkoeppe

Milestone: sage-7.5
Note: See TracTickets for help on using tickets.