The internal energy of a system is the sum of all kinetic and potential energies of all particles in that system.
Internal energy is a state function, which means its value depends only on the state of the system,
not the path in which the system took to arrive at that state.
For example, if you are climbing a mountain, your elevation above sea level would be like a state function.
There are many paths up the mountain you could take with varying distances you would hike,
but your change in elevation would only depend on your initial elevation and your current elevation.
This means we can calculate the change in internal energy for a system using just the final an initial values of the internal energy.
If we apply this to a chemical reaction, we can determine the change in internal energy for the reaction
based on the internal energies of the reactants and products, regardless of how many steps we took to get there in our reaction.
Let's apply this to the reaction of solid carbon combining with oxygen gas to produce carbon dioxide gas.
If we add up the internal energy of carbon and oxygen, our reactants,
they will have a higher internal energy than carbon dioxide gas, our product.
Since our reactants have a higher energy than our products, energy flows from our system to the surroundings.
The change in internal energy of our system is negative,
but the change in internal energy of the surroundings is equal in magnitude and opposite in sign, so it's positive.
Remember our law of conservation of energy: we cannot create or destroy energy, only change it from one form to another or transfer it.
If we reverse the process, we also reverse the energy flow.
So if we consider the decomposition of carbon dioxide gas to produce solid carbon and oxygen gas,
the internal energy of our reactant, carbon dioxide, is now lower than the internal energy of our products, carbon and oxygen.
So energy must have flowed from the surroundings to the system.
This means there's a positive change in internal energy for our system and a negative change in internal energy for our surroundings.
We can transfer internal energy between the system and surroundings through heat, work, or both.
Our change in internal energy, delta E, equals q, which is heat, plus w, which is work.
We need to be very careful with signs in this equation.
If we're calculating the change in internal energy of a system, then the signs of heat and work must be from the system's perspective.
If the system gains thermal energy then q positive; if the system loses thermal energy, q is negative.
If work is done by the system on the surroundings,
the energy needed to do that work is being transferred from the system to the surroundings, so it is a negative work for the system.
If work is done by the surroundings on the system, we're increasing the internal energy of our system, so it is a positive work.
Let's practice calculating the change in internal energy.
Our problem reads, "The cylinder and piston assembly, which is defined as the system, is warmed by an external flame.
The contents of the cylinder expand, doing work on the surroundings by pushing the piston outward against an external pressure.
If the system absorbs 559 joules of heat and does 488 joules of work during the expansion,
what is the change in internal energy of the system?"
We'll start with our equation: change in internal energy equals heat plus work.
In our problem, an external flame is heating our system, the cylinder and piston assembly,
so thermal energy is transferred from our surroundings to our system.
This is a positive q for the system.
We're also told that the cylinder expands against an external pressure.
Since this is work done by our system on the surroundings, it is a negative w for the system.
Plugging in our values for heat and work, we get a positive change in internal energy for our system of 71 joules.