I am having a bit of a crisis in understanding of the physical meanings of total derivatives.

When a quantity $\rho$ (be it a vector or a scalar) is said to be conserved, then (mathematically) $$\frac{d\rho}{dt} = 0$$ (right??)

Now, if I just integrate both sides with respect to time I get $\rho$ = constant.

But the total derivative can be written as (via the chain rule) $$ \frac{d\rho}{dt} = \frac{\partial \rho}{\partial t} + \mathbf{u}\cdot\nabla\rho$$ where I am not even sure what $\mathbf{u}$ is (the speed of a moving reference frame?).

Given these equations, if the former has $\rho$ = constant as a solution, then what is the point of partial derivative and gradients? They are all going to be zero anyway?

And what exactly is the physical meaning of the total derivative? In fluid dynamics and plasma physics I have been told that it describes how a quantity changes when observed from the frame "moving with the fluid"...

  • 1
    $\begingroup$ Related: physics.stackexchange.com/q/9122/2451 and links therein. $\endgroup$
    – Qmechanic
    Commented Apr 22, 2014 at 19:30
  • $\begingroup$ The detailed answers below will give you the complete background, but the error in the above is saying $\rho =$ constant : you get $\rho(x(t),t) = \rho_0(x_0)$, independent of $t$ BUT for a given $x_0$. $\endgroup$
    – Joce
    Commented Apr 23, 2014 at 7:08
  • $\begingroup$ @Edward: You integrate wrt time, so the constant depends on position (in a Lagrangian setting). Imagine an initial condition with $\rho(x,t_0)=\rho_0(x)$. Advect this with a velocity field $u$, the trajectories are $x(t)=\int u(x(t))dt$, and $\mathrm{d}\rho/\mathrm{d}t=0$ yields $\rho(x(t),t)=\rho_0(x(t_0))$ $\endgroup$
    – Joce
    Commented Apr 23, 2014 at 9:02
  • $\begingroup$ Of course you are quite right - I completely misread what you said. Sorry about that! $\endgroup$ Commented Apr 23, 2014 at 9:36

4 Answers 4


It seems to me that you are confusing a generic notion of total derivative and the so called Lagrangian derivative (also known as material derivative).

Let us start from scratch. In Cartesian coordinates, a fluid or a generic continuous body is first of all described by a class of differentiable (smooth) maps from $\mathbb R^3$ to $\mathbb R^3$: $$x=x(t,y)\:, \quad x \in \mathbb R^3\:.$$ For every $t\in \mathbb R$, the map $\mathbb R^3 \ni y \mapsto x(t,y) \in \mathbb R^3$ associates the particle with initial position $y$ with the position $x$ of the same particle at time $t$.

For every fixed $t$, the map above is supposed to be inverible with differentiable (smooth) inverse, and the two maps $\mathbb R^3 \ni y \mapsto x(t,y) \in \mathbb R^3$ and $\mathbb R^3 \ni x \mapsto y(t,x) \in \mathbb R^3$ are jointly smooth in all variables simultaneously.

At time $t$, the velocity of the particle with initial position $y$ is consequently given by: $$v_L(t,y) = \frac{\partial x}{\partial t}\:.$$ The formula above pictures the field of velocities in the so called Lagrangian description: physically relevant quantities, at a given value of time, are viewed as functions of the initial position of the particles forming the continuous body. It is however often more convenient to describe this velocity as a function of the position in space at time $t$. We obtain this way the so called Eulerian description of the field of velocities: $$v(t,x) := v_L(t,y(t,x))\:.$$ (I will not make use on an index $E$, henceforth assuming that what it is not Lagrangian is automatically Eulerian.) $x$ is a given point in space at time $t$. At that time it is crossed by the particle with initial position $y(t,x)$.

Generally speaking, if $S$ is a (Cartesian) tensor field defined on the continuous body, we have two representations. The Lagrangian one $S_L(t,y)$ and the Eulerian one $S(t,x)$, where, obviously, $$S(t,x) = S_L(t,y(t,x))\quad \mbox{and}\quad S_L(t,y)= S(t,x(t,y))\:.$$ It is sometime convenient to compute the derivative of $S$ along the stories of the particles of continuous body while representing the obtained tensor field in Eulerian picture.

