# Electric field in spherical coordinates

Let's say I want to find the line integral of the electric field along some path $$ab$$ as shown here

I imagine taking small segments $$dl$$ of that path from $$a$$ to $$b$$, but as I imagine that, I imagine that the angles and radial distance change, however, that is how it was done, it says that there are no components in the theta and phi directions, what does it mean? If it means that each segment I choose on that path doesn't change the angles then I cannot visualize it.

We have two vectors $$d\mathbf l=dr\hat{\mathbf r}+rd\theta\hat{\mathbf\theta}+r\sin\theta d\phi\hat{\mathbf\phi}$$ $$\mathbf E=\frac{1}{4\pi\epsilon_0}\frac{q}{r^2}\hat{\mathbf r}+0\hat{\mathbf\theta}+0\hat{\mathbf\phi}$$

Then you just do the dot product $$\mathbf E\cdot d{\mathbf l}=\frac{1}{4\pi\epsilon_0}\frac{q}{r^2}\cdot dr+0+0$$

This is why the angular dependence goes away. It is not because the angular dependence is not present in the line element. It is because the electric field points radially outwards.

The angles certainly change as you move along the path. Each $$\mathrm{d}\ell$$ consists of a $$\mathrm{d}r$$, $$\mathrm{d}\theta$$ and a $$\mathrm{d}\phi$$. But for each $$\mathrm{d}\ell$$ along the path, only the $$dr$$ part has a non-zero contribution to the integral.

When you have a point-charge $$q$$ on the point $$O$$, the potential created by $$q$$ in a point $$M$$ in space is Striclty dependent on the distance $$|OM|$$.

If you move from a point $$M$$ to a point $$M'$$ where $$|OM|=|OM'|$$, the potential is constant, and thus There's no electric field action when you move from $$M$$ to $$M'$$. i.e:

$$\int_M^{M'} E . \mathrm{d}\vec{r}=0$$

As such the line integral only depends on the distance from the origin.