MATLAB: Having trouble finding a derivative

derivatives

Im fairly new to matlab and I keep getting the same error message.
When the following is entered: diff cot^2(sin theta)
I get:
Error using sym>convertExpression (line 2256) Conversion to 'sym' returned the MuPAD error: Error: Unexpected 'identifier'. [line 1, col 11]
Error in sym>convertChar (line 2167) s = convertExpression(x);
Error in sym>convertCharWithOption (line 2150) s = convertChar(x);
Error in sym>tomupad (line 1881) S = convertCharWithOption(x,a);
Error in sym (line 108) S.s = tomupad(x,'');
Error in char/diff (line 11) y = diff(sym(f),varargin{:});
Would appreciate any help or guidance thank you.

Best Answer

syms theta
diff( cot(sin(theta))^2, theta)