Hi again,

There were long discussion about the typesetting of partial derivatives
in the new system, but I don't think we got to a conclusion yet. The
previous thread is here:

http://groups.google.com/group/sage-devel/browse_thread/thread/7479c3eeb96348a2


I agree that this is annoying and trivial to typeset better:

sage: version()
'Sage Version 4.0.1, Release Date: 2009-06-06'
sage: f = function('f')
sage: f(x).derivative(x,5)
D[0, 0, 0, 0, 0](f)(x)


However, how to typeset these is not so clear:

sage: f(x+2*y).derivative(x,2)
D[0, 0](f)(x + 2*y)
sage: f(x+2*y).derivative(y,2)
4*D[0, 0](f)(x + 2*y)

In these examples, keep in mind that we did not define what the first
argument of the function is called, so we can't just replace D[0, 0]
with d/dx.

The power of this notation is seen mainly with more than one argument:

sage: f(x+y, x-y).derivative(y)
D[0](f)(x + y, x - y) - D[1](f)(x + y, x - y)


Here is what MMA does:

In[1]:= D[F[x], x]

Out[1]= F'[x]

In[2]:= TeXForm[%]

Out[2]//TeXForm= F'(x)

In[3]:= D[F[x], x, x, x, x, x]

         (5)
Out[3]= F   [x]

In[4]:= TeXForm[%]

Out[4]//TeXForm= F^{(5)}(x)

In[5]:= D[F[x+2*y], x, x]

Out[5]= F''[x + 2 y]

In[6]:= TeXForm[%]

Out[6]//TeXForm= F''(x+2 y)

In[7]:= D[F[x+2*y], y, y]

Out[7]= 4 F''[x + 2 y]

In[8]:= TeXForm[%]

Out[8]//TeXForm= 4 F''(x+2 y)

In[9]:= D[F[x+y, x-y], y]

          (0,1)                  (1,0)
Out[9]= -F     [x + y, x - y] + F     [x + y, x - y]

In[10]:= TeXForm[%]

Out[10]//TeXForm= F^{(1,0)}(x+y,x-y)-F^{(0,1)}(x+y,x-y)


And Maple:

> diff(f(x),x);  
                                    d
                                    -- f(x)
                                    dx

> diff(f(x),x$5);
                                    5
                                   d
                                   --- f(x)
                                     5
                                   dx

> diff(f(x+2*y), y$2);
                                 (2)
                             4 (D   )(f)(x + 2 y)

> convert(%, diff);
                            /  2       \|
                            | d        ||
                          4 |---- f(t1)||
                            |   2      ||
                            \dt1       /|t1 = x + 2 y

> diff(f(x+y, x-y), y);
                 D[1](f)(x + y, x - y) - D[2](f)(x + y, x - y)

> convert(%, diff);
                 D[1](f)(x + y, x - y) - D[2](f)(x + y, x - y)



I like the way MMA handles this. It's compact and consistent. So I
suggest we change things to use the MMA convention.


Comments?


Cheers,
Burcin

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to