Operators > Calculus Operators > Gradient Operator
The gradient operator returns the gradient of a scalar valued differentiable function of several variables. The components of the returned function are partial differentials of a given function by given variables:
You can calculate the gradient by any subset of variables. In the example above, the gradient is calculated for all the variables of the function. In the following example, the gradient is calculated only for a and c:
Operands
f(a,b,c) is a scalar-valued differentiable function of several variables. You can use a previously defined function or ad-hoc function.
Or
a, b, c... is a comma-separated list of variables. You can use any subset of the arguments of function f.
The list of variables is optional. If you do not include the list, Mathcad will calculate the gradient for all the function variables.
The gradient operator uses functions of several variables. Define these variables as a separate arguments of the function, as demonstrated above, or group them in a vector, as follows:
You can evaluate the gradient operator symbolically as demonstrated above. You can also evaluate it numerically if all variables have numeric values. For example, define and evaluate vector x as follows:
The defined values also apply for symbolic evaluation:
The list of arguments is not optional. Mathcad interprets f without an argument as a free variable and not as a function name.
For example, for the following function:
You can use:
But not
Or