For instance, the acceleration field is $$a(t,x)= \left.\frac{\partial }{\partial t} v_L(t,y)\right|_{y=y(t,x)}\:.$$ Notice that the time derivative is correctly computed in Lagrangian representation, since we have to follow each particle separately. The RHS of the identity above reads, only exploiting Eulerian objects: $$a(t,x) = \frac{\partial v}{\partial t} + v \cdot \nabla_x v(t,x)\:.$$ (It is an easy exercise to establish that identity from definitions.)

In general the Lagrangian derivative of a tensor field (represented in Eulerian picture) $S(t,x)$ is defined as: $$\frac{DS}{Dt} := \frac{\partial S}{\partial t} + v(t,x)\cdot \nabla_x S(t,x)\qquad(1)$$ It turs out that: $$\left.\frac{DS}{Dt}(t,x)\right|_{x=x(t,y)}= \frac{\partial}{\partial t} S_L(t,y)\:,\qquad (2)$$ so that, the Lagrangian derivative is just a way to compute time derivatives along the stories of the particles of the continuous body remaining in Eulerian representation.

Remark. This Lagrangian derivative is the one you call total derivative, but its physical meaning is very precise as I illustrated above. In the rest of this post I keep denoting it by $D/Dt$ instead of $d/dt$.

Let us come to the conservation law of the mass. First of all, we have to endow our continuous system with a density of mass $\rho$. As before, we can adopt either an Eulerian or Lagrangian description: $$\rho= \rho(t,x)\qquad \mbox{and}\quad \rho_L= \rho_L(t,y):= \rho(t,y(t,x))\:.$$ The most clear statement concerning conservation of mass is the following.

For every (sufficiently regular) portion $V_L$ of the initial configuration of continuous body, corresponding to a portion $V_t$ at each value $t$ of time, $$V_t = \{x \in \mathbb R^3 \:|\: x = x(t,y)\:, y \in V_L\}\:,$$ the mass included in $V_t$ does not change in time: $$\frac{d}{dt} \int_{V_t} \rho(t,x) dx =0\:,\qquad(3)$$

