Smoothness at the origin of a radial function obtained by rotating an even function

Let $f:\mathbb{R}\to\mathbb{R}$ be a smooth even function. Define $g:\mathbb{R}^n\to\mathbb{R}$ by $g(x)=f(|x|)$. How to show that $g$ is smooth at the origin?

We can calculate $$\frac{\partial g}{\partial x^i}=\begin{cases} f'(|x|)\frac{x^i}{|x|} & \text{if $x\neq 0$} \\ 0 & \text{if $x=0$.}\end{cases}$$

Then since $f'(0)=0$, we see that $\partial g/\partial x^i$ is continuous everywhere, so that $g$ is $C^1$.

We can continue and calculate $\partial^2 g/\partial x^j\partial x^i$ and check that it is everywhere continuous, but it's annoying, and then we've only shown that $g$ is $C^2$, and I don't see how to induct. Is there an easier way?


First, I will show that the function $h:\mathbb{R}\to\mathbb{R}$ defined by $$ h(x) = \begin{cases} \frac{f'(x)}{x} & \text{if $x\neq 0$} \\ f''(0) & \text{if $x=0$}\end{cases} $$ is even and smooth. By L'Hôpital's rule, $h$ is continuous at $x=0$. The evenness of $h$ follows from the fact that $f'$ is odd. To show the smoothness of $h$, we can calculate that for $x\neq 0$ and $m\geq 1$, \begin{align*} h^{(m)}(x) &= \sum_{k=0}^m \binom{m}{k} f^{(m-k+1)}(x)\cdot(-1)^kk!x^{-k-1} \\ &= \frac{\sum_{k=0}^m (-1)^k k!\binom{m}{k}x^{m-k}f^{(m-k+1)}(x)}{x^{m+1}}. \end{align*} We use L'Hôpital's rule to find $\lim_{x\to 0} h^{(m)}(x)$. The limit is of the indeterminant form $\frac{0}{0}$, and we get \begin{align} \lim_{x\to 0} h^{(m)}(x) &= \lim_{x\to 0} \frac{\sum_{k=0}^{m-1} (-1)^kk!\binom{m}{k}(m-k)x^{m-k-1}f^{(m-k+1)}(x) + \sum_{k=-1}^{m-1}(-1)^{k+1}(k+1)!\binom{m}{k+1}x^{m-k-1}f^{(m+1-k)}(x)}{(m+1)x^m} \\ &= \lim_{x\to 0} \frac{x^mf^{(m+2)}(x)}{(m+1)x^m} \\ &= \frac{f^{(m+2)}(0)}{m+1}. \end{align} If we assume that $h^{(m-1)}(x)$ is continuous, then the above shows (see Rudin's Principles of Mathematical Analysis, Exercise 5.9) that $h^{(m)}(0)$ exists and moreover that $h^{(m)}(x)$ is continuous at $x=0$. By induction, $h$ has derivatives of all orders.

Now back to the original problem. I noted in my statement of the question that we can calculate that $$ \frac{\partial g}{\partial x^i} = \begin{cases} h(|x|)x^i & \text{if $x\neq 0$} \\ 0 & \text{if $x=0$.}\end{cases} $$ This shows that $g$ is $C^1$. We have thus proven for $k=1$ the statement "Given any $f:\mathbb{R}\to\mathbb{R}$ smooth and even, $g:\mathbb{R}^n\to\mathbb{R}$ defined by $g(x)=f(|x|)$ is $C^k$". Assuming the statement proved for $k$, it is also proved for $k+1$. For the above expression shows that each partial derivative of $g$ is $C^k$ (we apply the induction hypothesis to $h$). This completes the proof.


The purpose of this answer is to note that the proof given by @frakbak here can be used to prove something a bit stronger:

We can replace the assumption that $f$ is even by the weaker assumption that all its odd order derivatives vanish at zero.

That is, let $f:[0,\infty) \to\mathbb{R}$ be smooth and suppose that all its odd order derivatives vanish at zero. Then the map $g_f:\mathbb{R}^n\to\mathbb{R}$ given by $g_f(x)=f(\|x\|)$ is smooth.

In fact, $g_f$ is smooth if and only if $f$ satisfies the conditions above. (see comment at the end).

We shall prove this by induction:

More specifically, we will prove that for every natural $k$ given any such $f$, $g_f \in C^k$.

The case $k=1$:

Direct calculation shows that $$\frac{\partial g}{\partial x^i}(x)=\begin{cases} f'(\|x\|)\frac{x^i}{\|x\|} & \text{if $x\neq 0$} \\ 0 & \text{if $x=0$}\end{cases} \tag{1}$$ which is continuous at the origin. Indeed,

$$ \lim_{x \to 0}f'(\|x\|)\frac{x^i}{\|x\|} =\lim_{x \to 0}\frac{f'(\|x\|)-f'(0)}{\|x\|}x^i=f''(0)\cdot \lim_{x \to 0}x^i=0.$$

Comment: The claim $\frac{\partial g}{\partial x^i}(0)=0$ relies upon the assumption $f'(0)=0$. In general, we would get $"\frac{\partial g}{\partial x^i}(0)=\pm f'(0)$, i.e. to different left and right derivatives.

This proves the claim for $k=1$.

Now, we assume that the claim holds for $k$ and proves it for $k+1$:

Using equation $(1)$, we can write $$\frac{\partial g}{\partial x^i}(x)= F(\|x\|)x^i \tag{2}$$ where $F:[0,\infty) \to\mathbb{R}$ is defined by $$F(x) := \begin{cases} \frac{f'(x)}{x} & \text{if $x\neq 0$} \\ f''(0) & \text{if $x=0$}\end{cases}.$$

Now, $f \in C^{\infty} \Rightarrow f' \in C^{\infty}$ which together with $f'(0)=0$, imply that $F \in C^{\infty}$, and $F^{m}(0)=\frac{f^{(m+2)}(0)}{m+1}$ for every natural $m$. Thus, all the odd derivatives of $F$ vanish at zero. The induction hypothesis (applied for $F$) imply that $x \mapsto F(\|x\|)$ is in $C^{k}$, thus by equation $(2)$ $g \in C^{k+1}$ as required.


A proof that these conditions on $f$ are necessary for $g_f$ to be smooth:

Suppose that $g_f(x)=f(\|x\|)$ is smooth. Then $x \mapsto g(0,\dots,0,x,0\dots,0)=f(|x|) $, is smooth which in turn implies $f$ is infinitely differentiable at zero, and that all derivatives of $f$ of odd order vanish at zero.

Note that for positive $x$ the map $x \mapsto f(|x|)$ coincides with $f(x)$ so $f$ must be smooth also on $(0,\infty)$.