answered 10 years ago
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