Derivation for instantaneous voltage across a charging capacitor