[Physics] How to convert electric field from spherical coordinates to cartesian

coordinate systemshomework-and-exercisesVector Fields

I have 3 components, $r$, $\theta$ and $\phi$, for an electric field in spherical coordinates (and the $\phi$ component happens to be zero), let's say I just want to convert the $r$ component into cartesian, which looks like:

$$ -\frac{0.058125 \cos\theta\sin^2\theta}{r^3} $$

How do I convert this into cartesian?

Edit: Sorry maybe I should have explained that this expression is one component of a vector, which I got using E= −∇V

Best Answer

You said this is the $r$-component, then you've missed the $\hat{\bf r}$.

Use $$r=\sqrt{x^2+y^2+z^2}$$ $$\cos\theta=z/r=\frac{z}{\sqrt{x^2+y^2+z^2}}$$ $$\hat{\bf r}=\frac{x\hat{\bf x}+y\hat{\bf y}+z\hat{\bf z}}{r}$$