Stokes’ theorem states that the surface integral of the curl of a vector field over an oriented surface equals the line integral of the vector field around the boundary curve of that surface.

Consider a vector field \(\boldsymbol{F}(x,y,z)=F_x(x,y,z)\hat{\boldsymbol{i}}+F_y(x,y,z)\hat{\boldsymbol{j}}+F_z(x,y,z)\hat{\boldsymbol{k}}\) defined on an open surface \(S\) bounded by a curve \(c\) (see diagram above).
Let the Cartesian axes \(x\) and \(y\) coincide with the edges AB and AD of an infinitesimal rectangular patch ABCD on the surface such that \(AB=dx\) in the \(x\)-direction, \(AD=dy\) in the \(y\)-direction, and \(z=0\). The line integral of \(\boldsymbol{F}\) around the boundary of ABCD is given by:
$$\oint_{\partial(ABCD)}\boldsymbol{F}\cdot d\boldsymbol{r}=\int_{AB}\boldsymbol{F}\cdot d\boldsymbol{r}+\int_{BC}\boldsymbol{F}\cdot d\boldsymbol{r}+\int_{CD}\boldsymbol{F}\cdot d\boldsymbol{r}+\int_{DA}\boldsymbol{F}\cdot d\boldsymbol{r}$$
where \(\partial(ABCD)\) denotes the ABCD boundary curve, the circle on the integral symbol indicates that the integration is taken over a closed curve, and \(\boldsymbol{r}=x\hat{\boldsymbol{i}}+y\hat{\boldsymbol{j}}+z\hat{\boldsymbol{k}}\).
For the edge AB, \(y\) in \(\boldsymbol{F}\) is constant, and so, \(\int_{AB}\boldsymbol{F}\cdot d\boldsymbol{r}\approx F_x(x,y,z)dx\). For the edge BC, \(x\) in \(\boldsymbol{F}\) is a constant at \(x+dx\), and so, \(\int_{BC}\boldsymbol{F}\cdot d\boldsymbol{r}\approx F_y(x+dx,y,z)dy\). For a multivariable function \(f(x_1,x_2,\cdots,x_n)\), the first-order Taylor series about the point \((a_1,a_2,\cdots,a_n)\) is
$$f(x_1,x_2,\cdots,x_n)=f(a_1,a_2,\cdots,a_n)+\sum_{i=1}^n\frac{\partial f(a_1,a_2,\cdots,a_n)}{\partial x_i}(x_i-a_i)$$
Evaluating \(F_y\) at the nearby point \((x+dx,y,z)\), where \((a_1,a_2,a_3)=(x,y,z)\) gives:
$$F_y(x+dx,y,z)=F_y(x,y,z)+\frac{\partial F_y}{\partial x}dx$$
Therefore,
$$\int_{BC}\boldsymbol{F}\cdot d\boldsymbol{r}\approx F_y(x,y,z)dy+\frac{\partial F_y}{\partial x}dxdy$$
For the edge CD, \(y\) in \(\boldsymbol{F}\) is a constant at \(y+dy\), and so, \(\int_{CD}\boldsymbol{F}\cdot d\boldsymbol{r}\approx -F_x(x,y+dy,z)dx\). Using Taylor expansion gives \(\int_{CD}\boldsymbol{F}\cdot d\boldsymbol{r}\approx -F_x(x,y,z)dx-\frac{\partial F_x}{\partial y}dxdy\). Finally, for the edge DA, \(x\) in \(\boldsymbol{F}\) is a constant at \(x\), and so, \(\int_{DA}\boldsymbol{F}\cdot d\boldsymbol{r}\approx -F_y(x,y,z)dy\).
Summing all line integrals of the four edges yields:
$$\oint_{\partial(ABCD)}\boldsymbol{F}\cdot d\boldsymbol{r}\approx\frac{\partial F_y}{\partial x}dxdy-\frac{\partial F_x}{\partial y}dxdy=\biggr(\frac{\partial F_y}{\partial x}-\frac{\partial F_x}{\partial y}\biggr)dxdy\;\;\;\;\;\;\;\;10$$
Notably,
$$\nabla\times\boldsymbol{F}=\begin{vmatrix}\hat{\boldsymbol{i}}&\hat{\boldsymbol{j}}&\hat{\boldsymbol{k}}\\\frac{\partial}{\partial x}&\frac{\partial}{\partial y}&\frac{\partial}{\partial z}\\F_x&F_y&F_z\end{vmatrix}=\hat{\boldsymbol{i}}\biggr(\frac{\partial F_z}{\partial y}-\frac{\partial F_y}{\partial z}\biggr)-\hat{\boldsymbol{j}}\biggr(\frac{\partial F_z}{\partial x}-\frac{\partial F_x}{\partial z}\biggr)+\hat{\boldsymbol{k}}\biggr(\frac{\partial F_y}{\partial x}-\frac{\partial F_x}{\partial y}\biggr)$$
where \(\nabla\times\boldsymbol{F}\) is called the curl of \(\boldsymbol{F}\).
So,
$$(\nabla\times\boldsymbol{F})\cdot\hat{\boldsymbol{k}}=\frac{\partial F_y}{\partial x}-\frac{\partial F_x}{\partial y}\;\;\;\;\;\;\;\;11$$
Substituting eq11 back into eq10 gives:
$$\oint_{\partial(ABCD)}\boldsymbol{F}\cdot d\boldsymbol{r}\approx(\nabla\times\boldsymbol{F})\cdot d\boldsymbol{S}\;\;\;\;\;\;\;\;12$$
where \(d\boldsymbol{S}=\hat{\boldsymbol{k}}dxdy\).

Summing over all infinitesimal rectangle patches that partition the surface \(S\) results in
$$\lim_{dS_i\rightarrow 0}\sum_i\oint_{\partial(ABCD_i=dS_i)}\boldsymbol{F}\cdot d\boldsymbol{r}=\lim_{dS_i\rightarrow 0}\sum_i(\nabla\times\boldsymbol{F})\cdot d\boldsymbol{S}_i\;\;\;\;\;\;\;\;13$$
where the interior edges cancel pairwise, leaving only the contribution from the outer boundary (see diagram above).
Thus, the LHS of eq13 is equivalent to the line integral of \(\boldsymbol{F}\) around the boundary \(c\), while the RHS becomes the surface integral of \(\nabla\times\boldsymbol{F}\) over \(S\):
$$\oint_{c}\boldsymbol{F}\cdot d\boldsymbol{r}=\iint_S(\nabla\times\boldsymbol{F})\cdot d\boldsymbol{S}$$
which is the mathematical expression of the Stokes’ theorem.