Ticket #6376 (closed defect: duplicate)
serious bug in _maxima_init_ method for formal derivatives with new symbolics
|Reported by:||was||Owned by:||burcin|
|Cc:||gmhossain, mhansen||Work issues:|
sage: f(x) = function('f',x) sage: g = f(-x).diff(x); g -D(f)(-x) sage: g._maxima_init_() "(diff('f(x), x, 1))*(-1)"
Notice that the -x inside f is totally ignored! This is because of code in the derivative method around line 454 of sage/symbolic/expression_conversion.py
Changing the line
args = ex.args()
args = ex.operands()
"fixes" the problem, in that a NotImplementedError? gets raised, instead of a wrong result returned. This is way better than the current situation, and we better fix this asap.
A better fix of course is to implement proper conversion. mhansen wrote this code, so maybe it would be easy for him.