a question about gradient

52 Views Asked by At

Let $f(x,y)=\ln\|\mathbf r\|$ where $\mathbf r=x\mathbf i+y\mathbf j$. Show that $\nabla f=\frac{\mathbf r}{\|\mathbf r\|^2}$.

I attempt to calculate $\nabla\mathbf r$. But I have no idea how to calculate a vector's gradient. Can anybody help me?

1

There are 1 best solutions below

2
On BEST ANSWER

$$\vec \nabla f = \frac{\partial f}{\partial x} \hat i +\frac{\partial f}{\partial y} \hat j + \frac{\partial f}{\partial z} \hat k $$

$$\vec r = x \hat i + y\hat j $$ so $$||\vec r || = \sqrt{x^2+y^2}$$ so $$\ln||\vec r|| = \ln\sqrt{x^2+y^2}$$ so $$\vec \nabla \Big(\ln \sqrt{x^2+y^2}\Big)$$ $$ = \frac{\partial \Big(\ln \sqrt{x^2+y^2}\Big)}{\partial x}\hat i + \frac{\partial \Big(\ln \sqrt{x^2+y^2}\Big)}{\partial y}\hat + \frac{\partial \Big(\ln \sqrt{x^2+y^2}\Big)}{\partial z}\hat k$$ $$ = \frac{2x \cdot \frac{1}{2}\frac{1}{\sqrt{x^2+y^2}}}{\sqrt{x^2+y^2}}\hat i + \frac{2y \cdot \frac{1}{2}\frac{1}{\sqrt{x^2+y^2}}}{\sqrt{x^2+y^2}}\hat j + \frac{2z \cdot \frac{1}{2}\frac{1}{\sqrt{x^2+y^2}}}{\sqrt{x^2+y^2}}\hat k$$ $$ = \frac{x}{x^2+y^2} \hat i + \frac{y}{x^2+y^2} \hat j + \frac{z}{x^2+y^2} \hat k$$ $$ = \frac{1}{x^2+y^2} (x \hat i + y\hat j + z\hat k)$$ $$ = \frac{1}{||\vec r||^2} \vec r$$ $$ = \frac{\vec r}{||\vec r||^2}$$ as required