# Divergence theorem/Proof

Let ${\displaystyle {\mathbf {E} }({\mathbf {x} })=[E_{x}(x,y,z),E_{y}(x,y,z),E_{z}(x,y,z)]}$ be a smooth (differentiable) three-component vector field on the three dimensional space and ${\displaystyle \nabla \cdot \mathbf {E} ={\frac {\partial E_{x}}{\partial x}}+{\frac {\partial E_{y}}{\partial y}}+{\frac {\partial E_{z}}{\partial z}}}$ is its divergence then the field divergence integral over the arbitrary three dimensional volume ${\displaystyle V}$ equals to the integral over the surface ${\displaystyle S}$ of the field itself projected onto the unite length vector field ${\displaystyle \mathbf {n} (\mathbf {x} )}$ always perpendicular to the surface and pointing outside the surface which contains this volume or otherwise the inner values of the field divergence make virtually no contributions to the integral over the volume i.e,

${\displaystyle \int _{V}\nabla \cdot \mathbf {E} \,\,dV=\int _{S}\mathbf {E} \cdot d\mathbf {S} }$

where ${\displaystyle d\mathbf {S} =\mathbf {n} dS}$ and the ${\displaystyle S}$ wraps the ${\displaystyle V}$.

#### Proof

We can approximate the integral of the divergence over the volume by the finite sum by dividing densely the space inside the volume ${\displaystyle V}$ into small cubes with the edges ${\displaystyle dx=dy=dz}$ and the corners ${\displaystyle [x_{i},y_{j},z_{k}]}$ as well as approximating three of the coordinate derivatives by their difference quotients. We will keep the edges coordinate names for the convenience even if they are equal. We get

${\displaystyle \int _{V}\nabla \cdot \mathbf {E} \,\,dV=\sum _{i,j,k}\left[{\frac {E_{x}(x_{i+1},y_{j},z_{k})-E_{x}(x_{i},y_{j},z_{k})}{dx}}+{\frac {E_{y}({x_{i},y_{j+1},z_{k}})-E_{y}(x_{i},y_{j},z_{k})}{dy}}+{\frac {E_{z}(x_{i,j,k+1})-E_{z}(x_{i,j,k})}{dz}}\right]dxdydz+\Theta (dxdydz)}$

Let us focus on a single contribution to this sum related to the derivative with respect to a chosen coordinate for example ${\displaystyle x}$ i.e. for example ${\displaystyle \sum _{i,j,k}{\frac {E_{x}(x_{i+1},y_{j},z_{k})-E_{x}(x_{i},y_{j},z_{k})}{dx}}dxdydz}$. For a fixed ${\displaystyle j,k}$ we have

${\displaystyle \sum _{i}{\frac {E_{x}(x_{i+1},y_{j},z_{k})-E_{x}(x_{i},y_{j},z_{k})}{dx}}dxdydz=\sum _{i}[E_{x}(x_{i+1},y_{j},z_{k})-E_{x}(x_{i},y_{j},z_{k})]dydz}$

Note now that because of the alternating signs the vast majority of terms in the right sum vanish and we have

${\displaystyle \sum _{i}[E_{x}(x_{i+1},y_{j},z_{k})-E_{x}(x_{i},y_{j},z_{k})]dydz=[E_{x}(x_{1},y_{j},z_{k})-E_{x}(x_{0},y_{j},z_{k})+E_{x}(x_{2},y_{j},z_{k})-E_{x}(x_{1},y_{j},z_{k})+...+E_{x}(x_{n},y_{j},z_{k})-E_{x}(x_{n-1},y_{j},z_{k})]dydz}$

which reduces only to two terms or

${\displaystyle \sum _{i}[E_{x}(x_{i+1},y_{j},z_{k})-E_{x}(x_{i},y_{j},z_{k})]dydz=[E_{x}(x_{n},y_{j},z_{k})-E_{x}(x_{1},y_{j},z_{k})]dydz}$

where the bordering ${\displaystyle [x_{n},y_{j},z_{k}]}$ and ${\displaystyle [x_{1},y_{j},z_{k}]}$ with the first coordinate obviously depending on the choice of ${\displaystyle j}$ and ${\displaystyle k}$ are such that those points are the closed to the surface ${\displaystyle S}$ containing the volume ${\displaystyle V}$.

Also note that while ${\displaystyle dydz}$ is an infinitesimal (small) element of the surface parallel to the ${\displaystyle y-z}$ plane and for the unite vector ${\displaystyle \mathbf {n} _{x}=[1,0,0]}$ perpendicular to it ${\displaystyle \mathbf {E} (x_{n},y_{j},z_{k})\cdot \mathbf {n} _{x}=E_{x}(x_{n},y_{j},z_{k})}$ and so for the second point the right side is an approximate to the growth ${\displaystyle \mathbf {E} \cdot d\mathbf {S} }$ of the surface integral ${\displaystyle \int _{S}\mathbf {E} \cdot d\mathbf {S} }$ i.e.

${\displaystyle E_{x}(x_{n},y_{j},z_{k})dydz=\mathbf {E} \cdot d\mathbf {S} +\Theta (dydz)}$,

${\displaystyle -E_{x}(x_{1},y_{j},z_{k})]dydz=\mathbf {E} \cdot d\mathbf {S} +\Theta (dydz)}$,

Repeating the estimate for the two other dimensions and coming back to the original sum we get

${\displaystyle \int _{V}\nabla \cdot \mathbf {E} \,\,dV=\sum _{j,k}[E_{x}(x_{n_{j,k}},y_{j},z_{k})-E_{x}(x_{1_{j,k}},y_{j},z_{k})]dydz+\sum _{i,k}[E_{y}(x_{i},y_{n_{i,k}},z_{k})-E_{y}(x_{i},y_{1_{i,k}},z_{k})]dxdz+\sum _{i,j}[E_{z}(x_{i},y_{j},z_{n_{i,j}})-E_{z}(x_{i},y_{j},z_{1_{i,j}})]dxdy+\Theta (dxdydz)}$

so the right side is the approximate surface integral (sum over the surfaces of the cubes closest to the surface ${\displaystyle S}$) of the field itself projected on the outward unit vector field which proves the therem i.e.

${\displaystyle \int _{V}\nabla \cdot \mathbf {E} \,\,dV=\int _{S}\mathbf {E} \cdot d\mathbf {S} }$.