We have previously described how an expression can be differentiated with respect to a varaible; however, we have also discussed function algebra. To differentiate a function, we will use the D operator.
[> diff( cos(x), x );
$-sin(x)$
[> diff( sec(x) + 2*csc(x) + 3*cot(x) + 4 );
$-3 \cot(x)^2 - 2 \cot(x) \csc(x) + \sec(x) \tan(x) - 3$
[> p := x^3 + 5*x^2 + 2*x + 1;
[> diff( t^3 + 5 t^2 + 2 t + 1, t );
$3 t^2 + 10 t + 2$
[> eval( diff( 3*sin(2*x), x ), x = 1 ); # Evaluate the derivative at 1
$6 \cos(2)$
If Maple does not know anything about the function, it will return unevaluated:
[> diff( sin(t) + y(t) + 1, t );
$\cos(t) + \frac{d}{dt}y(t)$
[> diff( sin( 2*x ), x )
$2 \cos(2x)$
You can calculate higher derivatives by using multiple variables with which the differentiation should occur:
[> diff( sin(2*x), x, x, x, x );
$16 \sin(2 x)$