Projection of space onto unit sphere - differentiating it! 
I am trying to differentiate the function that projects each $x\in
 \mathbb{R}^3$ onto the unit sphere, namely:
$$f(x)=\frac{x}{||x||},\quad f(0)=0$$

I know that the derivative is $$Df\big|_{x}(h)=\frac{x\times (h\times x)}{||x||^3}=\frac{h}{||x||}-\frac{x(x\cdot h)}{||x||^3}$$
But I am having a lot of trouble proving it. I can reduce it to:
$$f(x+h)-f(x)-Df\big|_x(h)=x\left(\frac{1}{||x+h||}-\frac{1}{||x||}+\frac{(x\cdot h)}{||x||^3}\right)+o(h)$$
I am struggling to show that the expression in brackets is $o(h)$. It looks like the $||x+h||^{-1}$ is begging for expansion but I'm not sure how to deal with it because they are vectors. Help?
 A: Let us do the computations in $\mathbb{R}^n$ and let $(e_1,\ldots,e_n)$ be the standard basis of $\mathbb{R}^n$. I also assume $\|\cdot\|$ is the euclidean norm on $\mathbb{R}^n$.
Let $i\in\{1,\ldots,n\}$, for all $x:=(x_1,\ldots,x_n)\in\mathbb{R}^n\setminus\{0\}$, one has: $$\partial_if(x)=\frac{\|x\|e_i-x\partial_i\|\cdot\|(x)}{\|x\|^2}=\frac{\displaystyle\|x\|e_i-\frac{x_i}{\|x\|}x}{\|x\|^2}=\frac{1}{\|x\|}e_i-\frac{x_i}{\|x\|^3}x.$$
Therefore, for all $x:=(x_1,\ldots,x_n)\in\mathbb{R}^n\setminus\{0\}$ and for all $h:=(h_1,\ldots,h_n)\in\mathbb{R}^n$, one gets:

$$\mathrm{d}f(x)(h)=\sum_{i=1}^n\partial_if(x)h_i=\frac{1}{\|x\|}\sum_{i=1}^nh_ie_i-\frac{1}{\|x\|^3}\left(\sum_{i=1}^nx_ih_i\right)x=\frac{h}{\|x\|}-\frac{\langle x,h\rangle}{\|x\|^3}x.$$

$\Box$
WARNING. I assume $f$ is differentiable on $\mathbb{R}^n\setminus\{0\}$ when writing: $$\mathrm{d}f(x)(h)=\sum_{i=1}^n\partial_if(x)h_i.$$ The existence of the partial derivatives of $f$ does not suffice to prove that $f$ is differentiable. Some functions admits partial derivatives without being differentiable nor being continuous. 
Howeover, it is not hard to show qualitatively that $f$ is differentiable on $\mathbb{R}^n\setminus\{0\}$ (as a quotient). Indeed, $x\mapsto\|x\|$ is differentiable on $\mathbb{R}^n\setminus\{0\}$ as the composition of $t\mapsto\sqrt{t}$ (differentiable on $\mathbb{R}_+^*$) and $x\in\mathbb{R}^n\setminus\{0\}\mapsto\|x\|^2\in\mathbb{R}_+^*$ (polynomial in the coordinates).

Remark (computation of the partial derivatives of $\|.\|$). For all $x\in\mathbb{R}^n$, one has: $$\|x\|=\sqrt{\sum_{i=1}^nx_i^2}.$$
Therefore, for all $i\in\{1,\ldots,n\}$, one has: $$\partial_i\|\cdot\|(x)=\frac{2x_i}{\displaystyle2\sqrt{\sum_{i=1}^nx_i^2}}=\frac{x_i}{\|x\|}.$$
A: I assume you mean computing the gradient restriction of the vector field $x/\|x\|$ defined over all of $\mathbb R^n \{0\}$, on the $(n-1)$-dimensional unit-sphere
The following fact is proved here https://math.stackexchange.com/a/1936635/168758.

Fact. Let $M$ be a smooth manifold embedded in $\mathbb R^n$ and let $f:\mathbb R^n \to \mathbb R^m$ be a differentiable function. Then $f|_M$ is differentiable and $df|_M(x;h) = \langle \mbox{proj}_{T_x M}(\nabla f(x)), h\rangle$, the projection of $\nabla f(x)$ onto $T_xM$, the tangent space of $M$ at $x$


In your case, $M = \mathbb S_{n-1} := \{x \in \mathbb R^n \mid \|x\| = 1\}$, the $(n-1)$-dimensional unit-sphere in $\mathbb R^n$.
One easily computes $T_x M = x^\perp := \{y \in \mathbb R^n \mid y^\top x = 0\}$, and the projection onto $T_x M$ is given by $\mbox{proj}_{T_x M}(v) = \mbox{proj}_{x^\perp}(v) = (I_n - xx^T)v$, for all $x \in M$.
In your specific problem, you have $f(x) := g(x/\|x\|)$ for $x \in \mathbb R^n\setminus\{0\}$ (with arbitrary continuation at $O$). Thus, $\nabla f(x) = g'(x/\|x\|)\cdot \dfrac{I_n-xx^\top/\|x\|^2}{\|x\|} \in \mathbb R^{n \times m}$, which is already a vector field on $T_x M$ (i.e no need to project).
