There's no problem per se, I'm just confused by the definition of work and electric potential energy: work done by the electric field is defined to be the negative of delta_U, the change in electric potential energy. This definition makes sense to me.
However, according to my textbook, it is the other way round for capacitors: the total work to charge a capacitor is defined as Q^2 / (2C), which according to my textbook is the same as the electric potential energy U of the charged capacitor. Where did the minus sign go?
W(done by electric field) = - delta_U
Q^2 / (2C) = W = U