I am really confused about the relation of potential difference and the electric field.
As you know theThe relation between potential and electric field is: $$V_{ab}=-\int_{b}^a{\vec{E}\cdot\vec{dr}}$$$$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 $$$$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 \, .$$
now the results makeThe result makes no sense because it means that $V{a}<V{b}$$V(a) < V(b)$ which means that the electric field of the solid sphere is in the $-\vec{r}$ direction and this, 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.
I hope it was clear, thanks a lot!