Step 1: First Law of Thermodynamics. 
  
The first law of thermodynamics states:
\[
dQ = dU + dW
\]
where \( dQ \) is the heat added to the system, \( dU \) is the change in internal energy, and \( dW \) is the work done.
For an isothermal process, the temperature is constant, so the change in internal energy \( dU = 0 \). Thus, the heat added is equal to the work done:
\[
dQ = dW
\]
   Step 2: Work Done in an Isothermal Process. 
  
The work done during an infinitesimal expansion or compression of a gas is given by:
\[
dW = P \, dV
\]
where \( P \) is the pressure and \( dV \) is the infinitesimal change in volume.
Using the ideal gas law \( P = \frac{nRT}{V} \), we can substitute into the equation for work:
\[
dW = \frac{nRT}{V} \, dV
\]
   Step 3: Integrating the Work. 
  
To find the total work done during the isothermal process, we integrate from the initial volume \( V_i \) to the final volume \( V_f \):
\[
W = \int_{V_i}^{V_f} \frac{nRT}{V} \, dV
\]
Since \( T \) is constant, we can take it outside the integral:
\[
W = nRT \int_{V_i}^{V_f} \frac{1}{V} \, dV
\]
The integral of \( \frac{1}{V} \) is \( \ln V \), so:
\[
W = nRT \ln \left( \frac{V_f}{V_i} \right)
\]