First, capacitor will discharge through `R-1`.
At `t =R_1C, q_1 = CV(e^(-R_1C//R_1C)) =(CV)/(e )`
Now it will be charged through `R_1+R_2`. so
`int_(q1)^q (dq)/(Cepsilon -q) = int_(R_1C)^(2R_1C+R_2C) (dt)/((R_1+R_2)C)`
or `q = Cepsilon (1-(1)/(e )) +(CV)/(e^2)`
When the switch `S_1` is opened and `S_2` is closed, the capacitor
is finally chaged ot `q_(final) =Cepsilon`. Hence, capacitor is charged from `q_0 "to" q_f` exponentially. in this case, the time after `S_2` is closed is
`Deltat = (2R_1C+R_2C)-R_1C)-R_1C = (R_1C+R_2C) =(R_1+R_2)C`
The time constant of the circuit after switch `S_2` is closed is
`tau = (R_1+R_2)C`
Hence, required value of charge si
`q=(CV)/(E )+(Cepsilon-(CV)/(e ))(1-e^(-((R_(1)+R_(2))C)/((R_(1)+R_(2))C)))`
`=(CV)/(e )+(Cepsilon-(CV)/(e ))(1-e^(-1))=Cepsilon(1-(1)/(e )) +(CV)/(e^2)`