Let \(f:\mathbb R^n\setminus\{0\}\to\mathbb R\) be differentiable. Suppose that for each \(j=1,\dots,n\) the limit \[ \lim_{x\to0}\frac{\partial f}{\partial x_j}(x) \] exists.
- Can \(f\) be extended to a continuous map \(\mathbb R^n\to\mathbb R\)?
- Assuming continuity at the origin, is the extension differentiable at the origin?
Solution
For \[ j=1,\ldots,n, \] write \[ a_j \coloneqq \lim_{x\to0}\frac{\partial f}{\partial x_j}(x), \qquad a\coloneqq(a_1,\ldots,a_n). \]
1. The gradient is bounded on some punctured neighborhood of theorigin, and\[ \nabla f(x)\longrightarrow a \]as \(x\to0\).
For each \(j\), the stated finite limit implies that \[ \frac{\partial f}{\partial x_j} \] is bounded on some punctured neighborhood of \(0\). Since there are only finitely many coordinates, there are \(\delta>0\) and \(M>0\) such that \[ \|\nabla f(x)\|\le M \] whenever \[ 0<\|x\|<\delta. \]
Coordinatewise convergence in the finite-dimensional space \(\RR^n\) is equivalent to convergence in the Euclidean norm, so the same hypotheses give \[ \nabla f(x)\to a. \]
2. If \(n=1\), the hypotheses do not in general force a continuousextension to the origin.
Define \[ f(x) = \begin{cases} 0,&x<0,\\ 1,&x>0. \end{cases} \] Then \(f\) is differentiable on \(\RR\setminus\{0\}\) and \[ f'(x)=0 \] there, so \[ \lim_{x\to0}f'(x)=0. \] However, \[ \lim_{x\to0^-}f(x)=0 \qquad\text{and}\qquad \lim_{x\to0^+}f(x)=1. \] Thus no choice of \(f(0)\) makes the function continuous at \(0\).
3. Assume \(n\ge2\). If\[ 0<\|x\|,\|y\|<\delta, \]then there is a piecewise \(C^1\) path in\[ B_\delta(0)\setminus\{0\} \]from \(x\) to \(y\) whose length is at most\[ (\pi+2)\max\{\|x\|,\|y\|\}. \]
Write \[ x=r u, \qquad y=s v, \] where \[ r=\|x\|, \qquad s=\|y\|, \qquad \|u\|=\|v\|=1, \] and put \[ \rho=\max\{r,s\}. \]
First move radially from \(ru\) to \(\rho u\), then along a shortest great-circle arc on the sphere of radius \(\rho\) from \(\rho u\) to \(\rho v\), and finally radially from \(\rho v\) to \(sv\). Such an arc exists because \(n\ge2\), and its length is at most \(\pi\rho\). The two radial pieces have total length \[ (\rho-r)+(\rho-s)\le2\rho. \] Hence the whole path has length at most \[ (\pi+2)\rho. \] It stays on points of norm between \(\min\{r,s\}\) and \(\rho\), except possibly that one radial segment is constant, so it never meets the origin and lies inside \(B_\delta(0)\).
4. If \(n\ge2\), then for\[ 0<\|x\|,\|y\|<\delta \]one has\[ |f(x)-f(y)| \le M(\pi+2)\max\{\|x\|,\|y\|\}. \]
Take the path from step 3 and split it into its finitely many smooth pieces, each parameterized by arclength. On each piece \(\gamma\), the one-variable function \[ t\longmapsto f(\gamma(t)) \] is differentiable, and the chain rule with step 1 gives \[ \left| \frac{d}{dt}f(\gamma(t)) \right| = |\nabla f(\gamma(t))\cdot\gamma'(t)| \le M \] because \(\|\gamma'(t)\|=1\). The one-variable mean value theorem on each piece therefore bounds the change of \(f\) by \(M\) times the length of that piece. Summing over the pieces and using step 3 gives the displayed inequality.
5. If \(n\ge2\), the limit\[ L\coloneqq\lim_{x\to0}f(x) \]exists.
Let \(\varepsilon>0\). Choose \[ 0<\eta<\delta \] such that \[ M(\pi+2)\eta<\varepsilon. \] Then step 4 gives \[ |f(x)-f(y)|<\varepsilon \] whenever \[ 0<\|x\|,\|y\|<\eta. \] Thus \(f\) satisfies the Cauchy criterion for a finite limit at the puncture. Since \(\RR\) is complete, the limit \(L\) exists.
6. Consequently, for \(n\ge2\), defining\[ F(0)=L, \qquad F(x)=f(x)\quad(x\ne0) \]gives a continuous extension\[ F:\RR^n\to\RR. \]
Away from \(0\), differentiability of \(f\) implies continuity. At \(0\), continuity is exactly the limit statement in step 5.
7. Now assume, in any dimension \(n\ge1\), that \(f\) has been extendedcontinuously to a function\[ F:\RR^n\to\RR. \]For every \(h\ne0\), define\[ \phi_h(t) \coloneqq F(th)-F(0)-t\,a\cdot h \]for\[ 0\le t\le1. \]Then there is \(\theta_h\in(0,1)\) such that\[ F(h)-F(0)-a\cdot h = \bigl(\nabla f(\theta_hh)-a\bigr)\cdot h. \]
Continuity of \(F\) makes \(\phi_h\) continuous on \([0,1]\). For \(0<t<1\), the point \(th\) is nonzero, so differentiability of \(f\) and the chain rule give \[ \phi_h'(t) = \bigl(\nabla f(th)-a\bigr)\cdot h. \] The one-variable mean value theorem applied on \([0,1]\) gives some \(\theta_h\in(0,1)\) such that \[ \phi_h(1)-\phi_h(0)=\phi_h'(\theta_h). \] Since \(\phi_h(0)=0\), this is exactly the displayed identity.
8. The continuous extension \(F\) is differentiable at \(0\), withderivative\[ DF(0)(h)=a\cdot h = \sum_{j=1}^n a_jh_j. \]
By step 7 and Cauchy–Schwarz, \[ \frac{ |F(h)-F(0)-a\cdot h| }{ \|h\| } \le \|\nabla f(\theta_hh)-a\|. \] As \(h\to0\), \[ \|\theta_hh\| \le \|h\| \longrightarrow0. \] Therefore step 1 implies \[ \|\nabla f(\theta_hh)-a\| \longrightarrow0. \] This is precisely the definition of differentiability of \(F\) at \(0\) with derivative \(h\mapsto a\cdot h\).
9. The answers are therefore:
\[ \boxed{ \begin{array}{ll} \text{(1)}& \text{not always if }n=1,\text{ but yes if }n\ge2,\\[2mm] \text{(2)}& \text{yes in every dimension once continuity at }0\text{ is assumed.} \end{array} } \]
Step 2 gives the obstruction in dimension \(1\). Steps <1>3–<1>6 prove existence of the continuous extension for \(n\ge2\). Steps <1>7–<1>8 prove differentiability under the continuity assumption in all dimensions.
10. Q.E.D.
Step 9 gives both requested conclusions.