During the Industrial Revolution of the 19th century, as machines (e.g. steam engine, combustion engine, refrigerator etc.) were being developed, physicists wondered if a perpetual motion machine (a machine that can perform work without any energy input) is a scientific possibility. From their analysis, the laws of thermodynamics were born.
The First Law of Thermodynamics is actually a statement of the Principle of Conservation of Energy, adapted for thermodynamic processes.
It states how energy can flow across the boundary separating a system from its surroundings: the increase in internal energy (of a system) ΔU is equal to the heat suppled (to the system) Q plus the work done (on the system) WON.
Let’s take a closer look at the meaning of these terms.
A positive ΔU means that there is an increase in U. For an ideal gas, where , a positive ΔU also corresponds to an increase in temperature. The opposite is true if ΔU is negative.
It is very common for students to confuse ΔU with Q. Now, look at ! It shows clearly that , unless Won happens to be 0. For solids and liquids where W is negligible, ΔU is equal to Q. But this is not true in general, especially for gases which can undergo large changes in volume.
A positive Q means that heat is supplied to the system, and a negative Q means that heat is lost to the surrounding. Whether heat is supplied or lost is decided by the temperature of the system relative to the surrounding.
WON is positive when the external pressure compresses the system. WON is negative when the system expands against the external pressure. Basically, WON is positive when the volume of the system decreases but negative when it increases. Some people simply memorise in their head that or .
Sometimes it is more convenient to talk about work done by the system WBY instead of work done on the system WON. WBY is positive when the system expands against the external pressure but negative when the external pressure compresses the system. Basically WBY and WON is referring to the same work, but viewed from opposite sides of the system boundary. Numerically,
In fact, the first law is sometimes expressed as
Who is Doing the (Positive) Work?
When a system is compressed (so WON is positive and WBY is negative) by external pressure, we say “work is done on the system”. Conversely, when a system expands against external pressure (so WBY is positive and WON is negative), we say “work is done by the system”. Perhaps it would be clearer if we say “positive work is done on the system” and “positive work is done by the system”. But by default, the word positive is implied.
PhET (gas properties)
 There are three laws of thermodynamics in total (excluding the zeroth law), but the A-level syllabus includes only the first law.