Skip to content

serious bug in _maxima_init_ method for formal derivatives with new symbolics #6376

@williamstein

Description

@williamstein
sage: f(x) = function('f',x)
sage: g = f(-x).diff(x); g
-D[0](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()

to

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.

CC: @golam-m-hossain @mwhansen

Component: calculus

Issue created by migration from https://trac.sagemath.org/ticket/6376

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions