Exercise showing that $\nabla f(r) = \frac{\mathrm{d} f}{\mathrm{d}r}\cdot \frac{\underline{r}}{r} $

86 Views Asked by At

Let $f : \mathbb{R} \rightarrow \mathbb{R}$ be a differentiable function. Let

$$\underline{r}(x,y,z) := \begin{pmatrix}x\\y\\z\end{pmatrix}$$

be a vector field in Cartesian coordinates. The length $r$ of the vector $\underline{r}$ is

$$r = \sqrt{x^2+ y^2 + z^2} $$

Show that

$$\nabla f(r) = \dfrac{\mathrm{d} f}{\mathrm{d}r}\cdot \dfrac{\underline{r}}{r} $$


This is an exercise in preparation for a test. Here's what I have tried to do using chain rule:

$$\begin{split} \nabla f(r) &= \begin{pmatrix}\partial_x(f(r))\\ \partial_y (f(r))\\ \partial_z(f(r))\end{pmatrix}\\ &= \begin{pmatrix}\partial_x(f(r)) \cdot \dfrac{x}{r}\\ \partial_y (f(r)) \cdot \dfrac{y}{r}\\ \partial_z(f(r))\cdot \dfrac{z}{r}\end{pmatrix}\\ \end{split}$$

So if $$\partial_x(f(r)) = \partial_y(f(r)) = \partial_z(f(r)) = \dfrac{\mathrm{d} f}{\mathrm{d}r}\ $$ was a scalar, I would be done. However I don't know this would be the case or if I have applied the chain rule correctly.

How do I continue from here, or how should I start in the first place to solve this?

2

There are 2 best solutions below

2
On

You haven't applied the chain rule correctly. Doing so gives you the result pretty easily. The correct chain rule is

$$\nabla f(r):= \begin{pmatrix} \partial_x(f(r)) \\ \partial_y(f(r))\\ \partial_z(f(r)) \end{pmatrix} = \begin{pmatrix} \frac{df}{dr}\cdot\partial_x(r) \\ \frac{df}{dr}\cdot\partial_y(r)\\ \frac{df}{dr}\cdot\partial_z(r) \end{pmatrix} $$

All that's left now is to compute these partial derivatives, which you seem to have already done.

I hope this helps.

0
On

I'm going to use the notation $\vec{r} = (x, y, z)$. We are ultimately trying to find $\nabla f(r) = \nabla f(g(\vec{r}))$ where $g(r) = \|\vec{r}\|$. Now we know from the chain rule that $\nabla f(g(\vec{r}))=\frac{df}{dg(\vec{r})} \nabla g(\vec{r})$, which gives the desired answer.

When remembering the chain rule, it's often helpful to think of the derivative matrix. The chain rule says that (using the notation in the link) $D(f(g(\vec{x}))) = Df(g(\vec{x})) \cdot Dg(\vec{x})$, where the dot symbolizes matrix multiplication. Note that for this matrix multiplication to be well-defined, we must have the composition to be well-defined. In the special case that we have some $h(\vec{x}): \mathbb{R}^n \to \mathbb{R}$, we use the shorthand $Dh(\vec{x}) = \nabla h(\vec{x})$.