18. Differentiation

18.1 Functions and Variables for Differentiation

Returns a two-element list, such that an antiderivative of expr with
respect to x can be constructed from the list. The expression expr
may contain an unknown function u and its derivatives.

Let L, a list of two elements, be the return value of antid.
Then L[1] + 'integrate (L[2], x)
is an antiderivative of expr with respect to x.

When antid succeeds entirely,
the second element of the return value is zero.
Otherwise, the second element is nonzero,
and the first element is nonzero or zero.
If antid cannot make any progress,
the first element is zero and the second nonzero.

load ("antid") loads this function. The antid package also
defines the functions nonzeroandfreeof and linear.

antid is related to antidiff as follows.
Let L, a list of two elements, be the return value of antid.
Then the return value of antidiff is equal to
L[1] + 'integrate (L[2], x) where x is the
variable of integration.

Returns an antiderivative of expr with respect to x.
The expression expr may contain an unknown function u and its
derivatives.

When antidiff succeeds entirely, the resulting expression is free of
integral signs (that is, free of the integrate noun).
Otherwise, antidiff returns an expression
which is partly or entirely within an integral sign.
If antidiff cannot make any progress,
the return value is entirely within an integral sign.

load ("antid") loads this function.
The antid package also defines the functions nonzeroandfreeof and
linear.

antidiff is related to antid as follows.
Let L, a list of two elements, be the return value of antid.
Then the return value of antidiff is equal to
L[1] + 'integrate (L[2], x) where x is the
variable of integration.

Evaluates the expression expr with the variables assuming the values as
specified for them in the list of equations [eqn_1, ...,
eqn_n] or the single equation eqn.

If a subexpression depends on any of the variables for which a value is
specified but there is no atvalue specified and it can't be otherwise
evaluated, then a noun form of the at is returned which displays in a
two-dimensional form.

at carries out multiple substitutions in parallel.

See also atvalue. For other functions which carry out substitutions,
see also subst and ev.

Assigns the value c to expr at the point x = a.
Typically boundary values are established by this mechanism.

expr is a function evaluation, f(x_1, ..., x_m),
or a derivative, diff (f(x_1, ..., x_m), x_1,
n_1, ..., x_n, n_m)
in which the function arguments explicitly appear.
n_i is the order of differentiation with respect to x_i.

The point at which the atvalue is established is given by the list of equations
[x_1 = a_1, ..., x_m = a_m].
If there is a single variable x_1,
the sole equation may be given without enclosing it in a list.

printprops ([f_1, f_2, ...], atvalue) displays the atvalues
of the functions f_1, f_2, ... as specified by calls to
atvalue. printprops (f, atvalue) displays the atvalues of
one function f. printprops (all, atvalue) displays the atvalues
of all functions for which atvalues are defined.

The exterior calculus of differential forms is a basic tool
of differential geometry developed by Elie Cartan and has important
applications in the theory of partial differential equations.
The cartan package
implements the functions ext_diff and lie_diff,
along with the operators ~ (wedge product) and | (contraction
of a form with a vector.)
Type demo (tensor) to see a brief
description of these commands along with examples.

The variable dependencies is the list of atoms which have functional
dependencies, assigned by depends, the function dependencies, or gradef.
The dependencies list is cumulative:
each call to depends, dependencies, or gradef appends additional items.
The default value of dependencies is [].

The function dependencies(f_1, …, f_n) appends f_1, …, f_n,
to the dependencies list,
where f_1, …, f_n are expressions of the form f(x_1, …, x_m),
and x_1, …, x_m are any number of arguments.

Each argument f_1, x_1, etc., can be the name of a variable or
array, or a list of names.
Every element of f_i (perhaps just a single element)
is declared to depend
on every element of x_i (perhaps just a single element).
If some f_i is the name of an array or contains the name of an array,
all elements of the array depend on x_i.

diff recognizes indirect dependencies established by depends
and applies the chain rule in these cases.

remove (f, dependency) removes all dependencies declared for
f.

depends returns a list of the dependencies established.
The dependencies are appended to the global variable dependencies.
depends evaluates its arguments.

diff is the only Maxima command which recognizes dependencies established
by depends. Other functions (integrate, laplace, etc.)
only recognize dependencies explicitly represented by their arguments.
For example, integrate does not recognize the dependence of f on
x unless explicitly represented as integrate (f(x), x).

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.

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[1], X[2], … to be used. If
coordinates has not been assigned a value, then the variables will be
treated as in (1) above.

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 df/dx_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.

Attempts to compute the Laplace transform of expr with respect to the
variable t and transform parameter s.

laplace recognizes in expr the functions delta, exp,
log, sin, cos, sinh, cosh, and erf,
as well as derivative, integrate, sum, and ilt. If
laplace fails to find a transform the function specint is called.
specint can find the laplace transform for expressions with special
functions like the bessel functions bessel_j, bessel_i, …
and can handle the unit_step function. See also specint.

If specint cannot find a solution too, a noun laplace is returned.

expr may also be a linear, constant coefficient differential equation in
which case atvalue of the dependent variable is used.
The required atvalue may be supplied either before or after the transform is
computed. Since the initial conditions must be specified at zero, if one has
boundary conditions imposed elsewhere he can impose these on the general
solution and eliminate the constants by solving the general solution
for them and substituting their values back.

laplace recognizes convolution integrals of the form
integrate (f(x) * g(t - x), x, 0, t);
other kinds of convolutions are not recognized.

Functional relations must be explicitly represented in expr;
implicit relations, established by depends, are not recognized.
That is, if f depends on x and y,
f (x, y) must appear in expr.