# Proving conservation of mass for linear advection

Reading through some course notes about conservation of mass in linear advection approximation schemes, given $\phi(x, t) \in \mathbb{R}$ and is defined for $0 \leq x < 1$ with periodic boundary conditions, and given mass $M = \int_0^1{\phi dx}$ the proof begins as follows:

$$\frac{dM}{dt} = \frac{d}{dt} \int_0^1 \phi dx = \int_0^1 {\frac{d\phi}{dt} dx}$$

A couple of questions:

1. How can we justify moving $\frac{d}{dt}$ inside the integral?
2. Shouldn't this now be a partial differential $\frac{\partial \phi}{\partial t}$ since $\phi$ is a function of space ($x$) and time ($t$)?

The proof continues: $$-u \int_0^1\frac{d\phi}{dx}dx = -u \int_0^1 d \phi = -u \left[ \phi \right]_0^1 = 0$$ since $\phi(0, t) = \phi(1, t) \forall t$ due to the periodic boundary.

• Is $\phi$ continuous ?
– Amr
Dec 10, 2013 at 15:41
• @Amr Yes, we can assume $\phi$ is continuous Dec 10, 2013 at 15:48
• the condition $$\fi$$ is in C^1 is a sufficient condition to bring the derivate into the integral... on the point 2) I agree with you. Dec 10, 2013 at 15:50
• @Jekyll I've clarified that $\phi \in \mathbb{R}$. Can you give me some intuition to explain why this can be done? Dec 10, 2013 at 15:56
• @hertzsprung I am sorry, I meant is $\phi'$ continuous or at least bouneded
– Amr
Dec 10, 2013 at 15:56

If $\phi: [0,1]\times [a,b]\rightarrow \mathbb R$, $(x,t)\mapsto \varphi(x,t)$ is continuous on $[0,1]\times [a,b]$ with its partial derivative $\frac{\partial \phi}{\partial x}(x,t)$, then $M=M(t)$ is differentiable and

$$\frac{dM}{dt}(t)=\int_0^1\frac{\partial \phi}{\partial x}(x,t)dx.$$

The proof uses the Mean value theorem and the fact that any continuous function on a compact subset of $\mathbb R^n$ is ivi uniformly continuous. Sketchy:

$$\frac{M(t+h)-M(t)}{h}=\int_0^1\frac{\phi(x,t+h)-\phi(x,t)}{h}dx= \int_0^1\frac{\partial \phi}{\partial x}(x,t)dx+ \int_0^1\left[\frac{\partial \phi}{\partial x}(x,t+\theta h)-\frac{\partial \phi}{\partial x}(x,t)\right]dx,$$

with $0<\theta<1$. In the second equality we added and subtracted the terms $\int_0^1\frac{\partial \phi}{\partial x}(x,t)dx$ (which exist as the $\frac{\partial \phi}{\partial x}(x,t)$ is supposed to be continuous) and we used the Mean value theorem on the term with the ratio $\frac{\phi(x,t+h)-\phi(x,t)}{h}$.

We go on; as $\frac{\partial \phi}{\partial x}(x,t)$ is continuous on $[0,1]\times [a,b]$ which is compact in $\mathbb R^2$, it follows by the Heine-Cantor Theorem that it is uniformly continuous on $[0,1]\times [a,b]$, i.e.

$$\forall \epsilon>0~\exists\delta=\delta(\epsilon):~|(t+\theta h)-t|<\delta\Rightarrow |\frac{\partial \phi}{\partial x}(x,t+\theta h)-\frac{\partial \phi}{\partial x}(x,t)|<\epsilon.$$

Uniformly continuity implies that the above $\delta$ is a function of $\epsilon$ alone (this is not true in general for continuous functions). In summary we arrive at

$$\big|\frac{M(t+h)-M(t)}{h}-\int_0^1\frac{\partial \phi}{\partial x}(x,t)dx|\leq \int_0^1|\frac{\partial \phi}{\partial x}(x,t+\theta h)-\frac{\partial \phi}{\partial x}(x,t)|dx\leq \underbrace{\epsilon(1-0)}_{\text{here we used the unif. continuity}}=\epsilon,$$

for all $\epsilon>0$.

• I'd love to mark this as accepted, but I'm not sure what the policy is for accepting an answer you don't properly understand! :) Dec 10, 2013 at 18:56
• You should note accept it then :-) I would like to make it more understandable, though: which are the parts you would like to extend? Dec 10, 2013 at 20:54
• I have edited my answer. Dec 11, 2013 at 9:34