Hi, Wow, thanks for the extremely rapid and helpful response + patch!
> In [2]: print f(5*x).diff(x) > 5*D(f(5*x), 5*x) But I am not sure how this notation can work in the general case. How should sympy handle this input: In [3]: f(x,5*x).diff(x) or even just: In [4]: f(x,x).diff(x) I tried this in your development version, and get results that I "kind of understand", but which are not formally correct. For example: In [5]: f(x,x).diff(x) Out [5]: 2*D(f(x,x),x) I would expect something like this: In [6]: f(x,x).diff(x) Out [6]: D(f(x_1,x),x1).subs(x_1,x) + D(f(x,x_2),x_2).subs(x_2,x) > What remains to be done is to improve the Derivative class to > represent the substitution, [...] When we teach > Derivative(x**2, x).subs(x, 0) to behave like a number, then > all should work as expected. Right, a proper handling of substitutions appear to be related also to the solution to the above issue. Currently one cannot even input the expression in Out[6] above without the substitutions just falling away. > Any ideas? I think we just need another argument to be added to > Derivative --- the point of differentiation and that should be it. That sounds very reasonable. So, its either that -- allowing Derivative to represent both a derivative and subsequent substitution -- or to make sure subs can stay unevaluated in expressions. To keep the ability of Derivative to represent more than one derivative, while adding the ability to represent a point of differentiation, it seems something as fancy as this is needed: In [7]: f(x,x).diff(x) Out [7]: Derivative(f(x_1,x),(x_1,x)) + Derivative(f(x,x_2),(x_2,x)) Or perhaps this is nicer: In [8]: f(x,x).diff(x) Out [8]: Derivative(f(x_1,x),x_1==x) + Derivative(f(x,x_2),x_2==x) (But would that work, or will there be an issue with x_1==x evaluating to False?) Best regards, Rickard --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sympy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sympy?hl=en -~----------~----~----~----~------~----~------~--~---