Given:
- Volume of the cylinder, \( V = 0.1 \, {m}^3 \)
- Initial pressure, \( P_1 = 10 \, {MPa} \)
- Final pressure, \( P_2 = 5 \, {MPa} \)
- Temperature, \( T = 300 \, {K} \)
- The nitrogen behaves as an ideal gas.
For an ideal gas, the work done during an isothermal process is given by the equation:
\[
W = nRT \ln \left( \frac{V_2}{V_1} \right)
\]
where \( n \) is the number of moles, \( R \) is the gas constant, and \( V_1 \) and \( V_2 \) are the initial and final volumes.
From the ideal gas law:
\[
P_1 V_1 = nRT {and} P_2 V_2 = nRT
\]
Since \( T \) and \( n \) are constant, we can write:
\[
\frac{V_2}{V_1} = \frac{P_1}{P_2}
\]
Substituting the known values:
\[
\frac{V_2}{V_1} = \frac{10}{5} = 2
\]
Now, the work done by the gas is:
\[
W = nRT \ln \left( 2 \right)
\]
Since \( nRT = P_1 V_1 \), we can substitute:
\[
W = P_1 V_1 \ln \left( 2 \right)
\]
Substituting the known values:
\[
W = 10 \times 10^6 \times 0.1 \times \ln \left( 2 \right) \approx 0.5 \, {MJ}
\]
Thus, the work done by the nitrogen gas is \( 0.5 \, {MJ} \).