Let us transform this requirement into the equivalent local statement. Passing to the Lagrangian picture, (1) reads: $$\frac{d}{dt} \int_{V_L} \rho(t,x(t,y)) |J_t| dy =0$$ that is $$\frac{d}{dt} \int_{V_L} \rho_L(t,y) |J_t| dy =0$$ where $J_t$ is the determinant of the Jacobian matrix of elements $\frac{\partial x_i}{\partial y_j}$. Since in (2) $V_L$ does not depend on time and everything is regular (the integrand is smooth and $V_L$ can always be assumed to be bounded) we can swap the symbol of derivative and that of integral (essentially taking advantage of Lebesgue's dominated convergence theorem): $$ \int_{V_L} \left(\frac{\partial}{\partial t}\rho_L(t,y)\right) |J_t| + \rho_L(t,y) \frac{\partial}{\partial t} |J_t| dy =0\:.$$ It is possible to prove (it is not so simple actually), that $\frac{\partial}{\partial t} |J_t| = |J_t|\nabla_x \cdot v(t,x)|_{x=x(t,y)}$. Using it in the LHS of the found identity and taking (1) and (2), into account, we find that (3) implies (in fact is equivalent to): $$ \int_{V_L} \left( \left.\frac{D\rho}{Dt}\right|_{x=x(t,y)}+\rho_L(t,y) \left.\nabla_x \cdot v(t,x)\right|_{x=x(t,y)}\right) |J_t| dy =0\:.\qquad (4)$$ In other words, coming back to Eulerian variables: $$ \int_{V_t} \frac{D\rho}{Dt}+\rho(t,x) \nabla_x \cdot v(t,x) dx =0\:.\qquad(5)$$ Form (4) or (5), using the fact that the integrand is continuous and $V_L$ or $V_t$ substantially are arbitrary, ones infers that the integral version of the law of mass conservation (3) is equivalent to the local requirement in Eulerian formulation: $$\frac{D\rho}{Dt}+\rho(t,x) \nabla_x \cdot v(t,x) = 0 \qquad (6)\:.$$ Finally, makig use of the definition of Lagrangian derivative (1), that identity can equivalently be stated as: $$\frac{\partial\rho}{\partial t}+ \nabla_x \cdot \rho(t,x) v(t,x) = 0 \qquad (7)\:.$$

Remark. A continuous body is incompressible if the volume measure $V_t$ of its portions $V_L$ remains constant along its story: $$\frac{d}{dt} \int_{V_t} dx =0\:.\qquad(3)'$$ Dealing with as before, one immediately sees that it is completely equivalent to say that (it would be enough to everywhere replace $\rho$ for $1$) $$\nabla_x \cdot v(t,x) = 0 \qquad (6)'\:.$$ Consequently, the law of conservation of mass for an incompressible continuous body, from (6),symply reads: $$\frac{D\rho}{Dt}=0\:. \qquad (8)$$ This is the equation you pointed out in the case of the law of conservation of mass. However, with that interpretation, it holds for incompressible bodies only, the general formulation being (6)'.

For a generic quantity $\rho$ (even vectorial or tensorial), (8) simply says that the quantity is constant in time along the story of every particle of the system, though that constant may depend on the particle.

For the sake of completeness, let me say a few words about another popular formulation of the conservation mass law. Starting from (7), integrating both sides in a geometric volume $U$ (so, not a portion of continuous body, but a geometric volume at rest with the reference frame we are using), we have: $$\int_U \frac{\partial \rho}{\partial t} dx = - \int_U \nabla_x \cdot \rho v(t,x) dx\:.$$ Thus, divergence theorem leads to the most popular version of the considered law whose meaning is illustrated in other answers to your question, so I will not spend any word on it: $$\frac{d}{dt}\int_U \rho(t,x) dx = - \int_{+\partial U} \rho v(t,x)\cdot n dS(x)\:,\qquad (9)$$ where $n$ is the outward unit vector at $x\in \partial U$.

As a final remark regarding the theory of continuous bodies, let me stress that the notion of Lagrangian derivative plays a crucial role in developing the theory of continuous bodies. For instance "$F=ma$" has to be written, for every portion $V_L$ of continuous body, exploiting the Lagrangian derivative: $$\frac{d}{dt}\int_{V_t} \rho(t,x) v(t,x) dx = F_{V_t}$$
that is, with some elementary manipulations, taking (6) into account, $$\int_{V_t} \rho(t,x) \frac{Dv}{Dt}(t,x) dx = F_{V_t}\:.$$

Remark. Dealing with Hamiltonian mechanics, there is a similar conservation law concerning probability when one studies statistical ensembles, i.e. statistical (Hamiltonian) mechanics. In that situation, in fact, Liouville's theorem establishes that the Hamiltonian evolution preserves the canonical volume of the space of phases. In other words (6)' holds true, where $v$ is the field of Hamiltonian velocities $(dq/dt,dp/dq)$. As a consequence the law of conservation of probabilities, described by the Liouville density $\rho$, can be stated in the simpler version: $$\frac{D\rho}{Dt}=0\:,$$ which, in turn, adopting the standard notation of statistical Hamiltonian mechanics, reads: $$\frac{d\rho}{dt}=0\:,$$ and, eventually, can be re-formulated into the celebrated Liouville equation form: $$\frac{\partial \rho}{\partial t} + \{\rho , H\}=0\:.$$

  • $\begingroup$ Thanks for the very comprehensive and mathematically rigorous answer. Everyone here seems to be assuming that if $\rho(x,t)$ then $x$ is also a function of time. It might be just me, but why?! What if $x$ is just a fixed coordinate associated with a fixed Cartesian coordinate system? $\endgroup$ Commented Apr 25, 2014 at 0:30
  • $\begingroup$ $x$ is not a function of time, in general it is just a simple set of three Cartesian coordinate. It becomes a function of time and another set of $y$ in the following way whenever you consider something like a fluid described by particles which cannot occupy the same position at any time. So, for a position x in space at given time $t$ there is exactly a particle, just defined by initial position $y$ at $t=0$, which passes through $x$ at time $t$. That correspondence defines a function $y=y(t,x)$. This map is invertible and so you have the function $x=x(t,y)$ I used in my answer. $\endgroup$ Commented Apr 26, 2014 at 13:39
  • $\begingroup$ Sorry my question is going to be a little off topic: But where did you gather all that knowledge about Lagragian and Eulerian derivatives? Did you teach it yourself or do you have some references? I'm interested in Continuum Mechanics and also have a course in it. But it introduces the concept of Eulerian and Lagrangian derivatives very sloppy and superficial. So, if you know some good refernces, I'd be glad if you can help me out :) $\endgroup$
    – F. Ha
    Commented Apr 4, 2016 at 0:44
  • 1
    $\begingroup$ @F.Ha Several years ago I was lecturer of a course on continuum mechanics. I also wrote lecture notes which, more or less, collect all my knowledge on the subject. Unfortunately they are written in Italian as the course was for the bachelor degree. $\endgroup$ Commented Apr 4, 2016 at 6:55
  • $\begingroup$ I really like that you treat the subject in such a rigorous mathematical way. Unfortunaltey, my italian is very rough, so I cannot read your notes, even if I found them :/ $\endgroup$
    – F. Ha
    Commented Apr 4, 2016 at 18:36

