Ask Your Question
1

derivatives of variable order

asked 2014-09-08 11:12:11 +0100

rws gravatar image

Using diff/derivative it does not seem easily possible to specify derivatives of variable order, e.g., to define a function P(m,n) that applies the diff m+n times to a polynomial:

sage: x=var('x')
sage: P(m,n)=derivative((1-x^2)^n,x,m+n)
...
TypeError: argument symb must be a symbol

sage: R.<x> = PolynomialRing(QQ, 'x')
sage: p=(1-x^2)^11
sage: P(m,n)=derivative(p,x,m+n)
...
ValueError: Cannot differentiate with respect to m + n

This is obviously because diff supports such syntactic sugar like diff(p,x,x,x). So how to differentiate to a variable order?

edit retag flag offensive close merge delete

Comments

Good question, but I'm not sure that is supported even by Ginac or Maxima...

kcrisman gravatar imagekcrisman ( 2014-09-08 14:16:35 +0100 )edit

If so, that leaves as only solution looping through single diffs.

rws gravatar imagerws ( 2014-09-08 17:13:47 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-09-08 17:52:53 +0100

god.one gravatar image

Don't know if this helps but

x=var('x')
def P(f,m,n):
    return derivative(f,x,m+n)
f=x^20
P(f,1,2)

works fine with sagenb.org

edit flag offensive delete link more

Comments

So it needed a Python def, not a Sage function. Thanks!

rws gravatar imagerws ( 2014-09-09 08:17:58 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-09-08 11:12:11 +0100

Seen: 758 times

Last updated: Sep 08 '14