# Capacitors energy

I am not sure if I have full understanding of capacitors energy, because I found a contradiction in solving one problem. The problem is: -
If an uncharged capacitor connected to another fully charged capacitor in parallel, what will be the new charge distribution on both capacitors? “Assuming equal capacitance”
I believe we have two rules of respect:-
1- Conservation of charge
2- Conservation of energy
If we assume that C = capacitance, and Vi = initial voltage and Qi=the initial charge on the charged capacitance.
Let the energy before connecting the two capacitance equal to the energy after linking them together:-

0.5*C*Vi^2 = 0.5*(2C)*Vf^2
then: - Vf=Vi/sqrt(2)

Know consider the total charge after linking both capacitors:-

Qt = Ct * Vf= (2C)*Vi/sqrt(2)=C*Vi*sqrt(2)

Which is obviously not equal to C*Vi “the initial charge”.

I am confused which one of these two fundamental concepts I have to base my calculation in, and why it doesn’t work with the other concept.