Why is q positive in an isothermal expansion?
Because it has to flow into the system for it to expand without changing the temperature.
An isothermal expansion is what it sounds like... increasing volume at constant temperature.
For an ideal gas, the internal energy is only a function of temperature, so the first law of thermodynamics reads
#cancel(DeltaU)^(0) = q + w#
#DeltaU#is the change in internal energy, #q#is heat flow, and #w#is work from the perspective of the SYSTEM.
#-q < 0#
and that therefore means
If it were a nonideal gas, it could expand not as easily (i.e. attractive intermolecular forces dominate), or it could expand too easily (i.e. repulsive intermolecular forces dominate). As a result,