$f(x) = \|\textbf{x}\|\textbf{x}$, first derivative, second derivative. Consider the function $f: \mathbb{R}^n \to \mathbb{R}^n$ given by $f(x) = \|\textbf{x}\|\textbf{x}$. Is $f$ differentiable at $\textbf{0}$? Do the second-order partial derivatives of $f$ exist at $\textbf{0}$?
 A: Hint: Start thinking small. For $n=1$, you have $f(x) = |x|x$, which is $x^2$ for $x \geq 0$ and $-x^2$ for $x \leq 0$. Then you can see from the graph that its derivative is zero at $x=0$. With this, you might suspect that $f'(0) = 0$ in the general case, so try to check that. About second derivatives, go back to $n=1$, and make the graph of $f'(x)$ to conclude.
A: $f$ is differentiable at ${0}$ if and only if there exists a linear map $L: \mathbb{R}^n \to \mathbb{R}^n$ such that$$\lim_{\|{h}\| \to 0} {{f({h}) - f({0}) - L({h})}\over{\|{h}\|}}$$exists. $L$ is certainly a linear map, and we have$$\lim_{\|{h}\| \to 0} {{f({h}) - f({0}) - L({h})}\over{\|{h}\|}} = \lim_{\|h\| \to 0} {{\|{h}\|{h}}\over{\|{h}\|}} = \lim_{\|{h}\| \to 0} {h} = {0}.$$The existence of this limit implies that $f$ is differentiable at ${0}$. Moreover, the Jacobian $L$ of $f$ at ${0}$ is the zero matrix, so all first-order partial derivatives at $0$ are $0$.
We can also deal with this part directly:$${{\partial f_i}\over{\partial x_i}} = {\partial\over{\partial x_i}}\left( x_i \sqrt{x_1^2 + \dots + x_i^2 + \dots + x_n^2}\right)$$$$= \sqrt{x_1^2 + \dots + x_i^2 + \dots +  x_n^2} + {{x_i^2}\over{\sqrt{x_1^2 + \dots + x_i^2 + \dots + x_n^2}}} = \|x\| + {{x_i^2}\over{\|x\|}}.$$And also,$${{\partial f_j}\over{\partial x_i}} = {\partial\over{\partial x_i}} \left( x_j \sqrt{x_1^2 + \dots + x_i^2 + \dots + x_n^2}\right)$$$$=x_j {1\over{2\sqrt{x_1^2 + \dots + x_i^2 + \dots + x_n^2}}}2x_i = {{x_jx_i}\over{\|x\|}}.$$Now let us consider$$\lim_{\|x\| \to 0} {{\partial f_i}\over{\partial x_i}} = \lim_{\|x\| \to 0} \|x\| + \lim_{\|x\| \to 0} {{x_i^2}\over{\|x\|}} = 0 + \lim_{\|x\| \to 0} {{x_i^2}\over{\|x\|}}.$$But$${{x_i^2}\over{\|x\|}} \le {{x_i^2}\over{\sqrt{x_i^2}}} = {{x_i^2}\over{|x_i|}}$$and$$\lim_{\|x\| \to 0} {{x_i^2}\over{|x_i|}} = 0$$clearly, so$$\lim_{\|x\| \to 0} {{\partial f_i}\over{\partial x_i}} = 0.$$And similarly for$$\lim_{\|x\| \to 0} {{\partial f_j}\over{\partial x_i}} = 0.$$Thus, all first-order partial derivatives exist and are continuous, and are $0$ at $0$, so we are done with that part.
With regards to second-order partial derivatives, the answer is no, and the reasoning is as follows. Look even at the simplest case when $n = 0$. Then$$f(x) = |x|x \implies f'(x) = |2x|,$$which is well-known to be not differentiable. Similar phenomenon can be observed in the general case.
