First law: ΔQ = ΔU + ΔW — heat supplied = rise in internal energy + work done by the gas.
Heat Q: + when supplied TO the system, − when released.
Work W: + when done BY the gas (expansion), − on compression.
ΔU depends only on the end states (a state function); Q and W depend on the path. Over a full cycle ΔU = 0.