Gradient in coordinates of function in 2-sphere Let $\mathbb{S}^{2}$ a 2-sphere that is subset of $\mathbb{R}^{3}$ and let a function $f:\mathbb{S}^{2}\longrightarrow \mathbb{R}$ defined by $f(x,y,z)=z$. Compute in coordinates the gradient $\nabla f$ with a metric of $\mathbb{S}^{2}$. I am unable to calculate the metric and inverse matrix coefficients using stereographic projection and I am a little confused in this step. A helping hand is very grateful.
 A: Let $i : \mathbb{S}^2 \to \mathbb{R}^3$ be the inclusion. It is an embedding and its differential at a point $p \in \mathbb{S}^2$ is just the inclusion of the tangent space $\mathrm{d}i_p : T_p\mathbb{S}^2=p^{\perp} \to \mathbb{R}^3$.
The metric on the sphere is defined to be the pullback metric $g=i^*g_0$ where $g_0$ is the euclidean metric.
Let $h : \mathbb{R}^3 \to \mathbb{R}$ be defined by $h(x,y,z) = z$ and let $f$ be its restriction to the sphere. We have
$$
f = h\circ i
$$
Thus, we have
$$
\forall p \in \mathbb{S}^2,~ \mathrm{d}f_p = \mathrm{d}h_{f(p)}\circ \mathrm{d}i_p = \mathrm{d}h_p\circ \mathrm{d}i_p
$$
and if $v$ is a tangent vector at $p$, then
$$
\mathrm{d}f_p(v) = \mathrm{d}h_p \circ \mathrm{d}i_p(v) = \mathrm{d}h_p(v)
$$
Now, the gradient of $f$ at $p$, say $\mathrm{grad}f_p$, is defined to be the unique tangent vector in $T_p\mathbb{S}^2$ such that
$$\forall v \in T_p\mathbb{S}^2,~ \mathrm{d}f_p(v) = g_p\left(\mathrm{grad}f_p,v \right)
$$
Let $\partial_z=(0,0,1)$ be the third coordinate vector in the canonical basis. It is the usual gradient of $h$ in $\mathbb{R}^3$, so that
$$
\mathrm{d}h_p(v) = \langle \partial_z,v\rangle
$$
If $\pi^\perp_p$ is the orthogonal projection from $\mathbb{R}^3$ to $T_p\mathbb{S}^2$, $\pi^{\perp}_p\partial_z \in T_p\mathbb{S}^2$ and for all $v$ tangent to the sphere at $p$:
$$
\mathrm{d}f_p(v) = \langle\partial_z,v \rangle = \langle \pi^{\perp}_p\partial_z,v\rangle = \langle \mathrm{d}i_p(\pi^{\perp}_p\partial_z),\mathrm{d}i_p(v) \rangle = g_p\left( \pi^{\perp}_p\partial_z,v\right)
$$
And this shows that $\mathrm{grad}f_p = \pi^{\perp}_p\partial_z$. Thus,
$$
\mathrm{grad}f_p = \partial_z - \langle \partial_z,p\rangle p =(-zx,-zy,1-z^2)
$$
if $p=(x,y,z) \in \mathbb{S}^2 \subset \mathbb{R}^3$. As a consequence, one can see that at the north and south poles (where $p = \pm \partial_z$), the gradient of $f$ is zero, which correspond to extrema of the function $f$.
More generally, let $M \hookrightarrow N$ be an embedded submanifold, $g_0$ a riemannian metric on $N$, and $g$ the induced metric on $M$. Let $h : N \to \mathbb{R}$ be a smooth real function and $f$ its restriction of $M$. Then
$$\mathrm{grad}f_p = \pi^{\perp}_p (\mathrm{grad}h_p)$$
where $\pi^{\perp}_p : T_pN \to T_pM$ is the orthogonal projection with respect to $g_0$. The proof is the same as above.
