Capacitor and energy I have I capacitor, with $+Q$ on the bottom plate, on $-Q$ on the top plate. A student move the top plate by $dx$ along the $x$ axis. My course states that : 
$$d(E_{\text{kin}}+E_p+E_e)=\delta W_o + \delta W_e$$
where $E_{\text{kin}}$ is the kinetic energy of the capacitor, $E_p$ its potential energy due to gravity, and $E_e$ the electrostatic energy. And, $\delta W_o$ is the work done by the student and $\delta W_e$ is the electrical work received by the capacitor. I don't understand where does this formula come from. I know that the variation of the total energy of a system is equal to the sum of the work done by the non conservative force, but electrical force is conservative... 
 A: (a) I don't see why the forces used in calculating the work need to be non-conservative. [If we were taking the capacitor through a complete cycle, the work done by conservative forces would be zero, but it wouldn't matter much if we included them, as it would just add a zero to the right hand side! But we're not going through a complete cycle!] (b) The plates are presumably isolated, so $\delta W_e$ is zero. (c) Perhaps the best way to address your difficulty is to do an example...
Suppose the capacitor has two horizontal plates, each of area $A$, and mass $m$, separated by distance $a$. The capacitor is connected to a battery of emf $\mathscr E$.
The capacitance is $C=\frac{\epsilon_0 A}{a}$, the magnitude of the charge on each plate is $Q=C\mathscr E=\frac{\epsilon_0 A}{a}\mathscr E$, the electric field strength between the plates is $E=\frac{\mathscr E}{a}$ and the electrostatic attractive force between the plates is $F_{es}=\tfrac12 QE=\tfrac12  C{\mathscr E} \times \frac {\mathscr E}{a}=\frac{1}{2a}  C{\mathscr E}^2$.
Suppose that the bottom plate is fixed and that we lift the top plate slowly by a small distance $\Delta a$. 'Slowly' means slowly enough for us to neglect any KE acquired and any dissipation of energy in wires or internal resistance of battery.
Work done against pull gravity is $$W_g=mg \Delta a$$.
Work done against electrostatic force is $$W_{es}=F_{es} \Delta a=\frac{1}{2a}  C{\mathscr E}^2 \Delta a$$
So the work done by the lifter is the sum of these.
The capacitance decreases. It is easy to show that $\Delta C = -C \frac{\Delta a}{a}$.
Therefore charge $\Delta Q =\Delta C \mathscr E$ runs 'backwards' through the battery, so the electrical work done is $$W_e=-{\mathscr E} \Delta Q=-{\mathscr E}^2\Delta C = -{\mathscr E}^2 C \frac{\Delta a}{a}$$
So the total of mechanical and electrical work done on the capacitor is
$$W_g +W_{es}+W_e =mg \Delta a + \frac{1}{2a}  C{\mathscr E}^2 \Delta a -{\mathscr E}^2 C \frac{\Delta a}{a}$$
That is $$W_g +W_{es}+W_e =mg \Delta a - \frac{1}{2a} C{\mathscr E}^2 \Delta a $$
The gain in gravitational potential energy of the top plate is
$$\Delta E_g =mg \Delta a$$
The electrostatic energy stored in the capacitor is $ E_e=\tfrac12 C {\mathscr E}^2$, so the gain in electrostatic energy at constant $\mathscr E$ is
$$ \Delta E_e=\tfrac12 \Delta C {\mathscr E}^2=-\tfrac12 C \frac {\Delta a}{a}{\mathscr E}^2$$
So $$\Delta E_g + \Delta E_e =mg \Delta a - \tfrac12 C \frac {\Delta a}{a}{\mathscr E}^2$$
in agreement with $$W_g +W_{es}+W_e=\Delta E_g + \Delta E_e$$
