thermodynamics calculators

Work Done by Gas Calculator

Calculates the work done by an ideal gas during isothermal expansion or compression. Use it in thermodynamics problems when temperature stays constant and volume changes.

About this calculator

During an isothermal (constant-temperature) process, an ideal gas follows the relationship PV = nRT. Because pressure changes as volume changes, the work done cannot simply be P×ΔV. Instead, integrating P dV over the volume change yields the formula: W = nRT × ln(V_f / V_i), where n is moles, R = 8.314 J/(mol·K), T is absolute temperature in Kelvin, and ln denotes the natural logarithm. When V_f > V_i the gas expands and W is positive (gas does work on surroundings). When V_f < V_i the gas is compressed and W is negative (surroundings do work on gas). This formula strictly applies to ideal gases; real gases require corrections.

How to use

Suppose 2 mol of gas at 300 K expands from 0.01 m³ to 0.03 m³. Step 1 – identify inputs: n = 2 mol, T = 300 K, V_i = 0.01 m³, V_f = 0.03 m³. Step 2 – compute the log ratio: ln(0.03 / 0.01) = ln(3) ≈ 1.0986. Step 3 – apply the formula: W = 2 × 8.314 × 300 × 1.0986 ≈ 5,482 J. The positive result confirms the gas did ~5.48 kJ of work on its surroundings during the expansion.

Frequently asked questions

What does a negative work value mean in isothermal gas expansion?

A negative result means the surroundings did work on the gas, i.e., the gas was compressed rather than expanded. This occurs whenever the final volume is smaller than the initial volume, making ln(V_f / V_i) negative. In thermodynamic sign convention, negative work means energy was transferred into the gas from outside. For compression processes this energy typically raises the internal energy if the process is not truly isothermal.

Why does the work done by an ideal gas during isothermal expansion use a natural logarithm?

The natural logarithm arises from integrating the ideal gas pressure P = nRT/V over the volume change from V_i to V_f. The integral of 1/V dV is ln(V), so the total work becomes nRT × ln(V_f / V_i). A simple ΔV formula would only work if pressure were constant, but pressure continuously falls as the gas expands, requiring this integral approach. The logarithmic relationship means that doubling the volume always produces the same fractional change in work regardless of the starting volume.

What units should I use for temperature and volume in the work done by gas calculator?

Temperature must be entered in Kelvin (K), not Celsius or Fahrenheit, because the ideal gas law requires an absolute temperature scale. Volume must be in cubic metres (m³) to keep the result in Joules when using R = 8.314 J/(mol·K). If your volumes are in litres, divide by 1000 to convert to m³ before entering them. The mole count is dimensionless but must represent the total amount of substance in the system.