Skip to content

rewrite buggy Expression.coefficients() without Maxima #20455

Closed
@rwst

Description

@rwst

At the moment the ex1.coefficients(ex2) method uses pexpect-Maxima to get a coefficient list of a symbolic expression ex1 when seen as a polynomial in ex2 but the list is wrong whenever the exponent of ex2 is nonnumeric:

sage: var('a, x')
(a, x)
sage: f = a*x - x^x
sage: f.coefficient(x^x)
-1
sage: f.coefficients(x)
[[-x^x, 0], [a, 1]]

It should not be difficult to rewrite coefficients using wildcard power search and the coefficient method (which doesn't use Maxima).

CC: @paulmasson

Component: symbolics

Issue created by migration from https://trac.sagemath.org/ticket/20455

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions