Your comments

Thank you. This is very helpful. I have another related question. What if the circuit has no battery? The capacitor has a charge Q and is discharging when a switch is closed. How do we derive the equation for the charge on the discharging capacitor?