The work done by a gas during an isobaric process (constant pressure) is given by the formula:
\[
W = - P \Delta V
\]
Where:
- \( W \) is the work done by the gas,
- \( P = 1 \times 10^5 \, \text{Pa} \) is the pressure,
- \( \Delta V = V_f - V_i = 2 - 5 = -3 \, \text{m}^3 \) is the change in volume.
Thus, the work done is:
\[
W = - (1 \times 10^5) \times (-3) = 3 \times 10^5 \, \text{J}
\]
The negative sign indicates that the gas is being compressed, meaning the work done on the gas is negative. Therefore, the work done by the gas is \( -3 \times 10^5 \, \text{J} \).