Updates:
Cc: [email protected]
Comment #9 on issue 2571 by asmeurer: Regression in Integral.subs
http://code.google.com/p/sympy/issues/detail?id=2571
So I see your issue, though.
There are two ideas of what subs should do. One is evaluating the
expression at a point, and the other is replacing all instances of
something in an expression with something else. This is why many CASs have
separate eval() and subs() functions. You are thinking of Integral(x,
x).subs(x, 5) as Integral(x, (x, 5)), but I am thinking of it as
Integral(x, x).replace(x, 5).
First, note that the first sense of interpretation doesn't even make sense
if old is not a Symbol, like Integral(exp(x*log(x)), x).subs(exp(x*log(x)),
x**x).
Either way, though, I think that we should always think of subs
structurally, i.e., as doing replacement, not mathematically. We never
have to have any kind of relation like old == new (it makes perfect sense
to say, e.g., subs(x, 2*x)). We just want to replace all instances of old
with new in an expression. To be sure, subs might make some mathematical
assumptions to be "smart" about this replacement (like assuming 2*x ==
2/3*(3*x)), but I think it's best to just think of this as "adding to the
structure," so to speak.
This works for derivatives and Subs because we say, basically, "hold off on
the substitution until the derivative is evaluated." It probably would
make more sense actually if diff(f(2*g(x)), x) returned something that is
itself a Derivative (analogous to Integral(expr, (x, point))). I think the
solution proposed at issue 1620 might be more along these lines.
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.