Module 1 : A Crash Course in Vectors
Lecture 4 : Gradient of a Scalar Function
  We can generalize the above to closely packed volumes and conclude that the flux out of the bounding surface $S$ of a volume $V$ is equal to the sum of fluxes out of the elemental cubes. If $\Delta V$ is the volume of an elemental cube with $\Delta S$ as the surface, then,
\begin{displaymath}\int_S\vec F\cdot\vec{dS}= \sum\int_{\Delta S}\vec F\cdot{dS}... ...}\left(\frac{1}{\Delta V}\int\vec F\cdot\vec{dS}\right)\Delta V\end{displaymath}
  The quantity in the bracket of the above expression was defined as the divergence of $\vec F$, giving
 
  This is known as the Divergence Theorem.
  We now calculate the divergence of $\vec F$ from an infinitisimal volume over which variation of $\vec F$ is small so that one can retain only the first order term in a Taylor expansion. Let the dimensions of the volume element be $\Delta x\times\Delta y\times\Delta z$ and let the element be oriented parallel to the axes.
  Consider the contribution to the flux from the two shaded faces. On these faces, the normal is along the $+\hat\jmath$ and $-\hat\jmath$ directions so that the contribution to the flux is from the y-component of $\vec F$ only and is given by
   
8