Calculating radial derivative from Cartesian derivatives

1.7k Views Asked by At

For a radially symmetric function $f(x, y, z)$, is there a simple method to convert from $\frac{\partial f(x, y, z)}{\partial x}$, $\frac{\partial f(x, y, z)}{\partial y}$, $\frac{\partial f(x, y, z)}{\partial z}$ to $\frac{\partial f(x, y, z)}{\partial r}$?

Such a function could be a spherical Gaussian evaluated on a Cartesian grid, for which I want to calculate the radial derivative numerically.

1

There are 1 best solutions below

0
On BEST ANSWER

$$\begin{align}\frac{\partial f}{\partial r}&=\frac{\partial f}{\partial x}\frac{dx}{dr}+\frac{\partial f}{\partial y}\frac{dy}{dr}+\frac{\partial f}{\partial z}\frac{dz}{dr}\\&=\frac{\partial f}{\partial x}\sin\theta\cos\phi+\frac{\partial f}{\partial y}\sin\theta\sin\phi+\frac{\partial f}{\partial z}\cos\theta\\&=(\nabla f)\cdot \hat r\end{align}$$