Two capacitors are connected in parallel. Hence, the potential on each of them remains the same. So, the charge on each capacitor is
QA = QB = CV
Formula for energy stored = \(\cfrac12\) CV2 = \(\cfrac12\)\(\cfrac{Q^2}{C}\)
Net capacitance with switch S closed = C + C = 2C
\(\therefore\) Energy stored = \(\cfrac12\) x 2C x V2 = CV2
After the switch S is opened, capacitance of each capacitor = KC
In this case, voltage only across A remains the same.
The voltage across B changes to V' = \(\cfrac{Q}{C'}=\cfrac{Q}{KC}\)
\(\therefore\) Energy stored in capacitor A = \(\cfrac12\)KCV2
Energy stored in capacitor B =
\(\therefore\) Total Energy stored
Required ratio