-
-
Notifications
You must be signed in to change notification settings - Fork 673
Description
The documentation of function() is incomplete and confusing.
For example, none of the methods described in http://www.sagemath.org/doc/reference/calculus/sage/symbolic/function_factory.html show up when I type:
function?
The distinction between
f = function('f')
and
f = function('f', x)
is also not documented. See also #17445 for sources of confusion. Need to explain what happens in the second case above (f = function('f',x)
). A symbolic function f
is first created and then overwritten by the expression f
?
See the following example, where f is first an expression, then becomes redefined to a function in the background, but does not contain any information about its variables.
sage: f = function('f', x); print type(f)
<type 'sage.symbolic.expression.Expression'>
sage: fx = function('f',x); print type(f)
<class 'sage.symbolic.function_factory.NewSymbolicFunction'>
sage: f.variables()
()
sage: fx.variables()
(x,)
See http://ask.sagemath.org/question/9932/how-to-substitute-a-function-within-derivatives/?answer=14752#post-id-14752 for a possible start at how to explain this, at least for those writing this.
CC: @nbruin @kcrisman @sagetrac-tmonteil @zimmermann6
Component: documentation
Author: Nils Bruin, Ralf Stephan
Branch/Commit: 7c029f3
Reviewer: Ralf Stephan, Nils Bruin
Issue created by migration from https://trac.sagemath.org/ticket/17447