A gas absorbs a quantity of heat $Q = 500$ J and at the same time does work $A = 200$ J. Find the change in internal energy of the gas.
The first law of thermodynamics: $Q = \Delta U + A$, hence
$$\Delta U = Q - A = 500 - 200 = 300 \text{ J}$$
The internal energy of the gas increased by 300 J.
$\Delta U = 300$ J