I'm considering the following volume integral
$$ \int f \; \nabla \cdot (\rho \mathbf{v}) \; d^3x, $$
where $f,g$ are both scalar functions of time and 3-dimensional space, $d^3x$ represents a 3-dimensional volume and bold face letters are vector valued functions.
I proceeded as follows; I began by considering $\; f \; \nabla \cdot (\rho \mathbf{v}) $ which, using the product rule is given by,
$$f \left[ \rho \; \nabla \cdot \mathbf{v}+ \mathbf{v} \cdot \nabla \rho \right]. $$
Following this, I multiplied the scalar function $f$ into the expression in the brackets which gives
$$ (f \rho) \; \nabla \cdot \mathbf{v} + \mathbf{v} \cdot f \nabla \rho.$$
Substituting $f \nabla \rho = \nabla (f\rho) – \rho \nabla f $ from the product rule gives
$$ (f \rho) \nabla \cdot \mathbf{v} + \mathbf{v} \cdot \nabla (f \rho) – \rho \mathbf{v} \cdot \nabla f, $$
which can be expressed in final form as
$$ \int \nabla \cdot (f \rho \mathbf{v})- \int\rho \mathbf{v} \cdot \nabla f. $$
Finally using Gauss theorem the expression on the can be be converted into a surface integral.
Question:
This all seems too long winded when the instructor simply pulled it out without a second thought. Is there an alternate way to proceed from the first expression?
Best Answer
Applying the product rule $\nabla \cdot (\phi \vec A)=\vec A\cdot \nabla \phi +\phi \nabla \cdot \vec A$ with $\phi =f$ and $\vec A=\rho \vec v$, we obtain
$$f\nabla\cdot(\rho \vec v)=\nabla\cdot(f\rho \vec v)-\rho \vec v\cdot\nabla f$$
Then, upon integrating over the domain $V$ with boundary $S$ and applying the Divergence Theorem we find
$$\int_V f\nabla\cdot(\rho \vec v)\,dV=\oint_{S}f\rho \vec v\cdot \hat n\,dS-\int_V \rho \vec v\cdot\nabla f\,dV$$