Skip to content

series doesn't work well with Subs #26858

Open
@KPCCoiL

Description

series is sometimes wrong when Subs is involved. For instance:

Python 3.12.4 (main, Jul 25 2024, 17:11:12) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sympy as s
>>> s.init_printing(pretty_print=True)
>>> x = s.symbols("x")
>>> f = s.symbols("f", cls=s.Function)
>>> exp1 = f(x + 1).diff(x)
>>> exp1d        ⎞│
⎜───(f(ξ₁))⎟│
⎝₁       ⎠│ξ=x + 1
>>> exp2 = x * f(x + 1).diff(x)
>>> exp2d        ⎞│
x⋅⎜───(f(ξ₁))⎟│
  ⎝₁       ⎠│ξ=x + 1
>>> exp1.series(x)
⎛ d        ⎞│
⎜───(f(ξ₁))⎟│
⎝₁       ⎠│ξ=x + 1
>>> exp2.series(x)
   d6x⋅───(f(ξ₁)) + Ox

exp1 is not expanded, and in the expansion of exp2 the dummy variable ξ₁ is exposed.

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions