Let a capacitor be connected to a battery in a circuit.The The battery does work worth CV^2$CV^2$ but the capacitor stores only half that amount....We We say the other half went away as heat,but but how do we mathematically show where the other half went.?