Moving the plates of a charged capacitor to calculate energy density - where's the flaw in my argument? For a charged air-dielectric capacitor, let the plates be parallel to the $xy$ plane, with the top carrying a positive charge $+Q$, the bottom a charge $-Q$. The force on an infinitesimal charge contained in a volume $dv$ inside the top plate is 
$$-\vec E_z\rho(x,y,z)dv$$ 
Integrating this over the volume of the plate gives the total force on its center of mass as 
$$-\vec E_z Q$$ 
which becomes using Gauss's law
$$-\hat n_z E^2A\epsilon_0$$ 
If the plates are moved apart a distance $dz$ by an opposing force $\vec F$, the infinitesimal work done is $E^2\epsilon_0Adz$, and integrating this from zero to their final separation $d$ gives the energy density as $E^2\epsilon_0$. 
But this is different to the correct value of $1/2E^2\epsilon_0$, so where's the flaw in the above argument?
 A: The error is in the initial force calculation, where, to calculate the force on a charge element, you use the net electric field.  Since this field is generated by both plates, not just one, you are effectively including a force on the charge due to its own field.
Instead, consider the field generated by the other plate only, which is half the net field and gives the correct force on the charge element.  (From this perspective, the field generated by the charge element is isotropic and of course results in 0 force.)
Another way to see this is to start with the self-field generated by a charge element, which is 1/2 the net field in the up direction and 1/2 the net field down.  To calculate the force on this charge element, one must first subtract out the self-field from the net field.  
A: The flaw is in assuming the electric field is $\vec E_z$ everwhere inside the charge layer.
One part of the charge layer boundary is in contact with the conductor where the electric field is zero, another with the air where the electric field is $\vec E_z$. So clearly the electric field inside the charge layer volume will be somewhere between these two values, and we need to solve Poisson's equation:
$$\nabla^2 \phi = \rho/\epsilon_0$$
Along an electric field tube of cross sectional area $dA$ entering the charge layer from the air and terminating on the other side in contact with the conductor, we can write:
$$\epsilon_0 d\vec E(\vec r) = \rho(\vec r)dr\tag{1}$$
Multiplying both sides of (1) by $\vec EdA$ gives the differential force, and We can therefore integrate this along an electric tube where the electric field is $E_z$ as it enters the charge layer, and 0 when it terminates at the conducting region, to give the total differential force on the plate
$$d\vec F_z = 1/2\epsilon_0 \hat n_z E^2dA$$
Integrating this over the whole surface area gives the total force as $1/2\epsilon_0 \hat n_z E^2A$, and your following arguments then gives the correct energy density.
