The capacitor 1 has capacitance C and as dielectric contains in capacitor 2 so its capacitance becomes kC.
The net capacitance Ceq=C.kCC+kC=Ck1+k
and Qeq=CeqE
When dielectric is reemoved from capacitor 2, its capacitance becomes C.
now net capacitance C′eq=C.CC+C=C2
and Q′eq=C′eqE=CE2
When the capacitors are connected in series, they each have the same charge as the net capacitance. Thus, Qeq=Q1=Q2 and Q′eq=Q′1=Q′2
∴Q′1Q1=Q′2Q2=2kk+1