# 6.1: The Leibniz rule

- Page ID
- 18076

Leibniz’s rule^{1} allows us to take the time derivative of an integral over a domain that is itself changing in time. Suppose that \(f\left( \vec{x},t \right)\) is the volumetric concentration of some unspecified property we will call “stuff”. The Leibniz rule is mathematically valid for any function \(f\left(\vec{x},t\right)\), but it is easiest to interpret physically if we imagine that f is something per unit volume. For a concrete example, imagine that the “stuff” is air, and \(f\) is then the mass of air molecules per unit volume, i.e., the density. Now consider a closed surface that can change arbitrarily in time (not a material volume, in general). Its area is \(A(t)\) and the volume it encloses is \(V(t)\) (Figure \(\PageIndex{1}\)a). The quantity of “stuff” contained in the volume at any given time is \(\int_V f\left( \vec{x},t \right) dV=\int_V \frac{\partial f}{\partial t}dV\). That quantity can change in time in two ways.

First, the concentration \(f\) may change in time, e.g., the density of the air may change due to heating or cooling. If this were the only source of change, we could write:

\[\frac{d}{d t} \int_{V} f(\vec{x}, t) d V=\int_{V} \frac{\partial f}{\partial t} d V.\label{eqn:1} \]

**Second**, the volume itself can change, for example, the volume could grow, thereby engulfing more “stuff”. Quantifying this second contribution requires a bit more thought. At any point on the boundary we define \(\hat{n}\) to be the outward-pointing normal vector (Figure \(\PageIndex{1}\)a). The points that make up the boundary have velocity \(\vec{u}_A\), which varies over the boundary and also in time as the surface evolves. The expansion velocity, \(\vec{u}_A\cdot\hat{n}\), is the component of \(\vec{u}_A\) that is perpendicular to the boundary and directed outward. Now consider the motion of a small surface element over a brief time \(dt\) (Figure \(\PageIndex{1}\)b). The surface element moves by a distance \(\vec{u}_A\cdot\hat{n}dt\), thereby enclosing a small volume \(dV=\vec{u}_A\cdot\hat{n}dtdA\). The amount of “stuff” contained in this small volume is \(f dV\), or \(f\vec{u}_A\cdot\hat{n}dtdA\). If we now integrate this quantity over the whole surface, we get the amount of “stuff” engulfed (or ejected, if \(\vec{u}_A\cdot\hat{n}<0\)) in time \(dt\): \(\int_A f\vec{u}_A\cdot\hat{n}dt dA\). Dividing by \(dt\) and taking the limit \(dt \rightarrow 0\), we have the second term that controls the change in the amount of “stuff” enclosed by our surface \(A\):

\[\frac{d}{d t} \int_{V(t)} f(\vec{x}, t) d V=\int_{V(t)} \frac{\partial f}{\partial t} d V+\int_{A(t)} f \vec{u}_{A} \cdot \hat{n} d A.\label{eqn:2} \]

This is the most general form of Leibniz’s rule.

## Three special cases

1. If the surface is unchanging in time, then \(\vec{u}_A=0\) and Equation \(\ref{eqn:2}\) is the same as \(\ref{eqn:1}\).

2. Suppose that \(f\) is a function of only one spatial coordinate and time: \(f = f(x,t)\). The integral is then an ordinary integral from, say, \(x = a\) to \(x = b\), but the boundaries \(a\) and \(b\) can vary in time (Figure \(\PageIndex{2}\)). In that case Leibniz’ rule becomes

\[\frac{d}{d t} \int_{a(t)}^{b(t)} f(x, t) d x=\int_{a(t)}^{b(t)} \frac{\partial f}{\partial t} d x+f(b, t) \frac{d b}{d t}-f(a, t) \frac{d a}{d t}.\label{eqn:3} \]

The second and third terms on the right-hand side are the contributions due to the motion of the boundaries. This is the version of Leibniz’ rule commonly found in calculus textbooks.

3. The most important case of Equation \(\PageIndex{2}\) for fluid mechanics is that in which \(A(t)\) is a **material surface** \(A_m(t)\), always composed of the same fluid particles, and \(V = V_m(t)\) is therefore a material volume (or fluid parcel). In this case \(\vec{u}_A\) is just \(\vec{u}\left(\vec{x},t\right)\), the velocity of the motion, and the time derivative is \(D/Dt\):

\[\frac{D}{D t} \int_{V_{m}(t)} f(\vec{x}, t) d V=\int_{V_{m}(t)} \frac{\partial f}{\partial t} d V+\int_{A_{m}(t)} f \vec{u} \cdot \hat{n} d A. \nonumber \]

Note that the time derivative is defined as \(D/Dt\) because it is evaluated in a reference frame following the motion. It does not, however, have the form (5.1.3), as it does when applied to a continuous field. Now notice that, in the final term, the integrand is the dot product of the vector \(f\vec{u}\) and the outward unit normal \(\hat{n}\). According to the divergence theorem^{2}, we can convert this term to a volume integral:

\[\int_{A}(f \vec{u}) \cdot \hat{n} d A=\int_{V} \vec{\nabla} \cdot(f \vec{u}) d V. \nonumber \]

We now have **Leibniz’ rule for a material volume**:^{3}

\[\frac{D}{D t} \int_{V_{m}(t)} f(\vec{x}, t) d V=\int_{V_{m}(t)}\left(\frac{\partial f}{\partial t}+\vec{\nabla} \cdot f \vec{u}\right) d V.\label{eqn:4} \]

^{1}Gottfried Wilhelm Leibniz (1646-1716) was a German philosopher and mathematician who invented calculus independently of Isaac Newton. The notation “\(d/dx\)” that we use today comes from Leibniz’s version. As a philosopher, Leibniz espoused the theory of “optimism”, which holds that the universe we inhabit is the best one that God could have created. This cheery attitude is especially admirable given that Newton got all the credit for inventing calculus.

^{2}The divergence theorem reads \(\oint_A\vec{v}\cdot\hat{n}dA=\int_A\vec{\nabla}\cdot\vec{v}dV\), where \(\vec{v}\) is a general vector and \(\hat{n}\) is the unit normal to the closed surface \(A\). See section 4.2.3 for details.

^{3}Note that the integral on the left-hand side of Equation \(\ref{eqn:4}\) depends only on time. We write its time derivative as \(D/Dt = \partial/\partial t +\vec{u} \cdot \vec{\nabla}\), even though only the term \(\partial/\partial t\) is nonzero, and the derivative could be written just as accurately as \(d/dt\). We choose the symbol \(D/Dt\) to remind ourselves that this time derivative is measured by an observer moving with the flow.