# For differentiable functions $f,g$, $\nabla f(x)=g(x)x$. Then $f$ is constant on S.

Problem saying that :

$f:\mathbb{R}^{n}\rightarrow\mathbb{R}$ is differentiable. Assume that there is a differentiable function $g:\mathbb{R}^{n}\rightarrow\mathbb{R}$ such that $\nabla f(x)=g(x)x$ . Show that $f$ is constant on $S=\{x\in\mathbb{R}^{n}:||x||=r\}$ where $r$ is positive constant.

For $x=(x_1,\dots ,x_n)$ and $\nabla f=(\frac{\partial f}{\partial x_{1}},\dots,\frac{\partial f}{\partial x_{n}})$, problem says $\frac{\partial f}{\partial x_{i}}=g(x)x_{i}$. It seems to me that to solve this problem, knowing the relation between norm of gradient and its value is crucial. How can I do?

Notification : This question is edited since it's about same problem and the former one is about just notation.

• g(x) is a scalar. – Samuel Mar 25 '16 at 12:25
• For every $x$, $g(x)$ is a scalar. You can rightfully multiply scalars by vectors, in this case it's the scalar $g(x)$ times the vector $x$. – Git Gud Mar 25 '16 at 12:26
• I see. $g$ is a real-valued.... How could I delete this question or replace it about the way to solve that problem? – Darae-Uri Mar 25 '16 at 12:28
• Hint for your modified question: First show $\nabla \|x\| = \dfrac{x}{\|x\|}$, then use the chain rule with the ansatz $f(x) = \phi(\|x\|)$ for some real-valued function $\phi$ of one variable. – Andrew D. Hwang Mar 25 '16 at 12:36
• To add some intuition to what @AndrewD.Hwang said: The assumption says that $\nabla f$ points in the radial direction, which means that $f$ will not change when you move along a sphere centered at the origin. So $f$ should be a function of $\|x\|$ alone. – Harald Hanche-Olsen Mar 25 '16 at 12:43

Note that $f$ is constant on a sphere $S$ of radius $r$ iff for any curve $c :(-\epsilon,\epsilon)\rightarrow S$, $f\circ c(t)=C$ for all $t$ iff $\frac{d}{dt} (f\circ c)(t)=0$

If $c$ is a curve on the sphere so $|c(t)|=r$ Then $$c'(t)\cdot c(t)=0$$

Hence \begin{align} \frac{d}{dt} f\circ c(t) &=\nabla f\cdot c' \\ &= g(c(t))c(t)\cdot c'(t) =0 \end{align}

That is $f$ is constant on the curve.

(And note that gradient of $f$ is radial direction That is hypersurface, which is level surface of $f$, has unit normal of radial direction. Such kind of hypersurface is a sphere.)

• How can r be parametrized by a single variable t? – Mathcho Mar 25 '16 at 14:37
• I add more explanation – HK Lee Mar 25 '16 at 14:42
• How do I show the equivalence between f is constant on S and f is constant on such curves? – Darae-Uri Mar 27 '16 at 5:50
• Please read again. "for any curve $c$ ..." – HK Lee Mar 27 '16 at 5:51