Comment #35 on issue 1816 by asmeurer: Adding partial derivatives and taking derivatives with respect to functions
http://code.google.com/p/sympy/issues/detail?id=1816

From that Wikipedia page you reference: "However, all that is meant by this notation is the derivative of the function L(x,v,t) with respect to its second argument."

So I think that if we just assert that expr.diff(function) is a **notational/syntactic shortcut** to expr.subs(function, Dummy('x')).diff(Dummy('x')).subs(Dummy('x'), function) (pretend those Dummys are all the same), then this will all make sense.

The reason is that if you consider an expression to be a function of some Function in the expression, say F(f(x)), then F(u) means exactly the same thing as expr.subs(f(x), u) in SymPy. This too is technically a notational convenience, as you really must be defining it the second way first. But in this case it makes sense from a notational point of view to define it as F(f(x)) with the clear understanding that this just means F(u) at u=f(x) with f(x) replaced with u as it appears in the way that F is written. Of course, such strange things as "the way it is written" can be made precise in a system like SymPy, so a subtle notational abuse like this can actually become a notational convention instead in our case (or syntactical convention, if you prefer).

And of course (it seems I am saying this every time), this should be well explained in the documentation.

--
You received this message because you are subscribed to the Google Groups 
"sympy-patches" group.
To post to this group, send email to sympy-patches@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-patches+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy-patches?hl=en.

Reply via email to