Show that $\oint_{\partial S} \psi \,\mathrm{d}\ell = -\iint_S \nabla \psi \times \mathrm{d}S$. I want to prove following identity:

$$\oint_{\partial S} \psi \,\mathrm{d}\ell = -\iint_S \nabla \psi \times \mathrm{d}S. $$

Here $\psi$ is a scalar function. I'm in trouble about understanding this expression. I haven't seen both sides of equality anywhere. The divergence theorem and the Stokes' theorem doesn't seem related to the question. 
 A: You can use the fact: 

Two vectors $u, v$ are equal iff $u\cdot k = v\cdot k$ for all vector $k$.

For any constant vector $k$, we have
$$\require{cancel}\begin{align}k \cdot \oint_{\partial S} \psi d\ell
&= \oint_{\partial S} (\psi k) \cdot d\ell\\
\color{blue}{\text{Stoke's theorem }\rightarrow}&= \int_{S} (\nabla \times (\psi k)) \cdot dS\\
&= \int_{S} ((\nabla \psi) \times k + \psi \color{red}{\cancelto{0}{\color{gray}{(\nabla \times k )}}})\cdot S\\
&= -\int_{S} k \cdot (\nabla \psi \times dS )\\
&= -k\cdot \int_S \nabla \psi \times dS
\end{align}
$$
Since this is true for all $k$, you get
$$\oint_{\partial S} \psi d\ell = -\int_S \nabla \psi \times dS$$
A: The given vector identity follows from Stokes' Theorem:
\begin{align}\oint_{\partial S} \psi\, d{\boldsymbol\ell}&=
\mathbf{i}\oint_{\partial S} (\psi,0,0)\cdot d{\boldsymbol\ell}+
\mathbf{j}\oint_{\partial S} (0,\psi,0)\cdot d{\boldsymbol\ell}+
\mathbf{k}\oint_{\partial S} (0,0,\psi)\cdot d{\boldsymbol\ell}\\
&\stackrel{\text{Stokes}}{=}\mathbf{i}\iint_S(0,\psi_z,-\psi_y)\cdot d{\boldsymbol S}+\mathbf{j}\iint_S(-\psi_z,0,\psi_x)\cdot d{\boldsymbol S}
+\mathbf{k}\iint_S(\psi_y,-\psi_x,0)\cdot d{\boldsymbol S}\\
&=\mathbf{i}\iint_S(\psi_z (d{\boldsymbol S})_y-\psi_y(d{\boldsymbol S})_z)
+\mathbf{j}\iint_S(-\psi_z(d{\boldsymbol S})_x+\psi_x (d{\boldsymbol S})_z)\\
&\qquad\qquad+\mathbf{k}\iint_S(\psi_y (d{\boldsymbol S})_x-\psi_x(d{\boldsymbol S})_y)\\
&=\iint_S  d{\boldsymbol S}\times (\psi_x,\psi_y,\psi_z) =-\iint_S  \nabla \psi\times 
d{\boldsymbol S}.\end{align}
