Let's say I have an electric field $\vec{E} = (0, 0, E_z)$, where $E_z$ in constant. Then the electric potential is $\phi = - \vec{E} \cdot \vec{r}$, where $\vec{r} = (x, y, z)$.

Calculating $\vec{E} = - \nabla {\phi}$ in cartesian coordinates is ok, we get the $\vec{E}$ we started with.

But I have a problem with transforming this whole thing into spherical coordinates. Then the electric field is $\vec{E} = (E_z \cos{\theta}, -E_z\sin{\theta}, E_z)$ and $\nabla \phi = (\frac{\partial \phi}{\partial r}, \frac{1}{r} \frac{\partial \phi}{\partial \theta}, \frac{1}{r \sin{\theta}} \frac{\partial \phi}{\partial \varphi})$.

I am not really sure whether $\vec{r}$ should change to $(r \sin{\theta}\cos{\theta}, r \sin{\theta}\sin{\varphi}, r\cos{\theta})$ or $(r, r\theta, r\sin{(\theta)}\varphi)$ or something else. Either way, I can't get the original $\vec{E}$ from $\vec{E} = - \nabla {\phi}$. The result is wrong.

What am I doing wrong? I assume it's the $\vec{r}$ transformation but I am not sure.


1 Answer 1


$\phi = - \vec{E} \cdot \vec{r}$,

This equation is only true for a constant electric field. The correct relation between potential and field generally is :

$$ - \nabla \phi = \vec{E}$$

The above is a differential equation which you can solve to obtain $\phi$.

$$\vec{E} =(E_z\cosθ,−E_z\sinθ,E_z) $$

The conversion for cartesian to polar basis is:

$$ \hat{k} = \hat{e_r} \cos \theta - \hat{e_{\theta} } \sin \theta$$


$$ \vec{E} = E_z \vec{k} = E_z \cdot ( \hat{e_r} \cos \theta - \hat{e_{\theta} } \sin \theta) $$


$$\nabla \phi = (\frac{\partial \phi}{\partial r}, \frac{1}{r} \frac{\partial \phi}{\partial \theta}, \frac{1}{r \sin{\theta}} \frac{\partial \phi}{\partial \varphi})$$


$$-(\frac{\partial \phi}{\partial r}, \frac{1}{r} \frac{\partial \phi}{\partial \theta}, \frac{1}{r \sin{\theta}} \frac{\partial \phi}{\partial \varphi})=(E_z \cos \theta, - E_z \sin \theta,0)$$

Now, all you have to do is find a potential which satisfies the above equation.

Refer my answer here

  • 4
    $\begingroup$ $\phi = -\mathbf E \cdot \mathbf r$ is a valid choice of electrostatic potential if the electric field $\mathbf E$ is constant. $\endgroup$
    – J. Murray
    Commented Nov 1, 2020 at 15:47
  • $\begingroup$ On the RHS in the final equation, two last terms in the parenthesis should be in reverse order $\endgroup$ Commented Jul 12, 2022 at 7:31
  • $\begingroup$ Ah good catch. My mistake @user3725600 $\endgroup$ Commented Jul 12, 2022 at 10:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.