Ask Your Question

Revision history [back]

derivatives of variable order

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?