# Conservation of Mass Question

1. Jan 24, 2016

### joshmccraney

Hi PF!

Can someone help me understand why, when writing the continuity equation we write: $$\frac{\partial}{\partial t} \iiint_v \rho \, dv$$ instead of $$\iiint_v \frac{\partial}{\partial t} \rho \, dv$$

I understand the two are not necessarily the same, but why derive it the first way rather than the second?

Intuitively, the first seems to be saying "add up all the mass and then see how it changes in time" where as the second seems to say "see how density changes in time at each location and then add it all up".

I'm just having trouble understanding the second integral.

Thanks!

Josh

2. Jan 24, 2016

### Orodruin

Staff Emeritus
If you keep your volume fixed, the two are equivalent. This is usually how you will see the continuity equation on differential form derived.

3. Jan 24, 2016

### joshmccraney

Yea, The same with energy and fluid balances. But I don't know what the second integral means, or rather why it's technically incorrect, from an intuitive perspective (mathematically I realize you need to use Leibniz' rule if the boundaries are time-dependent and you want to interchange the derivative and integral)

Any help on this is greatly appreciated.

4. Jan 24, 2016

### Orodruin

Staff Emeritus
Well, "technically correct" depends on what you actually want to compute. Assuming that the volume is time dependent (since in the case where it is not the integrals are equivalent). The first integral gives you the change in the mass within a the volume by computing the mass as a function of time and then differentiating it. The second one only gives you the change of mass in the volume due to changes in the density and therefore neglects any contribution coming from the volume growing or shrinking (or moving!). As an example, consider a medium of constant density $\rho$. The mass within the volume $V(t)$ will be given by $M(t) = \rho V(t)$ and so $\dot M = \rho \dot V$. If you compute the density derivative $\dot \rho$, you will get zero because you are neglecting the fact that the volume might change and therefore engulf more or less mass.