What is the gradient of $f(x, y, z) = \sqrt{x^2+y^2+z^2}$?
I know that $\nabla f = \left\langle\frac{\partial f}{\partial x}, \frac{\partial f}{\partial y}, \frac{\partial f}{\partial z}\right\rangle$ or equivalently $\nabla f = \frac{\partial f}{\partial x}\mathbf{i} + \frac{\partial f}{\partial y}\mathbf{j} + \frac{\partial f}{\partial z}\mathbf{k}$.
Eventually, I am going to evaluate this gradient at a point and then dot it with some given unit vector to find a directional derivative. I think maybe what is troubling me is the radical in $f$. Will I have to use the chain rule in order to find the three partial derivatives?
I tried this:
$$\frac{\partial f}{\partial x} = \frac{1}{2}(x^2 + y^2 + z^2)^{-\frac{1}{2}}2x$$ $$= \frac{x}{\sqrt{x^2 + y^2 + z^2}}$$
That result looks ugly to me. However, if I did that partial derivative correctly, then I think I know what I am doing.
$$\nabla \|x\| = \frac{x}{\|x\|} $$ where $x = (x_1,x_2,\ldots, x_n)$ and $\|x\| = \sqrt{x_1^2+x_2^2+\ldots + x_n^2}$.