The change in internal energy of a system is equal to the heat added to the system minus the work done by the system.
ΔU = Q - W,
Where ΔU is the change in internal energy, Q is the heat added to the system and W is the work done by the system.