Curl (Kelvin-Stokes) theorem

Let $${\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 the field $$\nabla\times \mathbf{E}=\left[\frac{\partial E_z}{\partial y}-\frac{\partial E_y}{\partial z}, \frac{\partial E_x}{\partial z}-\frac{\partial E_z}{\partial x},\frac{\partial E_y}{\partial x}-\frac{\partial E_x}{\partial y}\right]$$ is its curl then the integral of the field curl projection onto the unite length vector field $$\mathbf{n}(\mathbf{x})$$ always perpendicular to the surface and pointing outside the surface over the arbitrary two dimensional surface $$S$$ equals to the integral over the boundary of the surface $$\partial S$$ of the field itself projected onto the smooth unite length vector field $$\mathbf{m}(\mathbf{x})$$ always tangent to this boundary or otherwise the out of the surface edge values of the field make virtually no contributions to the integral over the surface providing that the field is sufficiently smooth that the curl exists on the surface i.e.

$$\int_S (\nabla \times\mathbf{E})\cdot d \mathbf{S}=\oint\limits_{\partial S} \mathbf{E} \cdot d \mathbf{l}$$

where $$d \mathbf{S}= \mathbf{n} dS $$, $$d \mathbf{l}= \mathbf{m} dl $$ and the $$\partial S$$ is the edge of $$S$$.

Proof
We can approximate the integral of the curl over the surface by the finite sum by dividing densely the space around the surface $$S$$ into small cubes with the edges $$dx=dy=dz$$ and the corners $$[x_{i},y_{j},z_{k}]$$ and approximating the surface $$S$$ by the walls of those cubes which are the closet to the surface as well as the coordinate derivatives of the field $${\mathbf E}$$ in the curl by their difference quotients. We will keep the edges coordinate names for the convenience even if they are equal and keep the cube corners coordinate indices $$i,j,k$$ even if they are constrained by the closeness to the surface.

We get

$$\int_S (\nabla \times\mathbf{E})\cdot d \mathbf{S}=\sum_{i,j,k} \sgn_{yz}(i,j,k) \left [ \frac{E_z(x_i,y_{j+1},z_k) - E_z(x_i,y_j,z_k)}{dy}-\frac{E_y({x_i,y_j,z_{k+1}}) - E_y(x_i,y_j,z_k)}{dz} \right ] dydz+$$ $$\sgn_{xz}(i,j,k) \left [ \frac{E_x(x_i,y_j,z_{k+1}) - E_x(x_i,y_j,z_k)}{dz}-\frac{E_z({x_{i+1},y_j,z_k}) - E_z(x_i,y_j,z_k)}{dx} \right ] dxdz + $$ $$\sgn_{xy}(i,j,k) \left [ \frac{E_y(x_{i+1},y_j,z_k) - E_y(x_i,y_j,z_k)}{dx}-\frac{E_x({x_i,y_{j+1},z_k}) - E_x(x_i,y_j,z_k)}{dy} \right ] dxdy + \Theta(dydz)+\Theta(dxdz)+\Theta(dxdy),$$

where $$\sgn_{lm}(i,j,k)$$ is the sign of the contribution depending if the wall of the cube is facing the positive or the negative direction of the perpendicular coordinate.

Note that while $$dy dz$$ is an infinitesimal (small) element of the surface parallel to the $$y-z$$ plane and for the unite vector $$\mathbf{n}_x=[1,0,0]$$ perpendicular to it $$\pm (\nabla \times\mathbf{E}) (x_{n},y_j,z_k) \cdot \mathbf{n}_x = \pm \left [ \frac{E_z(x_i,y_{j+1},z_k) - E_z(x_i,y_j,z_k)}{dy}-\frac{E_y({x_i,y_j,z_{k+1}}) - E_y(x_i,y_j,z_k)}{dz} \right ]$$ and each term if the sum is an approximate to the growth $$(\nabla \times\mathbf{E}) \cdot d \mathbf{S}$$ of the surface integral $$\int_S  (\nabla \times\mathbf{E}) \cdot d \mathbf{S}$$ i.e.

$$\sgn_{yz}(i,j,k) \left [ \frac{E_z(x_i,y_{j+1},z_k) - E_z(x_i,y_j,z_k)}{dy}-\frac{E_y({x_i,y_j,z_{k+1}}) - E_y(x_i,y_j,z_k)}{dz} \right ] dy dz = (\nabla \times\mathbf{E}) \cdot d \mathbf{S} + \Theta(dydz)$$.

Now the essential in proving the theorem is to focus on the contribution to the finite sum approximating the curl surface integral from the one component of the $$\mathbf{E}$$ field itself and notice that because of the cancelation of the sign alternating term the sums reduce to only the end points. For example for $$E_z$$ and the fixed $$z$$-slice $$k$$ and its surface we have

$$\sum_{i,j} \sgn_{yz}(i,j,k) \left [ \frac{E_z(x_i,y_{j+1},z_k) - E_z(x_i,y_j,z_k)}{dy}\right ] dydz- \sgn_{xz}(i,j,k) \left [\frac{E_z({x_{i+1},y_j,z_k}) - E_z(x_i,y_j,z_k)}{dx} \right ] dxdz =(E_z(x_n,y_n,z_k)-E_z(x_1,y_1,z_k))dz $$,

where $$x_n, y_n, z_k$$ and $$x_1, y_1, z_k$$, are the coordinates of the cubic lattice corners near the approximate surface. To notice that one may consider two cases of the pieces of the approximate surface: 1) When the piece is the long rectangle consisting of many squares with the side $$dx=dy=dz$$ and with one side of this length. The sign-alternating terms cancel directly in the sum of difference quotients of the type $$\sum_{i,j} \sgn_{yz}(i,j,k) \left [ \frac{E_z(x_i,y_{j+1},z_k) - E_z(x_i,y_j,z_k)}{dy}\right ] dydz$$ to the endpoint values which later cancel with joining contributions. 2) The piece is the "stairs" of the width $$dx$$ climbing up or down by $$dx$$. In that case the terms cross-cancel to the end points to further cancel with joining contributions between the sum

