I = C . dV/dt
P = V . I = V . (C . dV/dt) = C . V. dV/dt
Energy acquired by capacitor during time interval dt is ...
dE = P . dt = (C . V. dV/dt) . dt = C . V . dV
Energy E acquired by capacitor as it charges from V = 0 to V = Vf is ...
_ V = Vf
 

 C . V . dV
_
V = 0
V = Vf
= [ 1/2 . C . V^2 ]
V = 0
= 1/2 . C . Vf^2