# Show there exists differentiable $g : (0, \infty) \to \mathbb{R}$ s.t $f(\vec{x}) = g(||\vec{x}||)$ for $f : \mathbb{R}^3 \to \mathbb{R}$

Let $$f : \mathbb{R}^3 \setminus \left \{0 \right \} \to \mathbb{R}$$ be a differentiable function s.t $$\nabla f \neq 0$$ and:

$$y \frac{\partial f}{\partial x} - x \frac{\partial f}{\partial y} =0 \\ z \frac{\partial f}{\partial y} - y \frac{\partial f}{\partial z} =0$$

Show there is a differentiable $$g : (0, \infty) \to \mathbb{R}$$ s.t $$f(x,y,z) = g(||(x,y,z)||)$$

I tried using spherical coordinates to show that the gradient is only determined by $$r$$ which I think should help, but I had some trouble with the algebra, help appreciated.

• In your notation, $x=(x,y,z)$?
– user9464
Feb 20, 2021 at 16:45
• The idea would be to show $\dfrac{\partial}{\partial\theta}f = \dfrac{\partial}{\partial\varphi}f = 0$. Feb 20, 2021 at 16:46
• @mrsamy no, x is the first coordinate Feb 20, 2021 at 16:48
• @AryamanMaithani Yes I tried showing that but it didn't work for the $\varphi$ partial derivative Feb 20, 2021 at 16:48
• Alternatively, use the equations to see that $\nabla f(x,y,z)$ is parallel to the position vector $(x,y,z)$. Do you see why that finishes it? Feb 20, 2021 at 17:51

Define $$g(r,\theta,\phi) := f(r\sin\theta\cos\phi, r\sin\theta\sin\phi, r\cos\theta)$$. Our assumptions say $$\frac{\partial f}{\partial x}r\sin\theta\sin\phi = \frac{\partial f}{\partial y}r\sin\theta\sin\phi$$ $$\frac{\partial f}{\partial y}r\cos\theta = \frac{\partial f}{\partial z}r\sin\theta\sin\phi$$ We have $$\frac{\partial g}{\partial \phi} = -\frac{\partial f}{\partial x}r\sin\theta\sin\phi + \frac{\partial f}{\partial y}r\sin\theta\sin\phi = 0$$ so $$g$$ in fact does not depend on $$\phi$$ and we can fix $$\phi = \frac\pi2$$ so $$g(r,\theta) = f(0, r\sin\theta, r\cos\theta).$$ We have $$\frac{\partial g}{\partial \theta} = \frac{\partial f}{\partial y}r\cos\theta - \frac{\partial f}{\partial z}r\sin\theta = 0$$ so $$g$$ doesn't depend on $$\theta$$ either. Therefore $$g(r,\theta,\phi) = g(r)$$ and is differentiable.

Taking $$(x,y,z)$$ from a dense subset of $$\Bbb{R}^3$$ we can define $$(r,\theta,\phi) = \left(\sqrt{x^2+y^2+z^2}, \arctan\frac{\sqrt{x^2+y^2}}z, \arctan\frac{y}x\right)$$ and notice $$f\left(x,y,z\right) = f(r\sin\theta\cos\phi, r\sin\theta\sin\phi, r\cos\theta) = g(r,\theta,\phi) = g(r)= g(\|(x,y,z)\|).$$ By continuity the result extends to all of $$\Bbb{R}^3$$.

• Could you elaborate on "Taking $(x,y,z)$ from a dense subset...". I don't really get why that is necessary. Feb 20, 2021 at 20:42
• @paxtibimarce Well, the denominators have to be nonzero so we can define $(r,\theta,\phi)$ as stated on the set $S = \{(x,y,z) \in \Bbb{R}^3 : x \ne 0, z \ne 0\}$. On $S$ we get the equality of continuous functions $f(x,y,z) = g(\|(x,y,z)\|)$. Since $S$ is dense in $\Bbb{R}^3$, the equality holds on all of $\Bbb{R}^3$. Feb 20, 2021 at 20:47

Since I prefer a more conceptual approach, note that you can deduce from the two equations that $$\nabla f(x,y,z) = \lambda(x,y,z)(x,y,z)$$ for some function $$\lambda$$. Since the gradient of a differentiable function is everywhere orthogonal to the level surfaces of that function, this tells you that the function $$f$$ is constant on spheres centered at the origin. Thus, $$f(x,y,z) = g(\|(x,y,z)\|)$$ for some function $$g$$.

(If you prefer, you can see that the directional derivative is $$0$$ in any direction tangent to such a sphere, because that directional derivative is given by the dot product of the gradient and the tangent vector, and we all know that $$(x,y,z)$$ is the normal to the sphere centered at the origin passing through the point $$(x,y,z)$$.)

• Ratio and proportion. The first equation tells you that $(\frac{\partial f}{\partial x},\frac{\partial f}{\partial x})$ is a scalar multiple of $(x,y)$ (away from $x=0$ and $y=0$) and likewise for the second equation. But then you can take care of these cases. Feb 20, 2021 at 20:17
• Thanks, could you elaborate on how you deduce the function is constant on spheres? Feb 20, 2021 at 20:24
• I can imagine it but I'm just not sure how to show it formally Feb 20, 2021 at 20:27
• Well, I gave the argument in the parenthetic second paragraph. The function stays constant if you move orthogonal to the position vector, which means along the sphere through that point. You know that the normal vector to a sphere centered at the origin is the position vector at every point, and there can be only one surface with that property. Feb 20, 2021 at 20:59
• Any point $\boldsymbol{r}=(x,y,z)\ne(0,0,0)$ is joined to $(0,r,0),$ $r=\sqrt{x^2+y^2+z^2},$ by an arc of a circle, centre $O,$ parameter $t,$ on which (abusing notation): $\boldsymbol{r}\cdot\boldsymbol{r}=r^2,$ whence $\boldsymbol{r}\cdot(d\boldsymbol{r}/dt)=0;$ and excepting at most one point, $y\ne0,$ therefore $\nabla f$ is a multiple of $\boldsymbol{r};$ therefore (chain rule) $df(\boldsymbol{r})/dt=(\nabla f)\cdot(d\boldsymbol{r}/dt)=0;$ therefore $f(\boldsymbol{r})=f(0,r,0)=g(r),$ say. Feb 20, 2021 at 21:26