Gradient (grad)
Gradient of an expression: the list of its partial derivatives.
How to write it
grad(f, variables)
- f
- The expression or function to work on. Takes an expression.
- variables
- The variables, in brackets. Takes a list of variables.
Examples
grad(x^2 + y^2, [x, y])In the solver,
Open in the solvergrad(x^2 + y^2, [x, y])gives[2x, 2y].
Related functions
- hessian
Hessian matrix of an expression: its second partial derivatives.
- div
Divergence of a vector field.
- integrate
Antiderivative of an expression, or its definite integral over a range.
- diff
Derivative of an expression with respect to one or more variables.
- jacobian
Jacobian matrix of a list of expressions: their partial derivatives.
- derivative
The derivative operator: derivative(n) is of order n, derivative(0, 1) is the partial in the second argument.