The first law of thermodynamics defines the change in internal energy \( \Delta U \) as: \[ \Delta U = Q - W \] With \( Q = 100 \, \text{J} \) representing heat absorbed by the gas and \( W = 40 \, \text{J} \) representing work done by the gas on its surroundings. The calculation is as follows: \[ \Delta U = 100 - 40 = 60 \, \text{J} \] Consequently, the gas's internal energy change is \( 60 \, \text{J} \).