The Basic Idea

Physically the total derivative tells you how a quantity changes when it is subjected to a space and time dependent velocity field. In physics we usually call it the material derivative.

An Intuitive Example

Suppose $\rho(\mathbb{x},t)$ measures the temperature of a fluid, according to a thermometer immersed at the point $\mathbb{x}$ and time $t$. Now suppose the thermometer moves through the fluid, with position vector $\mathbb{x}(t)$.

After a small time $dt$ there is a corresponding change in position $d\mathbb{x}$. The temperature change observed on the thermometer will be

$$d\rho = \frac{\partial \rho}{\partial t}dt + \frac{\partial \rho}{\partial\mathbb{x}}\cdot d\mathbb{x}$$

Morally this approximates the total change as the instantaneous rate of change in each spacetime direction, multiplied by the corresponding change in spacetime.

Now dividing through by $dt$ (which can be made mathematically rigorous) you obtain the usual formula

$$\frac{d\rho}{dt} = \frac{\partial\rho}{\partial t}+\frac{\partial \rho}{\partial\mathbb{x}}\cdot \frac{d\mathbb{x}}{dt}=\frac{\partial\rho}{\partial t}+\nabla\rho\cdot\mathbb{u}$$

Conserved Quantities

We say that $\rho$ is conserved (or constant) along the flow of the fluid if


Integrating up we find that

$$\rho(\mathbb{x}(t),t) = \rho(\mathbb{x}(t_0),t_0)$$

As Joce noted in his comment, different paths $\mathbb{x}(t)$ may still have different values for $\rho$. The conservation condition only says that $\rho$ is constant along each path.

You are right to think this isn't very interesting at present. But it's a useful notion when coupled with other physical conservation laws.

A Physical Application

One of these is the conservation of mass. It's easy to derive this and see where the total derivative comes in. Take $\rho(\mathbb{x},t)$ to be the density of the fluid. Then the total mass of fluid in a volume $V$ is

$$M = \int_V \rho\ dV$$

Every second, mass is lost across the boundary of $V$. Call this boundary $S$. This change in mass is given by

$$\delta M = -\int_S \rho \mathbb{u}\cdot\mathbb{n}\ dS$$

Putting these facts together we get

$$\frac{d}{dt}\int_V \rho \ dV = -\int_S \rho \mathbb{u}\cdot\mathbb{n}\ dS$$

Using the divergence theorem on RHS and the fact that $V$ is fixed in space on LHS we get

$$\int_V \frac{\partial \rho}{\partial t} dV = -\int_V\nabla\cdot(\rho \mathbb{u})\ dV$$

But $V$ was arbitrary so we get

$$\frac{\partial \rho}{\partial t}+\nabla\cdot(\rho\mathbb{u}) = 0$$

You can rewrite this in terms of a total derivative (exercise) and get

$$\frac{d\rho}{dt}+\rho\nabla\cdot\mathbb u = 0$$

So if the density is conserved (i.e. constant along the flow) then we know from the conservation of mass that

$$\nabla\cdot\mathbb{u} = 0$$

This is just the condition for a fluid to be incompressible. Intuitively that sounds about right.

Note that an incompressible fluid doesn't necessarily have to have uniform density everywhere! It's just got to be constant along the flow. See also Wikipedia.

Further Reading

If you want to understand more about the applications of material derivatives, I suggest you try reading these lecture notes.


Let's consider a function $f$ that depends on time $t$, position $q$ and momentum $p$. This is just an example related to Lagrangian physics regarding notations.