$$\sum_{i,j} \sgn_{yz}(i,j,k) \left [ \frac{E_z(x_i,y_{j+1},z_k) - E_z(x_i,y_j,z_k)}{dy}\right ] dydz$$ and $$-\sgn_{xz}(i,j,k) \left [\frac{E_z({x_{i+1},y_j,z_k}) - E_z(x_i,y_j,z_k)}{dx} \right ] dxdz$$.

Also note that while $$dz$$ is an infinitesimal (small) linear element of the surface boundary parallel to the $$z$$ axis and for the unite vector $$\mathbf{n}_z=[0,0,1]$$ parallel to it $$\mathbf{E} (x_{n},y_j,z_k) \cdot \mathbf{n}_z = E_z(x_{n},y_n,z_k)$$ and so for the second point with the minus sign the right side is an approximate to the growth $$\mathbf{E} \cdot d \mathbf{l}$$ of the surface edge integral $$\oint\limits_{\partial S} \mathbf{E} \cdot d \mathbf{l}$$ i.e.

$$(E_z(x_n,y_n,z_k)-E_z(x_1,y_1,z_k))dz = \mathbf{E} \cdot d \mathbf{l} + \Theta(dz)$$.

Summing up all the all the $$dz$$ contributions over $$k$$ and repeating the considerations for the field components $$E_x$$, $$E_y$$ leading to the $$dx$$ and the $$dy$$ contributions of the surface edge integral we get $$\int_S (\nabla \times\mathbf{E})\cdot d \mathbf{S}=\sum_{i,j,k} [E_x(x_{i},y_{ni},z_{ni})-E_x(x_{i},y_{1i},z_{1i})]dx+[E_y(x_{nj},y_{j},z_{nj})-E_y(x_{1j},y_{j},z_{1j})]dy+[E_z(x_{nk},y_{nk},z_k)-E_z(x_{1k},y_{1k},z_k)]dz$$

and so finally prove $$\int_S (\nabla \times\mathbf{E})\cdot d \mathbf{S}=\oint\limits_{\partial S} \mathbf{E} \cdot d \mathbf{l}$$.