Work done by a thermodynamic system is path-dependent under all conditions. Consider a system of two cylinders connected with a pressure valve. Initially, cylinder A is filled with an ideal gas, while cylinder B is empty On heating cylinder A, the gas absorbs the heat, temporarily increasing the pressure inside cylinder A, which opens the pressure valve. The gas expands isothermally into cylinder B, decreasing the pressure inside cylinder A. Considering negligible gas particles in connecting tubes, the final gas volume equals the sum of the volumes of gas in both cylinders. Here, the work is done on the pressure valve due to the heating of the gas. In another process, consider the same system in its initial state, insulated from its surroundings, such that no heat is exchanged. If the valve is removed, the gas undergoes a rapid free expansion into cylinder B, eventually attaining the same final volume as in the first process. During this expansion, no boundaries move, indicating that the work done by the gas is zero under free expansion.