Direction of $d\mathbf{l}$

A solid sphere has charge $$q$$ and radius $$R$$. Find the potential at a point a distance $$r$$ from the center of the sphere where $$r>R$$, using infinity as the reference point.

My attempt:

From Gauss' theorem we may deduce that $$\displaystyle\mathbf{E}=\frac{1}{4\pi\epsilon_0}\frac{q}{r'^2}\hat{\mathbf{r}}$$ where $$r'$$ is the distance of an arbitrary point from the center of the sphere provided $$r'>R$$.

$$V=-\int_\infty^\mathbf{r}\mathbf{E}\cdot d\mathbf{l}$$

My question: What is $$d\mathbf{l}$$? Since we are traversing in the direction opposite to $$\hat{\mathbf{r}}$$, I think it should be $$-dr'\hat{\mathbf{r}}$$. But when I use it to find $$V$$, I get a sign error. Please help!

I am going to contradict the answers by @Bio (whose answer has since been deleted) and @lineage and say that $$\text d\mathbf l$$ is actually $$\text d r'\hat{r}$$ The other answers are mathematically correct, but it goes against our physical intuition with how the limits of integration are set up, as it seems you were discussing in the comments of the answer.

Indeed, it would be nice if our lower limit of integration was where we started and the upper limit was where we ended. This makes so much more sense if we make $$\text d\mathbf l=\text d r'\hat{r}$$. This is because the sign of $$\text dr'$$ is actually determined by our limits already. In general, if we are integrating from $$r'=a$$ to $$r'=b$$ we will have $$\Delta V=-\int_a^bE_r\text dr'$$

If $$b>a$$ then $$\text dr'$$ is positive, and if $$b (which is what you are looking at) then $$\text dr'$$ is negative. The sign is already taken care of depending on how you set up the limits! You don't need to explicitly put in the sign of $$\text dr'$$

This is why in @Bio's answer (as well as @lineage's answer I believe, although that answer is very convoluted, so I am unsure) you need to switch the limits of integration. That way you are doing two sign changes, resulting in the same integral. While this is mathematically correct, I feel like you really lose the physical intuition of adding up these values as you move from the start to the end of the path. @Bio's integral is technically moving backwards along the path while adding up the negative of the values given by the integrand, thus yielding the same result.

• Good answer, Aaron. As I tell my students, the limits of the integral set the direction of the travel. The differential vector element shows the positive change direction of the coordinate which is being integrated. It's dangerous to try to show the path direction with both. – Bill N Apr 30 at 17:53
• @BillN exactly. The other answers do it the "dangerous ways". Which work but are more confusing. – Aaron Stevens Apr 30 at 22:51
• If I remember correctly, one of the inside covers of Griffiths' E&M shows this, albeit in Cartesian coordinates: $d\vec{l} = dx\ \hat{x} + dy\ \hat{y} + dz\ \hat{z}$ always, independent of path direction. – Josh McK May 1 at 21:20
• @JoshMcK yes, that is correct – Aaron Stevens May 1 at 21:29

When you are evaluating $$\vec E \cdot \Delta \vec l$$ you are really evaluating work done on a unit positive charge by an external force $$\vec E$$ when the displacement of the force is $$\Delta\vec l = \vec r _{\rm final} - \vec r_{\rm initial}$$.
This is the area under a force against displacement graph, the complication being that $$\vec E$$ varies with position.

If $$\vec E = E \,\hat r$$ and $$\Delta \vec l = (r _{\rm final} - r_{\rm initial})\,\hat r$$ and remembering that $$E$$ varies with position $$\vec E \cdot \Delta\vec l \approx E \,(r _{\rm final} - r_{\rm initial})= E\, \Delta r$$.
Note here that I am not interested in the exactly magnitude of this quantity but I am very interested as to whether its value is positive or negative.

So let's look at the graph of $$E$$ against $$r$$.

What is the area under this graph $$\approx E \,(r _{\rm final} - r_{\rm initial})$$?
You will immediately see that it depends on whether you follow the gray labels ($$r$$ increasing) or the red labels ($$r$$ decreasing).

With the grey labels the area is positive because $$r _{\rm final} - r_{\rm initial} > 0$$, ie $$\Delta r >0$$, and $$E$$ is positive whereas with the red labels the area is negative because $$r _{\rm final} - r_{\rm initial} < 0$$, ie $$\Delta r <0$$, and $$E$$ is positive.

The way you evaluate this area exactly is by evaluating an integral $$\int^{r_{\rm final}}_{r_{\rm initial}}E \,dr$$ which is just the limit as $$\Delta r$$ tends to zero of a sum with terms like $$E \,(r _{\rm final} - r_{\rm initial}) = E \,\Delta r$$.

And is $$(r _{\rm final} - r_{\rm initial})=\Delta r$$ positive or negative in this sum?
That is completely determined by the limits of integration.

