Green's theorem (integration by parts) on the unit sphere 
*

*List item


I am missing something here and I need help to find it:
Since the unit sphere $\mathbb{S}^{n-1}$ in $\mathbb{R}^{n}$ has no boundary, then given a smooth function $\phi$ and a smooth vector field
$\psi$ we can integrate by parts 
$$\int_{\mathbb{S}^{n-1}}\phi \nabla_{\mathbb{S}^{n-1}}\cdot\psi\, d\omega_n=-
\int_{\mathbb{S}^{n-1}} \nabla_{\mathbb{S}^{n-1}} \phi\cdot\psi\, d\omega_n \qquad (1)$$
where $\nabla_{\mathbb{S}^{n-1}}$ is the surface gradient on the sphere, and $\omega_n$ is the standard Surface measure on $\mathbb{S}^{n-1}$.
Therefore we have that 
$$\int_{\mathbb{S}^{n-1}} \nabla_{\mathbb{S}^{n-1}}\cdot\psi d\omega_n=0\qquad \qquad\qquad\qquad (2)$$ for any smooth vector field $\psi$.
Obviously, the smoothness condition is not necessary in the aforementioned statements. It can be relaxed to some appropriate integrability conditions. 
   Now, take the simple explicit example of the 
unit sphere $\mathbb{S}^{2}$ in $\mathbb{R}^{3}$, and for each point $(x,y,z)\in \mathbb{S}^{2}$, consider the parametric representation $(x,y,z)=(\cos{\theta},\sin{\theta}\cos{\varphi},\sin{\theta}\sin{\varphi})$,
$0\leq \theta \leq \pi$, $0\leq \varphi< 2\pi$. Then, we have
$$d\omega_3=\sin{\theta} d\theta d \varphi,$$
$$\nabla_{\mathbb{S}^{2}}=\frac{\partial}{\partial \theta} \widehat{\theta}+\frac{1}{\sin{\theta}}\frac{\partial}{\partial \varphi} \widehat{\varphi}$$ where $\widehat{\theta}$ and 
$\widehat{\varphi}$ are the standard orthonormal unit vectors tangent to the sphere pointing in the direction of increase of $\theta$ and $\varphi$ respectively.
We can write 
$$\frac{1}{\sin{\theta}}=\nabla_{\mathbb{S}^{2}}\cdot
\left(\frac{\theta}{\sin{\theta}} \nabla_{\mathbb{S}^{2}} \theta\right).$$
To verify this, one needs to recall that
$\nabla_{\mathbb{S}^{2}} \cdot\nabla_{\mathbb{S}^{2}} \theta=
\Delta_{\mathbb{S}^{2}} \theta$, where
$\Delta_{\mathbb{S}^{2}}=\frac{1}{\sin{\theta}}\frac{\partial}{\partial \theta} \left(\sin{\theta}\frac{\partial}{\partial \theta}\right)+
\frac{1}{\sin^2{\theta}}\frac{\partial^2}{\partial \varphi^2}$
is the Laplace Beltrami operator on $\mathbb{S}^{2}$.
On the other hand
$$\int_{\mathbb{S}^{2}} \frac{1}{\sin{\theta}}d\omega_3=
\int_{0}^{2\pi}\int_{0}^{\pi} \frac{1}{\sin{\theta}}\sin{\theta}d \theta d\varphi=2\pi^2\neq 0.$$
Where is my mistake ?
 A: The problem here is that your vector field $X= \frac{\theta}{\sin \theta} \hat{\theta}$ is not smooth at the North and South poles. So when applying Green you should remove small disks $N_\epsilon$ and $S_\epsilon$ (say of radius $\epsilon>0$) around the poles and add the contribution from contour integration around the boundaries of those disks.
Now for $N_\epsilon$ it turns out that this contribution goes to zero as $\epsilon\rightarrow 0$ (I leave you to figure out the details). For $S_\epsilon$, however, you get a non-vanishing contribution. In local coordinates, writing $\theta=\pi-r$ (thus $r$ close to zero), the vector field becomes:
$$ X= \frac{\theta}{\sin \theta} \hat{\theta} = \frac{\pi}{r} \hat{r} + O(r^0)$$
so when you integrate this along $\partial S_\epsilon$ using the line element $d\ell=r\;d\phi$ you get:
 $$ \oint_{\partial S_\epsilon} X\cdot \hat{r} \; d\ell = \int_0^{2\pi} \frac{\pi}{r} rd\phi + O(\epsilon) =2 \pi^2 + O(\epsilon),$$
i.e. in accordance with the divergence theorem and your calculation.
