# Why does compressing a piston increase the internal energy?

When we compress a piston, its total internal energy increases, however I don't understand why.

As the piston compresses, the temperature should change, as the total energy density increases.

As a piston compresses, work is done to compress the gas. However, this is solely fighting a differential in pressure, as well as the force to accelerate the piston. It seems none (or very little) of this energy should be imparted to the gas - so why does the internal energy significantly increase?

The last one is somewhat explicable, however, when we pull back on a piston, uncompressing the air, we're not taking energy away from the air. While the overall energy density changes, the total energy itself shouldn't, as no process is removing energy. However, it does - so where is the energy going?

Ultimately I think this comes down to: where does the energy go, and how does it get there?

-
"None of this energy is imparted to the gas" - Yes, it is. Pressure is force per area, and this force is the time-average over all the little incidents where gas particles hit the walls of the piston. If you compress the piston, you're imparting extra energy onto those particles that hit the wall during that compression period. – Lagerbaer May 6 '13 at 19:33
@Lager Doesn't that make the total imparted energy highly variable? – Emrakul May 6 '13 at 19:34
what you mean with 'none of this energy is imparted to the gas'? The kinetic energy is transformed in potential electrostatic repulsion between atoms and friction, which becomes heat – lurscher May 6 '13 at 19:35
@lurscher It's only reducing the volume of the gas, and doesn't have an active force on the gas – Emrakul May 6 '13 at 19:37
@Emrakul Yes it does, as are all things in thermodynamics. But since we're dealing with so many particles, all these fluctuations average out. – Lagerbaer May 27 '14 at 19:12