40 - Electromagnetism

The energy stored in a Capacitor is basically the energy the battery spent to move the electrons between the plates of the capacitors against their natural tendency
The work done is a variable quantity, and so we have that
From this, the total work done means the energy stored in the capacitor, which is the integral for W,