Skip to content

diff(f,t) should work even with Function objects #17701

@rwst

Description

@rwst
sage: t = var('t')
sage: sage: f = function('f')(t)
sage: diff(f,x,x)
0
sage: desolve(diff(f,t) - (f+1)/(t+1), f)
(_C - 1/(t + 1))*(t + 1)

sage: sage: f = function('f')
sage: diff(f,t) 
...
TypeError: unable to convert f to a symbolic expression
sage: diff(sin,t)
...
TypeError: unable to convert f to a symbolic expression

The same error can be had with the simple SR(sin), i.e., any function object in contrast to the resp. function call, which returns an Expression.

Since function objects can be used in other context it seems they should be part of symbolic expressions too. This ticket however will limit itself to giving a better error message in SR.coerce and handling Function objects in calculus/functional.py:derivative().

See also #15025

Component: calculus

Author: Ralf Stephan

Branch/Commit: u/rws/diff_f_t__should_work_even_with_function_objects @ 0cecec3

Reviewer: Travis Scrimshaw

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions