Gradient of norm of gradient of scalar field I have a function $f:\mathbb{R}^2\rightarrow\mathbb{R}$ representing a surface $z=f(x,y)$ in euclidean space. Is there an elegant way to apply the chain rule to expand $\nabla||\nabla f||_2$, where $||\cdot||_2$ is the euclidean norm?
 A: The gradient of $f$ is a vector field (i.e. a function $\Bbb{R}^2 \to \Bbb{R}^2$). Then the norm is a scalar function $\Bbb{R}^2 \to \Bbb{R}$.
In general, if we have $G \circ F$, where $F \colon \Bbb{R}^2 \to \Bbb{R}^2$ and $G \colon \Bbb{R}^2 \to \Bbb{R}$, then the chain rule says:
$$ \nabla (G \circ F) = \nabla G \cdot DF $$
On the right-hand side, $\nabla G$ is evaluated at $F(x,y)$, and $DF$ means the Jacobian matrix of $F$.
In your example, $F$ is $\nabla f$, so the Jacobian matrix is the matrix of second partial derivatives of $f$:
$$ DF = \begin{pmatrix} f_{xx} & f_{xy} \\ f_{yx} & f_{yy} \end{pmatrix} $$
And for you, $G(x,y) = \sqrt{x^2+y^2}$, so the gradient is
$$ \nabla G = \left( \frac{x}{\sqrt{x^2+y^2}}, \; \frac{y}{\sqrt{x^2+y^2}} \right) $$
As I said above, we want to evaluate this at $F(x,y)$, meaning we want to plug in the derivatves $f_x$ and $f_y$ for $x$ and $y$, so we get:
$$ \nabla G (f_x,f_y) = \left( \frac{f_x}{\left| \nabla f \right|}, \; \frac{f_y}{\left| \nabla f \right|} \right) = \frac{\nabla f}{\left| \nabla f \right|} $$
Now just put it all together, and do the vector-matrix multiplication.
A: Kind of. But we want to do it very rigorously (at least one time). Furthermore we will assume that $f \in C^2(\mathbb{R}^2)$, i.e. that it is twice continuously differentiable. You will later see why.
Now let $g(x) := \lVert x \rVert_2$, $g:\mathbb{R}^2 \rightarrow \mathbb{R}$. Note that we have
$$
\partial_{x_1} g(x) = \partial_{x_1} \sqrt{x_1^2 + x_2^2} = \frac{x_1}{\sqrt{x_1^2 + x_2^2}}
$$
by the chain rule for one variable. You can do the same computation to get $\partial_{x_2} g$. So, (we set $Dg := \nabla g^\top$)
$$
\nabla g(x) = \frac{x}{g(x)} \implies Dg(x) = \frac{x^\top}{g(x)}
$$
which is a formula that can be very useful if you know it by heart. But this also means that $g \in C^1(\mathbb{R} \setminus \lbrace (0, 0)^\top \rbrace)$.
Furthermore let $h: \mathbb{R}^2 \rightarrow \mathbb{R}^2 $, $h(x) := \nabla f(x)$. Note that $Dh(x) = Hf (x)$. So, for $x \in Z$ where $Z := \lbrace y \in \mathbb{R}^2: \nabla f(x) \neq 0 \rbrace $:
$$
D (\lVert \nabla f(x) \rVert_2) = D(g \circ h)(x) = Dg(y)\vert_{y = h(x)}Dh(x) = \frac{1}{\lVert \nabla f(x) \rVert_2}\nabla f(x)^\top Hf(x)
$$
We conclude:
$$
\nabla \lVert \nabla f(x) \rVert_2 = \left( \frac{1}{\lVert \nabla f(x) \rVert_2}\nabla f(x)^\top Hf(x) \right)^\top = \frac{1}{\lVert \nabla f(x) \rVert}_2 Hf(x) \nabla f(x)
$$
I think the latter is the expression you looked for.
Some nice facts:
The assumption $f \in C^2(\mathbb{R})$ allowed us to write $Hf(x)^\top = Hf(x)$ in the very last step. This is calles Schwartz's theorem.
Also, the set $Z$ is open: We can write
$$
Z = \nabla f^{-1}((-\infty, 0) \cup (0, \infty)).
$$
So $Z$ is the preimage of an open set under a continuous function, hence open. (The topology is always the euclidian one...)
