# nthd(y,x) is the nth derivative of y to x; # assume n is natural number 0,1,2,...,n ; nthd2(a_*b_,x_):=if(isfree(a,x), a*nthd(b,x), if(b==x, d(a*x,x,n),sum(binomial(n,k)*d(a,x,n-k)*d(b,x,k),k,0,n) )); nthd2(a_+b_,x_):=nthd2(a,x)+nthd2(b,x); nthd2(a_*b_*c_,x_):=if(isfree(a,x),a*nthd2(b*c,x)); nthd2(y_):= nthd2(y,x);