Gradient of function in spherical coordinates

3.6k Views Asked by At

How do you find the gradient of the function: $$h(r,\theta,\phi) = \frac{1}{r}e^{r^2}$$ I'm not sure what $h(r,\theta,\phi)$ is supposed to output? Is it coordinates? How do you convert this function to cartesian coordinates?

1

There are 1 best solutions below

0
On BEST ANSWER

$h(r,\theta,\phi)$ will output a scalar (a number), as it depends only on the radial distance $r$; the gradient of $h$ will output a vector: $\nabla h$ is a vector.

To find the gradient, consider that in spherical coordinates the gradient has the form:

$$\nabla=(\frac{\partial}{\partial r},\frac{1}{r}\frac{\partial}{\partial \theta},\frac{1}{r \sin\theta}\frac{\partial}{\partial \phi})$$ Thus, the sought gradient in spherical coordinates is $$\nabla h = (-\frac{e^{r^2}}{r^2}+2e^{r^2}\ln e, 0, 0 )$$ The first component of the derived gradient vector is the derivative of $h$ w/respect to $r$.

To convert $h$ to Cartesian coordinates, consider the conversion formula: $$r=\sqrt{x^2+y^2+z^2}$$. You don't need the conversions of $\theta$ or $\phi$ since $h$ does not depend on them:

$$h(x,y,z)=\frac{1}{\sqrt{x^2+y^2+z^2}}e^{x^2+y^2+z^2}$$