Charge equation for charging a capacitor