Sponsored links: Algebra eBooks ### The Maxima on-line user's manual

Algebra Calculator

#### Search: Function: gradef (<f>(<x_1>, ..., <x_n>), <g_1>, ..., <g_m>) Function: gradef (<a>, <x>, <expr>) Defines the partial derivatives (i.e., the components of the gradient) of the function <f> or variable <a>.

`gradef (<f>(<x_1>, ..., <x_n>), <g_1>, ..., <g_m>)` defines `d<f>/d<x_i>` as <g_i>, where <g_i> is an expression; <g_i> may be a function call, but not the name of a function. The number of partial derivatives <m> may be less than the number of arguments <n>, in which case derivatives are defined with respect to <x_1> through <x_m> only.

`gradef (<a>, <x>, <expr>)` defines the derivative of variable <a> with respect to <x> as <expr>. This also establishes the dependence of <a> on <x> (via `depends (<a>, <x>)`).

The first argument `<f>(<x_1>, ..., <x_n>)` or <a> is quoted, but the remaining arguments <g_1>, ..., <g_m> are evaluated. `gradef` returns the function or variable for which the partial derivatives are defined.

`gradef` can redefine the derivatives of Maximas built-in functions. For example, `gradef (sin(x), sqrt (1 - sin(x)^2))` redefines the derivative of `sin`.

`gradef` cannot define partial derivatives for a subscripted function.

`printprops ([<f_1>, ..., <f_n>], gradef)` displays the partial derivatives of the functions <f_1>, ..., <f_n>, as defined by `gradef`.

`printprops ([<a_n>, ..., <a_n>], atomgrad)` displays the partial derivatives of the variables <a_n>, ..., <a_n>, as defined by `gradef`.

`gradefs` is the list of the functions for which partial derivatives have been defined by `gradef`. `gradefs` does not include any variables for which partial derivatives have been defined by `gradef`.

Gradients are needed when, for example, a function is not known explicitly but its first derivatives are and it is desired to obtain higher order derivatives.

There are also some inexact matches for `gradef`. Try `?? gradef` to see them.

```(%o1)                                true
(%i2) ```

### Related Examples

f(x,y):=(1.5-(1-y))^2...

g_1(1);

Calculate

E(x2,x3,x4):=(x2)^2+(...

g_1(1);

Calculate

E(x2,x3,x4):=(x2)^2+(...

g_1(1);

Calculate

f(x,y):=(1.5-(1-y))^2...

g_1(1);

Calculate

f(x,y):=x*y;

Calculate

E(x2,x3,x4):=(x2)^2+(...

g_1(1);

Calculate

f : (2*x + y^2 -1/z);

Calculate

Calculate

f: (2*x + y^2 -1/z);

f;

Calculate 