Maple help on "Diff"

diff or Diff - Differentiation or Partial Differentiation

Calling Sequence:

     diff(a, x1, x2, ..., xn)

     Diff(a, x1, x2, ..., xn)

     diff(a, [x1, x2, ..., xn])

     Diff(a, [x1, x2, ..., xn])

Parameters:

     a               - an algebraic expression

     x1, x2, ..., xn - names

Description:

·        diff computes the partial derivative of the expression a with respect to x1, x2, ..., xn, respectively. The most frequent use is diff(f(x),x), which computes the derivative of the function f(x) with respect to x.

·        Note that where n is greater than 1, the call to diff is the same as diff called recursively. Thus diff(f(x), x, y); is equivalent to the call diff(diff (f(x), x), y).

·        diff has a user interface that will call the user's own differentiation functions. If the procedure `diff/f` is defined then the function call diff(f(x, y, z), y) will invoke `diff/f`(x,y,z,y) to compute the derivative. See example below.

·        The sequence operator $ is useful for forming higher-order derivatives. diff(f(x),x$4), for example, is equivalent to diff(f(x),x,x,x,x) and diff(g(x,y),x$2,y$3) is equivalent to diff(g(x,y),x,x,y,y,y)

·        The names with respect to which the differentiation is to be done can also be given as a list of names. This format allows for the special case of differentiation with respect to no variables, in the form of an empty list. In this case, the result is simply the original expression, a. This format is especially useful when used together with the sequence operator and sequences with potentially zero variables.

·        If the derivative cannot be expressed (if the expression is an undefined function), the diff function call itself is returned. (The prettyprinter displays the diff function in a two-dimensional d/dx format.)

·        The diff command assumes that partial derivatives commute.

·        The capitalized function name Diff is the inert diff function, which simply returns unevaluated. The prettyprinter understands Diff to be equivalent to diff for printing purposes but formats the derivative in black to visually distinguish the inert case.

·        The differential operator D is also defined in Maple; see D. For a comparison of D and diff see operators[D].

Examples:

> diff(sin(x),x);

> diff(sin(x),y);

> diff(sin(x),x$3);

> diff(x*sin(cos(x)),x);

> diff(tan(x),x);

> Diff(tan(x),x);

> Diff(tan(x),x) = diff(tan(x),x);

> diff(f(x),x);

> diff(f(x,y),x,y);

> diff(f(x,y),x,y) - diff(f(x,y),y,x);

These two forms are equivalent:

> diff(g(x,y,z),x,z,z);

> diff(g(x,y,z),[x,z,z]);

An empty list specifies no derivatives:

> diff(g(x,y,z),[]);

teach Maple how to differentiate f(g(x)) = diff(g(x),x)/f(x)^2

> `diff/f` := proc(g,x) diff(g,x)/f(x)^2 end proc:

diff(f(sin(x)),x);

See Also:

D, int, dsolve, $, implicitdiff, operators[D] 


 
back

Any questions or suggestions should be directed to
Michel Vallières at vallieres@physics.drexel.edu