# Electric potential between 2 charged spheres -- problems with sign?

I'm trying to find the electric potential between 2 nested spheres. The outer one has $R_1$ and $Q_1$; the inner one has $R_2$ and $Q_2$. I know the potential at $R_1$ is $\frac{Q_1+Q_2}{R_1}$by Gauss's law, but I'm struggling with finding the potential at $R_2$. An online resource says:

But the directionality is confusing me. We take the integral moving outward from $R_1$ to $R_2$, so $ds$ points inward. But the electric field has to point outwards, so $E*ds$ should be negative, so the quantity on line 2 should be positive. Where is my thinking wrong?

The quantity in line $2$ is positive.

What is $\vec E \cdot d\vec s$?

It is $E \hat r \cdot dr \hat r = E \, dr$ where $E$ and $dr$ are components in the $\hat r$ direction

What does $dr$ mean?

It is $\Delta r = r_{\rm final} - r_{\rm initial}$ making that interval smaller and smaller.

How does one decide on the values of $r_{\rm final}$ and $r_{\rm initial}$?

They are shown by the limits of integration so in this case consider a small but finite displacement $\Delta r$ which is equivalent to writing $\displaystyle \int ^{r_{\rm final}} _{r_{\rm initial}} E \,\Delta r = E\, (r_{\rm final} - r_{\rm initial})$

$\vec E = \dfrac {Q_2}{r^2} \hat i$ so $E = +\dfrac {Q_2}{r^2}$ ie it is a quantity whose sign depends on the sign of $Q_2$.

Note that there is nothing to say whether the displacement is towards or away from the charge $Q_2$ until one decides on the values of $r_{\rm final}$ and $r_{\rm initial}$.

If $r_{\rm final} < r_{\rm initial}$ then $\displaystyle \int ^{r_{\rm final}} _{r_{\rm initial}} E \,\Delta r = E\, (r_{\rm final} - r_{\rm initial})$ is negative.

The quantity $\displaystyle \int ^{r_{\rm final}} _{r_{\rm initial}} E \,\Delta r$ is the work done by the electric field and as the change in potential is define as minus the work done by the electric field the quantity on the right hand side of line $2$ is positive.