The flux from a cube; Gauss’ theorem
We now take the special case of a small cube1 and find an interesting formula for the flux out of it. Consider a cube whose edges are lined up with the axes as in Fig. 3–5. Let us suppose that the coordinates of the corner nearest the origin are $x$, $y$, $z$. Let $\Delta x$ be the length of the cube in the $x$-direction, $\Delta y$ be the length in the $y$-direction, and $\Delta z$ be the length in the $z$-direction. We wish to find the flux of a vector field $\FLPC$ through the surface of the cube. We shall do this by making a sum of the fluxes through each of the six faces. First, consider the face marked $1$ in the figure. The flux outward on this face is the negative of the $x$-component of $\FLPC$, integrated over the area of the face. This flux is \begin{equation*} -\int C_x\,dy\,dz. \end{equation*}  Since we are considering a small cube, we can approximate this integral by the value of $C_x$ at the center of the face—which we call the point $(1)$—multiplied by the area of the face, $\Delta y\,\Delta z$: \begin{equation*} \text{Flux out of $1$}=-C_x(1)\,\Delta y\,\Delta z. \end{equation*}  Similarly, for the flux out of face $2$, we write \begin{equation*} \text{Flux out of $2$}=C_x(2)\,\Delta y\,\Delta z. \end{equation*}  Now $C_x(1)$ and $C_x(2)$ are, in general, slightly different. If $\Delta x$ is small enough, we can write \begin{equation*} C_x(2)=C_x(1)+\ddp{C_x}{x}\,\Delta x. \end{equation*}  There are, of course, more terms, but they will involve $(\Delta x)^2$ and higher powers, and so will be negligible if we consider only the limit of small $\Delta x$. So the flux through face $2$ is \begin{equation*} \text{Flux out of $2$}=\biggl[C_x(1)+\ddp{C_x}{x}\,\Delta x\biggr]\,\Delta y\,\Delta z. \end{equation*}  Summing the fluxes for faces $1$ and $2$, we get \begin{equation*} \text{Flux out of $1$ and $2$}=\ddp{C_x}{x}\,\Delta x\,\Delta y\,\Delta z. \end{equation*}  The derivative should really be evaluated at the center of face $1$; that is, at $[x,y+(\Delta y/2),z+(\Delta z/2)]$. But in the limit of an infinitesimal cube, we make a negligible error if we evaluate it at the corner $(x,y,z)$. Applying the same reasoning to each of the other pairs of faces, we have \begin{equation*} \text{Flux out of $3$ and $4$}=\ddp{C_y}{y}\,\Delta x\,\Delta y\,\Delta z \end{equation*} and \begin{equation*} \text{Flux out of $5$ and $6$}=\ddp{C_z}{z}\,\Delta x\,\Delta y\,\Delta z. \end{equation*}  The total flux through all the faces is the sum of these terms. We find that \begin{equation*} \underset{\text{cube}}{\int}\FLPC\cdot\FLPn\,da= \biggl(\ddp{C_x}{x}+\ddp{C_y}{y}+\ddp{C_z}{z}\biggr)\Delta x\,\Delta y\,\Delta z, \end{equation*}  and the sum of the derivatives is just $\FLPdiv{\FLPC}$. Also, $\Delta x\,\Delta y\,\Delta z=\Delta V$, the volume of the cube. So we can say that for an infinitesimal cube \begin{equation} \label{Eq:II:3:17} \underset{\text{surface}}{\int}\FLPC\cdot\FLPn\,da= (\FLPdiv{\FLPC})\,\Delta V. \end{equation}  We have shown that the outward flux from the surface of an infinitesimal cube is equal to the divergence of the vector multiplied by the volume of the cube. We now see the “meaning” of the divergence of a vector. The divergence of a vector at the point $P$ is the flux—the outgoing “flow” of $\FLPC$—per unit volume, in the neighborhood of $P$. We have connected the divergence of $\FLPC$ to the flux of $\FLPC$ out of each infinitesimal volume. For any finite volume we can use the fact we proved above—that the total flux from a volume is the sum of the fluxes out of each part. We can, that is, integrate the divergence over the entire volume. This gives us the theorem that the integral of the normal component of any vector over any closed surface can also be written as the integral of the divergence of the vector over the volume enclosed by the surface. This theorem is named after Gauss. 
  Gauss’ Theorem \begin{equation} \label{Eq:II:3:18} \int_S\FLPC\cdot\FLPn\,da=\int_V\FLPdiv{\FLPC}\,dV, \end{equation}  where $S$ is any closed surface and $V$ is the volume inside it.