Let us consider the steady-state conditions when the voltage across the capacitor practically does not change and is equal on the average to Ust.
When the key is switched to position 1, the charge on the capacitor will change during a short time interval Δt by
When the key is switched to position 2, the charge will change by
During cycle, the total change in charge must be zero:
Hence the voltage Ust and the capacitor charge qst in the steady state can be found from the formulas