One wants to measure the variation of $f(t,q,p)$ with respect to time. We know that $f(t,q,p)$ has an explicit dependence on time but nothing keeps $q$ and $p$ to also depend on time. Then one can differentiate $f$: $$ \mathrm d f(t,q,p) = \frac{\partial f}{\partial t} \mathrm d t +\frac{\partial f}{\partial q} \mathrm d q +\frac{\partial f}{\partial p} \mathrm d p $$ The total derivative of $f(t,q,p)$ is then: $$ \frac{\mathrm d f}{\mathrm d t}(t,q,p) = \frac{\partial f}{\partial t} +\frac{\partial f}{\partial q}\frac{\mathrm d q}{\mathrm d t} +\frac{\partial f}{\partial p}\frac{\mathrm d p}{\mathrm d t} $$ where $\partial$ denotes partial derivatives and $\mathrm d$ denotes total derivatives.

The things one can deduce when a total derivative or a partial derivative is equal to zero are different.

If $\frac{\mathrm d f}{\mathrm d t} = 0$ then $f$ is a conserved quantity it doesn't depend on time. If $\frac{\partial f}{\partial t} = 0$ then $f$ is not necessarily a conserved quantity but one can say that $f$ has no explicit time dependance. Those two conclusions aren't the same, and obviously: $$\frac{\mathrm d f}{\mathrm d t} = 0 \quad \Rightarrow \quad \frac{\partial f}{\partial t} = 0$$

The expression you gave for the total derivative, needs some additional precision. The function $\rho$ depends on time and on spatial coordinates (let's say two, but any number is allowed). Using the expressions I gave one get: $$ \frac{\mathrm d \rho}{\mathrm d t}(t,x,y) = \frac{\partial \rho}{\partial t} +\frac{\partial \rho}{\partial x}\frac{\mathrm d x}{\mathrm d t} +\frac{\partial \rho}{\partial y}\frac{\mathrm d y}{\mathrm d t} $$ one can notice that: $$ \nabla \rho = \frac{\partial \rho}{\partial x} \pmb x + \frac{\partial \rho}{\partial y} \pmb y $$ If we define $$\pmb u = \frac{\mathrm d x}{\mathrm d t} \pmb x+ \frac{\mathrm d y}{\mathrm d t} \pmb y $$ We get the expression you wrote: $$ \frac{\mathrm d \rho}{\mathrm d t}(t,x,y) = \frac{\partial \rho}{\partial t} +\pmb u \cdot \nabla \rho $$ then $\pmb u$ is simply the time derivative of the position vector $\pmb r = x(t) \pmb x + y(t) \pmb y$

In fluid dynamics $x(t)$ and $y(t)$ are often functions of time, then if one want to take a time derivative, one has to take care of the time dependance of $x$ and $y$. Physically a total derivative is a derivative that takes every time depenence into account.


Conservation laws are expressed in the form, $$ \frac{\partial q}{\partial t}+\nabla\cdot\mathbb T =0\tag{1} $$ for some quantity $q$. Here, the term $\mathbb T$ depends on what the quantity $q$ is; for the Euler hydrodynamic equations, it would be: $$ \mathbb T=\begin{cases}\rho\mathbf u & q=\rho \\ \rho\mathbf{uu}^T+p\mathbb{I} & q=\rho\mathbf u \\ \left(E+p\right)\mathbf u & q=E\end{cases} $$ where $p$ is the total pressure, $\mathbf u$ the velocity of the fluid, $\mathbb I$ is the identity matrix, and $E$ the total energy.

The physical meaning of the conservation law is that any amount of $q$ that changes in time (the $\partial_tq$ term) depends on how much leaves or enters a volume $V$ (the $\nabla\cdot\mathbb T$ term).

  • If nothing leaves or enters ($\nabla\cdot\mathbb T=0$), then $\partial_tq=0$ by necessity.
  • If $q$ is constant in time ($\partial_tq=0$), then $\nabla\cdot\mathbb T=0$ by necessity.

There are two ways to look at hydrodynamics, the Eulerian and Lagrangian approaches. It's easiest to picture them by using an analogy of a boat floating along a river:

  1. Standing by the side of the river (Eulerian)
  2. Standing in the boat on the river (Lagrangian)

The difference between them is that the Lagrangian approach (which uses the total/material derivative) describes the dynamic evolution of the quantity $q$ along its pathline. The Eulerian approach (which uses Equation (1) above) describes the dynamic evolution of the quantity $q$ through some control volume $V$.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.