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

Algebra Calculator

#### Search: #### Diff

Function: diff (<expr>, <x_1>, <n_1>, ..., <x_m>, <n_m>) Function: diff (<expr>, <x>, <n>)

Function: diff (<expr>, <x>)

Function: diff (<expr>) Returns the derivative or differential of <expr> with respect to some or all variables in <expr>.

`diff (<expr>, <x>, <n>)` returns the <n>th derivative of <expr> with respect to <x>.

`diff (<expr>, <x_1>, <n_1>, ..., <x_m>, <n_m>)` returns the mixed partial derivative of <expr> with respect to <x_1>, ..., <x_m>. It is equivalent to `diff (... (diff (<expr>, <x_m>, <n_m>) ...), <x_1>, <n_1>)`.

`diff (<expr>, <x>)` returns the first derivative of <expr> with respect to the variable <x>.

`diff (<expr>)` returns the total differential of <expr>, that is, the sum of the derivatives of <expr> with respect to each its variables times the differential `del` of each variable. No further simplification of `del` is offered.

The noun form of `diff` is required in some contexts, such as stating a differential equation. In these cases, `diff` may be quoted (as diff) to yield the noun form instead of carrying out the differentiation.

When `derivabbrev` is `true`, derivatives are displayed as subscripts. Otherwise, derivatives are displayed in the Leibniz notation, `dy/dx`.

Examples:

```          (%i1) diff (exp (f(x)), x, 2);
2
f(x)  d               f(x)  d         2
(%o1)       %e     (--- (f(x))) + %e     (-- (f(x)))
2                   dx
dx
(%i2) derivabbrev: true\$
(%i3) integrate (f(x, y), y, g(x), h(x));
h(x)
/
[
(%o3)                   I     f(x, y) dy
]
/
g(x)
(%i4) diff (%, x);
h(x)
/
[
(%o4) I     f(x, y)  dy + f(x, h(x)) h(x)  - f(x, g(x)) g(x)
]            x                     x                  x
/
g(x)```

For the tensor package, the following modifications have been incorporated:

(1) The derivatives of any indexed objects in <expr> will have the variables <x_i> appended as additional arguments. Then all the derivative indices will be sorted.

(2) The <x_i> may be integers from 1 up to the value of the variable `dimension` [default value: 4]. This will cause the differentiation to be carried out with respect to the <x_i>th member of the list `coordinates` which should be set to a list of the names of the coordinates, e.g., `[x, y, z, t]`. If `coordinates` is bound to an atomic variable, then that variable subscripted by <x_i> will be used for the variable of differentiation. This permits an array of coordinate names or subscripted names like `X`, `X`, ... to be used. If `coordinates` has not been assigned a value, then the variables will be treated as in (1) above.

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

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

### Related Articles

How to create Hessian matrix

### Related Examples

##### diff

diff(35*q^4 -84*q^5+7...

Calculate

##### diff-log

diff(log(y)*y,y);

Calculate

##### diff-exp-ic1-ode2

eq1:'diff(y,x)=5*y+ex...

solg: ode2(eq1,y,x);

solp: ic1(solg, x=2,y...

Calculate

##### diff-reveal-sqrt

eq : (x^(-1)) *(x^2 +...

eq1: diff(eq,x);

reveal(eq1,1);

Calculate

##### diff

(1-x^2)*diff(a*x^2+b*...

Calculate

##### diff

f : (L^2 - x0^2)^(1/2...

d : diff(f, x0);

Calculate

##### diff-sqrt

eq1:sqrt(0.9-2*y^3);

eq2:x+2=y;

diff(eq1,x);

Calculate

##### diff-log-sin

f(x,y) := e^(-y*sin(x));

[diff(f(x,y),x), diff...

log(e);

Calculate

eq1:x*4+y-2=y;

eq2:x+2=y;

diff(eq1, x);

Calculate

##### diff

diff(tanx,x);

Calculate 