求微分
diff(函数) , 求的一阶导数;
diff(函数, n) , 求的n阶导数(n是具体整数);
diff(函数,变量名), 求对的偏导数;
diff(函数, 变量名,n) ,求对的n阶偏导数;
>>syms x b
>>S1 = '6*x^3-4*x^2+b*x-5';
>>S2 = 'sin(a)';
>>S3 = '(1 - t^3)/(1 + t^4)';
>>diff(S1)
ans=18*x^2-8*x+b
>>diff(S1,2)
ans= 36*x-8
>>diff(S1,'b')
ans= x
>>diff(S2)
ans= cos(a)
>>diff(S3)
ans=-3*t^2/(1+t^4)-4*(1-t^3)/(1+t^4)^2*t^3
>>simplify(diff(S3))
ans= t^2*(-3+t^4-4*t)/(1+t^4)^2