Divergence
Motivation
Fluids can be represented by a vector field (each vector represents the movement of the particle at that instant). The movement of these particles would correspond with some change in their density, and we can ask the question of how we would calculate the change in density as particles move along vectors defined by a vector-valued function.
Divergence, like a gradient, is represented by the symbol \(\nabla\) and is a "vector" of partial derivative operators. For a vector-valued function \(\vec{\mathbf{v}}(x,y,...)\), the process for calculating the divergence is as follows:
\(\nabla \cdot \vec{\mathbf{v}} = \left[\begin{matrix} \frac{\partial}{\partial x_1} \\ \frac{\partial}{\partial x_2} \\ \frac{\partial}{\partial x_3} \\ \ldots \end{matrix}\right] \cdot \left[\begin{matrix} v_1(x_1, x_2, x_3, \ldots) \\ v_2(x_1, x_2, x_3, \ldots) \\ v_3(x_1, x_2, x_3, \ldots) \\ \ldots\end{matrix}\right] = \frac{\partial v_1}{\partial x_1} + \frac{\partial v_2}{\partial x_2} + \frac{\partial v_3}{\partial x_3} \ldots\)
Another way of considering this is realizing that this is equivalent to taking the Jacobian of \(\vec{\mathbf{v}}\) and summing the diagonal.