2.22. Find $\operatorname{grad} U$, if:

a) $U=\sqrt{x^{2}+y^{2}+z^{2}}$;

b) $U=\frac{1}{x^{2}+y^{2}+z^{2}}$.
Solution.

a) The problem is easiest to solve by transitioning to spherical coordinates. In these coordinates, $U=r$ and using formulas $(2.80)$ we get

$$
\operatorname{grad} U=\frac{\partial U}{\partial r} \ddot{e}_{r}+\frac{1}{r} \frac{\partial U}{\partial \theta} \ddot{e}_{0}+\frac{1}{r \sin \theta} \frac{\partial U}{\partial \varphi} \vec{e}_{\phi}=\dot{e}_{r}
$$

(Since the scalar field $U$ does not depend on $\theta$ and $\varphi$.) In Cartesian coordinates, $\operatorname{grad} U$ has the form

$$
\begin{gathered}
\operatorname{grad} U=\frac{\partial U}{\partial x} \dot{i}+\frac{\partial U}{\partial y} j+\frac{\partial U}{\partial z} \dot{k}= \\
=\frac{x}{\sqrt{x^{2}+y^{2}+z^{2}}} \ddot{i}+\frac{y}{\sqrt{x^{2}+y^{2}+z^{2}}} \ddot{j}+\frac{z}{\sqrt{x^{2}+y^{2}+z^{2}}}
\end{gathered}
$$

b) In spherical coordinates:

$$
\operatorname{grad} U=\frac{\partial U}{\partial r} \dot{e}_{r}=\frac{\partial}{\partial r}\left(\frac{1}{r^{2}}\right) \dot{e}_{r}=-\frac{2}{r^{3}} \dot{e}_{r}
$$

In Cartesian coordinates:

$$
\begin{gathered}
\operatorname{grad} U=\frac{\partial}{\partial \boldsymbol{x}}\left(\frac{1}{x^{2}+y^{2}+z^{2}}\right) \dot{i}+ \\
+\frac{\partial}{\partial y}\left(\frac{1}{x^{2}+y^{2}+z^{2}}\right) \vec{j}+\frac{\partial}{\partial z}\left(\frac{1}{x^{2}+y^{2}+z^{2}}\right) \dot{k}= \\
=(-2)\left(\frac{x \vec{i}}{\left(x^{2}+y^{2}+z^{2}\right)^{2}}+\frac{y \vec{j}}{\left(x^{2}+y^{2}+z^{2}\right)^{2}}+\frac{z \vec{k}}{\left(x^{2}+y^{2}+z^{2}\right)^{2}}\right) .
\end{gathered}
$$