Getting 'partial' rather than 'D' notation for derivatives

3,258 views
Skip to first unread message

Mike Witt

unread,
Jan 24, 2010, 12:29:32 PM1/24/10
to sage-s...@googlegroups.com
It seems to me I saw information somewhere on how to get:

foo=function('foo',x,y)
latex(diff(foo,y))

To give the 'partial' notation rather than 'D' notation.
I hope that makes sense. The idea is that I'd like something on
the order of "\frac{\partial}{\partial y} foo" ...

Anyway, I can't find the information about this now, and I wonder
if someone could point me to the relevant documentation or thread.

Thanks!

-Mike

Nils Bruin

unread,
Jan 24, 2010, 5:36:51 PM1/24/10
to sage-support
On Jan 24, 9:29 am, Mike Witt <msg...@gmail.com> wrote:
> To give the 'partial' notation rather than 'D' notation.
> I hope that makes sense. The idea is that I'd like something on
> the order of "\frac{\partial}{\partial y} foo" ...
>
> Anyway, I can't find the information about this now, and I wonder
> if someone could point me to the relevant documentation or thread.

This was discussed before in:

http://groups.google.ca/group/sage-support/browse_thread/thread/d7520e53b492f878/0dfb76b4d21dbb47

The problem arises when you want to print:

D[0](f)(g(x,y),h(x,y))

In this situation, the "first variable" for f does not have a natural
name, so it is hard to come up with a sensible "partial derivative"
print form. Earlier threads already pointed out that even cases like

D[0](f)(x,h(x,y))

do not equal the simplistic guess (df/dx)(x,h(x,y)). The chain rule
really is the culprit here. The form

(df/du1)(u1,u2)|_{\{u1=x,u2=h(x,y)\}}

would be a possibility and could be done with some default choice for
the variable name (here u). The code could then develop further by
adding heuristics for choosing more sensible variable names and
situations where the "evaluated at" clause can be collapsed.

Reply all
Reply to author
Forward
0 new messages