I am reading the Feynman Lectures on Physics about the Principle of Least Action. During this lecture (around 3/4th of the page), Dr. Feynman formulated the electrostatics problem as:
\begin{equation*} U\star=\frac{\epsilon}{2}\int(\nabla{\phi})^2\,dV- \int\rho\phi\,dV, \end{equation*}
From one of his previous lectures, I understand that the first integral refers to the energy at a certain location due to electric field (eqn. 8.35).
As for the second integral, it should refer to the potential energy gained by bringing charges to their current locations (eqn. 8.28).
However, eqn. 8.28 had a 1/2 factor to account for double counting the forces between a pair of charges.
Question: Why does this factor disappear from the formulation of the electrostatics Principle of Least Action problem?
Equations Mentioned
Eqn 8.28 - $$U = \frac {1}{2} \int \rho \phi d V \tag{8.28}$$
This equation can be interpreted as follows. The potential energy of the charge ρdVρdV is the product of this charge and the potential at the same point. The total energy is therefore the integral over ϕρdVϕρdV. But there is again the factor 1212. It is still required because we are counting energies twice. The mutual energies of two charges is the charge of one times the potential at it due to the other. Or, it can be taken as the second charge times the potential at it from the first.
Eqn 8.35 - $$U = \frac {\epsilon_0}{2} \int\limits_{all space} (\nabla \phi) * (\nabla \phi) d V = \frac {\epsilon_0}{2} \int\limits_{all space} E * E d V\tag{8.35}$$
We see that it is possible for us to represent the energy of any charge distribution as being the integral over an energy density located in the field.