代码:syms x f=x*cos(x); diff(f,'x') 求一次导有ans=cos(x)-x*sin(x) 求三阶导代码:syms x f=x*cos(x); diff(f,'x',3) ans=-3*cos(x)+x*sin(x)