Step 1: Analyze the process \( X \to Y \).
For the process \( X \to Y \), the gas performs 10 J of work and absorbs 2 J of heat. According to the first law of thermodynamics:
\[
\Delta U = Q - W
\]
where \( Q \) is the heat absorbed by the system and \( W \) is the work done by the gas.
Substituting the given values:
\[
\Delta U = 2 \, \text{J} - 10 \, \text{J}
\]
\[
\Delta U = -8 \, \text{J}
\]
Thus, the change in internal energy during the process \( X \to Y \) is \( -8 \, \text{J} \).
Step 2: Consider the reverse process \( Y \to X \).
Internal energy is a state function; therefore, the change in internal energy for the reverse process will be equal in magnitude but opposite in sign:
\[
\Delta U_{Y \to X} = +8 \, \text{J}
\]
During the reverse process, 6 J of heat is evolved, which means heat is released by the system. Hence:
\[
Q = -6 \, \text{J}
\]
Applying the first law again:
\[
\Delta U = Q - W
\]
\[
8 \, \text{J} = -6 \, \text{J} - W
\]
Solving for \( W \):
\[
W = -14 \, \text{J}
\]
A negative value of work indicates that work is done on the gas.
Step 3: Interpret the result.
Since the sign is negative, the magnitude of the work done on the gas is:
\[
\text{Work done on the gas} = 14 \, \text{J}
\]
Final Answer: Work done on the gas is \( 14 \, \text{J} \).