Previous Up Next

2.17.5  Derivative and partial derivative

diff or derive may have one or two arguments to compute a first order derivative (or first order partial derivative) of an expression or of a list of expressions, or several arguments to compute the n-th partial derivative of an expression or list of expressions.

Derivative and first order partial derivative : diff derive deriver

diff (or derive) takes two arguments : an expression and a variable (resp a vector of the variable name) (see several variable functions in 2.50). If only one argument is provided, the derivative is taken with respect to x
diff (or derive) returns the derivative (resp a vector of derivative) of the expression with respect to the variable (resp with respect to each variable) given as second argument.
Examples :

Derivative and n-th order partial derivative : diff derive deriver

derive (or diff) may take more than two arguments : an expression and the names of the derivation variables (each variable may be followed by $n to indicate the number n of derivations).
diff returns the partial derivative of the expression with respect to the variables given after the first argument.

The notation $ is usefull if you want to derive k times with respect to the same variable, instead of entering k times the same variable name, one enters the variable name followed by $k, for example x$3 instead of (x,x,x). Each variable may be followed by a $, for example diff(exp(x*y),x$3,y$2,z) is the same as diff(exp(x*y),x,x,x,y,y,z)
Examples

Remark


Previous Up Next