This is documentation for Mathematica 4, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
Wolfram Research, Inc.

DifferentiationDerivatives of Unknown Functions

3.5.2 Total Derivatives

Total differentiation operations.

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

There are two common cases. Either and are assumed to stay fixed when changes, or they are allowed to vary with . In a standard partial derivative , all variables other than are assumed fixed. On the other hand, in the total derivative , all variables are allowed to change with .

In Mathematica, D[f, x] gives a partial derivative, with all other variables assumed independent of x. 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 . y is assumed to be independent of x.

In[1]:= D[x^2 + y^2, x]


This gives the total derivative . Now y is assumed to depend on x.

In[2]:= Dt[x^2 + y^2, x]


You can make a replacement for .

In[3]:= % /. Dt[y, x] -> yp


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

In[4]:= y/: Dt[y, x] = 0


With this definition made, Dt treats y as independent of x.

In[5]:= Dt[x^2 + y^2 + z^2, x]


This removes your definition for the derivative of y.

In[6]:= Clear[y]

This takes the total derivative, with z held fixed.

In[7]:= Dt[x^2 + y^2 + z^2, x, Constants->{z}]


This specifies that c is a constant under differentiation.

In[8]:= SetAttributes[c, Constant]

The variable c is taken as a constant.

In[9]:= Dt[a^2 + c x^2, x]


The function c is also assumed to be a constant.

In[10]:= Dt[a^2 + c[x] x^2, x]


This gives the total differential .

In[11]:= Dt[x^2 + c y^2]


You can make replacements and assignments for total differentials.

In[12]:= % /. Dt[y] -> dy


DifferentiationDerivatives of Unknown Functions