Starting from Newton's second law, I am trying to show that energy is not conserved with an applied external force when moving a positive charge from $r_b$ to $r_a$ (see image). I'm not sure where I'm missing a minus sign? Also shouldn't the work done by the external force increase the total energy so that $E_a = W_F + E_b$ ?
Conservation of Energy in Electrostatics – Potential Energy and Work
conventionselectrostaticsintegrationpotential energywork
Related Solutions
I think you just forgot that the $\int_A^B F\,dl$ is not a scalar expression. Rather it should be written in a form $\int_A^B \vec{F}\cdot d\vec{l}$. Then it comes to the sign of the scalar product: $$\vec{F}\cdot d\vec{l}=F\,dl\,\cos\theta$$ where the angle $\theta$ is taken between the vector $\vec{F}$ and the direction of the tangent to the integration path from $A$ to $B$. Then, in your first example,
$W_{A \to B}=\int_{r_A}^{r_B} F(r) dr = \int_{r_A}^{r_B} \left(-\frac{GMm}{r^2} \right)dr$
the path could go with any slope, but the gravity is always directed downwards, along the $r$ axis. That means, we can always take $(\pi-\theta)$ as the angle between the vector $d\vec{l}$ and the $r$ axis, that is $$dl\,\cos(\pi-\theta)=dr$$ but $\cos(\pi-\theta)=-\cos\theta$ and thus we have $$\vec{F}\cdot d\vec{l}=-F\,dr=-\frac{GMm}{r^2}dr$$
For your second example:
...we also should change the sign, because the gravitational force is always a force of attraction.
what the authors actually mean is that: the Coulomb's and Newton's forces have exactly the same expressions, but the sign conventions for them are different. The Newton's force is defined that if all the quantities ($M$, $m$ and $r$) are positive, then the vector of the force is directed towards the other body. But for the Coulomb's force, if all the quantities ($q_1$, $q_2$ and $r$) are positive, then the vector of the force is directed away from the other charge. That becomes manifest if we take the vector expressions for these forces: $$\vec{F}_N=-\frac{GMm\,\vec{r}}{r^3}\qquad\vec{F}_C=\frac{q_1q_2\,\vec{r}}{4\pi\epsilon_0\,r^3}$$ Now the different signs are clearly seen.
"...from point $A$ to point $B$..." - ...as I understand it - the work that I must do is always $U_B-U_A$. However the work that the force that is being created by the field do_es_ is always $U_A-U_B$, am I correct?
Yes this is correct.
The mnemonic rule is very simple: $U$ is like the height of the slope. When you go up, $U_B>U_A$, and it is you who does the work. But when you go down, $U_A>U_B$, and it is the field force who does the work.
The first thing you must do is define your system.
If the system is the book alone the the external forces on the book are the force that you exert on the book and the gravitational attraction on the book by the Earth.
If the book starts and finishes at rest then there is no change in the kinetic energy.
The work done by you on the book is positive as the direction of the force that you exert on the book is the same as the displacement of the book.
The work done by the gravitational force due to the Earth is negative because the gravitational force is in the opposite direction to the displacement of the book.
If the two external forces are equal in magnitude and opposite in direction then the net work done on the book is zero (equal to the change in kinetic energy).
Of course one could reason that the net external force on the book is zero so the net work done by external forces on the book is zero.
There is no mention of gravitational potential energy because it is the energy associated with the book and the Earth as a system.
So now let's consider this system of the book and the Earth.
The external force is now the force that you apply on the book.
The force that the Earth exerts on the book is an internal force and its Newton third law pair is the force that the book exerts on the Earth.
When you do positive work separating the book and the Earth that work increases the gravitational potential energy of the book-Earth system.
If you released the book the separation between the book and the Earth will decrease and the gravitational potential energy of the system will decrease.
The book (and the Earth) would then have kinetic energy.
Usually only the motion and kinetic energy of the book is considered because the mass of the Earth is so much greater than the book.
This results in the speed and kinetic energy of the Earth being very much smaller that that of the book.
Best Answer
As you have suspected it is a matter of signs.
As an example of what you have done wrong look at your integral $\displaystyle \int_{r_{\rm b}}^{r_{\rm a}}F\,dr = F(r_{\rm a} - r_{\rm b})$.
Since $r_{\rm a} < r_{\rm b}$ this integral gives a negative value and yet the displacement of the force is in the same direction as the force!
I have annotated your derivation.
Charge $q$ is the origin of your coordinate system and with your statement that the net force is $F-F_{\rm E}$ you have defined the positive direction as in the $7$ o'clock direction.
What that means is that your starting point is at $r=-r_{\rm b}$ and your finishing point is $r=-r_{\rm a}$ as shown on the diagram above.
This assumes that you intended $r_{\rm a}$ and $r_{\rm b}$ to be positive quantities?
So now the work done by force $F$ is $\displaystyle \int_{-r_{\rm b}}^{-r_{\rm a}}F\,dr = F(r_{\rm b} - r_{\rm a})$, positive as expected.
The same change of sign will also occur for the electric potential energy terms and then you will find that the work done by force $F$ is equal to the change in kinetic energy plus the change in electric potential energy.
Perhaps you would have found it easier to choose the positive direction towards $1$ o'clock with the net force $F_{\rm E} -F$ and moving the charge from $+r_{\rm b}$ to $+r_{\rm a}$?
I have shown you how that might be done below.
System - Charge $Q_{\rm 0}$ alone
There are two external forces acting on the charge $\vec F_{\rm E}$ and $\vec F$.
You now need to consider a positive direction which can be $\hat r$ pointing roughly towards one o'clock.
This is the first place that you must be careful.
From your diagram $\vec F_{\rm E}=\dfrac{qq_0}{4\pi \epsilon_0 r^2}(\hat r)$ where $\dfrac{qq_0}{4\pi \epsilon_0 r^2}$ is a positive quantity and $\vec F = F(-\hat r)$ with $F$ chosen by you as being positive.
In moving from $\vec r_{\rm b} = r_{\rm b} (\hat r)$ to $\vec r_{\rm a}=r_{\rm a} (\hat r)$ the work done by the two forces is $\displaystyle \int_{r_{\rm b}}^{r_{\rm a}}(\vec F_{\rm E}+ \vec F)\cdot d\vec r$ where $d\vec r = dr\, \hat r$ with the sign of the component of the displacement $dr$ completely defined by the limits of integration.
This point is explained in the answer to the post Why does this line integral give the wrong sign?.
So the work done by the two external forces is
$\displaystyle \int_{r_{\rm b}}^{r_{\rm a}}(\vec F_{\rm E}+ \vec F)\cdot d\vec r=\displaystyle \int_{r_{\rm b}}^{r_{\rm a}}(F_{\rm E}(\hat r)+ F(-\hat r))\cdot dr(\hat r) =\displaystyle \int_{r_{\rm b}}^{r_{\rm a}}(F_{\rm E} -F)dr =\dfrac{qq_0}{4\pi \epsilon_0 r_{\rm a}}-\dfrac{qq_0}{4\pi \epsilon_0 r_{\rm b}}+F(r_{\rm b} - r_{\rm a})$
and this is equal to the change in the kinetic energy of the system (charge $q_0$).
From your derivation you have have chosen a different system as you cannot define a potential energy for a system consisting of a single particle/charge.
System - Charge $Q_{\rm 0}$ and charge $q$.
The assumption is then made that charge $q$ does not move / moves very little compared with charge $q_0$, ie the mass of $q$ is much greater than the mass of $q_0$.
Now there is only one external force $\vec F$ and two internal forces, the force on charge $q$ due to charge $q_0$ and its Newton third law pair, the force on charge $q_0$ due to charge $q$.
Because $q$ does not move the derivation is essentially the same and the work done by the external force is So the work done by the two external forces is $F(r_{\rm b} - r_{\rm a})$ with the change in electric potential energy being $\dfrac{qq_0}{4\pi \epsilon_0 r_{\rm a}}-\dfrac{qq_0}{4\pi \epsilon_0 r_{\rm b}} = U(r_{\rm a})-U(r_{\rm b})$ and the change in kinetic energy being $K_{\rm a}-K_{\rm b}$.
Bringing everything together gives $K_{\rm a}-K_{\rm b} = F(r_{\rm b} - r_{\rm a}) - (U(r_{\rm a})-U(r_{\rm b}))$.
If the work done by the external force, $F(r_{\rm b} - r_{\rm a})$, is greater than the increase in the electric potential energy of the system, $U(r_{\rm a})-U(r_{\rm b})$, the kinetic energy of the system increases.