Relation between line integral of scalar function and surface integral I've seen the following identity on a book: 
$$\int_{\partial S} f \, d\vec{\ell} = \iint_S d\vec{S} \times \nabla f$$
where $f$ is a scalar function and $\partial S$ is a closed curve.
I've been trying to prove it but I don't know where to start. 
 A: Let $\vec F$, the open surface $S$ and its boundary $\partial S$ meet the conditions of Stokes' Theorem.  Then, we have   
$$\oint_{\partial S} \vec F\cdot \hat t\,d\ell=\int_S \nabla\times\vec F\cdot \hat n\,
dS$$
Now, let $\vec F=\hat x_i f$.  Then, $\nabla \times \vec F=\nabla f\times \hat x_i$ and we have
$$ \oint_{\partial S}(\hat x_if) \cdot\,\hat t\,d\ell= \int_S (\nabla f\times \hat x_i)\cdot \hat n\, dS \tag1$$
Next, note that we have
$$\oint_{\partial S}(\hat x_if) \cdot\,\hat t\,d\ell=\hat x_i \cdot \oint_{\partial S}f\,d\vec\ell\tag2$$
and using the vector triple product we have
$$\begin{align}
\int_S (\nabla f\times \hat x_i)\cdot \hat n\, dS=\hat x_i\cdot \int_S \hat n\times \nabla f\, dS\tag3
\end{align}$$
Substituting $(2)$ and $(3)$ into $(1)$ yields
$$\hat x_i \cdot \oint_{\partial S}f\,d\vec\ell=\hat x_i\cdot \int_S \hat n\times \nabla f\, dS\tag4$$
Since $(4)$ is true for all $i$, then we conclude that 
$$\oint_{\partial S}f\,d\vec\ell=\int_S \hat n\times \nabla f\, dS$$
as was to be shown!
