On the relation $\Delta U = -W$ for electric work

My text writes $$\Delta U = − W$$ with $$W$$ the electric work and $$U$$ the electrical potential energy. I tried to verify this relation for a simple case. I considered bringing close to another two positive charges initially at infinite distance. As work is defined as $$W = \mathbf{F} ⋅ d\mathbf{s}$$ as the displacement and the force applied have the same direction the work is positive. Regarding the variation of electrical potential energy $$\Delta U = U_f - U_i$$ taking $$U_i(\infty) = 0$$ we have a positive $$\Delta U$$ too, so the relation $$\Delta U = − W$$ seems not correct. What's the fault in my reasoning (if there's one)?

• The W in that expression is the work done by the electric field, which is negative when two like charges are brought close to each other, because the electric forces are directed away from each other and hence in the opposite direction as the motion. It seems you are assuming that that W is the work done by other objects on the charges to push them together, which is not the correct interpretation. May 30 at 15:06
• @march Please consider entering this comment as an answer. May 30 at 15:17
• why is there a different between $F_{elec}$ and $F_{external}$? May 30 at 15:21
• @BobD Questions like this are usually duplicates, which is why I just made a comment. I looked for a duplicate, but I’m really bad at finding them, so I figured I’d leave that for someone else but in the meantime help May 30 at 15:21
• @march Related question&answers: physics.stackexchange.com/questions/559642/… May 30 at 15:28