Open
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)
>>> exp1
⎛ d ⎞│
⎜───(f(ξ₁))⎟│
⎝dξ₁ ⎠│ξ₁=x + 1
>>> exp2 = x * f(x + 1).diff(x)
>>> exp2
⎛ d ⎞│
x⋅⎜───(f(ξ₁))⎟│
⎝dξ₁ ⎠│ξ₁=x + 1
>>> exp1.series(x)
⎛ d ⎞│
⎜───(f(ξ₁))⎟│
⎝dξ₁ ⎠│ξ₁=x + 1
>>> exp2.series(x)
d ⎛ 6⎞
x⋅───(f(ξ₁)) + O⎝x ⎠
dξ₁
exp1
is not expanded, and in the expansion of exp2
the dummy variable ξ₁
is exposed.