#17445: Missing documentation of derivative operator/notation
-------------------------------+------------------------
       Reporter:  schymans     |        Owner:
           Type:  enhancement  |       Status:  new
       Priority:  major        |    Milestone:  sage-6.5
      Component:  symbolics    |   Resolution:
       Keywords:               |    Merged in:
        Authors:  schymans     |    Reviewers:
Report Upstream:  N/A          |  Work issues:
         Branch:               |       Commit:
   Dependencies:               |     Stopgaps:
-------------------------------+------------------------

Comment (by schymans):

 Replying to [comment:6 nbruin]:

 > The fact that `function('f')` and `function('f',x)` return different
 types of arguments is '''really''' bad. It prevents any convincing
 explanation of the distinction that is essential here, because the
 interface ''itself'' confuses the two different issues. On top of that, we
 have a lot of documentation that was written by people who were equally
 confused, so the calculus doc makes a good effort to confuse any new user
 too.

 Wow, the reason while I hesitated about adding documentation of the
 D-notation was that I thought it should go into the documentation of
 function() and then I found out that the documentation of function()
 itself is already incomplete and confusing. Should we open a ticket for
 that, too?
 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.
 Only now I realised that function('f') returns a function, while
 function('f',x) returns an expression. Furthermore, differentiation of a
 function is not supported, it needs to be converted to an expression
 first:
 {{{
 f = function('f')
 fx = function('f', x)
 print type(f)
 print type(fx)
 print type(f(x))
 print fx.diff()
 print f(x).diff()
 print f.diff()
 ///
 <class 'sage.symbolic.function_factory.NewSymbolicFunction'>
 <type 'sage.symbolic.expression.Expression'>
 <type 'sage.symbolic.expression.Expression'>
 D[0](f)(x)
 D[0](f)(x)
 Traceback (most recent call last):    print f(x).diff()
   File "", line 1, in <module>

   File "/tmp/tmpMe44Jp/___code___.py", line 9, in <module>
     exec compile(u'print f.diff()' + '\n', '', 'single')
   File "", line 1, in <module>

 AttributeError: 'NewSymbolicFunction' object has no attribute 'diff'
 }}}




 >
 > It's an entirely different issue, though. Apparently the documentation
 never ''explains'' what `D[0](f)(x)` means. We can do that independent of
 whether we go out of our way to confuse users about the distinction
 between functions and functions evaluated at ...

 If we modify the documentation of diff(), though, we should explain why
 f(x).diff() works but f.diff() does not.

--
Ticket URL: <http://trac.sagemath.org/ticket/17445#comment:8>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to