Skip to content

Add Expression.coefficient(...expand=True) keyword #20824

Open
@rwst

Description

@rwst

There is no reason why there should be different results:

sage: (x*(x*y+y^2)).coefficient(x)
y
sage: (x*(x*y+y^2)).coefficient(x,2)
0
sage: (x*(x*y+y^2)).expand().coefficient(x)
y^2
sage: (x*(x*y+y^2)).expand().coefficient(x,2)
y

This would also be unsurprising for Mma users, see #9505 comment:6

Maybe add keyword expand=True.

Component: symbolics

Author: Ralf Stephan

Branch/Commit: u/rws/20824 @ 7ab049f

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

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