Potenial difference from electric field and line integral

I am really confused about the relation of potential difference and the electric field.

The relation between potential and electric field is $$V_{ab} \equiv V_a - V_b = -\int_{b}^a{\vec{E}\cdot\vec{dr}} \, .$$

Now let's look at a solid sphere uniformly charged with $$q$$ and let's find the potential difference $$V_{ab}$$ while $$b\to\infty$$.

The electric field of a solid sphere is in the $$\vec{r}$$ direction hence if we are going from $$b$$ to $$a$$ we are going against the electric field (because $$b>a$$).

With that we get $$V_{ab} = -\int_{b}^a{\vec{E}\cdot d\vec{r}} = -\int_{b}^a E \, dr \, \cos(\pi) = \int_{b\to\infty}^a \frac{kq}{r^2} \, dr = -\frac{kq}{a} < 0 \, .$$

The result makes no sense because it means that $$V(a) < V(b)$$ which means that the electric field of the solid sphere is in the $$-\vec{r}$$ direction, which is wrong.

What I'm doing wrong? I saw many solutions of exercises which are using this relation and it seems that each one of them is just solving the integral without considering the dot product.

• The quantity $\vec{E}\cdot d\vec{r}$ is negative. You're moving from $b$ to $a$, against the electric field, so d$\vec{r}$ and $\vec{E}$ are pointing in opposite directions. – probably_someone Oct 23 '18 at 19:24
• i don't understand your answer, this is exactly what i wrote. – Guy Oct 23 '18 at 19:47

The relation between potential and electric field is $$V_{ab} \equiv V_a - V_b = -\int_{b}^a{\vec{E}\cdot\vec{dr}} \, .$$

is correct.

Now what are $$\vec E$$ and $$d\vec r$$ in terms of the unit vector $$\hat r$$?

$$\vec E = E\,\hat r$$ and $$d\vec r = dr\,\hat r$$ where $$E$$ and $$dr$$ are components of those two vectors in the $$\hat r$$ direction and they can be either positive or negative.

This gives you $$\vec E \cdot d\vec r = E\,\hat r \cdot dr\,\hat r = E\,dr$$

$$V_{ab} \equiv V_a - V_b = -\int_{b}^a{\vec{E}\cdot\vec{dr}} = -\int_{b}^aE\,dr$$

In your example the electric field is radially outwards and so $$E$$ will be a positive quantity.

It is the sign of $$dr$$ which causes the confusion, so is $$dr$$ positive or negative?

The sign of $$dr$$ is entirely determined by the limits of integration.

You do not need to assign a sign to $$dr$$ all you need to do is state the limits of integration which will then determine the direction of travel.

In other words if $$a>b$$ then whilst doing the integration $$dr$$ is positive but if $$a then whilst doing the integration $$dr$$ is negative.

Going back to your example with $$b>a$$ you have $$E$$ is positive and $$dr$$ is negative so $$\vec E \cdot d\vec r = E\,dr$$ will be a negative quantity.
Thus $$-E\,dr$$ will be a positive quantity and it will give you that $$V_{\rm a} - V_{\rm b}$$ will be a positive quantity leading to the expected result that $$V_{\rm a} > V_{\rm b}$$

So finishing off the example

$$V_{\rm a} - 0 = V_{\rm a}=-\int_{\infty}^a{\vec{E}\cdot\vec{dr}} = -\int_{\infty}^a\frac{kq}{r^2}\,dr=+\frac{kq}{a}$$

You have stated that $$\vec{E}\cdot d\vec{r} = E \, dr \, \cos(\pi)$$

How did you get this relationship?

You said that $$\vec E = E \,\hat i$$ and that $$d\vec r = dr \left( -\hat i\right)$$.
In other words you have looked at the problem, noticed that the direction of travel will be in the $$-\hat i$$ direction and so assigned a positive value to $$dr$$.

What you cannot do now is use limits of integration such that the direction of travel will result in $$dr$$ being negative.

Doing it your way you proceed as follows:

$$V_{\rm a} - 0 = V_{\rm a}=-\int_{\infty}^a{\vec{E}\cdot\vec{dr}} = -\int^{\infty}_a\frac{kq}{r^2}\,\left(-dr\right)=+\frac{kq}{a}$$

Notice that the limits of integration reflect the fact that $$dr$$ is positive.

There is actually no need for the factor $$\cos(\pi)$$ even if $$\vec{dr}$$ is directed against $$\vec{E}$$.

It would be needed if we wanted to write the integral in terms of $$|E|$$ and $$|dr|$$: $$\int_b^a \vec{E}\cdot\vec{dr} = \int_b^a |\vec{E}| \, |\vec{dr}|\,\cos(\pi)~~~.$$ But it is more useful to write it in terms of magnitudes $$E,dr$$, as ordinary definite integral.

The correct way to express the line integral as ordinary definite integral is

$$\int_b^a \vec{E}\cdot\vec{dr} = \int_b^a E \, dr~~~.$$

This is because although $$E,dr$$ are not vectors, they still have signs, and this those signs are such that the product $$Edr$$ has the correct sign.

$$E>0,dr<0 \implies Edr<0.$$