Chemistry - Why does the internal energy increase when ice melts to give water?
Solution 1:
Potential energy refers in this case primarily to the energy associated with intermolecular hydrogen bonds between water molecules. The total strength of H-bonds for each water molecule is on average weaker in the liquid. The density is a function of the geometry of the solid or liquid required to accommodate the bonds. Water is odd in that it acquires a spacious bonding arrangement in ice, but this does not mean that bonding is any weaker for that matter. On the contrary, you might say that the geometry is special in order to accommodate those strong intermolecular bonds.
To complement a point made in another answer: the change in internal energy during a thermodynamic tranformation is the sum of the heat transferred to and work done on the system. Note that work done by a system (here the water) decreases its internal energy. In the case of ice melting under atmospheric pressure, the volume contraction means that the internal energy increases due to work done on the system by the surroundings. This increase in internal energy is on top of the gain due to a transfer of heat from the surroundings.
Note however that the free energy is unchanged during the process (if carried out reversibly), or, equivalently, the joint entropy of system and surroundings is constant. So the transfer of heat to the system (which reduces the entropy of the surroundings) is compensated by an increase in the entropy of water with melting.
Solution 2:
Buck Thorn has already addressed your second question, so allow me to address your first:
Since the temperature doesn’t change, all the thermal energy is used to increase the potential energy(is this correct?).
Not in this case.
Temperature is not a measure of kinetic energy. It is, more precisely, a measure of the kinetic energy per available degree of freedom. See my answer here: What exactly is temperature?
Intuitively, liquid water has more available degrees of freedom (rotational and translational) than ice. Thus, at the same temperature, liquid water will have more kinetic energy than solid water.
Think of it this way: As we change solid water into liquid water, we need to flow more thermal energy into it to "fill up" those additional kinetic degrees of freedom, to keep it at the same temperature. Consequently, the thermal energy used to melt ice increases both its potential energy and its kinetic energy.