What have I done wrong in the following derivation of energy stored in a capacitor What have I done wrong in the following derivation of energy stored in a capacitor.
If you want to charge a capacitor you've to remove electrons from one conductor and carry them to other conductor. Suppose at some intermediate stage charge on the positive conductor is $ne$(where $n$ is some positive integer and $e=1.6\times 10^{-19}\ coulombs$) then the potential difference between the conductors is $$V=V_{+}-V_{-}=-\int_{-}^{+}\vec{E} \cdot d\vec{l}=\frac{ne}{C}$$ where $C$ is the capacitance of the arrangement and $V_{+}$ and $V_{-}$ are the potentials of positive and negative conductors respectively.
The work done in moving one electron from positive conductor to negative conductor is
 $$W\left|_{+}^{-}\right.=-e\left[V_{-}-V_{+}\right]=-e\frac{-ne}{C}=\frac{ne^2}{C}$$
 Suppose you are charging the positive conductor to a final charge $Q=Ne$, then the total work done is
\begin{align}
W
&=\sum_{n=0}^{N-1} \frac{ne^2}{C}=\frac{e^2}{C}\sum_{n=0}^{N-1}n=\frac{e^2}{C}\left[\frac{(N-1)N}{2}\right]=\frac{N^2e^2}{2C}-\frac{Ne^2}{2C}
\\ & =\frac{Q^2}{2C}-\frac{Qe}{2C}.
\end{align}
However, this is in contrast to the usual result of electromagnetism textbooks, $W=\frac{Q^2}{2C}$. Is this calculation wrong?
 A: Your work is correct, as is your expression for $W=Q^2/2C - Qe/2C$. The reason it doesn't match the usual expression, which drops that second term, is that normally the calculation is done using one infinitesimal bit of charge at a time, and then integrating. In other words, it corresponds to your result in the limit of $e/Q\to 0$ - and indeed your solution reduces to the standard result in that limit.
Of course, your solution is in many ways the correct one, since charge is ultimately quantized, and there is no such thing in the lab as an infinitesimal amount of charge (not even in the way that you can speak of, for example, an infinitesimal displacement, which is really code for a finite but arbitrarily small change in position). You have found that the quantization of charge means that the standard result can only ever be an approximation.
The reason we use it is because it is normally a very good approximation. A standard (smallish) capacitor in a circuit board will have, say, about a picofarad of capacitance, and it will be subjected to about a volt of potential difference, so it will hold about a picocoulomb of charge:
$$
Q\cong 10^{-12}\:\mathrm{C} \approx 10^7e.
$$
This means that $e/Q$ is of the order of $10^{-7}$, so the usual expression $W=Q^2/2C$ is accurate to about seven significant figures. Corrections to this order are normally not something that we fret about, so we can usually just drop the term. If we do want 7+ significant figure accuracy on that energy, then we have a number of other things to worry about: a sufficiently accurate value for the capacitance, for instance, as well as a number of residual capacitances and inductances all over the lab, among many other effects that might contribute in any given situation.
And, as you'll have guessed by now, these charge quantization effects do become relevant if your circuit is small enough that you care about single-electron effects. However, if you're in that regime then odds are that you need to be doing things quantum mechanically to begin with, and that's a whole other ball game, with the energy itself being replaced by a more complicated object, just for starters.
