Pardon me, but this question has been troubling me for several days. I've searched a lot but couldn't find any convincing explanation.
In a purely resistive circuit, instantaneous power is given by \$P = V_m\sin(\omega t) \times I_m\sin(\omega t)\$. This power heats up the resistor and is always positive, the energy is flowing from emf source to the resistor; so the emf source will die after transferring all its energy to the resistor.
In a purely capacitive circuit, \$P = V_m\sin(\omega t) \times I_m\sin(\omega t+90) = \frac12 V_mI_m\sin(2\omega t)\$. Average value of this is \$0\$. This means energy goes back and forth between capacitor and the emf source.
Does the emf source live forever? If the emf source were ac mains, would I get any bill? Since I didn't use any energy, what was working on charging and discharging the capacitor? Charging and discharging requires work and needs energy right?