Equation (2) is consistent with the First Law; even though the internal energy changes during the course of the cyclic process, when the cyclic process finishes the system's internal energy is the same as the energy it had when the process began.