Open twmr opened 11 years ago
It returns 0 because diff works symbolically, using those things that are in the expression, so re(r) is not there, hence, it gives 0. See the docstring of Derivative.
This requires some thought. We used this definition because that is what things like F(x, f(x), f'(x)).diff(f'(x)) mean (as opposed to some kind of chain rule). It may be a good idea to extend _diff_wrt to let it dispatch on diff. This also goes back to the whole dispatch question again.
Status: Valid
Labels: -Differentiation Type-Enhancement
Original comment: http://code.google.com/p/sympy/issues/detail?id=3920#c1 Original author: https://code.google.com/u/asmeurer@gmail.com/
Original issue for #7019: http://code.google.com/p/sympy/issues/detail?id=3920 Original author: https://code.google.com/u/t.hisch@gmail.com/