Now remember, heat is the flow of energy, more specifically thermal energy between a hotter object towards a colder object. So, in heat applications, it transfers heat from a hotter object to a colder object. Let's assume that the sphere on the left is at a higher temperature, and then the sphere on the right is at a lower temperature. Heat naturally moves from a place that is hotter to a place that is colder. Now the system on the left is losing heat; this one here is gaining heat. Well, if you are losing, so if it loses, evolves, releases, or gives off heat, then the sign of q would be negative. On the other side, the heat is going towards the colder object so it is gaining heat. So if a system gains, absorbs, or takes any heat, then it has a positive q. So that's the way we observe the signs of q. If heat is being moved, whoever is gaining the heat is positive q, whoever is losing the heat is negative q.
Now work is a little bit different. Work is the force done by reacting molecules on a frictionless piston. All right. So we're going to say here, let's say we have our gas in this container and the piston here can move up or down. Let's say the gas molecules themselves want to be spread out even more from each other, and they decide to push up against the piston, so they're doing work on the piston here. As a result of doing work on the piston here, they are going to have a negative w. If the system does work on the surroundings, it is a negative w. The surroundings here would be the piston or the container. Conversely, let's say the gas molecules are just hanging around, not doing anything, and some outside force decides to push down on this piston. The piston again is our surroundings. It's going to come down and it's going to squeeze down on the gas molecules. In this case, the surroundings are doing work on the system. If the surroundings are doing work on the system and the system is doing nothing, then work will be positive. That's because the system is not working against an opposing force. It's just sitting back and letting it happen. So just remember, q and w can be positive or negative depending on situations. So just remember, if our system gains heat, it's positive q. If it loses heat, it's negative q. If the system does any type of work, it's going to be a negative w, and if the surroundings do work on the system, then it's positive.