The energy stored in a capacitor is given by: E=21CV2.
Initially, for the first capacitor, E1=21CV2=E (given), so CV2=2E. For the second capacitor, E2=21(2C)(2V)2=21×2C×4V2=4CV2=8E. Hence the total initial energy is Ei=E+8E=9E.
After connecting the capacitors, charge redistributes while the total charge remains conserved: Qtotal=CV+2C(2V)=CV+4CV=5CV. The total capacitance becomes Ctotal=C+2C=3C, so the common potential is Vf=CtotalQtotal=3C5CV=35V.
The final energy stored is Ef=21(3C)(35V)2=21×3C×925V2=625CV2=625×2E=325E.
The energy loss is given by ΔE=Ei−Ef=9E−325E=327E−25E=32E=3xE, which yields x=2.