Total Derivatives

Total differentiation operations.

When you find the derivative of some expression f with respect to x, you are effectively finding out how fast f changes as you vary x. Often f will depend not only on x, but also on other variables, say y and z. The results that you get then depend on how you assume that y and z vary as you change x.

There are two common cases. Either y and z are assumed to stay fixed when x changes, or they are allowed to vary with x. In a standard partial derivative ((∂f)/(∂x)), all variables other than x are assumed fixed. On the other hand, in the total derivative ((df)/(dx)), all variables are allowed to change with x.

In the Wolfram System, (RefLink[D, paclet:ref/D])[f,x] gives a partial derivative, with all other variables assumed independent of x. (RefLink[Dt, paclet:ref/Dt])[f,x] gives a total derivative, in which all variables are assumed to depend on x. In both cases, you can add an argument to give more information on dependencies.

This gives the partial derivative (∂/(∂x))((x^2)+(y^2)):y is assumed to be independent of x:

D[x^2+y^2,x]

This gives the total derivative (d/(dx))((x^2)+(y^2)). Now y is assumed to depend on x:

Dt[x^2+y^2,x]

You can make a replacement for ((dy)/(dx)):

%/.Dt[y,x]->yp

You can also make an explicit definition for ((dy)/(dx)). You need to use y/: to make sure that the definition is associated with y:

y/:Dt[y,x]=0

With this definition made, (RefLink[Dt, paclet:ref/Dt]) treats y as independent of x:

Dt[x^2+y^2+z^2,x]

This removes your definition for the derivative of y:

Clear[y]

This takes the total derivative, with z held fixed:

Dt[x^2+y^2+z^2,x,Constants->{z}]

This specifies that c is a constant under differentiation:

SetAttributes[c,Constant]

The variable c is taken as a constant:

Dt[a^2+c x^2,x]

The function c is also assumed to be a constant:

Dt[a^2+c[x] x^2,x]

This gives the total differential d((x^2)+c(y^2)):

Dt[x^2+c y^2]

You can make replacements and assignments for total differentials:

%/.Dt[y]->dy