✔ 最佳答案
This is the basis of the Principle of Conservation of Energy, which forms one of the basic principles in physics.
The water and ice cubes in this case form a system. Energy within this system could not be created nor destroyed, i.e. it should maintain at some constant value.
Putting this concept into mathematics, we have the following equation,
(thermal) energy of water + (thermal) energy of ice = constant
In the problem, the aim is to cool down the water. Hence, any decreases of thermal energy (and thus temperature) must bring to a corresponding increase of thermal energy of ice in order to keep the [constant] at the right hand side of the equation unchanged. This is the reason why you have to equate the energy changes of water and ice in your calculation.