Dear Student,
Initially, total charge is Q,
Thus energy in the system
When two similar capacitor's are connected in series, the charge divides into equal share. i.e Q/2
and equivalent capacitance becomes
Thus,
Energy energy stored in the system
Regards.