So you must write $$d \vec l = dr \,\hat r$$ and the sign of $$dr$$ will be determined by the limits of integration.

In your example, with the lower limit as infinity and the upper limit as $$r$$, the integral is negative (ie the process of integration is "using" negative $$dr$$) and so the change in the potential is positive as expected.

Potential is defined as the negative of the work done in moving unit charge at zero acceleration from reference to that point in field where the potential is being calculated. So dl represents a differential movement from reference (here infinity) towards r' (assumed straight line path, else tangential to path towards r'). On the other hand, since r' is being measured from origin so its differential dr' is directed in the incresing direction of r'--from r' towards reference point(infinity). Hence, if the path connecting the two points between which the test charge is being moved is a straight line, the differentials only differ in sign so that dr'=-dl.

Hence $$V =-\int_\mathbf{reference}^\mathbf{target}\mathbf{E(r').}\,\mathbf{dl}$$ At this point instead of proceeding as \begin{align} V &=-\int_\mathbf{\infty}^\mathbf{r}\mathbf{E(r').}\,\mathbf{dl}\\ &=-\int_\mathbf{-\infty}^\mathbf{-r}\mathbf{E(r').}\,(-\mathbf{dr'})\\ &=\int_{-\infty}^{-r}\frac{1}{4 \pi \epsilon_0} \frac{q}{r'^2} \,dr'\\ &=\frac{1}{4 \pi \epsilon_0} \frac{q}{r} \\ \end{align}

most books follow (as @Bio suggests)

\begin{align} V &=+\int_\mathbf{target}^\mathbf{reference}\mathbf{E(r').}\,\mathbf{dr'}\\ &=\int_\mathbf{r}^\mathbf{\infty}\mathbf{E(r').}\,\mathbf{dr'}\\ &=\int_r^\infty\frac{1}{4 \pi \epsilon_0} \frac{q}{r'^2} \,dr\\ &=\frac{1}{4 \pi \epsilon_0} \frac{q}{r} \\ \end{align}

This is imho, probably because in the former way there is an implicit substitution changing l to r' but without the proper use of limits(as in $$lim_{}$$), the negation in limits(as in $$\int_a^b\,$$) cannot be explained.

$$\\ \\ \\$$

This becomes clearer when one considers doing the integral this way-- $$V= -\int_\mathbf{reference}^\mathbf{target}\mathbf{E(l).}\,\mathbf{dl}$$ Since there exists dl so must l. Hence it should be possible to do the RHS without converting to r' coords. Doing this is a bit tricky as the limits would be \begin{align} \mathbf{reference}&=\mathbf{0}\\ \mathbf{target}&=\lim_{h\to \infty}(h-r)\mathbf{\hat{l}}\\ \end{align}

while $$\mathbf{E(l)}=\lim_{h\to \infty}\frac{-1}{4\pi\epsilon_{0}}\frac{q\mathbf{\hat{l}}}{(h-l)^2}$$

Then

\begin{align} V&=-\int_\mathbf{reference}^\mathbf{target}\mathbf{E(l).}\,\mathbf{dl}\\ &=- \lim_{h\to \infty} \int_ 0^{h-r} \lim_{h'\to h} \frac{-1}{4\pi\epsilon_{0}}\frac{q\mathbf{\hat{l}.dl}}{(h'-l)^2} \,\\ &=\frac{q}{4\pi\epsilon_{0}}\lim_{h\to \infty}\lim_{h'\to h}(\frac{1}{0-h'}+\frac{1}{h'-(h-r)})\\ &=\frac{1}{4 \pi \epsilon_0} \frac{q}{r} \end{align}

The integration performed in line 3 above is obtained from Mathematica as

$$\int_a^b \frac{1}{(A-x)^2} \, dx=\frac{1}{a-A}+\frac {1}{A-b}, \quad\quad\quad(a\geq A\lor A\geq b)\land a

• Like @Bio's answer, this seems needlessly convoluted. The sign of the infinitesimal element is already determined based on if the upper limit of your integral is larger or smaller than the lower limit. The sign doesn't need to be explicitly put in. You don't need to do all of these unnecessary mathematical tricks. Putting a negative on your infinitesimal element just requires you to stick another negative(s) somewhere else. In your answer it is by switching the limits to both be negative, but this is not needed at all. – Aaron Stevens Apr 30 at 16:08
• 1.Its complicated but not needless. The fundamental problem is pretty simple-choose limits;integrate-use common sense to decide the dir^n the differential points-but, this simply makes dl a mere notational replacement of dr causing dl to simply be eual to dr r^. However the above rigour is to show that dl and dr actually represent different motion of test charge-one from ref,other towards it. Since ref.=infinity, showing equivalence necessitates careful, but tedious, mathematical overkill. 2. That negation of limits is precisely what i have pointed out as being wrong without use of limits. – lineage Apr 30 at 16:37
• It is actually much simpler than this. – Aaron Stevens Apr 30 at 22:49